From eee6cf3032f6932fbc6e78b03f34b52f4e7f1111 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 15 Aug 2019 07:43:34 +0300 Subject: [PATCH 001/188] First iteration of codebase modernization --- QEverCloud/CMakeLists.txt | 51 +- QEverCloud/headers/AsyncResult.h | 9 +- QEverCloud/headers/EventLoopFinisher.h | 9 +- QEverCloud/headers/EverCloudException.h | 12 +- .../headers/{exceptions.h => Exceptions.h} | 27 +- QEverCloud/headers/{export.h => Export.h} | 0 QEverCloud/headers/{globals.h => Globals.h} | 3 +- QEverCloud/headers/Helpers.h | 164 ++ QEverCloud/headers/InkNoteImageDownloader.h | 7 +- QEverCloud/headers/{oauth.h => OAuth.h} | 11 +- QEverCloud/headers/Optional.h | 5 +- QEverCloud/headers/QEverCloud.h | 20 +- QEverCloud/headers/QEverCloudOAuth.h | 2 +- .../headers/{thumbnail.h => Thumbnail.h} | 9 +- QEverCloud/headers/VersionInfo.h.in | 2 +- .../generated/{constants.h => Constants.h} | 220 ++- QEverCloud/headers/generated/EDAMErrorCode.h | 866 +++++++++- .../generated/{services.h => Services.h} | 29 +- .../headers/generated/{types.h => Types.h} | 563 +------ QEverCloud/headers/qt4helpers.h | 90 - QEverCloud/src/AsyncResult.cpp | 11 +- .../src/{exceptions.cpp => Exceptions.cpp} | 23 +- QEverCloud/src/{globals.cpp => Globals.cpp} | 5 +- QEverCloud/src/{http.cpp => Http.cpp} | 18 +- QEverCloud/src/{http.h => Http.h} | 13 +- QEverCloud/src/{impl.h => Impl.h} | 11 +- QEverCloud/src/InkNoteImageDownloader.cpp | 12 +- QEverCloud/src/{oauth.cpp => OAuth.cpp} | 52 +- ...generated.cpp => ServicesNonGenerated.cpp} | 7 +- QEverCloud/src/{thrift.h => Thrift.h} | 8 +- .../src/{thumbnail.cpp => Thumbnail.cpp} | 7 +- .../{constants.cpp => Constants.cpp} | 417 ++++- QEverCloud/src/generated/EDAMErrorCode.cpp | 1256 ++++++++++++++ .../generated/{services.cpp => Services.cpp} | 22 +- .../src/generated/{types.cpp => Types.cpp} | 1498 +++++++++-------- .../generated/{types_impl.h => Types_io.h} | 67 +- 36 files changed, 3894 insertions(+), 1632 deletions(-) rename QEverCloud/headers/{exceptions.h => Exceptions.h} (89%) rename QEverCloud/headers/{export.h => Export.h} (100%) rename QEverCloud/headers/{globals.h => Globals.h} (98%) create mode 100644 QEverCloud/headers/Helpers.h rename QEverCloud/headers/{oauth.h => OAuth.h} (98%) rename QEverCloud/headers/{thumbnail.h => Thumbnail.h} (97%) rename QEverCloud/headers/generated/{constants.h => Constants.h} (91%) rename QEverCloud/headers/generated/{services.h => Services.h} (99%) rename QEverCloud/headers/generated/{types.h => Types.h} (92%) delete mode 100644 QEverCloud/headers/qt4helpers.h rename QEverCloud/src/{exceptions.cpp => Exceptions.cpp} (95%) rename QEverCloud/src/{globals.cpp => Globals.cpp} (97%) rename QEverCloud/src/{http.cpp => Http.cpp} (89%) rename QEverCloud/src/{http.h => Http.h} (97%) rename QEverCloud/src/{impl.h => Impl.h} (87%) rename QEverCloud/src/{oauth.cpp => OAuth.cpp} (84%) rename QEverCloud/src/{services_nongenerated.cpp => ServicesNonGenerated.cpp} (95%) rename QEverCloud/src/{thrift.h => Thrift.h} (99%) rename QEverCloud/src/{thumbnail.cpp => Thumbnail.cpp} (97%) rename QEverCloud/src/generated/{constants.cpp => Constants.cpp} (80%) create mode 100644 QEverCloud/src/generated/EDAMErrorCode.cpp rename QEverCloud/src/generated/{services.cpp => Services.cpp} (99%) rename QEverCloud/src/generated/{types.cpp => Types.cpp} (91%) rename QEverCloud/src/generated/{types_impl.h => Types_io.h} (93%) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index cd4bf20d..fe9c1c61 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -14,51 +14,52 @@ if(BUILD_WITH_OAUTH_SUPPORT) endif() set(NON_GENERATED_HEADERS - headers/export.h - headers/exceptions.h - headers/globals.h - headers/thumbnail.h headers/AsyncResult.h + headers/EventLoopFinisher.h + headers/EverCloudException.h + headers/Export.h + headers/Exceptions.h + headers/Globals.h + headers/Helpers.h headers/InkNoteImageDownloader.h headers/Optional.h - headers/EverCloudException.h - headers/qt4helpers.h - headers/EventLoopFinisher.h) + headers/Thumbnail.h) if(BUILD_WITH_OAUTH_SUPPORT) list(APPEND NON_GENERATED_HEADERS - headers/oauth.h) + headers/OAuth.h) endif() set(GENERATED_HEADERS - headers/generated/constants.h - headers/generated/services.h - headers/generated/types.h + headers/generated/Constants.h + headers/generated/Services.h + headers/generated/Types.h headers/generated/EDAMErrorCode.h) set(PRIVATE_HEADERS - src/thrift.h - src/http.h - src/impl.h - src/generated/types_impl.h) + src/Http.h + src/Impl.h + src/Thrift.h + src/generated/Types_io.h) set(SOURCES - src/globals.cpp - src/exceptions.cpp - src/http.cpp - src/services_nongenerated.cpp src/AsyncResult.cpp - src/EverCloudException.cpp src/EventLoopFinisher.cpp - src/thumbnail.cpp + src/EverCloudException.cpp + src/Exceptions.cpp + src/Globals.cpp + src/Http.cpp src/InkNoteImageDownloader.cpp - src/generated/constants.cpp - src/generated/services.cpp - src/generated/types.cpp) + src/ServicesNonGenerated.cpp + src/Thumbnail.cpp + src/generated/Constants.cpp + src/generated/EDAMErrorCode.cpp + src/generated/Services.cpp + src/generated/Types.cpp) if(BUILD_WITH_OAUTH_SUPPORT) list(APPEND SOURCES - src/oauth.cpp) + src/OAuth.cpp) endif() set(ALL_HEADERS_AND_SOURCES ${PUBLIC_HEADERS}) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index c9e885ff..702cfee5 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,11 +9,12 @@ #ifndef QEVERCLOUD_ASYNC_RESULT_H #define QEVERCLOUD_ASYNC_RESULT_H -#include "qt4helpers.h" -#include "export.h" #include "EverCloudException.h" -#include +#include "Export.h" +#include "Helpers.h" + #include +#include namespace qevercloud { diff --git a/QEverCloud/headers/EventLoopFinisher.h b/QEverCloud/headers/EventLoopFinisher.h index af8d53a0..8ef57378 100644 --- a/QEverCloud/headers/EventLoopFinisher.h +++ b/QEverCloud/headers/EventLoopFinisher.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,10 +9,11 @@ #ifndef QEVERCLOUD_EVENT_LOOP_FINISHER_H #define QEVERCLOUD_EVENT_LOOP_FINISHER_H -#include "qt4helpers.h" -#include "export.h" -#include +#include "Export.h" +#include "Helpers.h" + #include +#include namespace qevercloud { diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index d150cb30..2d4f5ae4 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,11 +9,13 @@ #ifndef QEVERCLOUD_EVER_CLOUD_EXCEPTION_H #define QEVERCLOUD_EVER_CLOUD_EXCEPTION_H -#include "qt4helpers.h" -#include "export.h" +#include "Export.h" +#include "Helpers.h" + #include #include #include + #include namespace qevercloud { @@ -33,9 +35,9 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception explicit EverCloudException(QString error); explicit EverCloudException(const std::string & error); explicit EverCloudException(const char * error); - ~EverCloudException() throw(); + ~EverCloudException() noexcept; - const char * what() const throw(); + const char * what() const noexcept; virtual QSharedPointer exceptionData() const; }; diff --git a/QEverCloud/headers/exceptions.h b/QEverCloud/headers/Exceptions.h similarity index 89% rename from QEverCloud/headers/exceptions.h rename to QEverCloud/headers/Exceptions.h index f0da48a3..ad993fb1 100644 --- a/QEverCloud/headers/exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,14 +9,15 @@ #ifndef QEVERCLOUD_EXCEPTIONS_H #define QEVERCLOUD_EXCEPTIONS_H -#include "Optional.h" -#include "export.h" #include "EverCloudException.h" +#include "Export.h" +#include "Optional.h" #include "generated/EDAMErrorCode.h" -#include "generated/types.h" -#include +#include "generated/Types.h" + #include #include +#include namespace qevercloud { @@ -79,11 +80,11 @@ class QEVERCLOUD_EXPORT EDAMUserExceptionData: public EvernoteExceptionData Q_OBJECT Q_DISABLE_COPY(EDAMUserExceptionData) public: - explicit EDAMUserExceptionData(QString error, EDAMErrorCode::type errorCode, Optional parameter); + explicit EDAMUserExceptionData(QString error, EDAMErrorCode errorCode, Optional parameter); virtual void throwException() const Q_DECL_OVERRIDE; protected: - EDAMErrorCode::type m_errorCode; + EDAMErrorCode m_errorCode; Optional m_parameter; }; @@ -93,11 +94,11 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionData: public EvernoteExceptionData Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionData) public: - explicit EDAMSystemExceptionData(QString err, EDAMErrorCode::type errorCode, Optional message, Optional rateLimitDuration); + explicit EDAMSystemExceptionData(QString err, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); virtual void throwException() const Q_DECL_OVERRIDE; protected: - EDAMErrorCode::type m_errorCode; + EDAMErrorCode m_errorCode; Optional m_message; Optional m_rateLimitDuration; }; @@ -122,13 +123,13 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: public EvernoteExcepti Q_OBJECT Q_DISABLE_COPY(EDAMInvalidContactsExceptionData) public: - explicit EDAMInvalidContactsExceptionData(QList contacts, Optional parameter, Optional > reasons); + explicit EDAMInvalidContactsExceptionData(QList contacts, Optional parameter, Optional > reasons); virtual void throwException() const Q_DECL_OVERRIDE; protected: QList< Contact > m_contacts; Optional< QString > m_parameter; - Optional< QList< EDAMInvalidContactReason::type > > m_reasons; + Optional< QList< EDAMInvalidContactReason > > m_reasons; }; /** @@ -146,7 +147,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: public EDAMSyst Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionRateLimitReachedData) public: - explicit EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode::type errorCode, Optional message, + explicit EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); virtual void throwException() const Q_DECL_OVERRIDE; }; @@ -166,7 +167,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpiredData: public EDAMSystemExc Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionAuthExpiredData) public: - explicit EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode::type errorCode, Optional message, + explicit EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); virtual void throwException() const Q_DECL_OVERRIDE; }; diff --git a/QEverCloud/headers/export.h b/QEverCloud/headers/Export.h similarity index 100% rename from QEverCloud/headers/export.h rename to QEverCloud/headers/Export.h diff --git a/QEverCloud/headers/globals.h b/QEverCloud/headers/Globals.h similarity index 98% rename from QEverCloud/headers/globals.h rename to QEverCloud/headers/Globals.h index 8c904cac..b7ffdf31 100644 --- a/QEverCloud/headers/globals.h +++ b/QEverCloud/headers/Globals.h @@ -9,7 +9,8 @@ #ifndef QEVERCLOUD_GLOBALS_H #define QEVERCLOUD_GLOBALS_H -#include "export.h" +#include "Export.h" + #include /** diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h new file mode 100644 index 00000000..fe9bf5d1 --- /dev/null +++ b/QEverCloud/headers/Helpers.h @@ -0,0 +1,164 @@ +/** + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dmitry Ivanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H +#define QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H + +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) + +// this adds const to non-const objects (like std::as_const) +template +Q_DECL_CONSTEXPR +typename std::add_const::type & qAsConst(T & t) Q_DECL_NOTHROW +{ + return t; +} + +// prevent rvalue arguments: +template +void qAsConst(const T &&) Q_DECL_EQ_DELETE; + +#endif // QT_VERSION_CHECK + +//////////////////////////////////////////////////////////////////////////////// + +template +class QAssociativeContainerReferenceWrapper +{ +public: + struct iterator + { + typename Container::iterator m_iterator; + iterator(const typename Container::iterator it) : + m_iterator(it) + {} + + typename Container::iterator operator*() + { + return m_iterator; + } + + iterator & operator++() + { + ++m_iterator; + return *this; + } + + bool operator!=(const iterator & other) const + { + return m_iterator != other.m_iterator; + } + }; + +public: + QAssociativeContainerReferenceWrapper(Container & container) + : m_container(container) + {} + + iterator begin() { + return m_container.begin(); + } + + iterator end() { + return m_container.end(); + } + +private: + Container & m_container; +}; + +//////////////////////////////////////////////////////////////////////////////// + +template +class QAssociativeContainerConstReferenceWrapper +{ +public: + struct iterator + { + typename Container::const_iterator m_iterator; + iterator(const typename Container::const_iterator it) : + m_iterator(it) + {} + + typename Container::const_iterator operator*() + { + return m_iterator; + } + + iterator & operator++() + { + ++m_iterator; + return *this; + } + + bool operator!=(const iterator & other) const + { + return m_iterator != other.m_iterator; + } + }; + +public: + QAssociativeContainerConstReferenceWrapper(const Container & container) + : m_container(container) + {} + + iterator begin() const { + return m_container.begin(); + } + + iterator end() const { + return m_container.end(); + } + +private: + const Container & m_container; +}; + +//////////////////////////////////////////////////////////////////////////////// + +template +QAssociativeContainerReferenceWrapper toRange(Container & container) +{ + return QAssociativeContainerReferenceWrapper(container); +} + +//////////////////////////////////////////////////////////////////////////////// + +template +QAssociativeContainerConstReferenceWrapper toRange( + const Container & container) +{ + return QAssociativeContainerConstReferenceWrapper(container); +} + +} // namespace qevercloud + +#endif // QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H diff --git a/QEverCloud/headers/InkNoteImageDownloader.h b/QEverCloud/headers/InkNoteImageDownloader.h index 073e1cb7..4927a02c 100644 --- a/QEverCloud/headers/InkNoteImageDownloader.h +++ b/QEverCloud/headers/InkNoteImageDownloader.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016 Dmitry Ivanov + * Copyright (c) 2016-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,9 +8,10 @@ #ifndef QEVERCLOD_INK_NOTE_IMAGE_DOWNLOADER_H #define QEVERCLOD_INK_NOTE_IMAGE_DOWNLOADER_H -#include "export.h" #include "AsyncResult.h" -#include "generated/types.h" +#include "Export.h" +#include "generated/Types.h" + #include #include #include diff --git a/QEverCloud/headers/oauth.h b/QEverCloud/headers/OAuth.h similarity index 98% rename from QEverCloud/headers/oauth.h rename to QEverCloud/headers/OAuth.h index 532e15a1..0eac3a19 100644 --- a/QEverCloud/headers/oauth.h +++ b/QEverCloud/headers/OAuth.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -14,11 +14,12 @@ #define QT_NO_UNICODE_LITERAL #endif -#include "generated/types.h" -#include "export.h" -#include "qt4helpers.h" -#include +#include "Export.h" +#include "Helpers.h" +#include "generated/Types.h" + #include +#include #if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010 // VS2010 is supposed to be C++11 but does not fulfull the entire standard. diff --git a/QEverCloud/headers/Optional.h b/QEverCloud/headers/Optional.h index b3b4cc92..79af8c07 100644 --- a/QEverCloud/headers/Optional.h +++ b/QEverCloud/headers/Optional.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -10,6 +10,7 @@ #define QEVERCLOUD_OPTIONAL_H #include "EverCloudException.h" + #include namespace qevercloud { @@ -29,7 +30,7 @@ namespace qevercloud { * * So for my library I created a special class that supports the optional value notion explicitly. * Basically Optional class just holds a bool value that tracks the fact that a value was assigned. But this tracking - * is done automatically and attempts to use unissigned values throw exceptions. In this way errors are much harder to + * is done automatically and attempts to use unassigned values throw exceptions. In this way errors are much harder to * make and it's harder for them to slip through testing unnoticed too. * */ diff --git a/QEverCloud/headers/QEverCloud.h b/QEverCloud/headers/QEverCloud.h index b74cd01c..4fe269b7 100644 --- a/QEverCloud/headers/QEverCloud.h +++ b/QEverCloud/headers/QEverCloud.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -12,17 +12,17 @@ #include "AsyncResult.h" #include "EventLoopFinisher.h" #include "EverCloudException.h" -#include "exceptions.h" -#include "export.h" -#include "globals.h" -#include "Optional.h" -#include "qt4helpers.h" -#include "thumbnail.h" +#include "Exceptions.h" +#include "Export.h" +#include "Globals.h" +#include "Helpers.h" #include "InkNoteImageDownloader.h" +#include "Optional.h" +#include "Thumbnail.h" #include "VersionInfo.h" #include "generated/EDAMErrorCode.h" -#include "generated/constants.h" -#include "generated/services.h" -#include "generated/types.h" +#include "generated/Constants.h" +#include "generated/Services.h" +#include "generated/Types.h" #endif // QEVERCLOUD_INFTHEADER_H diff --git a/QEverCloud/headers/QEverCloudOAuth.h b/QEverCloud/headers/QEverCloudOAuth.h index 2888ad44..94498e3e 100644 --- a/QEverCloud/headers/QEverCloudOAuth.h +++ b/QEverCloud/headers/QEverCloudOAuth.h @@ -9,7 +9,7 @@ #ifndef QEVERCLOUDOAUTH_INFTHEADER_H #define QEVERCLOUDOAUTH_INFTHEADER_H +#include "OAuth.h" #include "QEverCloud.h" -#include "oauth.h" #endif // QEVERCLOUDOAUTH_INFTHEADER_H diff --git a/QEverCloud/headers/thumbnail.h b/QEverCloud/headers/Thumbnail.h similarity index 97% rename from QEverCloud/headers/thumbnail.h rename to QEverCloud/headers/Thumbnail.h index 633c1803..ffde2251 100644 --- a/QEverCloud/headers/thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,12 +9,13 @@ #ifndef QEVERCLOUD_THUMBNAIL_H #define QEVERCLOUD_THUMBNAIL_H -#include "export.h" #include "AsyncResult.h" -#include "generated/types.h" +#include "Export.h" +#include "generated/Types.h" + #include -#include #include +#include namespace qevercloud { diff --git a/QEverCloud/headers/VersionInfo.h.in b/QEverCloud/headers/VersionInfo.h.in index c9363de9..4b45e2c1 100644 --- a/QEverCloud/headers/VersionInfo.h.in +++ b/QEverCloud/headers/VersionInfo.h.in @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017 Dmitry Ivanov + * Copyright (c) 2017-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT diff --git a/QEverCloud/headers/generated/constants.h b/QEverCloud/headers/generated/Constants.h similarity index 91% rename from QEverCloud/headers/generated/constants.h rename to QEverCloud/headers/generated/Constants.h index e1164abe..f3c59879 100644 --- a/QEverCloud/headers/generated/constants.h +++ b/QEverCloud/headers/generated/Constants.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,95 +8,100 @@ * This file was generated from Evernote Thrift API */ - #ifndef QEVERCLOUD_GENERATED_CONSTANTS_H #define QEVERCLOUD_GENERATED_CONSTANTS_H -#include "../Optional.h" -#include "../export.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "../Export.h" namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + // Limits.thrift /** * Minimum length of any string-based attribute, in Unicode chars */ QEVERCLOUD_EXPORT extern const qint32 EDAM_ATTRIBUTE_LEN_MIN; +// Limits.thrift /** * Maximum length of any string-based attribute, in Unicode chars */ QEVERCLOUD_EXPORT extern const qint32 EDAM_ATTRIBUTE_LEN_MAX; +// Limits.thrift /** * Any string-based attribute must match the provided regular expression. * This excludes all Unicode line endings and control characters. */ QEVERCLOUD_EXPORT extern const QString EDAM_ATTRIBUTE_REGEX; +// Limits.thrift /** * The maximum number of values that can be stored in a list-based attribute * (e.g. see UserAttributes.recentMailedAddresses) */ QEVERCLOUD_EXPORT extern const qint32 EDAM_ATTRIBUTE_LIST_MAX; +// Limits.thrift /** * The maximum number of entries that can be stored in a map-based attribute * such as applicationData fields in Resources and Notes. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_ATTRIBUTE_MAP_MAX; +// Limits.thrift /** * The minimum length of a GUID generated by the Evernote service */ QEVERCLOUD_EXPORT extern const qint32 EDAM_GUID_LEN_MIN; +// Limits.thrift /** * The maximum length of a GUID generated by the Evernote service */ QEVERCLOUD_EXPORT extern const qint32 EDAM_GUID_LEN_MAX; +// Limits.thrift /** * GUIDs generated by the Evernote service will match the provided pattern */ QEVERCLOUD_EXPORT extern const QString EDAM_GUID_REGEX; +// Limits.thrift /** * The minimum length of any email address */ QEVERCLOUD_EXPORT extern const qint32 EDAM_EMAIL_LEN_MIN; +// Limits.thrift /** * The maximum length of any email address */ QEVERCLOUD_EXPORT extern const qint32 EDAM_EMAIL_LEN_MAX; +// Limits.thrift /** * A regular expression that matches the part of an email address before * the '@' symbol. */ QEVERCLOUD_EXPORT extern const QString EDAM_EMAIL_LOCAL_REGEX; +// Limits.thrift /** * A regular expression that matches the part of an email address after * the '@' symbol. */ QEVERCLOUD_EXPORT extern const QString EDAM_EMAIL_DOMAIN_REGEX; +// Limits.thrift /** * A regular expression that must match any email address given to Evernote. * Email addresses must comply with RFC 2821 and 2822. */ QEVERCLOUD_EXPORT extern const QString EDAM_EMAIL_REGEX; +// Limits.thrift /** * A regular expression that must match any VAT ID given to Evernote. * ref http://en.wikipedia.org/wiki/VAT_identification_number @@ -104,16 +109,19 @@ QEVERCLOUD_EXPORT extern const QString EDAM_EMAIL_REGEX; */ QEVERCLOUD_EXPORT extern const QString EDAM_VAT_REGEX; +// Limits.thrift /** * The minimum length of a timezone specification string */ QEVERCLOUD_EXPORT extern const qint32 EDAM_TIMEZONE_LEN_MIN; +// Limits.thrift /** * The maximum length of a timezone specification string */ QEVERCLOUD_EXPORT extern const qint32 EDAM_TIMEZONE_LEN_MAX; +// Limits.thrift /** * Any timezone string given to Evernote must match the provided pattern. * This permits either a locale-based standard timezone or a GMT offset. @@ -124,70 +132,89 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_TIMEZONE_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_TIMEZONE_REGEX; +// Limits.thrift /** * The minimum length of any MIME type string given to Evernote */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MIME_LEN_MIN; +// Limits.thrift /** * The maximum length of any MIME type string given to Evernote */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MIME_LEN_MAX; +// Limits.thrift /** * Any MIME type string given to Evernote must match the provided pattern. * E.g.: image/gif */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_REGEX; +// Limits.thrift /** Canonical MIME type string for GIF image resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_GIF; +// Limits.thrift /** Canonical MIME type string for JPEG image resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_JPEG; +// Limits.thrift /** Canonical MIME type string for PNG image resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_PNG; +// Limits.thrift /** Canonical MIME type string for TIFF image resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_TIFF; +// Limits.thrift /** Canonical MIME type string for BMP image resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_BMP; +// Limits.thrift /** Canonical MIME type string for WAV audio resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_WAV; +// Limits.thrift /** Canonical MIME type string for MP3 audio resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_MP3; +// Limits.thrift /** Canonical MIME type string for AMR audio resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_AMR; +// Limits.thrift /** Canonical MIME type string for AAC audio resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_AAC; +// Limits.thrift /** Canonical MIME type string for MP4 audio resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_M4A; +// Limits.thrift /** Canonical MIME type string for MP4 video resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_MP4_VIDEO; +// Limits.thrift /** Canonical MIME type string for Evernote Ink resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_INK; +// Limits.thrift /** Canonical MIME type string for PDF resources */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_PDF; +// Limits.thrift /** MIME type used for attachments of an unspecified type */ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_DEFAULT; +// Limits.thrift /** * The set of resource MIME types that are expected to be handled * correctly by all of the major Evernote client applications. */ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_MIME_TYPES; +// Limits.thrift /** * The set of MIME types that Evernote will parse and index for * searching. With exception of images, PDFs and plain text files, @@ -195,6 +222,7 @@ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_MIME_TYPES; */ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPES; +// Limits.thrift /** * 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 @@ -202,16 +230,19 @@ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPE */ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES; +// Limits.thrift /** * The minimum length of a user search query string in Unicode chars */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_QUERY_LEN_MIN; +// Limits.thrift /** * The maximum length of a user search query string in Unicode chars */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_QUERY_LEN_MAX; +// Limits.thrift /** * Search queries must match the provided pattern. This is used for * both ad-hoc queries and SavedSearch.query fields. @@ -219,6 +250,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_QUERY_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_SEARCH_QUERY_REGEX; +// Limits.thrift /** * The exact length of a MD5 hash checksum, in binary bytes. * This is the exact length that must be matched for any binary hash @@ -226,16 +258,19 @@ QEVERCLOUD_EXPORT extern const QString EDAM_SEARCH_QUERY_REGEX; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_HASH_LEN; +// Limits.thrift /** * The minimum length of an Evernote username */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_USERNAME_LEN_MIN; +// Limits.thrift /** * The maximum length of an Evernote username */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_USERNAME_LEN_MAX; +// Limits.thrift /** * Any Evernote User.username field must match this pattern. This * restricts usernames to a format that could permit use as a domain @@ -243,32 +278,38 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_USERNAME_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_USER_USERNAME_REGEX; +// Limits.thrift /** * Minimum length of the User.name field */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_NAME_LEN_MIN; +// Limits.thrift /** * Maximum length of the User.name field */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_NAME_LEN_MAX; +// Limits.thrift /** * The User.name field must match this pattern, which excludes line * endings and control characters. */ QEVERCLOUD_EXPORT extern const QString EDAM_USER_NAME_REGEX; +// Limits.thrift /** * The minimum length of a Tag.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_TAG_NAME_LEN_MIN; +// Limits.thrift /** * The maximum length of a Tag.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_TAG_NAME_LEN_MAX; +// Limits.thrift /** * All Tag.name fields must match this pattern. * This excludes control chars, commas or line/paragraph separators. @@ -276,16 +317,19 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_TAG_NAME_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_TAG_NAME_REGEX; +// Limits.thrift /** * The minimum length of a Note.title, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_LEN_MIN; +// Limits.thrift /** * The maximum length of a Note.title, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_LEN_MAX; +// Limits.thrift /** * All Note.title fields must match this pattern. * This excludes control chars or line/paragraph separators. @@ -293,18 +337,21 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_TITLE_REGEX; +// Limits.thrift /** * Minimum length of a Note.content field. * Note.content fields must comply with the ENML DTD. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_CONTENT_LEN_MIN; +// Limits.thrift /** * Maximum length of a Note.content field * Note.content fields must comply with the ENML DTD. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_CONTENT_LEN_MAX; +// Limits.thrift /** * Minimum length of an application name, which is the key in an * applicationData LazyMap found in entities such as Resources and @@ -312,6 +359,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_CONTENT_LEN_MAX; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_NAME_LEN_MIN; +// Limits.thrift /** * Maximum length of an application name, which is the key in an * applicationData LazyMap found in entities such as Resources and @@ -319,12 +367,14 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_NAME_LEN_MIN; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_NAME_LEN_MAX; +// Limits.thrift /** * Minimum length of an applicationData value in a LazyMap, found * in entities such as Resources and Notes. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_VALUE_LEN_MIN; +// Limits.thrift /** * Maximum length of an applicationData value in a LazyMap, found * in entities such as Resources and Notes. Note, however, that @@ -334,12 +384,14 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_VALUE_LEN_MIN; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_VALUE_LEN_MAX; +// Limits.thrift /** * 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. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_ENTRY_LEN_MAX; +// Limits.thrift /** * An application name must match this regex. An application * name is the key portion of an entry in an applicationData @@ -350,6 +402,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_APPLICATIONDATA_ENTRY_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_APPLICATIONDATA_NAME_REGEX; +// Limits.thrift /** * An applicationData map value must match this regex. * Note that even if both the name and value regexes match, @@ -358,16 +411,19 @@ QEVERCLOUD_EXPORT extern const QString EDAM_APPLICATIONDATA_NAME_REGEX; */ QEVERCLOUD_EXPORT extern const QString EDAM_APPLICATIONDATA_VALUE_REGEX; +// Limits.thrift /** * The minimum length of a Notebook.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_NAME_LEN_MIN; +// Limits.thrift /** * The maximum length of a Notebook.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_NAME_LEN_MAX; +// Limits.thrift /** * All Notebook.name fields must match this pattern. * This excludes control chars or line/paragraph separators. @@ -375,16 +431,19 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_NAME_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTEBOOK_NAME_REGEX; +// Limits.thrift /** * The minimum length of a Notebook.stack, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_STACK_LEN_MIN; +// Limits.thrift /** * The maximum length of a Notebook.stack, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_STACK_LEN_MAX; +// Limits.thrift /** * All Notebook.stack fields must match this pattern. * This excludes control chars or line/paragraph separators. @@ -392,21 +451,25 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_STACK_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTEBOOK_STACK_REGEX; +// Limits.thrift /** * The minimum length of a Workspace.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_WORKSPACE_NAME_LEN_MIN; +// Limits.thrift /** * The maximum length of a Workspace.name, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_WORKSPACE_NAME_LEN_MAX; +// Limits.thrift /** * The maximum length of a Workspace.description, in Unicode characters */ QEVERCLOUD_EXPORT extern const qint32 EDAM_WORKSPACE_DESCRIPTION_LEN_MAX; +// Limits.thrift /** * All Workspace.name fields must match this pattern. * This excludes control chars or line/paragraph separators. @@ -414,36 +477,43 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_WORKSPACE_DESCRIPTION_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_WORKSPACE_NAME_REGEX; +// Limits.thrift /** * The minimum length of a public notebook URI component */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PUBLISHING_URI_LEN_MIN; +// Limits.thrift /** * The maximum length of a public notebook URI component */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PUBLISHING_URI_LEN_MAX; +// Limits.thrift /** * A public notebook URI component must match the provided pattern */ QEVERCLOUD_EXPORT extern const QString EDAM_PUBLISHING_URI_REGEX; +// Limits.thrift /** * The set of strings that may not be used as a publishing URI */ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_PUBLISHING_URI_PROHIBITED; +// Limits.thrift /** * The minimum length of a Publishing.publicDescription field. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MIN; +// Limits.thrift /** * The maximum length of a Publishing.publicDescription field. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MAX; +// Limits.thrift /** * Any public notebook's Publishing.publicDescription field must match * this pattern. @@ -452,16 +522,19 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_PUBLISHING_DESCRIPTION_REGEX; +// Limits.thrift /** * The minimum length of a SavedSearch.name field */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SAVED_SEARCH_NAME_LEN_MIN; +// Limits.thrift /** * The maximum length of a SavedSearch.name field */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SAVED_SEARCH_NAME_LEN_MAX; +// Limits.thrift /** * SavedSearch.name fields must match this pattern. * No control chars or line/paragraph separators, and can't start or @@ -469,92 +542,110 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_SAVED_SEARCH_NAME_LEN_MAX; */ QEVERCLOUD_EXPORT extern const QString EDAM_SAVED_SEARCH_NAME_REGEX; +// Limits.thrift /** * The minimum length of an Evernote user password */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_PASSWORD_LEN_MIN; +// Limits.thrift /** * The maximum length of an Evernote user password */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_PASSWORD_LEN_MAX; +// Limits.thrift /** * Evernote user passwords must match this regular expression */ QEVERCLOUD_EXPORT extern const QString EDAM_USER_PASSWORD_REGEX; +// Limits.thrift /** * The maximum length of an Evernote Business URI */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_URI_LEN_MAX; +// Limits.thrift /** * Valid Evernote Business marketing code / affiliate code format. */ QEVERCLOUD_EXPORT extern const QString EDAM_BUSINESS_MARKETING_CODE_REGEX_PATTERN; +// Limits.thrift /** * The maximum number of Tags per Note */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TAGS_MAX; +// Limits.thrift /** * The maximum number of Resources per Note */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_RESOURCES_MAX; +// Limits.thrift /** * Maximum number of Tags per account */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_TAGS_MAX; +// Limits.thrift /** * Maximum number of Tags per business account. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_TAGS_MAX; +// Limits.thrift /** * Maximum number of SavedSearches per account */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_SAVED_SEARCHES_MAX; +// Limits.thrift /** * Maximum number of Notes per user */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_NOTES_MAX; +// Limits.thrift /** * Maximum number of Notes per business account */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_NOTES_MAX; +// Limits.thrift /** * Maximum number of Notebooks per user */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_NOTEBOOKS_MAX; +// Limits.thrift /** * Maximum number of Workspaces per user */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_WORKSPACES_MAX; +// Limits.thrift /** * Maximum number of Notebooks in a business account */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_NOTEBOOKS_MAX; +// Limits.thrift /** * Maximum number of Workspaces in a business account */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_WORKSPACES_MAX; +// Limits.thrift /** * Maximum number of recent email addresses that are maintained * (see UserAttributes.recentMailedAddresses) */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_RECENT_MAILED_ADDRESSES_MAX; +// Limits.thrift /** * 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 @@ -562,6 +653,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_RECENT_MAILED_ADDRESSES_MAX; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_MAIL_LIMIT_DAILY_FREE; +// Limits.thrift /** * 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 @@ -569,36 +661,42 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_MAIL_LIMIT_DAILY_FREE; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM; +// Limits.thrift /** * The number of bytes of new data that may be uploaded to a Free user's * account each month. */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_FREE; +// Limits.thrift /** * The number of bytes of new data that may be uploaded to a Premium user's * account each month. */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_PREMIUM; +// Limits.thrift /** * The number of bytes of new data that may be uploaded to new business * account during the first month. 50GB. */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_FIRST_MONTH; +// Limits.thrift /** * The number of bytes of new data that may be uploaded to a business * account for the next month. 20GB. */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_NEXT_MONTH; +// Limits.thrift /** * The number of bytes of new data that may be uploaded each month to an account at * a Plus service level. */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_PLUS; +// Limits.thrift /** * 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 @@ -606,6 +704,7 @@ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_PLUS; */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_SURVEY_THRESHOLD; +// Limits.thrift /** * 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 @@ -613,6 +712,7 @@ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_SURVEY_THRESHOLD; */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS; +// Limits.thrift /** * 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 @@ -620,6 +720,7 @@ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS; */ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_PER_USER; +// Limits.thrift /** * Maximum total size of a Note that can be added to a Free account. * The size of a note is calculated as: @@ -628,6 +729,7 @@ QEVERCLOUD_EXPORT extern const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_PER_USER; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_SIZE_MAX_FREE; +// Limits.thrift /** * Maximum total size of a Note that can be added to a Premium account. * The size of a note is calculated as: @@ -636,22 +738,26 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_SIZE_MAX_FREE; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_SIZE_MAX_PREMIUM; +// Limits.thrift /** * Maximum size of a resource, in bytes, for Free accounts */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RESOURCE_SIZE_MAX_FREE; +// Limits.thrift /** * Maximum size of a resource, in bytes, for Premium accounts */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RESOURCE_SIZE_MAX_PREMIUM; +// Limits.thrift /** * Maximum number of linked notebooks per account, for a free * account. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_LINKED_NOTEBOOK_MAX; +// Limits.thrift /** * Maximum number of linked notebooks per account, for a premium * account. Users who are part of an active business are also @@ -659,42 +765,50 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_LINKED_NOTEBOOK_MAX; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM; +// Limits.thrift /** * Maximum number of shared notebooks per business notebook */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_BUSINESS_SHARED_NOTEBOOK_MAX; +// Limits.thrift /** * Maximum number of shared notebooks per personal notebook */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTEBOOK_PERSONAL_SHARED_NOTEBOOK_MAX; +// Limits.thrift /** * Maximum number of SharedNote records per business note */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_BUSINESS_SHARED_NOTE_MAX; +// Limits.thrift /** * Maximum number of SharedNote records per personal note */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_PERSONAL_SHARED_NOTE_MAX; +// Limits.thrift /** * The minimum length of the content class attribute of a note. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_CONTENT_CLASS_LEN_MIN; +// Limits.thrift /** * The maximum length of the content class attribute of a note. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_CONTENT_CLASS_LEN_MAX; +// Limits.thrift /** * The regular expression that the content class of a note must match * to be valid. */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_CONTENT_CLASS_REGEX; +// Limits.thrift /** * The content class prefix used for all notes created by Evernote Hello. * This prefix can be used to assemble individual content class strings, @@ -704,6 +818,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_CONTENT_CLASS_REGEX; */ QEVERCLOUD_EXPORT extern const QString EDAM_HELLO_APP_CONTENT_CLASS_PREFIX; +// Limits.thrift /** * The content class prefix used for all notes created by Evernote Food. * This prefix can be used to assemble individual content class strings, @@ -713,6 +828,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_HELLO_APP_CONTENT_CLASS_PREFIX; */ QEVERCLOUD_EXPORT extern const QString EDAM_FOOD_APP_CONTENT_CLASS_PREFIX; +// Limits.thrift /** * The content class prefix used for structured notes created by Evernote * Hello that represents an encounter with a person. When performing a @@ -721,6 +837,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_FOOD_APP_CONTENT_CLASS_PREFIX; */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_HELLO_ENCOUNTER; +// Limits.thrift /** * The content class prefix used for structured notes created by Evernote * Hello that represents the user's profile. When performing a @@ -729,6 +846,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_HELLO_ENCOUNTER; */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_HELLO_PROFILE; +// Limits.thrift /** * The content class prefix used for structured notes created by * Evernote Food that captures the experience of a particular meal. @@ -737,6 +855,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_HELLO_PROFILE; */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_FOOD_MEAL; +// Limits.thrift /** * The content class prefix used for structured notes created by Evernote * Skitch. When performing a wildcard search via filtered sync chunks @@ -744,18 +863,21 @@ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_FOOD_MEAL; */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_SKITCH_PREFIX; +// Limits.thrift /** * The content class value used for structured image notes created by Evernote * Skitch. */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_SKITCH; +// Limits.thrift /** * The content class value used for structured PDF notes created by Evernote * Skitch. */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_SKITCH_PDF; +// Limits.thrift /** * The content class prefix used for structured notes created by Evernote * Penultimate. When performing a wildcard search via filtered sync chunks @@ -763,65 +885,76 @@ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_SKITCH_PDF; */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_PENULTIMATE_PREFIX; +// Limits.thrift /** * The content class value used for structured notes created by Evernote * Penultimate that represents a Penultimate notebook. */ QEVERCLOUD_EXPORT extern const QString EDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured by the Post-it * camera. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_POSTIT; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured by the Moleskine * page camera. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_MOLESKINE; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured by * PFU ScanSnap Evernote Edition. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_EN_SCANSNAP; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured with the Embedded * Web Clipper. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_EWC; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured with the Android * share extension. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_ANDROID_SHARE_EXTENSION; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured with the iOS share * extension. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_IOS_SHARE_EXTENSION; +// Limits.thrift /** * The NoteAttributes.sourceApplication value used for notes captured with the Evernote * Web Clipper. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_APPLICATION_WEB_CLIPPER; +// Limits.thrift /** * The NoteAttributes.source value used for notes captured by the Microsoft Outlook clipper. */ QEVERCLOUD_EXPORT extern const QString EDAM_SOURCE_OUTLOOK_CLIPPER; +// Limits.thrift /** * A NoteAttributes.noteTitleQuality value indicating that a note has no meaningful title, * only a placeholder value such as "Untitled Note". */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_UNTITLED; +// Limits.thrift /** * 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 @@ -829,6 +962,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_UNTITLED; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_LOW; +// Limits.thrift /** * 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 @@ -836,6 +970,7 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_LOW; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_MEDIUM; +// Limits.thrift /** * 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 @@ -843,58 +978,68 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_MEDIUM; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_TITLE_QUALITY_HIGH; +// Limits.thrift /** * The minimum length of the plain text in a findRelated query, assuming that * plaintext is being provided. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_PLAINTEXT_LEN_MIN; +// Limits.thrift /** * The maximum length of the plain text in a findRelated query, assuming that * plaintext is being provided. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_PLAINTEXT_LEN_MAX; +// Limits.thrift /** * The maximum number of notes that will be returned from a findRelated() * query. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_MAX_NOTES; +// Limits.thrift /** * The maximum number of notebooks that will be returned from a findRelated() * query. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_MAX_NOTEBOOKS; +// Limits.thrift /** * The maximum number of tags that will be returned from a findRelated() query. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_MAX_TAGS; +// Limits.thrift /** * The maximum number of experts that will be returned from a findRelated() query */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_MAX_EXPERTS; +// Limits.thrift /** * The maximum number of related content snippets that will be returned from a * findRelated() query. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_RELATED_MAX_RELATED_CONTENT; +// Limits.thrift /** * The minimum length, in Unicode characters, of a description for a business * notebook. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN; +// Limits.thrift /** * The maximum length, in Unicode characters, of a description for a business * notebook. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX; +// Limits.thrift /** * All business notebook descriptions must match this pattern. * This excludes control chars or line/paragraph separators. @@ -902,42 +1047,50 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX */ QEVERCLOUD_EXPORT extern const QString EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX; +// Limits.thrift /** * The maximum length of a business phone number. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_BUSINESS_PHONE_NUMBER_LEN_MAX; +// Limits.thrift /** * Minimum length of a preference name */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_NAME_LEN_MIN; +// Limits.thrift /** * Maximum length of a preference name */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_NAME_LEN_MAX; +// Limits.thrift /** * Minimum length of a preference value */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_VALUE_LEN_MIN; +// Limits.thrift /** * Maximum length of a preference value */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_VALUE_LEN_MAX; +// Limits.thrift /** * Maximum number of name/value pairs allowed */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MAX_PREFERENCES; +// Limits.thrift /** * Maximum number of values per preference name when using * values of size no greater than EDAM_PREFERENCE_VALUE_LEN_MAX. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MAX_VALUES_PER_PREFERENCE; +// Limits.thrift /** * The maximum length of a preference value if you only use one value * per preference rather than up to EDAM_MAX_VALUES_PER_PREFERENCE. @@ -947,28 +1100,33 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_MAX_VALUES_PER_PREFERENCE; */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_ONLY_ONE_VALUE_LEN_MAX; +// Limits.thrift /** * A preference name must match this regex. */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_NAME_REGEX; +// Limits.thrift /** * A preference value must match this regex if you are using more * than a single value for a preference. */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_VALUE_REGEX; +// Limits.thrift /** * A preference value must match this regex if you are using a single * value for a preference. */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_ONLY_ONE_VALUE_REGEX; +// Limits.thrift /** * The name of the preferences entry that contains shortcuts. */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_SHORTCUTS; +// Limits.thrift /** * 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. @@ -981,6 +1139,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_SHORTCUTS; */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_BUSINESS_DEFAULT_NOTEBOOK; +// Limits.thrift /** * 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 @@ -997,145 +1156,172 @@ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_BUSINESS_DEFAULT_NOTEBOOK */ QEVERCLOUD_EXPORT extern const QString EDAM_PREFERENCE_BUSINESS_QUICKNOTE; +// Limits.thrift /** * The maximum number of shortcuts that a user may have. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PREFERENCE_SHORTCUTS_MAX_VALUES; +// Limits.thrift /** * Maximum length of the device identifier string associated with long sessions. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_DEVICE_ID_LEN_MAX; +// Limits.thrift /** * Regular expression for device identifier strings associated with long sessions. */ QEVERCLOUD_EXPORT extern const QString EDAM_DEVICE_ID_REGEX; +// Limits.thrift /** * Maximum length of the device description string associated with long sessions. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_DEVICE_DESCRIPTION_LEN_MAX; +// Limits.thrift /** * Regular expression for device description strings associated with long sessions. */ QEVERCLOUD_EXPORT extern const QString EDAM_DEVICE_DESCRIPTION_REGEX; +// Limits.thrift /** * Maximum number of search suggestions that can be returned */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_SUGGESTIONS_MAX; +// Limits.thrift /** * Maximum length of the search suggestion prefix */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX; +// Limits.thrift /** * Minimum length of the search suggestion prefix */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN; +// Limits.thrift /** * Default maximum number of results the service will return for findContact */ QEVERCLOUD_EXPORT extern const qint32 EDAM_FIND_CONTACT_DEFAULT_MAX_RESULTS; +// Limits.thrift /** * Absolute maximum number of results the service will return for findContact */ QEVERCLOUD_EXPORT extern const qint32 EDAM_FIND_CONTACT_MAX_RESULTS; +// Limits.thrift /** * The maximum number of separate notes that may be queried in a single call to * NoteStore.getViewersForNotes. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_NOTE_LOCK_VIEWERS_NOTES_MAX; +// Limits.thrift /** * Absolute maximum number of results the servce will return for PersistentInternalMarket.getOrders() */ QEVERCLOUD_EXPORT extern const qint32 EDAM_GET_ORDERS_MAX_RESULTS; +// Limits.thrift /** * The maximum length of a message body in unicode characters. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MESSAGE_BODY_LEN_MAX; +// Limits.thrift /** * The regex to validate message.body against */ QEVERCLOUD_EXPORT extern const QString EDAM_MESSAGE_BODY_REGEX; +// Limits.thrift /** * The maximum number of recipients on a MessageThread. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MESSAGE_RECIPIENTS_MAX; +// Limits.thrift /** * The maximum number of attachments a Message can have. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MESSAGE_ATTACHMENTS_MAX; +// Limits.thrift /** * The maximum length of a message attachment title in unicode characters. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MESSAGE_ATTACHMENT_TITLE_LEN_MAX; +// Limits.thrift /** * The regex to validate message attachment titles against */ QEVERCLOUD_EXPORT extern const QString EDAM_MESSAGE_ATTACHMENT_TITLE_REGEX; +// Limits.thrift /** * The maximum length of a message attachment snippet in unicode characters. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_MESSAGE_ATTACHMENT_SNIPPET_LEN_MAX; +// Limits.thrift /** * The regex to validate message attachment snippets against */ QEVERCLOUD_EXPORT extern const QString EDAM_MESSAGE_ATTACHMENT_SNIPPET_REGEX; +// Limits.thrift /** * Maximum user profile photo size, in bytes, that clients may send to the service. * Photos may be resized before being stored on the service. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_USER_PROFILE_PHOTO_MAX_BYTES; +// Limits.thrift /** * The maximum length of a promotion ID in unicode characters. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_PROMOTION_ID_LEN_MAX; +// Limits.thrift /** * The regex to validate promotion IDs against. */ QEVERCLOUD_EXPORT extern const QString EDAM_PROMOTION_ID_REGEX; +// Limits.thrift /** App Feedback Rating range */ QEVERCLOUD_EXPORT extern const qint16 EDAM_APP_RATING_MIN; +// Limits.thrift QEVERCLOUD_EXPORT extern const qint16 EDAM_APP_RATING_MAX; +// Limits.thrift /** * The maximium number of note snippets you can retrieve in a single request */ QEVERCLOUD_EXPORT extern const qint32 EDAM_SNIPPETS_NOTES_MAX; +// Limits.thrift /** * The maximum number of connected identities a client can request. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_CONNECTED_IDENTITY_REQUEST_MAX; +// Limits.thrift /** * 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. */ QEVERCLOUD_EXPORT extern const qint32 EDAM_OPEN_ID_ACCESS_TOKEN_MAX; - // Types.thrift /** * A value for the "recipe" key in the "classifications" map in NoteAttributes @@ -1143,43 +1329,48 @@ QEVERCLOUD_EXPORT extern const qint32 EDAM_OPEN_ID_ACCESS_TOKEN_MAX; */ QEVERCLOUD_EXPORT extern const QString CLASSIFICATION_RECIPE_USER_NON_RECIPE; +// Types.thrift /** * A value for the "recipe" key in the "classifications" map in NoteAttributes * that indicates the user has classified a note as being a recipe. */ QEVERCLOUD_EXPORT extern const QString CLASSIFICATION_RECIPE_USER_RECIPE; +// Types.thrift /** * 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. */ QEVERCLOUD_EXPORT extern const QString CLASSIFICATION_RECIPE_SERVICE_RECIPE; +// Types.thrift /** * Standardized value for the 'source' NoteAttribute for notes that * were clipped from the web in some manner. */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_SOURCE_WEB_CLIP; +// Types.thrift /** * Standardized value for the 'source' NoteAttribute for notes that * were clipped using the "simplified article" function of the clipper. */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_SOURCE_WEB_CLIP_SIMPLIFIED; +// Types.thrift /** * Standardized value for the 'source' NoteAttribute for notes that * were clipped from an email message. */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_SOURCE_MAIL_CLIP; +// Types.thrift /** * Standardized value for the 'source' NoteAttribute for notes that * were created via email sent to Evernote's email interface. */ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY; - // UserStore.thrift /** * The major version number for the current revision of the EDAM protocol. @@ -1188,6 +1379,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY; */ QEVERCLOUD_EXPORT extern const qint16 EDAM_VERSION_MAJOR; +// UserStore.thrift /** * The minor version number for the current revision of the EDAM protocol. * Clients pass this to the service using UserStore.checkVersion at the diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 4ceef164..de963bf2 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,11 +8,14 @@ * This file was generated from Evernote Thrift API */ - #ifndef QEVERCLOUD_GENERATED_EDAMERRORCODE_H #define QEVERCLOUD_GENERATED_EDAMERRORCODE_H -#include "../export.h" +#include "../Export.h" + + +#include +#include namespace qevercloud { @@ -86,49 +89,826 @@ namespace qevercloud { * 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.
+ * 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 type of authentication allowed for the user's - * account. This error is thrown when the user attempts to authenticate by another - * method (password, OpenId, etc).
- * - */ -struct QEVERCLOUD_EXPORT EDAMErrorCode -{ - enum type - { - 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 - }; + *
SSO authentication is the only type 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 class 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 }; +inline uint qHash(EDAMErrorCode value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EDAMErrorCode value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EDAMErrorCode value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class EDAMInvalidContactReason +{ + BAD_ADDRESS, + DUPLICATE_CONTACT, + NO_CONNECTION +}; + +inline uint qHash(EDAMInvalidContactReason value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EDAMInvalidContactReason value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EDAMInvalidContactReason value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class ShareRelationshipPrivilegeLevel +{ + READ_NOTEBOOK = 0, + READ_NOTEBOOK_PLUS_ACTIVITY = 10, + MODIFY_NOTEBOOK_PLUS_ACTIVITY = 20, + FULL_ACCESS = 30 +}; + +inline uint qHash(ShareRelationshipPrivilegeLevel value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ShareRelationshipPrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ShareRelationshipPrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class PrivilegeLevel +{ + NORMAL = 1, + PREMIUM = 3, + VIP = 5, + MANAGER = 7, + SUPPORT = 8, + ADMIN = 9 +}; + +inline uint qHash(PrivilegeLevel value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const PrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const PrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class ServiceLevel +{ + BASIC = 1, + PLUS = 2, + PREMIUM = 3, + BUSINESS = 4 +}; + +inline uint qHash(ServiceLevel value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ServiceLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ServiceLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * Every search query is specified as a sequence of characters. + * Currently, only the USER query format is supported. + */ +enum class QueryFormat +{ + USER = 1, + SEXP = 2 +}; + +inline uint qHash(QueryFormat value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const QueryFormat value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const QueryFormat value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * This enumeration defines the possible sort ordering for notes when + * they are returned from a search result. + */ +enum class NoteSortOrder +{ + CREATED = 1, + UPDATED = 2, + RELEVANCE = 3, + UPDATE_SEQUENCE_NUMBER = 4, + TITLE = 5 +}; + +inline uint qHash(NoteSortOrder value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const NoteSortOrder value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const NoteSortOrder value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class PremiumOrderStatus +{ + NONE = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3, + CANCELLATION_PENDING = 4, + CANCELED = 5 +}; + +inline uint qHash(PremiumOrderStatus value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const PremiumOrderStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const PremiumOrderStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class SharedNotebookPrivilegeLevel +{ + READ_NOTEBOOK = 0, + MODIFY_NOTEBOOK_PLUS_ACTIVITY = 1, + READ_NOTEBOOK_PLUS_ACTIVITY = 2, + GROUP = 3, + FULL_ACCESS = 4, + BUSINESS_FULL_ACCESS = 5 +}; + +inline uint qHash(SharedNotebookPrivilegeLevel value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotebookPrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotebookPrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class SharedNotePrivilegeLevel +{ + READ_NOTE = 0, + MODIFY_NOTE = 1, + FULL_ACCESS = 2 +}; + +inline uint qHash(SharedNotePrivilegeLevel value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotePrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotePrivilegeLevel value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class SponsoredGroupRole +{ + GROUP_MEMBER = 1, + GROUP_ADMIN = 2, + GROUP_OWNER = 3 +}; + +inline uint qHash(SponsoredGroupRole value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SponsoredGroupRole value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SponsoredGroupRole value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class BusinessUserRole +{ + ADMIN = 1, + NORMAL = 2 +}; + +inline uint qHash(BusinessUserRole value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessUserRole value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessUserRole value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class BusinessUserStatus +{ + ACTIVE = 1, + DEACTIVATED = 2 +}; + +inline uint qHash(BusinessUserStatus value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessUserStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessUserStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class SharedNotebookInstanceRestrictions +{ + ASSIGNED = 1, + NO_SHARED_NOTEBOOKS = 2 +}; + +inline uint qHash(SharedNotebookInstanceRestrictions value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotebookInstanceRestrictions value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotebookInstanceRestrictions value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class ReminderEmailConfig +{ + DO_NOT_SEND = 1, + SEND_DAILY_EMAIL = 2 +}; + +inline uint qHash(ReminderEmailConfig value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ReminderEmailConfig value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ReminderEmailConfig value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class BusinessInvitationStatus +{ + APPROVED = 0, + REQUESTED = 1, + REDEEMED = 2 +}; + +inline uint qHash(BusinessInvitationStatus value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessInvitationStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessInvitationStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * What kinds of Contacts does the Evernote service know about? + */ +enum class ContactType +{ + EVERNOTE = 1, + SMS = 2, + FACEBOOK = 3, + EMAIL = 4, + TWITTER = 5, + LINKEDIN = 6 +}; + +inline uint qHash(ContactType value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ContactType value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ContactType value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * Entity types + */ +enum class EntityType +{ + NOTE = 1, + NOTEBOOK = 2, + WORKSPACE = 3 +}; + +inline uint qHash(EntityType value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EntityType value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EntityType value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class RecipientStatus +{ + NOT_IN_MY_LIST = 1, + IN_MY_LIST = 2, + IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3 +}; + +inline uint qHash(RecipientStatus value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RecipientStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RecipientStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class CanMoveToContainerStatus +{ + CAN_BE_MOVED = 1, + INSUFFICIENT_ENTITY_PRIVILEGE = 2, + INSUFFICIENT_CONTAINER_PRIVILEGE = 3 +}; + +inline uint qHash(CanMoveToContainerStatus value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const CanMoveToContainerStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const CanMoveToContainerStatus value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class RelatedContentType +{ + NEWS_ARTICLE = 1, + PROFILE_PERSON = 2, + PROFILE_ORGANIZATION = 3, + REFERENCE_MATERIAL = 4 +}; + +inline uint qHash(RelatedContentType value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RelatedContentType value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RelatedContentType value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * 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 class RelatedContentAccess +{ + NOT_ACCESSIBLE = 0, + DIRECT_LINK_ACCESS_OK = 1, + DIRECT_LINK_LOGIN_REQUIRED = 2, + DIRECT_LINK_EMBEDDED_VIEW = 3 +}; + +inline uint qHash(RelatedContentAccess value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RelatedContentAccess value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RelatedContentAccess value); + +//////////////////////////////////////////////////////////////////////////////// + +/** + * + */ +enum class UserIdentityType +{ + EVERNOTE_USERID = 1, + EMAIL = 2, + IDENTITYID = 3 +}; + +inline uint qHash(UserIdentityType value) +{ + return static_cast(value); +} + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const UserIdentityType value); + +//////////////////////////////////////////////////////////////////////////////// + +QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const UserIdentityType value); } // namespace qevercloud diff --git a/QEverCloud/headers/generated/services.h b/QEverCloud/headers/generated/Services.h similarity index 99% rename from QEverCloud/headers/generated/services.h rename to QEverCloud/headers/generated/Services.h index f4d09f44..2b4cd4dc 100644 --- a/QEverCloud/headers/generated/services.h +++ b/QEverCloud/headers/generated/Services.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,23 +8,16 @@ * This file was generated from Evernote Thrift API */ - #ifndef QEVERCLOUD_GENERATED_SERVICES_H #define QEVERCLOUD_GENERATED_SERVICES_H -#include "../Optional.h" -#include "../export.h" +#include "../Export.h" + + #include "../AsyncResult.h" -#include "constants.h" -#include "types.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "../Optional.h" +#include "Constants.h" +#include "Types.h" #include namespace qevercloud { @@ -60,7 +53,7 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject Q_OBJECT Q_DISABLE_COPY(NoteStore) public: - explicit NoteStore(QString noteStoreUrl = QString(), QString authenticationToken = QString(), QObject * parent = 0); + explicit NoteStore(QString noteStoreUrl = QString(), QString authenticationToken = QString(), QObject * parent = nullptr); explicit NoteStore(QObject * parent); void setNoteStoreUrl(QString noteStoreUrl) { m_url = noteStoreUrl; } @@ -2400,7 +2393,7 @@ class QEVERCLOUD_EXPORT UserStore: public QObject Q_OBJECT Q_DISABLE_COPY(UserStore) public: - explicit UserStore(QString host, QString authenticationToken = QString(), QObject * parent = 0); + explicit UserStore(QString host, QString authenticationToken = QString(), QObject * parent = nullptr); void setAuthenticationToken(QString authenticationToken) { m_authenticationToken = authenticationToken; } QString authenticationToken() { return m_authenticationToken; } @@ -2863,10 +2856,10 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • DATA_REQUIRED "serviceLevel" - serviceLevel is null
  • * */ - AccountLimits getAccountLimits(ServiceLevel::type serviceLevel); + AccountLimits getAccountLimits(ServiceLevel serviceLevel); /** Asynchronous version of @link getAccountLimits @endlink */ - AsyncResult * getAccountLimitsAsync(ServiceLevel::type serviceLevel); + AsyncResult * getAccountLimitsAsync(ServiceLevel serviceLevel); private: QString m_url; diff --git a/QEverCloud/headers/generated/types.h b/QEverCloud/headers/generated/Types.h similarity index 92% rename from QEverCloud/headers/generated/types.h rename to QEverCloud/headers/generated/Types.h index ffd5f93a..1aa13b45 100644 --- a/QEverCloud/headers/generated/types.h +++ b/QEverCloud/headers/generated/Types.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,497 +8,36 @@ * This file was generated from Evernote Thrift API */ - #ifndef QEVERCLOUD_GENERATED_TYPES_H #define QEVERCLOUD_GENERATED_TYPES_H -#include "../Optional.h" -#include "../export.h" +#include "../Export.h" + + #include "EDAMErrorCode.h" -#include +#include "../Optional.h" +#include +#include #include +#include #include -#include #include #include #include #include -#include -#include namespace qevercloud { -/** - * 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. - */ -struct QEVERCLOUD_EXPORT EDAMInvalidContactReason { - enum type { - BAD_ADDRESS, - DUPLICATE_CONTACT, - NO_CONNECTION - }; -}; - -/** - * 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. - */ -struct QEVERCLOUD_EXPORT ShareRelationshipPrivilegeLevel { - enum type { - READ_NOTEBOOK = 0, - READ_NOTEBOOK_PLUS_ACTIVITY = 10, - MODIFY_NOTEBOOK_PLUS_ACTIVITY = 20, - FULL_ACCESS = 30 - }; -}; - -/** - * 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. - */ -struct QEVERCLOUD_EXPORT PrivilegeLevel { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT ServiceLevel { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT QueryFormat { - enum type { - USER = 1, - SEXP = 2 - }; -}; - -/** - * This enumeration defines the possible sort ordering for notes when - * they are returned from a search result. - */ -struct QEVERCLOUD_EXPORT NoteSortOrder { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT PremiumOrderStatus { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT SharedNotebookPrivilegeLevel { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT SharedNotePrivilegeLevel { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT SponsoredGroupRole { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT BusinessUserRole { - enum type { - 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
    - *
    - */ -struct QEVERCLOUD_EXPORT BusinessUserStatus { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT SharedNotebookInstanceRestrictions { - enum type { - ASSIGNED = 1, - 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. - */ -struct QEVERCLOUD_EXPORT ReminderEmailConfig { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT BusinessInvitationStatus { - enum type { - APPROVED = 0, - REQUESTED = 1, - REDEEMED = 2 - }; -}; - -/** - * What kinds of Contacts does the Evernote service know about? - */ -struct QEVERCLOUD_EXPORT ContactType { - enum type { - EVERNOTE = 1, - SMS = 2, - FACEBOOK = 3, - EMAIL = 4, - TWITTER = 5, - LINKEDIN = 6 - }; -}; - -/** - * Entity types - */ -struct QEVERCLOUD_EXPORT EntityType { - enum type { - NOTE = 1, - NOTEBOOK = 2, - WORKSPACE = 3 - }; -}; - -/** - * 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.
    - *
    - */ -struct QEVERCLOUD_EXPORT RecipientStatus { - enum type { - NOT_IN_MY_LIST = 1, - IN_MY_LIST = 2, - IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3 - }; -}; - -/** - * 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. - *
    - *
    - */ -struct QEVERCLOUD_EXPORT CanMoveToContainerStatus { - enum type { - CAN_BE_MOVED = 1, - INSUFFICIENT_ENTITY_PRIVILEGE = 2, - INSUFFICIENT_CONTAINER_PRIVILEGE = 3 - }; -}; - -/** - * 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 - */ -struct QEVERCLOUD_EXPORT RelatedContentType { - enum type { - 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. - */ -struct QEVERCLOUD_EXPORT RelatedContentAccess { - enum type { - NOT_ACCESSIBLE = 0, - DIRECT_LINK_ACCESS_OK = 1, - DIRECT_LINK_LOGIN_REQUIRED = 2, - DIRECT_LINK_EMBEDDED_VIEW = 3 - }; -}; - -/** - * - */ -struct QEVERCLOUD_EXPORT UserIdentityType { - enum type { - EVERNOTE_USERID = 1, - EMAIL = 2, - IDENTITYID = 3 - }; -}; - - /** * A monotonically incrementing number on each shard that identifies a cross shard * cache invalidation event. */ -typedef qint64 InvalidationSequenceNumber; +using InvalidationSequenceNumber = qint64; /** * A type alias for the primary identifiers for Identity objects. */ -typedef qint64 IdentityID; +using IdentityID = qint64; /** * Every Evernote account is assigned a unique numeric identifier which @@ -506,7 +45,7 @@ typedef qint64 IdentityID; * the (string-based) "username" which is known by the user for login * purposes. The user should have no reason to know their UserID. */ -typedef qint32 UserID; +using UserID = qint32; /** * Most data elements within a user's account (e.g. notebooks, notes, tags, @@ -518,7 +57,7 @@ typedef qint32 UserID; * The internal components of the GUID are not given any particular meaning: * only the entire string is relevant as a unique identifier. */ -typedef QString Guid; +using Guid = QString; /** * An Evernote Timestamp is the date and time of an event in UTC time. @@ -537,17 +76,17 @@ typedef QString Guid; * The service will accept timestamp values (e.g. for Note created and update * times) between 1000-01-01 and 9999-12-31 */ -typedef qint64 Timestamp; +using Timestamp = qint64; /** * A sequence number for the MessageStore subsystem. */ -typedef qint64 MessageEventID; +using MessageEventID = qint64; /** * A type alias for the primary identifiers for MessageThread objects. */ -typedef qint64 MessageThreadID; +using MessageThreadID = qint64; /** @@ -1232,7 +771,7 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { /** Specifies the types of Related Content that should be returned. */ - Optional< QSet< RelatedContentType::type > > relatedContentTypes; + Optional< QSet< RelatedContentType > > relatedContentTypes; bool operator==(const RelatedResultSpec & other) const { @@ -1304,7 +843,7 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { used by the service to convey information to the user, so clients should treat it as read-only. */ - Optional< ShareRelationshipPrivilegeLevel::type > bestPrivilege; + Optional< ShareRelationshipPrivilegeLevel > bestPrivilege; /** The individually granted privilege for the member, which does not take GROUP privileges into account. This value may be unset if @@ -1314,7 +853,7 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { should present to users for selection are given via the the 'restrictions' field. */ - Optional< ShareRelationshipPrivilegeLevel::type > individualPrivilege; + Optional< ShareRelationshipPrivilegeLevel > individualPrivilege; /** The restrictions on which privileges may be individually assigned to the recipient of this share relationship. @@ -1408,7 +947,7 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { to convey information to the user, so clients should treat it as read-only. */ - Optional< SharedNotePrivilegeLevel::type > privilege; + Optional< SharedNotePrivilegeLevel > privilege; /** The restrictions on which privileges may be individually assigned to the recipient of this share relationship. This field @@ -1464,7 +1003,7 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { accept this invitation. If the user already has a higher privilege to access this note then this will not affect the recipient's privileges. */ - Optional< SharedNotePrivilegeLevel::type > privilege; + Optional< SharedNotePrivilegeLevel > privilege; /** 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 @@ -1804,7 +1343,7 @@ struct QEVERCLOUD_EXPORT UserAttributes { notes in the user's business notebooks that the user has configured for e-mail notifications. */ - Optional< ReminderEmailConfig::type > reminderEmailConfig; + Optional< ReminderEmailConfig > reminderEmailConfig; /** 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 @@ -1954,7 +1493,7 @@ struct QEVERCLOUD_EXPORT Accounting { Indicates the phases of a premium account during the billing process. */ - Optional< PremiumOrderStatus::type > premiumServiceStatus; + Optional< PremiumOrderStatus > premiumServiceStatus; /** The order number used by the commerce system to process recurring payments @@ -2032,7 +1571,7 @@ struct QEVERCLOUD_EXPORT Accounting { /** DEPRECATED:See BusinessUserInfo. */ - Optional< BusinessUserRole::type > businessRole; + Optional< BusinessUserRole > businessRole; /** discount per seat in negative amount and smallest unit of the currency (e.g. cents for USD) @@ -2100,7 +1639,7 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { The role of the user within the Evernote Business account that they are a member of. */ - Optional< BusinessUserRole::type > role; + Optional< BusinessUserRole > role; /** 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 @@ -2268,12 +1807,12 @@ struct QEVERCLOUD_EXPORT User { */ Optional< QString > timezone; /** NOT DOCUMENTED */ - Optional< PrivilegeLevel::type > privilege; + Optional< PrivilegeLevel > privilege; /** The level of service the user currently receives. This will always be populated for users retrieved from the Evernote service. */ - Optional< ServiceLevel::type > serviceLevel; + Optional< ServiceLevel > serviceLevel; /** The date and time when this user account was created in the service. @@ -2380,7 +1919,7 @@ struct QEVERCLOUD_EXPORT Contact { /** What service does this contact come from? */ - Optional< ContactType::type > type; + Optional< ContactType > type; /** A URL of a profile photo representing this Contact. This field is filled in by the service and is read-only to clients. @@ -3089,7 +2628,7 @@ struct QEVERCLOUD_EXPORT SharedNote { /** The privilege level that the share grants to the recipient. */ - Optional< SharedNotePrivilegeLevel::type > privilege; + Optional< SharedNotePrivilegeLevel > privilege; /** The time at which the share was created. */ @@ -3433,7 +2972,7 @@ struct QEVERCLOUD_EXPORT Publishing { When the notes are publicly displayed, they will be sorted based on the requested criteria. */ - Optional< NoteSortOrder::type > order; + Optional< NoteSortOrder > order; /** If this is set to true, then the public notes will be displayed in ascending order (e.g. from oldest to newest). Otherwise, @@ -3491,7 +3030,7 @@ struct QEVERCLOUD_EXPORT BusinessNotebook { The privileges that will be granted to users who join the notebook through the business library. */ - Optional< SharedNotebookPrivilegeLevel::type > privilege; + Optional< SharedNotebookPrivilegeLevel > privilege; /** Whether the notebook should be "recommended" when displayed in the business library user interface. @@ -3582,7 +3121,7 @@ struct QEVERCLOUD_EXPORT SavedSearch { The format of the query string, to determine how to parse and process it. */ - Optional< QueryFormat::type > format; + Optional< QueryFormat > format; /** A number identifying the last transaction to modify the state of this object. The USN values are sequential within an @@ -3710,7 +3249,7 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings { that the recipient has "joined" the notebook) and perhaps also their default notebook */ - Optional< RecipientStatus::type > recipientStatus; + Optional< RecipientStatus > recipientStatus; bool operator==(const NotebookRecipientSettings & other) const { @@ -3794,7 +3333,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { The privilege level granted to the notebook, activity stream, and invitations. See the corresponding enumeration for details. */ - Optional< SharedNotebookPrivilegeLevel::type > privilege; + Optional< SharedNotebookPrivilegeLevel > privilege; /** Settings intended for use only by the recipient of this shared notebook. You should skip setting this value unless you want @@ -3868,7 +3407,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions { /** NOT DOCUMENTED */ - Optional< CanMoveToContainerStatus::type > canMoveToContainer; + Optional< CanMoveToContainerStatus > canMoveToContainer; bool operator==(const CanMoveToContainerRestrictions & other) const { @@ -4000,14 +3539,14 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions { associated with the notebook on which the NotebookRestrictions are defined. See the enumeration for further details. */ - Optional< SharedNotebookInstanceRestrictions::type > updateWhichSharedNotebookRestrictions; + Optional< SharedNotebookInstanceRestrictions > updateWhichSharedNotebookRestrictions; /** 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. */ - Optional< SharedNotebookInstanceRestrictions::type > expungeWhichSharedNotebookRestrictions; + Optional< SharedNotebookInstanceRestrictions > expungeWhichSharedNotebookRestrictions; /** The client may not share notes in the notebook via the shareNoteWithBusiness method. @@ -4422,11 +3961,11 @@ struct QEVERCLOUD_EXPORT UserProfile { /** The BusinessUserRole for the user */ - Optional< BusinessUserRole::type > role; + Optional< BusinessUserRole > role; /** The BusinessUserStatus for the user */ - Optional< BusinessUserStatus::type > status; + Optional< BusinessUserStatus > status; bool operator==(const UserProfile & other) const { @@ -4545,12 +4084,12 @@ struct QEVERCLOUD_EXPORT RelatedContent { /** The type of this related content. */ - Optional< RelatedContentType::type > contentType; + Optional< RelatedContentType > contentType; /** An indication of how this content can be accessed. This type influences the semantics of the url parameter. */ - Optional< RelatedContentAccess::type > accessType; + Optional< RelatedContentAccess > accessType; /** 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 @@ -4617,11 +4156,11 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { /** The role to grant the user after the invitation is accepted. */ - Optional< BusinessUserRole::type > role; + Optional< BusinessUserRole > role; /** The status of the invitation. */ - Optional< BusinessInvitationStatus::type > status; + Optional< BusinessInvitationStatus > status; /** 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 @@ -4693,7 +4232,7 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { */ struct QEVERCLOUD_EXPORT UserIdentity { /** NOT DOCUMENTED */ - Optional< UserIdentityType::type > type; + Optional< UserIdentityType > type; /** NOT DOCUMENTED */ Optional< QString > stringIdentifier; /** NOT DOCUMENTED */ @@ -4726,7 +4265,7 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { /** The service level of the account. */ - Optional< ServiceLevel::type > serviceLevel; + Optional< ServiceLevel > serviceLevel; /** NOT DOCUMENTED */ Optional< QString > username; /** @@ -5081,7 +4620,7 @@ struct QEVERCLOUD_EXPORT BootstrapInfo { class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException { public: - EDAMErrorCode::type errorCode; + EDAMErrorCode errorCode; Optional< QString > parameter; EDAMUserException(); @@ -5122,7 +4661,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException { public: - EDAMErrorCode::type errorCode; + EDAMErrorCode errorCode; Optional< QString > message; Optional< qint32 > rateLimitDuration; @@ -5215,7 +4754,7 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException public: QList< Contact > contacts; Optional< QString > parameter; - Optional< QList< EDAMInvalidContactReason::type > > reasons; + Optional< QList< EDAMInvalidContactReason > > reasons; EDAMInvalidContactsException(); virtual ~EDAMInvalidContactsException() throw() Q_DECL_OVERRIDE; @@ -5809,7 +5348,7 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { Evernote User ID, and so we won't know until the invitation is redeemed whether or not the recipient already has privilege. */ - Optional< ShareRelationshipPrivilegeLevel::type > privilege; + Optional< ShareRelationshipPrivilegeLevel > privilege; /** 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 @@ -6043,7 +5582,7 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { /** The privilege level to be granted. */ - Optional< SharedNotePrivilegeLevel::type > privilege; + Optional< SharedNotePrivilegeLevel > privilege; bool operator==(const SharedNoteTemplate & other) const { @@ -6088,7 +5627,7 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { /** The privilege level to be granted. */ - Optional< SharedNotebookPrivilegeLevel::type > privilege; + Optional< SharedNotebookPrivilegeLevel > privilege; bool operator==(const NotebookShareTemplate & other) const { @@ -6217,7 +5756,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { } // namespace qevercloud - Q_DECLARE_METATYPE(qevercloud::SyncState) Q_DECLARE_METATYPE(qevercloud::SyncChunkFilter) Q_DECLARE_METATYPE(qevercloud::NoteFilter) @@ -6297,4 +5835,5 @@ Q_DECLARE_METATYPE(qevercloud::CreateOrUpdateNotebookSharesResult) Q_DECLARE_METATYPE(qevercloud::ManageNoteSharesError) Q_DECLARE_METATYPE(qevercloud::ManageNoteSharesResult) + #endif // QEVERCLOUD_GENERATED_TYPES_H diff --git a/QEverCloud/headers/qt4helpers.h b/QEverCloud/headers/qt4helpers.h deleted file mode 100644 index ff2a5bf1..00000000 --- a/QEverCloud/headers/qt4helpers.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT - * - * This header provides the "backports" of several Qt5 macros into Qt4 - * so that one can use Qt5 candies with Qt4 as well - */ - -#ifndef QEVERCLOUD_QT4_HELPERS_H -#define QEVERCLOUD_QT4_HELPERS_H - -#include -#include - -#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) - -#if __cplusplus >= 201103L - -#ifndef Q_DECL_OVERRIDE -#define Q_DECL_OVERRIDE override -#endif - -#ifndef Q_DECL_FINAL -#define Q_DECL_FINAL final -#endif - -#ifndef Q_STATIC_ASSERT_X -#define Q_STATIC_ASSERT_X(x1,x2) static_assert(x1, x2) -#endif - -#ifndef Q_DECL_EQ_DELETE -#define Q_DECL_EQ_DELETE = delete -#endif - -#ifndef Q_NULLPTR -#define Q_NULLPTR nullptr -#endif - -#else // __cplusplus - -#ifndef Q_DECL_OVERRIDE -#define Q_DECL_OVERRIDE -#endif - -#ifndef Q_DECL_FINAL -#define Q_DECL_FINAL -#endif - -#ifndef Q_STATIC_ASSERT_X -#define Q_STATIC_ASSERT_X(x1,x2) -#endif - -#ifndef Q_DECL_EQ_DELETE -#define Q_DECL_EQ_DELETE -#endif - -#ifndef Q_NULLPTR -#define Q_NULLPTR NULL -#endif - -#endif // __cplusplus - -#ifndef QStringLiteral -#define QStringLiteral(x) QString::fromUtf8(x, sizeof(x) - 1) -#endif - -#define QEC_SIGNAL(className, methodName, ...) SIGNAL(methodName(__VA_ARGS__)) -#define QEC_SLOT(className, methodName, ...) SLOT(methodName(__VA_ARGS__)) - -#else // QT_VERSION - -// VS2010 is supposed to be C++11 but does not fulfull the entire standard. -#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010 - -#ifdef Q_DECL_OVERRIDE -#undef Q_DECL_OVERRIDE -#endif -#define Q_DECL_OVERRIDE - -#endif // VS2010 - -#define QEC_SIGNAL(className, methodName, ...) &className::methodName -#define QEC_SLOT(className, methodName, ...) &className::methodName - -#endif // QT_VERSION - -#endif // QEVERCLOUD_QT4_HELPERS_H diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index c7a3aa49..03e4ef25 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -1,16 +1,19 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ +#include "Http.h" + #include #include -#include "http.h" + #include #include + #include namespace qevercloud { @@ -106,8 +109,8 @@ void AsyncResult::start() { Q_D(AsyncResult); ReplyFetcher * replyFetcher = new ReplyFetcher; - QObject::connect(replyFetcher, QEC_SIGNAL(ReplyFetcher,replyFetched,QObject*), - this, QEC_SLOT(AsyncResult,onReplyFetched,QObject*)); + QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, + this, &AsyncResult::onReplyFetched); replyFetcher->start(evernoteNetworkAccessManager(), d->m_request, d->m_postData); } diff --git a/QEverCloud/src/exceptions.cpp b/QEverCloud/src/Exceptions.cpp similarity index 95% rename from QEverCloud/src/exceptions.cpp rename to QEverCloud/src/Exceptions.cpp index 06151b18..85c9cb85 100644 --- a/QEverCloud/src/exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -1,16 +1,17 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ +#include "Impl.h" +#include "generated/Types_io.h" + +#include #include -#include -#include -#include "generated/types_impl.h" -#include "impl.h" +#include namespace qevercloud { @@ -34,7 +35,7 @@ ThriftException::Type::type ThriftException::type() const return m_type; } -QByteArray strEDAMErrorCode(EDAMErrorCode::type errorCode) +QByteArray strEDAMErrorCode(EDAMErrorCode errorCode) { switch(errorCode) { @@ -188,7 +189,7 @@ QSharedPointer EDAMInvalidContactsException::exceptionDa } EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData(QList contacts, Optional parameter, - Optional > reasons) : + Optional > reasons) : EvernoteExceptionData(QStringLiteral("EDAMInvalidContactsExceptionData")), m_contacts(contacts), m_parameter(parameter), @@ -228,7 +229,7 @@ QSharedPointer EDAMSystemException::exceptionData() cons this->rateLimitDuration)); } -EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, EDAMErrorCode::type errorCode, Optional message, +EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration) : EvernoteExceptionData(error), m_errorCode(errorCode), @@ -245,7 +246,7 @@ void EDAMSystemExceptionData::throwException() const throw exception; } -EDAMSystemExceptionRateLimitReachedData::EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode::type errorCode, +EDAMSystemExceptionRateLimitReachedData::EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) @@ -344,7 +345,7 @@ QSharedPointer EDAMSystemExceptionAuthExpired::exception this->rateLimitDuration)); } -EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode::type errorCode, +EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) @@ -369,7 +370,7 @@ void ThriftExceptionData::throwException() const throw ThriftException(m_type, errorMessage); } -EDAMUserExceptionData::EDAMUserExceptionData(QString error, EDAMErrorCode::type errorCode, Optional parameter) : +EDAMUserExceptionData::EDAMUserExceptionData(QString error, EDAMErrorCode errorCode, Optional parameter) : EvernoteExceptionData(error), m_errorCode(errorCode), m_parameter(parameter) diff --git a/QEverCloud/src/globals.cpp b/QEverCloud/src/Globals.cpp similarity index 97% rename from QEverCloud/src/globals.cpp rename to QEverCloud/src/Globals.cpp index 924c73fb..8aaf3b7e 100644 --- a/QEverCloud/src/globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -6,10 +6,11 @@ * https://opensource.org/licenses/MIT */ -#include -#include +#include + #include #include +#include namespace qevercloud { diff --git a/QEverCloud/src/http.cpp b/QEverCloud/src/Http.cpp similarity index 89% rename from QEverCloud/src/http.cpp rename to QEverCloud/src/Http.cpp index 5302649c..66d89680 100644 --- a/QEverCloud/src/http.cpp +++ b/QEverCloud/src/Http.cpp @@ -6,10 +6,12 @@ * https://opensource.org/licenses/MIT */ -#include -#include -#include -#include "http.h" +#include "Http.h" + +#include +#include +#include + #include #include #include @@ -25,7 +27,7 @@ ReplyFetcher::ReplyFetcher(QObject * parent) : m_httpStatusCode(0) { m_ticker = new QTimer(this); - QObject::connect(m_ticker, QEC_SIGNAL(QTimer,timeout), this, QEC_SLOT(ReplyFetcher,checkForTimeout)); + QObject::connect(m_ticker, &QTimer::timeout, this, &ReplyFetcher::checkForTimeout); } void ReplyFetcher::start(QNetworkAccessManager * nam, QUrl url) @@ -53,10 +55,10 @@ void ReplyFetcher::start(QNetworkAccessManager * nam, QNetworkRequest request, Q m_reply = QSharedPointer(nam->post(request, postData), &QObject::deleteLater); } - QObject::connect(m_reply.data(), QEC_SIGNAL(QNetworkReply,finished), this, QEC_SLOT(ReplyFetcher,onFinished)); + QObject::connect(m_reply.data(), &QNetworkReply::finished, this, &ReplyFetcher::onFinished); QObject::connect(m_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onError(QNetworkReply::NetworkError))); - QObject::connect(m_reply.data(), QEC_SIGNAL(QNetworkReply,sslErrors,QList), this, QEC_SLOT(ReplyFetcher,onSslErrors,QList)); - QObject::connect(m_reply.data(), QEC_SIGNAL(QNetworkReply,downloadProgress,qint64,qint64), this, QEC_SLOT(ReplyFetcher,onDownloadProgress,qint64,qint64)); + QObject::connect(m_reply.data(), &QNetworkReply::sslErrors, this, &ReplyFetcher::onSslErrors); + QObject::connect(m_reply.data(), &QNetworkReply::downloadProgress, this, &ReplyFetcher::onDownloadProgress); } void ReplyFetcher::onDownloadProgress(qint64, qint64) diff --git a/QEverCloud/src/http.h b/QEverCloud/src/Http.h similarity index 97% rename from QEverCloud/src/http.h rename to QEverCloud/src/Http.h index 0438166c..8adf409e 100644 --- a/QEverCloud/src/http.h +++ b/QEverCloud/src/Http.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,17 +9,18 @@ #ifndef QEVERCLOUD_HTTP_H #define QEVERCLOUD_HTTP_H -#include -#include +#include + #include -#include #include #include #include -#include #include -#include #include +#include +#include +#include +#include /** @cond HIDDEN_SYMBOLS */ diff --git a/QEverCloud/src/impl.h b/QEverCloud/src/Impl.h similarity index 87% rename from QEverCloud/src/impl.h rename to QEverCloud/src/Impl.h index ca566c5b..0fdb3b3b 100644 --- a/QEverCloud/src/impl.h +++ b/QEverCloud/src/Impl.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,11 +9,12 @@ #ifndef QEVERCLOUD_IMPL_H #define QEVERCLOUD_IMPL_H +#include "Http.h" +#include "Thrift.h" + +#include +#include #include -#include -#include -#include "http.h" -#include "thrift.h" /** diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index 20f0422a..15d8510b 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -1,17 +1,19 @@ /** - * Copyright (c) 2016 Dmitry Ivanov + * Copyright (c) 2016-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ +#include "Http.h" + +#include #include -#include -#include "http.h" -#include + +#include #include #include -#include +#include namespace qevercloud { diff --git a/QEverCloud/src/oauth.cpp b/QEverCloud/src/OAuth.cpp similarity index 84% rename from QEverCloud/src/oauth.cpp rename to QEverCloud/src/OAuth.cpp index c24fde40..dc1fd1da 100644 --- a/QEverCloud/src/oauth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -1,16 +1,19 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ -#include -#include -#include "http.h" -#include +#include "Http.h" + +#include +#include + #include +#include +#include #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE #include @@ -21,7 +24,6 @@ #include #endif -#include #include /** @cond HIDDEN_SYMBOLS */ @@ -116,12 +118,12 @@ EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : QWidget(parent), d_ptr(new EvernoteOAuthWebViewPrivate(this)) { - QObject::connect(d_ptr, QEC_SIGNAL(EvernoteOAuthWebViewPrivate,authenticationFinished,bool), - this, QEC_SIGNAL(EvernoteOAuthWebView,authenticationFinished,bool)); - QObject::connect(d_ptr, QEC_SIGNAL(EvernoteOAuthWebViewPrivate,authenticationSuceeded), - this, QEC_SIGNAL(EvernoteOAuthWebView,authenticationSuceeded)); - QObject::connect(d_ptr, QEC_SIGNAL(EvernoteOAuthWebViewPrivate,authenticationFailed), - this, QEC_SIGNAL(EvernoteOAuthWebView,authenticationFailed)); + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFinished, + this, &EvernoteOAuthWebView::authenticationFinished); + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationSuceeded, + this, &EvernoteOAuthWebView::authenticationSuceeded); + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFailed, + this, &EvernoteOAuthWebView::authenticationFailed); QVBoxLayout * pLayout = new QVBoxLayout(this); pLayout->addWidget(d_ptr); @@ -143,8 +145,8 @@ void EvernoteOAuthWebView::authenticate(QString host, QString consumerKey, QStri // step 1: acquire temporary token ReplyFetcher * replyFetcher = new ReplyFetcher(); - QObject::connect(replyFetcher, QEC_SIGNAL(ReplyFetcher,replyFetched,QObject*), - d, QEC_SLOT(EvernoteOAuthWebViewPrivate,temporaryFinished,QObject*)); + QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, + d, &EvernoteOAuthWebViewPrivate::temporaryFinished); QUrl url(d->m_oauthUrlBase + QStringLiteral("&oauth_callback=nnoauth")); #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE replyFetcher->start(evernoteNetworkAccessManager(), url); @@ -198,8 +200,8 @@ void EvernoteOAuthWebViewPrivate::temporaryFinished(QObject * rf) QString token = reply.left(index); // step 2: directing a user to the login page - QObject::connect(this, QEC_SIGNAL(EvernoteOAuthWebViewPrivate,urlChanged,QUrl), - this, QEC_SLOT(EvernoteOAuthWebViewPrivate,onUrlChanged,QUrl)); + QObject::connect(this, &EvernoteOAuthWebViewPrivate::urlChanged, + this, &EvernoteOAuthWebViewPrivate::onUrlChanged); QUrl loginUrl(QStringLiteral("https://%1//OAuth.action?%2").arg(m_host, token)); setUrl(loginUrl); } @@ -220,8 +222,8 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) // step 4: acquire permanent token ReplyFetcher * replyFetcher = new ReplyFetcher(); - QObject::connect(replyFetcher, QEC_SIGNAL(ReplyFetcher,replyFetched,QObject*), - this, QEC_SLOT(EvernoteOAuthWebViewPrivate,permanentFinished,QObject*)); + QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, + this, &EvernoteOAuthWebViewPrivate::permanentFinished); QUrl url(m_oauthUrlBase + QStringLiteral("&oauth_token=%1").arg(token)); #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE replyFetcher->start(evernoteNetworkAccessManager(), url); @@ -234,8 +236,8 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) setError(QStringLiteral("Authentification failed.")); } - QObject::disconnect(this, QEC_SIGNAL(EvernoteOAuthWebViewPrivate,urlChanged,QUrl), - this, QEC_SLOT(EvernoteOAuthWebViewPrivate,onUrlChanged,QUrl)); + QObject::disconnect(this, &EvernoteOAuthWebViewPrivate::urlChanged, + this, &EvernoteOAuthWebViewPrivate::onUrlChanged); QMetaObject::invokeMethod(this, "clearHtml", Qt::QueuedConnection); } } @@ -303,10 +305,10 @@ EvernoteOAuthDialog::EvernoteOAuthDialog(QString consumerKey, QString consumerSe setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); d_ptr->m_pWebView = new EvernoteOAuthWebView(this); - QObject::connect(d_ptr->m_pWebView, QEC_SIGNAL(EvernoteOAuthWebView,authenticationSuceeded), - this, QEC_SLOT(EvernoteOAuthDialog,accept), Qt::QueuedConnection); - QObject::connect(d_ptr->m_pWebView, QEC_SIGNAL(EvernoteOAuthWebView,authenticationFailed), - this, QEC_SLOT(EvernoteOAuthDialog,reject), Qt::QueuedConnection); + QObject::connect(d_ptr->m_pWebView, &EvernoteOAuthWebView::authenticationSuceeded, + this, &EvernoteOAuthDialog::accept, Qt::QueuedConnection); + QObject::connect(d_ptr->m_pWebView, &EvernoteOAuthWebView::authenticationFailed, + this, &EvernoteOAuthDialog::reject, Qt::QueuedConnection); QVBoxLayout * pLayout = new QVBoxLayout(this); pLayout->addWidget(d_ptr->m_pWebView); @@ -367,4 +369,4 @@ void EvernoteOAuthDialog::open() /** @endcond */ -#include "oauth.moc" +#include "OAuth.moc" diff --git a/QEverCloud/src/services_nongenerated.cpp b/QEverCloud/src/ServicesNonGenerated.cpp similarity index 95% rename from QEverCloud/src/services_nongenerated.cpp rename to QEverCloud/src/ServicesNonGenerated.cpp index 79c0b192..2eef8cec 100644 --- a/QEverCloud/src/services_nongenerated.cpp +++ b/QEverCloud/src/ServicesNonGenerated.cpp @@ -1,13 +1,14 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ -#include -#include +#include +#include + #include namespace qevercloud { diff --git a/QEverCloud/src/thrift.h b/QEverCloud/src/Thrift.h similarity index 99% rename from QEverCloud/src/thrift.h rename to QEverCloud/src/Thrift.h index 97638a21..803957e3 100644 --- a/QEverCloud/src/thrift.h +++ b/QEverCloud/src/Thrift.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -9,10 +9,12 @@ #ifndef QEVERCLOUD_THRIFT_H #define QEVERCLOUD_THRIFT_H -#include -#include +#include +#include + #include #include + #include #include diff --git a/QEverCloud/src/thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp similarity index 97% rename from QEverCloud/src/thumbnail.cpp rename to QEverCloud/src/Thumbnail.cpp index b6df409a..79894ddb 100644 --- a/QEverCloud/src/thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -1,13 +1,14 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT */ -#include -#include "http.h" +#include "Http.h" + +#include namespace qevercloud { diff --git a/QEverCloud/src/generated/constants.cpp b/QEverCloud/src/generated/Constants.cpp similarity index 80% rename from QEverCloud/src/generated/constants.cpp rename to QEverCloud/src/generated/Constants.cpp index 114fe51d..08003088 100644 --- a/QEverCloud/src/generated/constants.cpp +++ b/QEverCloud/src/generated/Constants.cpp @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,225 +8,628 @@ * This file was generated from Evernote Thrift API */ - -#include -#include "../impl.h" -#include +#include +#include "../Impl.h" +#include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + // Limits.thrift const qint32 EDAM_ATTRIBUTE_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_ATTRIBUTE_LEN_MAX = 4096; +// Limits.thrift + const QString EDAM_ATTRIBUTE_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,4096}$"); +// Limits.thrift + const qint32 EDAM_ATTRIBUTE_LIST_MAX = 100; +// Limits.thrift + const qint32 EDAM_ATTRIBUTE_MAP_MAX = 100; +// Limits.thrift + const qint32 EDAM_GUID_LEN_MIN = 36; +// Limits.thrift + const qint32 EDAM_GUID_LEN_MAX = 36; +// Limits.thrift + const QString EDAM_GUID_REGEX = QStringLiteral("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"); +// Limits.thrift + const qint32 EDAM_EMAIL_LEN_MIN = 6; +// Limits.thrift + const qint32 EDAM_EMAIL_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_EMAIL_LOCAL_REGEX = QStringLiteral("^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*$"); +// Limits.thrift + const QString EDAM_EMAIL_DOMAIN_REGEX = QStringLiteral("^[A-Za-z0-9-]*[A-Za-z0-9](\\.[A-Za-z0-9-]*[A-Za-z0-9])*\\.([A-Za-z]{2,})$"); +// Limits.thrift + const QString EDAM_EMAIL_REGEX = QStringLiteral("^[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,})$"); +// Limits.thrift + const QString EDAM_VAT_REGEX = QStringLiteral("^(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)$"); +// Limits.thrift + const qint32 EDAM_TIMEZONE_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_TIMEZONE_LEN_MAX = 32; +// Limits.thrift + const QString EDAM_TIMEZONE_REGEX = QStringLiteral("^([A-Za-z_-]+(/[A-Za-z_-]+)*)|(GMT(-|\\+)[0-9]{1,2}(:[0-9]{2})?)$"); +// Limits.thrift + const qint32 EDAM_MIME_LEN_MIN = 3; +// Limits.thrift + const qint32 EDAM_MIME_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_MIME_REGEX = QStringLiteral("^[A-Za-z]+/[A-Za-z0-9._+-]+$"); +// Limits.thrift + const QString EDAM_MIME_TYPE_GIF = QStringLiteral("image/gif"); +// Limits.thrift + const QString EDAM_MIME_TYPE_JPEG = QStringLiteral("image/jpeg"); +// Limits.thrift + const QString EDAM_MIME_TYPE_PNG = QStringLiteral("image/png"); +// Limits.thrift + const QString EDAM_MIME_TYPE_TIFF = QStringLiteral("image/tiff"); +// Limits.thrift + const QString EDAM_MIME_TYPE_BMP = QStringLiteral("image/bmp"); +// Limits.thrift + const QString EDAM_MIME_TYPE_WAV = QStringLiteral("audio/wav"); +// Limits.thrift + const QString EDAM_MIME_TYPE_MP3 = QStringLiteral("audio/mpeg"); +// Limits.thrift + const QString EDAM_MIME_TYPE_AMR = QStringLiteral("audio/amr"); +// Limits.thrift + const QString EDAM_MIME_TYPE_AAC = QStringLiteral("audio/aac"); +// Limits.thrift + const QString EDAM_MIME_TYPE_M4A = QStringLiteral("audio/mp4"); +// Limits.thrift + const QString EDAM_MIME_TYPE_MP4_VIDEO = QStringLiteral("video/mp4"); +// Limits.thrift + const QString EDAM_MIME_TYPE_INK = QStringLiteral("application/vnd.evernote.ink"); +// Limits.thrift + const QString EDAM_MIME_TYPE_PDF = QStringLiteral("application/pdf"); +// Limits.thrift + const QString EDAM_MIME_TYPE_DEFAULT = QStringLiteral("application/octet-stream"); +// Limits.thrift + const QSet< QString > EDAM_MIME_TYPES = QSet< QString >() << 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; +// Limits.thrift + const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPES = QSet< QString >() << QStringLiteral("application/msword") << QStringLiteral("application/mspowerpoint") << QStringLiteral("application/excel") << QStringLiteral("application/vnd.ms-word") << QStringLiteral("application/vnd.ms-powerpoint") << QStringLiteral("application/vnd.ms-excel") << QStringLiteral("application/vnd.openxmlformats-officedocument.wordprocessingml.document") << QStringLiteral("application/vnd.openxmlformats-officedocument.presentationml.presentation") << QStringLiteral("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") << QStringLiteral("application/vnd.apple.pages") << QStringLiteral("application/vnd.apple.numbers") << QStringLiteral("application/vnd.apple.keynote") << QStringLiteral("application/x-iwork-pages-sffpages") << QStringLiteral("application/x-iwork-numbers-sffnumbers") << QStringLiteral("application/x-iwork-keynote-sffkey"); +// Limits.thrift + const QSet< QString > EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES = QSet< QString >() << QStringLiteral("application/x-sh") << QStringLiteral("application/x-bsh") << QStringLiteral("application/sql") << QStringLiteral("application/x-sql"); +// Limits.thrift + const qint32 EDAM_SEARCH_QUERY_LEN_MIN = 0; +// Limits.thrift + const qint32 EDAM_SEARCH_QUERY_LEN_MAX = 1024; +// Limits.thrift + const QString EDAM_SEARCH_QUERY_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Zl}\\p{Zp}]{0,1024}$"); +// Limits.thrift + const qint32 EDAM_HASH_LEN = 16; +// Limits.thrift + const qint32 EDAM_USER_USERNAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_USER_USERNAME_LEN_MAX = 64; +// Limits.thrift + const QString EDAM_USER_USERNAME_REGEX = QStringLiteral("^[a-z0-9]([a-z0-9_-]{0,62}[a-z0-9])?$"); +// Limits.thrift + const qint32 EDAM_USER_NAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_USER_NAME_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_USER_NAME_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,255}$"); +// Limits.thrift + const qint32 EDAM_TAG_NAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_TAG_NAME_LEN_MAX = 100; +// Limits.thrift + const QString EDAM_TAG_NAME_REGEX = QStringLiteral("^[^,\\p{Cc}\\p{Z}]([^,\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^,\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_NOTE_TITLE_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,253}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_NOTE_CONTENT_LEN_MIN = 0; +// Limits.thrift + const qint32 EDAM_NOTE_CONTENT_LEN_MAX = 5242880; +// Limits.thrift + const qint32 EDAM_APPLICATIONDATA_NAME_LEN_MIN = 3; +// Limits.thrift + const qint32 EDAM_APPLICATIONDATA_NAME_LEN_MAX = 32; +// Limits.thrift + const qint32 EDAM_APPLICATIONDATA_VALUE_LEN_MIN = 0; +// Limits.thrift + const qint32 EDAM_APPLICATIONDATA_VALUE_LEN_MAX = 4092; +// Limits.thrift + const qint32 EDAM_APPLICATIONDATA_ENTRY_LEN_MAX = 4095; +// Limits.thrift + const QString EDAM_APPLICATIONDATA_NAME_REGEX = QStringLiteral("^[A-Za-z0-9_.-]{3,32}$"); +// Limits.thrift + const QString EDAM_APPLICATIONDATA_VALUE_REGEX = QStringLiteral("^[\\p{Space}[^\\p{Cc}]]{0,4092}$"); +// Limits.thrift + const qint32 EDAM_NOTEBOOK_NAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_NOTEBOOK_NAME_LEN_MAX = 100; +// Limits.thrift + const QString EDAM_NOTEBOOK_NAME_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_NOTEBOOK_STACK_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_NOTEBOOK_STACK_LEN_MAX = 100; +// Limits.thrift + const QString EDAM_NOTEBOOK_STACK_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_WORKSPACE_NAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_WORKSPACE_NAME_LEN_MAX = 100; +// Limits.thrift + const qint32 EDAM_WORKSPACE_DESCRIPTION_LEN_MAX = 600; +// Limits.thrift + const QString EDAM_WORKSPACE_NAME_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_PUBLISHING_URI_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_PUBLISHING_URI_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_PUBLISHING_URI_REGEX = QStringLiteral("^[a-zA-Z0-9.~_+-]{1,255}$"); +// Limits.thrift + const QSet< QString > EDAM_PUBLISHING_URI_PROHIBITED = QSet< QString >() << QStringLiteral(".") << QStringLiteral(".."); +// Limits.thrift + const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MAX = 200; +// Limits.thrift + const QString EDAM_PUBLISHING_DESCRIPTION_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,198}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_SAVED_SEARCH_NAME_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_SAVED_SEARCH_NAME_LEN_MAX = 100; +// Limits.thrift + const QString EDAM_SAVED_SEARCH_NAME_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_USER_PASSWORD_LEN_MIN = 6; +// Limits.thrift + const qint32 EDAM_USER_PASSWORD_LEN_MAX = 64; +// Limits.thrift + const QString EDAM_USER_PASSWORD_REGEX = QStringLiteral("^[A-Za-z0-9!#$%&'()*+,./:;<=>?@^_`{|}~\\[\\]\\\\-]{6,64}$"); +// Limits.thrift + const qint32 EDAM_BUSINESS_URI_LEN_MAX = 32; +// Limits.thrift + const QString EDAM_BUSINESS_MARKETING_CODE_REGEX_PATTERN = QStringLiteral("[A-Za-z0-9-]{1,128}"); +// Limits.thrift + const qint32 EDAM_NOTE_TAGS_MAX = 100; +// Limits.thrift + const qint32 EDAM_NOTE_RESOURCES_MAX = 1000; +// Limits.thrift + const qint32 EDAM_USER_TAGS_MAX = 100000; +// Limits.thrift + const qint32 EDAM_BUSINESS_TAGS_MAX = 100000; +// Limits.thrift + const qint32 EDAM_USER_SAVED_SEARCHES_MAX = 100; +// Limits.thrift + const qint32 EDAM_USER_NOTES_MAX = 100000; +// Limits.thrift + const qint32 EDAM_BUSINESS_NOTES_MAX = 500000; +// Limits.thrift + const qint32 EDAM_USER_NOTEBOOKS_MAX = 250; +// Limits.thrift + const qint32 EDAM_USER_WORKSPACES_MAX = 0; +// Limits.thrift + const qint32 EDAM_BUSINESS_NOTEBOOKS_MAX = 10000; +// Limits.thrift + const qint32 EDAM_BUSINESS_WORKSPACES_MAX = 1000; +// Limits.thrift + const qint32 EDAM_USER_RECENT_MAILED_ADDRESSES_MAX = 10; +// Limits.thrift + const qint32 EDAM_USER_MAIL_LIMIT_DAILY_FREE = 50; +// Limits.thrift + const qint32 EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM = 200; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_FREE = 62914560; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_PREMIUM = 10737418240; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_FIRST_MONTH = 53687091200; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_NEXT_MONTH = 21474836480; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_PLUS = 1073741824; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_SURVEY_THRESHOLD = 5368709120; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS = 10737418240; +// Limits.thrift + const qint64 EDAM_USER_UPLOAD_LIMIT_BUSINESS_PER_USER = 2147483647; +// Limits.thrift + const qint32 EDAM_NOTE_SIZE_MAX_FREE = 26214400; +// Limits.thrift + const qint32 EDAM_NOTE_SIZE_MAX_PREMIUM = 209715200; +// Limits.thrift + const qint32 EDAM_RESOURCE_SIZE_MAX_FREE = 26214400; +// Limits.thrift + const qint32 EDAM_RESOURCE_SIZE_MAX_PREMIUM = 209715200; +// Limits.thrift + const qint32 EDAM_USER_LINKED_NOTEBOOK_MAX = 100; +// Limits.thrift + const qint32 EDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM = 500; +// Limits.thrift + const qint32 EDAM_NOTEBOOK_BUSINESS_SHARED_NOTEBOOK_MAX = 5000; +// Limits.thrift + const qint32 EDAM_NOTEBOOK_PERSONAL_SHARED_NOTEBOOK_MAX = 500; +// Limits.thrift + const qint32 EDAM_NOTE_BUSINESS_SHARED_NOTE_MAX = 1000; +// Limits.thrift + const qint32 EDAM_NOTE_PERSONAL_SHARED_NOTE_MAX = 100; +// Limits.thrift + const qint32 EDAM_NOTE_CONTENT_CLASS_LEN_MIN = 3; +// Limits.thrift + const qint32 EDAM_NOTE_CONTENT_CLASS_LEN_MAX = 32; +// Limits.thrift + const QString EDAM_NOTE_CONTENT_CLASS_REGEX = QStringLiteral("^[A-Za-z0-9_.-]{3,32}$"); +// Limits.thrift + const QString EDAM_HELLO_APP_CONTENT_CLASS_PREFIX = QStringLiteral("evernote.hello."); +// Limits.thrift + const QString EDAM_FOOD_APP_CONTENT_CLASS_PREFIX = QStringLiteral("evernote.food."); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_HELLO_ENCOUNTER = QStringLiteral("evernote.hello.encounter"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_HELLO_PROFILE = QStringLiteral("evernote.hello.profile"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_FOOD_MEAL = QStringLiteral("evernote.food.meal"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_SKITCH_PREFIX = QStringLiteral("evernote.skitch"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_SKITCH = QStringLiteral("evernote.skitch"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_SKITCH_PDF = QStringLiteral("evernote.skitch.pdf"); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_PENULTIMATE_PREFIX = QStringLiteral("evernote.penultimate."); +// Limits.thrift + const QString EDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK = QStringLiteral("evernote.penultimate.notebook"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_POSTIT = QStringLiteral("postit"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_MOLESKINE = QStringLiteral("moleskine"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_EN_SCANSNAP = QStringLiteral("scanner.scansnap.evernote"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_EWC = QStringLiteral("clipncite.web"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_ANDROID_SHARE_EXTENSION = QStringLiteral("android.clipper.evernote"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_IOS_SHARE_EXTENSION = QStringLiteral("ios.clipper.evernote"); +// Limits.thrift + const QString EDAM_SOURCE_APPLICATION_WEB_CLIPPER = QStringLiteral("webclipper.evernote"); +// Limits.thrift + const QString EDAM_SOURCE_OUTLOOK_CLIPPER = QStringLiteral("app.ms.outlook"); +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_QUALITY_UNTITLED = 0; +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_QUALITY_LOW = 1; +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_QUALITY_MEDIUM = 2; +// Limits.thrift + const qint32 EDAM_NOTE_TITLE_QUALITY_HIGH = 3; +// Limits.thrift + const qint32 EDAM_RELATED_PLAINTEXT_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_RELATED_PLAINTEXT_LEN_MAX = 131072; +// Limits.thrift + const qint32 EDAM_RELATED_MAX_NOTES = 25; +// Limits.thrift + const qint32 EDAM_RELATED_MAX_NOTEBOOKS = 1; +// Limits.thrift + const qint32 EDAM_RELATED_MAX_TAGS = 25; +// Limits.thrift + const qint32 EDAM_RELATED_MAX_EXPERTS = 10; +// Limits.thrift + const qint32 EDAM_RELATED_MAX_RELATED_CONTENT = 10; +// Limits.thrift + const qint32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX = 200; +// Limits.thrift + const QString EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,198}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_BUSINESS_PHONE_NUMBER_LEN_MAX = 20; +// Limits.thrift + const qint32 EDAM_PREFERENCE_NAME_LEN_MIN = 3; +// Limits.thrift + const qint32 EDAM_PREFERENCE_NAME_LEN_MAX = 32; +// Limits.thrift + const qint32 EDAM_PREFERENCE_VALUE_LEN_MIN = 1; +// Limits.thrift + const qint32 EDAM_PREFERENCE_VALUE_LEN_MAX = 1024; +// Limits.thrift + const qint32 EDAM_MAX_PREFERENCES = 100; +// Limits.thrift + const qint32 EDAM_MAX_VALUES_PER_PREFERENCE = 256; +// Limits.thrift + const qint32 EDAM_PREFERENCE_ONLY_ONE_VALUE_LEN_MAX = 16384; +// Limits.thrift + const QString EDAM_PREFERENCE_NAME_REGEX = QStringLiteral("^[A-Za-z0-9_.-]{3,32}$"); +// Limits.thrift + const QString EDAM_PREFERENCE_VALUE_REGEX = QStringLiteral("^[^\\p{Cc}]{1,1024}$"); +// Limits.thrift + const QString EDAM_PREFERENCE_ONLY_ONE_VALUE_REGEX = QStringLiteral("^[^\\p{Cc}]{1,16384}$"); +// Limits.thrift + const QString EDAM_PREFERENCE_SHORTCUTS = QStringLiteral("evernote.shortcuts"); +// Limits.thrift + const QString EDAM_PREFERENCE_BUSINESS_DEFAULT_NOTEBOOK = QStringLiteral("evernote.business.notebook"); +// Limits.thrift + const QString EDAM_PREFERENCE_BUSINESS_QUICKNOTE = QStringLiteral("evernote.business.quicknote"); +// Limits.thrift + const qint32 EDAM_PREFERENCE_SHORTCUTS_MAX_VALUES = 250; +// Limits.thrift + const qint32 EDAM_DEVICE_ID_LEN_MAX = 32; +// Limits.thrift + const QString EDAM_DEVICE_ID_REGEX = QStringLiteral("^[^\\p{Cc}]{1,32}$"); +// Limits.thrift + const qint32 EDAM_DEVICE_DESCRIPTION_LEN_MAX = 64; +// Limits.thrift + const QString EDAM_DEVICE_DESCRIPTION_REGEX = QStringLiteral("^[^\\p{Cc}]{1,64}$"); +// Limits.thrift + const qint32 EDAM_SEARCH_SUGGESTIONS_MAX = 10; +// Limits.thrift + const qint32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX = 1024; +// Limits.thrift + const qint32 EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN = 2; +// Limits.thrift + const qint32 EDAM_FIND_CONTACT_DEFAULT_MAX_RESULTS = 100; +// Limits.thrift + const qint32 EDAM_FIND_CONTACT_MAX_RESULTS = 256; +// Limits.thrift + const qint32 EDAM_NOTE_LOCK_VIEWERS_NOTES_MAX = 150; +// Limits.thrift + const qint32 EDAM_GET_ORDERS_MAX_RESULTS = 2000; +// Limits.thrift + const qint32 EDAM_MESSAGE_BODY_LEN_MAX = 2048; +// Limits.thrift + const QString EDAM_MESSAGE_BODY_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,2046}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_MESSAGE_RECIPIENTS_MAX = 50; +// Limits.thrift + const qint32 EDAM_MESSAGE_ATTACHMENTS_MAX = 100; +// Limits.thrift + const qint32 EDAM_MESSAGE_ATTACHMENT_TITLE_LEN_MAX = 255; +// Limits.thrift + const QString EDAM_MESSAGE_ATTACHMENT_TITLE_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,253}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_MESSAGE_ATTACHMENT_SNIPPET_LEN_MAX = 2048; +// Limits.thrift + const QString EDAM_MESSAGE_ATTACHMENT_SNIPPET_REGEX = QStringLiteral("^[^\\p{Cc}\\p{Z}]([\\n[^\\p{Cc}\\p{Zl}\\p{Zp}]]{0,2046}[^\\p{Cc}\\p{Z}])?$"); +// Limits.thrift + const qint32 EDAM_USER_PROFILE_PHOTO_MAX_BYTES = 716800; +// Limits.thrift + const qint32 EDAM_PROMOTION_ID_LEN_MAX = 32; +// Limits.thrift + const QString EDAM_PROMOTION_ID_REGEX = QStringLiteral("^[A-Za-z0-9_.-]{1,32}$"); +// Limits.thrift + const qint16 EDAM_APP_RATING_MIN = 1; +// Limits.thrift + const qint16 EDAM_APP_RATING_MAX = 5; +// Limits.thrift + const qint32 EDAM_SNIPPETS_NOTES_MAX = 24; +// Limits.thrift + const qint32 EDAM_CONNECTED_IDENTITY_REQUEST_MAX = 100; -const qint32 EDAM_OPEN_ID_ACCESS_TOKEN_MAX = 1000; +// Limits.thrift +const qint32 EDAM_OPEN_ID_ACCESS_TOKEN_MAX = 1000; // Types.thrift const QString CLASSIFICATION_RECIPE_USER_NON_RECIPE = QStringLiteral("000"); +// Types.thrift + const QString CLASSIFICATION_RECIPE_USER_RECIPE = QStringLiteral("001"); +// Types.thrift + const QString CLASSIFICATION_RECIPE_SERVICE_RECIPE = QStringLiteral("002"); +// Types.thrift + const QString EDAM_NOTE_SOURCE_WEB_CLIP = QStringLiteral("web.clip"); +// Types.thrift + const QString EDAM_NOTE_SOURCE_WEB_CLIP_SIMPLIFIED = QStringLiteral("Clearly"); +// Types.thrift + const QString EDAM_NOTE_SOURCE_MAIL_CLIP = QStringLiteral("mail.clip"); -const QString EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = QStringLiteral("mail.smtp"); +// Types.thrift +const QString EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = QStringLiteral("mail.smtp"); // UserStore.thrift const qint16 EDAM_VERSION_MAJOR = 1; +// UserStore.thrift + const qint16 EDAM_VERSION_MINOR = 28; } // namespace qevercloud diff --git a/QEverCloud/src/generated/EDAMErrorCode.cpp b/QEverCloud/src/generated/EDAMErrorCode.cpp new file mode 100644 index 00000000..13aae848 --- /dev/null +++ b/QEverCloud/src/generated/EDAMErrorCode.cpp @@ -0,0 +1,1256 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#include +#include "../Impl.h" + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const EDAMErrorCode value) +{ + switch(value) + { + case EDAMErrorCode::UNKNOWN: + out << "EDAMErrorCode::UNKNOWN"; + break; + case EDAMErrorCode::BAD_DATA_FORMAT: + out << "EDAMErrorCode::BAD_DATA_FORMAT"; + break; + case EDAMErrorCode::PERMISSION_DENIED: + out << "EDAMErrorCode::PERMISSION_DENIED"; + break; + case EDAMErrorCode::INTERNAL_ERROR: + out << "EDAMErrorCode::INTERNAL_ERROR"; + break; + case EDAMErrorCode::DATA_REQUIRED: + out << "EDAMErrorCode::DATA_REQUIRED"; + break; + case EDAMErrorCode::LIMIT_REACHED: + out << "EDAMErrorCode::LIMIT_REACHED"; + break; + case EDAMErrorCode::QUOTA_REACHED: + out << "EDAMErrorCode::QUOTA_REACHED"; + break; + case EDAMErrorCode::INVALID_AUTH: + out << "EDAMErrorCode::INVALID_AUTH"; + break; + case EDAMErrorCode::AUTH_EXPIRED: + out << "EDAMErrorCode::AUTH_EXPIRED"; + break; + case EDAMErrorCode::DATA_CONFLICT: + out << "EDAMErrorCode::DATA_CONFLICT"; + break; + case EDAMErrorCode::ENML_VALIDATION: + out << "EDAMErrorCode::ENML_VALIDATION"; + break; + case EDAMErrorCode::SHARD_UNAVAILABLE: + out << "EDAMErrorCode::SHARD_UNAVAILABLE"; + break; + case EDAMErrorCode::LEN_TOO_SHORT: + out << "EDAMErrorCode::LEN_TOO_SHORT"; + break; + case EDAMErrorCode::LEN_TOO_LONG: + out << "EDAMErrorCode::LEN_TOO_LONG"; + break; + case EDAMErrorCode::TOO_FEW: + out << "EDAMErrorCode::TOO_FEW"; + break; + case EDAMErrorCode::TOO_MANY: + out << "EDAMErrorCode::TOO_MANY"; + break; + case EDAMErrorCode::UNSUPPORTED_OPERATION: + out << "EDAMErrorCode::UNSUPPORTED_OPERATION"; + break; + case EDAMErrorCode::TAKEN_DOWN: + out << "EDAMErrorCode::TAKEN_DOWN"; + break; + case EDAMErrorCode::RATE_LIMIT_REACHED: + out << "EDAMErrorCode::RATE_LIMIT_REACHED"; + break; + case EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED: + out << "EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED"; + break; + case EDAMErrorCode::DEVICE_LIMIT_REACHED: + out << "EDAMErrorCode::DEVICE_LIMIT_REACHED"; + break; + case EDAMErrorCode::OPENID_ALREADY_TAKEN: + out << "EDAMErrorCode::OPENID_ALREADY_TAKEN"; + break; + case EDAMErrorCode::INVALID_OPENID_TOKEN: + out << "EDAMErrorCode::INVALID_OPENID_TOKEN"; + break; + case EDAMErrorCode::USER_NOT_ASSOCIATED: + out << "EDAMErrorCode::USER_NOT_ASSOCIATED"; + break; + case EDAMErrorCode::USER_NOT_REGISTERED: + out << "EDAMErrorCode::USER_NOT_REGISTERED"; + break; + case EDAMErrorCode::USER_ALREADY_ASSOCIATED: + out << "EDAMErrorCode::USER_ALREADY_ASSOCIATED"; + break; + case EDAMErrorCode::ACCOUNT_CLEAR: + out << "EDAMErrorCode::ACCOUNT_CLEAR"; + break; + case EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED: + out << "EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const EDAMErrorCode value) +{ + switch(value) + { + case EDAMErrorCode::UNKNOWN: + out << "EDAMErrorCode::UNKNOWN"; + break; + case EDAMErrorCode::BAD_DATA_FORMAT: + out << "EDAMErrorCode::BAD_DATA_FORMAT"; + break; + case EDAMErrorCode::PERMISSION_DENIED: + out << "EDAMErrorCode::PERMISSION_DENIED"; + break; + case EDAMErrorCode::INTERNAL_ERROR: + out << "EDAMErrorCode::INTERNAL_ERROR"; + break; + case EDAMErrorCode::DATA_REQUIRED: + out << "EDAMErrorCode::DATA_REQUIRED"; + break; + case EDAMErrorCode::LIMIT_REACHED: + out << "EDAMErrorCode::LIMIT_REACHED"; + break; + case EDAMErrorCode::QUOTA_REACHED: + out << "EDAMErrorCode::QUOTA_REACHED"; + break; + case EDAMErrorCode::INVALID_AUTH: + out << "EDAMErrorCode::INVALID_AUTH"; + break; + case EDAMErrorCode::AUTH_EXPIRED: + out << "EDAMErrorCode::AUTH_EXPIRED"; + break; + case EDAMErrorCode::DATA_CONFLICT: + out << "EDAMErrorCode::DATA_CONFLICT"; + break; + case EDAMErrorCode::ENML_VALIDATION: + out << "EDAMErrorCode::ENML_VALIDATION"; + break; + case EDAMErrorCode::SHARD_UNAVAILABLE: + out << "EDAMErrorCode::SHARD_UNAVAILABLE"; + break; + case EDAMErrorCode::LEN_TOO_SHORT: + out << "EDAMErrorCode::LEN_TOO_SHORT"; + break; + case EDAMErrorCode::LEN_TOO_LONG: + out << "EDAMErrorCode::LEN_TOO_LONG"; + break; + case EDAMErrorCode::TOO_FEW: + out << "EDAMErrorCode::TOO_FEW"; + break; + case EDAMErrorCode::TOO_MANY: + out << "EDAMErrorCode::TOO_MANY"; + break; + case EDAMErrorCode::UNSUPPORTED_OPERATION: + out << "EDAMErrorCode::UNSUPPORTED_OPERATION"; + break; + case EDAMErrorCode::TAKEN_DOWN: + out << "EDAMErrorCode::TAKEN_DOWN"; + break; + case EDAMErrorCode::RATE_LIMIT_REACHED: + out << "EDAMErrorCode::RATE_LIMIT_REACHED"; + break; + case EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED: + out << "EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED"; + break; + case EDAMErrorCode::DEVICE_LIMIT_REACHED: + out << "EDAMErrorCode::DEVICE_LIMIT_REACHED"; + break; + case EDAMErrorCode::OPENID_ALREADY_TAKEN: + out << "EDAMErrorCode::OPENID_ALREADY_TAKEN"; + break; + case EDAMErrorCode::INVALID_OPENID_TOKEN: + out << "EDAMErrorCode::INVALID_OPENID_TOKEN"; + break; + case EDAMErrorCode::USER_NOT_ASSOCIATED: + out << "EDAMErrorCode::USER_NOT_ASSOCIATED"; + break; + case EDAMErrorCode::USER_NOT_REGISTERED: + out << "EDAMErrorCode::USER_NOT_REGISTERED"; + break; + case EDAMErrorCode::USER_ALREADY_ASSOCIATED: + out << "EDAMErrorCode::USER_ALREADY_ASSOCIATED"; + break; + case EDAMErrorCode::ACCOUNT_CLEAR: + out << "EDAMErrorCode::ACCOUNT_CLEAR"; + break; + case EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED: + out << "EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const EDAMInvalidContactReason value) +{ + switch(value) + { + case EDAMInvalidContactReason::BAD_ADDRESS: + out << "EDAMInvalidContactReason::BAD_ADDRESS"; + break; + case EDAMInvalidContactReason::DUPLICATE_CONTACT: + out << "EDAMInvalidContactReason::DUPLICATE_CONTACT"; + break; + case EDAMInvalidContactReason::NO_CONNECTION: + out << "EDAMInvalidContactReason::NO_CONNECTION"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const EDAMInvalidContactReason value) +{ + switch(value) + { + case EDAMInvalidContactReason::BAD_ADDRESS: + out << "EDAMInvalidContactReason::BAD_ADDRESS"; + break; + case EDAMInvalidContactReason::DUPLICATE_CONTACT: + out << "EDAMInvalidContactReason::DUPLICATE_CONTACT"; + break; + case EDAMInvalidContactReason::NO_CONNECTION: + out << "EDAMInvalidContactReason::NO_CONNECTION"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const ShareRelationshipPrivilegeLevel value) +{ + switch(value) + { + case ShareRelationshipPrivilegeLevel::READ_NOTEBOOK: + out << "ShareRelationshipPrivilegeLevel::READ_NOTEBOOK"; + break; + case ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY: + out << "ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY"; + break; + case ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY: + out << "ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY"; + break; + case ShareRelationshipPrivilegeLevel::FULL_ACCESS: + out << "ShareRelationshipPrivilegeLevel::FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const ShareRelationshipPrivilegeLevel value) +{ + switch(value) + { + case ShareRelationshipPrivilegeLevel::READ_NOTEBOOK: + out << "ShareRelationshipPrivilegeLevel::READ_NOTEBOOK"; + break; + case ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY: + out << "ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY"; + break; + case ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY: + out << "ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY"; + break; + case ShareRelationshipPrivilegeLevel::FULL_ACCESS: + out << "ShareRelationshipPrivilegeLevel::FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const PrivilegeLevel value) +{ + switch(value) + { + case PrivilegeLevel::NORMAL: + out << "PrivilegeLevel::NORMAL"; + break; + case PrivilegeLevel::PREMIUM: + out << "PrivilegeLevel::PREMIUM"; + break; + case PrivilegeLevel::VIP: + out << "PrivilegeLevel::VIP"; + break; + case PrivilegeLevel::MANAGER: + out << "PrivilegeLevel::MANAGER"; + break; + case PrivilegeLevel::SUPPORT: + out << "PrivilegeLevel::SUPPORT"; + break; + case PrivilegeLevel::ADMIN: + out << "PrivilegeLevel::ADMIN"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const PrivilegeLevel value) +{ + switch(value) + { + case PrivilegeLevel::NORMAL: + out << "PrivilegeLevel::NORMAL"; + break; + case PrivilegeLevel::PREMIUM: + out << "PrivilegeLevel::PREMIUM"; + break; + case PrivilegeLevel::VIP: + out << "PrivilegeLevel::VIP"; + break; + case PrivilegeLevel::MANAGER: + out << "PrivilegeLevel::MANAGER"; + break; + case PrivilegeLevel::SUPPORT: + out << "PrivilegeLevel::SUPPORT"; + break; + case PrivilegeLevel::ADMIN: + out << "PrivilegeLevel::ADMIN"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const ServiceLevel value) +{ + switch(value) + { + case ServiceLevel::BASIC: + out << "ServiceLevel::BASIC"; + break; + case ServiceLevel::PLUS: + out << "ServiceLevel::PLUS"; + break; + case ServiceLevel::PREMIUM: + out << "ServiceLevel::PREMIUM"; + break; + case ServiceLevel::BUSINESS: + out << "ServiceLevel::BUSINESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const ServiceLevel value) +{ + switch(value) + { + case ServiceLevel::BASIC: + out << "ServiceLevel::BASIC"; + break; + case ServiceLevel::PLUS: + out << "ServiceLevel::PLUS"; + break; + case ServiceLevel::PREMIUM: + out << "ServiceLevel::PREMIUM"; + break; + case ServiceLevel::BUSINESS: + out << "ServiceLevel::BUSINESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const QueryFormat value) +{ + switch(value) + { + case QueryFormat::USER: + out << "QueryFormat::USER"; + break; + case QueryFormat::SEXP: + out << "QueryFormat::SEXP"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const QueryFormat value) +{ + switch(value) + { + case QueryFormat::USER: + out << "QueryFormat::USER"; + break; + case QueryFormat::SEXP: + out << "QueryFormat::SEXP"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const NoteSortOrder value) +{ + switch(value) + { + case NoteSortOrder::CREATED: + out << "NoteSortOrder::CREATED"; + break; + case NoteSortOrder::UPDATED: + out << "NoteSortOrder::UPDATED"; + break; + case NoteSortOrder::RELEVANCE: + out << "NoteSortOrder::RELEVANCE"; + break; + case NoteSortOrder::UPDATE_SEQUENCE_NUMBER: + out << "NoteSortOrder::UPDATE_SEQUENCE_NUMBER"; + break; + case NoteSortOrder::TITLE: + out << "NoteSortOrder::TITLE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const NoteSortOrder value) +{ + switch(value) + { + case NoteSortOrder::CREATED: + out << "NoteSortOrder::CREATED"; + break; + case NoteSortOrder::UPDATED: + out << "NoteSortOrder::UPDATED"; + break; + case NoteSortOrder::RELEVANCE: + out << "NoteSortOrder::RELEVANCE"; + break; + case NoteSortOrder::UPDATE_SEQUENCE_NUMBER: + out << "NoteSortOrder::UPDATE_SEQUENCE_NUMBER"; + break; + case NoteSortOrder::TITLE: + out << "NoteSortOrder::TITLE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const PremiumOrderStatus value) +{ + switch(value) + { + case PremiumOrderStatus::NONE: + out << "PremiumOrderStatus::NONE"; + break; + case PremiumOrderStatus::PENDING: + out << "PremiumOrderStatus::PENDING"; + break; + case PremiumOrderStatus::ACTIVE: + out << "PremiumOrderStatus::ACTIVE"; + break; + case PremiumOrderStatus::FAILED: + out << "PremiumOrderStatus::FAILED"; + break; + case PremiumOrderStatus::CANCELLATION_PENDING: + out << "PremiumOrderStatus::CANCELLATION_PENDING"; + break; + case PremiumOrderStatus::CANCELED: + out << "PremiumOrderStatus::CANCELED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const PremiumOrderStatus value) +{ + switch(value) + { + case PremiumOrderStatus::NONE: + out << "PremiumOrderStatus::NONE"; + break; + case PremiumOrderStatus::PENDING: + out << "PremiumOrderStatus::PENDING"; + break; + case PremiumOrderStatus::ACTIVE: + out << "PremiumOrderStatus::ACTIVE"; + break; + case PremiumOrderStatus::FAILED: + out << "PremiumOrderStatus::FAILED"; + break; + case PremiumOrderStatus::CANCELLATION_PENDING: + out << "PremiumOrderStatus::CANCELLATION_PENDING"; + break; + case PremiumOrderStatus::CANCELED: + out << "PremiumOrderStatus::CANCELED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const SharedNotebookPrivilegeLevel value) +{ + switch(value) + { + case SharedNotebookPrivilegeLevel::READ_NOTEBOOK: + out << "SharedNotebookPrivilegeLevel::READ_NOTEBOOK"; + break; + case SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY: + out << "SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY"; + break; + case SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY: + out << "SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY"; + break; + case SharedNotebookPrivilegeLevel::GROUP: + out << "SharedNotebookPrivilegeLevel::GROUP"; + break; + case SharedNotebookPrivilegeLevel::FULL_ACCESS: + out << "SharedNotebookPrivilegeLevel::FULL_ACCESS"; + break; + case SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS: + out << "SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const SharedNotebookPrivilegeLevel value) +{ + switch(value) + { + case SharedNotebookPrivilegeLevel::READ_NOTEBOOK: + out << "SharedNotebookPrivilegeLevel::READ_NOTEBOOK"; + break; + case SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY: + out << "SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY"; + break; + case SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY: + out << "SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY"; + break; + case SharedNotebookPrivilegeLevel::GROUP: + out << "SharedNotebookPrivilegeLevel::GROUP"; + break; + case SharedNotebookPrivilegeLevel::FULL_ACCESS: + out << "SharedNotebookPrivilegeLevel::FULL_ACCESS"; + break; + case SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS: + out << "SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const SharedNotePrivilegeLevel value) +{ + switch(value) + { + case SharedNotePrivilegeLevel::READ_NOTE: + out << "SharedNotePrivilegeLevel::READ_NOTE"; + break; + case SharedNotePrivilegeLevel::MODIFY_NOTE: + out << "SharedNotePrivilegeLevel::MODIFY_NOTE"; + break; + case SharedNotePrivilegeLevel::FULL_ACCESS: + out << "SharedNotePrivilegeLevel::FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const SharedNotePrivilegeLevel value) +{ + switch(value) + { + case SharedNotePrivilegeLevel::READ_NOTE: + out << "SharedNotePrivilegeLevel::READ_NOTE"; + break; + case SharedNotePrivilegeLevel::MODIFY_NOTE: + out << "SharedNotePrivilegeLevel::MODIFY_NOTE"; + break; + case SharedNotePrivilegeLevel::FULL_ACCESS: + out << "SharedNotePrivilegeLevel::FULL_ACCESS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const SponsoredGroupRole value) +{ + switch(value) + { + case SponsoredGroupRole::GROUP_MEMBER: + out << "SponsoredGroupRole::GROUP_MEMBER"; + break; + case SponsoredGroupRole::GROUP_ADMIN: + out << "SponsoredGroupRole::GROUP_ADMIN"; + break; + case SponsoredGroupRole::GROUP_OWNER: + out << "SponsoredGroupRole::GROUP_OWNER"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const SponsoredGroupRole value) +{ + switch(value) + { + case SponsoredGroupRole::GROUP_MEMBER: + out << "SponsoredGroupRole::GROUP_MEMBER"; + break; + case SponsoredGroupRole::GROUP_ADMIN: + out << "SponsoredGroupRole::GROUP_ADMIN"; + break; + case SponsoredGroupRole::GROUP_OWNER: + out << "SponsoredGroupRole::GROUP_OWNER"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const BusinessUserRole value) +{ + switch(value) + { + case BusinessUserRole::ADMIN: + out << "BusinessUserRole::ADMIN"; + break; + case BusinessUserRole::NORMAL: + out << "BusinessUserRole::NORMAL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const BusinessUserRole value) +{ + switch(value) + { + case BusinessUserRole::ADMIN: + out << "BusinessUserRole::ADMIN"; + break; + case BusinessUserRole::NORMAL: + out << "BusinessUserRole::NORMAL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const BusinessUserStatus value) +{ + switch(value) + { + case BusinessUserStatus::ACTIVE: + out << "BusinessUserStatus::ACTIVE"; + break; + case BusinessUserStatus::DEACTIVATED: + out << "BusinessUserStatus::DEACTIVATED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const BusinessUserStatus value) +{ + switch(value) + { + case BusinessUserStatus::ACTIVE: + out << "BusinessUserStatus::ACTIVE"; + break; + case BusinessUserStatus::DEACTIVATED: + out << "BusinessUserStatus::DEACTIVATED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const SharedNotebookInstanceRestrictions value) +{ + switch(value) + { + case SharedNotebookInstanceRestrictions::ASSIGNED: + out << "SharedNotebookInstanceRestrictions::ASSIGNED"; + break; + case SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS: + out << "SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const SharedNotebookInstanceRestrictions value) +{ + switch(value) + { + case SharedNotebookInstanceRestrictions::ASSIGNED: + out << "SharedNotebookInstanceRestrictions::ASSIGNED"; + break; + case SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS: + out << "SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const ReminderEmailConfig value) +{ + switch(value) + { + case ReminderEmailConfig::DO_NOT_SEND: + out << "ReminderEmailConfig::DO_NOT_SEND"; + break; + case ReminderEmailConfig::SEND_DAILY_EMAIL: + out << "ReminderEmailConfig::SEND_DAILY_EMAIL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const ReminderEmailConfig value) +{ + switch(value) + { + case ReminderEmailConfig::DO_NOT_SEND: + out << "ReminderEmailConfig::DO_NOT_SEND"; + break; + case ReminderEmailConfig::SEND_DAILY_EMAIL: + out << "ReminderEmailConfig::SEND_DAILY_EMAIL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const BusinessInvitationStatus value) +{ + switch(value) + { + case BusinessInvitationStatus::APPROVED: + out << "BusinessInvitationStatus::APPROVED"; + break; + case BusinessInvitationStatus::REQUESTED: + out << "BusinessInvitationStatus::REQUESTED"; + break; + case BusinessInvitationStatus::REDEEMED: + out << "BusinessInvitationStatus::REDEEMED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const BusinessInvitationStatus value) +{ + switch(value) + { + case BusinessInvitationStatus::APPROVED: + out << "BusinessInvitationStatus::APPROVED"; + break; + case BusinessInvitationStatus::REQUESTED: + out << "BusinessInvitationStatus::REQUESTED"; + break; + case BusinessInvitationStatus::REDEEMED: + out << "BusinessInvitationStatus::REDEEMED"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const ContactType value) +{ + switch(value) + { + case ContactType::EVERNOTE: + out << "ContactType::EVERNOTE"; + break; + case ContactType::SMS: + out << "ContactType::SMS"; + break; + case ContactType::FACEBOOK: + out << "ContactType::FACEBOOK"; + break; + case ContactType::EMAIL: + out << "ContactType::EMAIL"; + break; + case ContactType::TWITTER: + out << "ContactType::TWITTER"; + break; + case ContactType::LINKEDIN: + out << "ContactType::LINKEDIN"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const ContactType value) +{ + switch(value) + { + case ContactType::EVERNOTE: + out << "ContactType::EVERNOTE"; + break; + case ContactType::SMS: + out << "ContactType::SMS"; + break; + case ContactType::FACEBOOK: + out << "ContactType::FACEBOOK"; + break; + case ContactType::EMAIL: + out << "ContactType::EMAIL"; + break; + case ContactType::TWITTER: + out << "ContactType::TWITTER"; + break; + case ContactType::LINKEDIN: + out << "ContactType::LINKEDIN"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const EntityType value) +{ + switch(value) + { + case EntityType::NOTE: + out << "EntityType::NOTE"; + break; + case EntityType::NOTEBOOK: + out << "EntityType::NOTEBOOK"; + break; + case EntityType::WORKSPACE: + out << "EntityType::WORKSPACE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const EntityType value) +{ + switch(value) + { + case EntityType::NOTE: + out << "EntityType::NOTE"; + break; + case EntityType::NOTEBOOK: + out << "EntityType::NOTEBOOK"; + break; + case EntityType::WORKSPACE: + out << "EntityType::WORKSPACE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const RecipientStatus value) +{ + switch(value) + { + case RecipientStatus::NOT_IN_MY_LIST: + out << "RecipientStatus::NOT_IN_MY_LIST"; + break; + case RecipientStatus::IN_MY_LIST: + out << "RecipientStatus::IN_MY_LIST"; + break; + case RecipientStatus::IN_MY_LIST_AND_DEFAULT_NOTEBOOK: + out << "RecipientStatus::IN_MY_LIST_AND_DEFAULT_NOTEBOOK"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const RecipientStatus value) +{ + switch(value) + { + case RecipientStatus::NOT_IN_MY_LIST: + out << "RecipientStatus::NOT_IN_MY_LIST"; + break; + case RecipientStatus::IN_MY_LIST: + out << "RecipientStatus::IN_MY_LIST"; + break; + case RecipientStatus::IN_MY_LIST_AND_DEFAULT_NOTEBOOK: + out << "RecipientStatus::IN_MY_LIST_AND_DEFAULT_NOTEBOOK"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const CanMoveToContainerStatus value) +{ + switch(value) + { + case CanMoveToContainerStatus::CAN_BE_MOVED: + out << "CanMoveToContainerStatus::CAN_BE_MOVED"; + break; + case CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE: + out << "CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE"; + break; + case CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE: + out << "CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const CanMoveToContainerStatus value) +{ + switch(value) + { + case CanMoveToContainerStatus::CAN_BE_MOVED: + out << "CanMoveToContainerStatus::CAN_BE_MOVED"; + break; + case CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE: + out << "CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE"; + break; + case CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE: + out << "CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const RelatedContentType value) +{ + switch(value) + { + case RelatedContentType::NEWS_ARTICLE: + out << "RelatedContentType::NEWS_ARTICLE"; + break; + case RelatedContentType::PROFILE_PERSON: + out << "RelatedContentType::PROFILE_PERSON"; + break; + case RelatedContentType::PROFILE_ORGANIZATION: + out << "RelatedContentType::PROFILE_ORGANIZATION"; + break; + case RelatedContentType::REFERENCE_MATERIAL: + out << "RelatedContentType::REFERENCE_MATERIAL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const RelatedContentType value) +{ + switch(value) + { + case RelatedContentType::NEWS_ARTICLE: + out << "RelatedContentType::NEWS_ARTICLE"; + break; + case RelatedContentType::PROFILE_PERSON: + out << "RelatedContentType::PROFILE_PERSON"; + break; + case RelatedContentType::PROFILE_ORGANIZATION: + out << "RelatedContentType::PROFILE_ORGANIZATION"; + break; + case RelatedContentType::REFERENCE_MATERIAL: + out << "RelatedContentType::REFERENCE_MATERIAL"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const RelatedContentAccess value) +{ + switch(value) + { + case RelatedContentAccess::NOT_ACCESSIBLE: + out << "RelatedContentAccess::NOT_ACCESSIBLE"; + break; + case RelatedContentAccess::DIRECT_LINK_ACCESS_OK: + out << "RelatedContentAccess::DIRECT_LINK_ACCESS_OK"; + break; + case RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED: + out << "RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED"; + break; + case RelatedContentAccess::DIRECT_LINK_EMBEDDED_VIEW: + out << "RelatedContentAccess::DIRECT_LINK_EMBEDDED_VIEW"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const RelatedContentAccess value) +{ + switch(value) + { + case RelatedContentAccess::NOT_ACCESSIBLE: + out << "RelatedContentAccess::NOT_ACCESSIBLE"; + break; + case RelatedContentAccess::DIRECT_LINK_ACCESS_OK: + out << "RelatedContentAccess::DIRECT_LINK_ACCESS_OK"; + break; + case RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED: + out << "RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED"; + break; + case RelatedContentAccess::DIRECT_LINK_EMBEDDED_VIEW: + out << "RelatedContentAccess::DIRECT_LINK_EMBEDDED_VIEW"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & out, const UserIdentityType value) +{ + switch(value) + { + case UserIdentityType::EVERNOTE_USERID: + out << "UserIdentityType::EVERNOTE_USERID"; + break; + case UserIdentityType::EMAIL: + out << "UserIdentityType::EMAIL"; + break; + case UserIdentityType::IDENTITYID: + out << "UserIdentityType::IDENTITYID"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<(QDebug & out, const UserIdentityType value) +{ + switch(value) + { + case UserIdentityType::EVERNOTE_USERID: + out << "UserIdentityType::EVERNOTE_USERID"; + break; + case UserIdentityType::EMAIL: + out << "UserIdentityType::EMAIL"; + break; + case UserIdentityType::IDENTITYID: + out << "UserIdentityType::IDENTITYID"; + break; + default: + out << "Unknown (" << static_cast(value) << ")"; + break; + } + return out; +} + +} // namespace qevercloud diff --git a/QEverCloud/src/generated/services.cpp b/QEverCloud/src/generated/Services.cpp similarity index 99% rename from QEverCloud/src/generated/services.cpp rename to QEverCloud/src/generated/Services.cpp index dca33693..429a1cb7 100644 --- a/QEverCloud/src/generated/services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,14 +8,16 @@ * This file was generated from Evernote Thrift API */ - -#include -#include "../impl.h" -#include "../impl.h" -#include "types_impl.h" -#include +#include +#include "../Impl.h" +#include "../Impl.h" +#include "Types_io.h" +#include namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getSyncState_prepareParams(QString authenticationToken) { ThriftBinaryBufferWriter w; @@ -10954,7 +10956,7 @@ AsyncResult* UserStore::listBusinessInvitationsAsync(bool includeRequestedInvita return new AsyncResult(m_url, params, UserStore_listBusinessInvitations_readReplyAsync); } -QByteArray UserStore_getAccountLimits_prepareParams(ServiceLevel::type serviceLevel) +QByteArray UserStore_getAccountLimits_prepareParams(ServiceLevel serviceLevel) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -11038,14 +11040,14 @@ QVariant UserStore_getAccountLimits_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getAccountLimits_readReply(reply)); } -AccountLimits UserStore::getAccountLimits(ServiceLevel::type serviceLevel) +AccountLimits UserStore::getAccountLimits(ServiceLevel serviceLevel) { QByteArray params = UserStore_getAccountLimits_prepareParams(serviceLevel); QByteArray reply = askEvernote(m_url, params); return UserStore_getAccountLimits_readReply(reply); } -AsyncResult* UserStore::getAccountLimitsAsync(ServiceLevel::type serviceLevel) +AsyncResult* UserStore::getAccountLimitsAsync(ServiceLevel serviceLevel) { QByteArray params = UserStore_getAccountLimits_prepareParams(serviceLevel); return new AsyncResult(m_url, params, UserStore_getAccountLimits_readReplyAsync); diff --git a/QEverCloud/src/generated/types.cpp b/QEverCloud/src/generated/Types.cpp similarity index 91% rename from QEverCloud/src/generated/types.cpp rename to QEverCloud/src/generated/Types.cpp index e0832058..a2ab29b9 100644 --- a/QEverCloud/src/generated/types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,17 +8,19 @@ * This file was generated from Evernote Thrift API */ - -#include -#include "../impl.h" -#include "../impl.h" -#include "types_impl.h" -#include +#include +#include "../Impl.h" +#include "../Impl.h" +#include "Types_io.h" +#include namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + /** @cond HIDDEN_SYMBOLS */ -void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode::type & e) { +void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode & e) { qint32 i; r.readI32(i); switch(i) { @@ -54,7 +56,7 @@ void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode::type & e } } -void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason::type & e) { +void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason & e) { qint32 i; r.readI32(i); switch(i) { @@ -65,7 +67,7 @@ void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidC } } -void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel::type & e) { +void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel & e) { qint32 i; r.readI32(i); switch(i) { @@ -77,7 +79,7 @@ void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, Share } } -void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel::type & e) { +void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel & e) { qint32 i; r.readI32(i); switch(i) { @@ -91,7 +93,7 @@ void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel::type & } } -void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel::type & e) { +void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel & e) { qint32 i; r.readI32(i); switch(i) { @@ -103,7 +105,7 @@ void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel::type & e) } } -void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat::type & e) { +void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat & e) { qint32 i; r.readI32(i); switch(i) { @@ -113,7 +115,7 @@ void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat::type & e) { } } -void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder::type & e) { +void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder & e) { qint32 i; r.readI32(i); switch(i) { @@ -126,7 +128,7 @@ void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder::type & e } } -void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus::type & e) { +void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus & e) { qint32 i; r.readI32(i); switch(i) { @@ -140,7 +142,7 @@ void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus } } -void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel::type & e) { +void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel & e) { qint32 i; r.readI32(i); switch(i) { @@ -154,7 +156,7 @@ void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNo } } -void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel::type & e) { +void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel & e) { qint32 i; r.readI32(i); switch(i) { @@ -165,7 +167,7 @@ void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePr } } -void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole::type & e) { +void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole & e) { qint32 i; r.readI32(i); switch(i) { @@ -176,7 +178,7 @@ void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole } } -void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole::type & e) { +void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole & e) { qint32 i; r.readI32(i); switch(i) { @@ -186,7 +188,7 @@ void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole::ty } } -void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus::type & e) { +void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus & e) { qint32 i; r.readI32(i); switch(i) { @@ -196,7 +198,7 @@ void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus } } -void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions::type & e) { +void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions & e) { qint32 i; r.readI32(i); switch(i) { @@ -206,7 +208,7 @@ void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, Sh } } -void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig::type & e) { +void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig & e) { qint32 i; r.readI32(i); switch(i) { @@ -216,7 +218,7 @@ void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConf } } -void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus::type & e) { +void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus & e) { qint32 i; r.readI32(i); switch(i) { @@ -227,7 +229,7 @@ void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvi } } -void readEnumContactType(ThriftBinaryBufferReader & r, ContactType::type & e) { +void readEnumContactType(ThriftBinaryBufferReader & r, ContactType & e) { qint32 i; r.readI32(i); switch(i) { @@ -241,7 +243,7 @@ void readEnumContactType(ThriftBinaryBufferReader & r, ContactType::type & e) { } } -void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType::type & e) { +void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType & e) { qint32 i; r.readI32(i); switch(i) { @@ -252,7 +254,7 @@ void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType::type & e) { } } -void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus::type & e) { +void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus & e) { qint32 i; r.readI32(i); switch(i) { @@ -263,7 +265,7 @@ void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus::type } } -void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus::type & e) { +void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus & e) { qint32 i; r.readI32(i); switch(i) { @@ -274,7 +276,7 @@ void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToCon } } -void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType::type & e) { +void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType & e) { qint32 i; r.readI32(i); switch(i) { @@ -286,7 +288,7 @@ void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType } } -void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess::type & e) { +void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess & e) { qint32 i; r.readI32(i); switch(i) { @@ -298,7 +300,7 @@ void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAc } } -void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType::type & e) { +void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e) { qint32 i; r.readI32(i); switch(i) { @@ -320,17 +322,17 @@ void writeSyncState(ThriftBinaryBufferWriter & w, const SyncState & s) { w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); w.writeI32(s.updateCount); w.writeFieldEnd(); - if(s.uploaded.isSet()) { + if (s.uploaded.isSet()) { w.writeFieldBegin(QStringLiteral("uploaded"), ThriftFieldType::T_I64, 4); w.writeI64(s.uploaded.ref()); w.writeFieldEnd(); } - if(s.userLastUpdated.isSet()) { + if (s.userLastUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("userLastUpdated"), ThriftFieldType::T_I64, 5); w.writeI64(s.userLastUpdated.ref()); w.writeFieldEnd(); } - if(s.userMaxMessageEventId.isSet()) { + if (s.userMaxMessageEventId.isSet()) { w.writeFieldBegin(QStringLiteral("userMaxMessageEventId"), ThriftFieldType::T_I64, 6); w.writeI64(s.userMaxMessageEventId.ref()); w.writeFieldEnd(); @@ -424,7 +426,7 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldBegin(QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); w.writeI64(s.currentTime); w.writeFieldEnd(); - if(s.chunkHighUSN.isSet()) { + if (s.chunkHighUSN.isSet()) { w.writeFieldBegin(QStringLiteral("chunkHighUSN"), ThriftFieldType::T_I32, 2); w.writeI32(s.chunkHighUSN.ref()); w.writeFieldEnd(); @@ -432,101 +434,101 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); w.writeI32(s.updateCount); w.writeFieldEnd(); - if(s.notes.isSet()) { + if (s.notes.isSet()) { w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); - for(QList< Note >::const_iterator it = s.notes.ref().constBegin(), end = s.notes.ref().constEnd(); it != end; ++it) { - writeNote(w, *it); + for(const auto & value: qAsConst(s.notes.ref())) { + writeNote(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.notebooks.isSet()) { + if (s.notebooks.isSet()) { w.writeFieldBegin(QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); - for(QList< Notebook >::const_iterator it = s.notebooks.ref().constBegin(), end = s.notebooks.ref().constEnd(); it != end; ++it) { - writeNotebook(w, *it); + for(const auto & value: qAsConst(s.notebooks.ref())) { + writeNotebook(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.tags.isSet()) { + if (s.tags.isSet()) { w.writeFieldBegin(QStringLiteral("tags"), ThriftFieldType::T_LIST, 6); w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); - for(QList< Tag >::const_iterator it = s.tags.ref().constBegin(), end = s.tags.ref().constEnd(); it != end; ++it) { - writeTag(w, *it); + for(const auto & value: qAsConst(s.tags.ref())) { + writeTag(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.searches.isSet()) { + if (s.searches.isSet()) { w.writeFieldBegin(QStringLiteral("searches"), ThriftFieldType::T_LIST, 7); w.writeListBegin(ThriftFieldType::T_STRUCT, s.searches.ref().length()); - for(QList< SavedSearch >::const_iterator it = s.searches.ref().constBegin(), end = s.searches.ref().constEnd(); it != end; ++it) { - writeSavedSearch(w, *it); + for(const auto & value: qAsConst(s.searches.ref())) { + writeSavedSearch(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.resources.isSet()) { + if (s.resources.isSet()) { w.writeFieldBegin(QStringLiteral("resources"), ThriftFieldType::T_LIST, 8); w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); - for(QList< Resource >::const_iterator it = s.resources.ref().constBegin(), end = s.resources.ref().constEnd(); it != end; ++it) { - writeResource(w, *it); + for(const auto & value: qAsConst(s.resources.ref())) { + writeResource(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.expungedNotes.isSet()) { + if (s.expungedNotes.isSet()) { w.writeFieldBegin(QStringLiteral("expungedNotes"), ThriftFieldType::T_LIST, 9); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotes.ref().length()); - for(QList< Guid >::const_iterator it = s.expungedNotes.ref().constBegin(), end = s.expungedNotes.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.expungedNotes.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.expungedNotebooks.isSet()) { + if (s.expungedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("expungedNotebooks"), ThriftFieldType::T_LIST, 10); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotebooks.ref().length()); - for(QList< Guid >::const_iterator it = s.expungedNotebooks.ref().constBegin(), end = s.expungedNotebooks.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.expungedNotebooks.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.expungedTags.isSet()) { + if (s.expungedTags.isSet()) { w.writeFieldBegin(QStringLiteral("expungedTags"), ThriftFieldType::T_LIST, 11); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedTags.ref().length()); - for(QList< Guid >::const_iterator it = s.expungedTags.ref().constBegin(), end = s.expungedTags.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.expungedTags.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.expungedSearches.isSet()) { + if (s.expungedSearches.isSet()) { w.writeFieldBegin(QStringLiteral("expungedSearches"), ThriftFieldType::T_LIST, 12); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedSearches.ref().length()); - for(QList< Guid >::const_iterator it = s.expungedSearches.ref().constBegin(), end = s.expungedSearches.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.expungedSearches.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.linkedNotebooks.isSet()) { + if (s.linkedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("linkedNotebooks"), ThriftFieldType::T_LIST, 13); w.writeListBegin(ThriftFieldType::T_STRUCT, s.linkedNotebooks.ref().length()); - for(QList< LinkedNotebook >::const_iterator it = s.linkedNotebooks.ref().constBegin(), end = s.linkedNotebooks.ref().constEnd(); it != end; ++it) { - writeLinkedNotebook(w, *it); + for(const auto & value: qAsConst(s.linkedNotebooks.ref())) { + writeLinkedNotebook(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.expungedLinkedNotebooks.isSet()) { + if (s.expungedLinkedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("expungedLinkedNotebooks"), ThriftFieldType::T_LIST, 14); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedLinkedNotebooks.ref().length()); - for(QList< Guid >::const_iterator it = s.expungedLinkedNotebooks.ref().constBegin(), end = s.expungedLinkedNotebooks.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.expungedLinkedNotebooks.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); @@ -796,86 +798,86 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & s) { w.writeStructBegin(QStringLiteral("SyncChunkFilter")); - if(s.includeNotes.isSet()) { + if (s.includeNotes.isSet()) { w.writeFieldBegin(QStringLiteral("includeNotes"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.includeNotes.ref()); w.writeFieldEnd(); } - if(s.includeNoteResources.isSet()) { + if (s.includeNoteResources.isSet()) { w.writeFieldBegin(QStringLiteral("includeNoteResources"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.includeNoteResources.ref()); w.writeFieldEnd(); } - if(s.includeNoteAttributes.isSet()) { + if (s.includeNoteAttributes.isSet()) { w.writeFieldBegin(QStringLiteral("includeNoteAttributes"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.includeNoteAttributes.ref()); w.writeFieldEnd(); } - if(s.includeNotebooks.isSet()) { + if (s.includeNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includeNotebooks"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.includeNotebooks.ref()); w.writeFieldEnd(); } - if(s.includeTags.isSet()) { + if (s.includeTags.isSet()) { w.writeFieldBegin(QStringLiteral("includeTags"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.includeTags.ref()); w.writeFieldEnd(); } - if(s.includeSearches.isSet()) { + if (s.includeSearches.isSet()) { w.writeFieldBegin(QStringLiteral("includeSearches"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.includeSearches.ref()); w.writeFieldEnd(); } - if(s.includeResources.isSet()) { + if (s.includeResources.isSet()) { w.writeFieldBegin(QStringLiteral("includeResources"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.includeResources.ref()); w.writeFieldEnd(); } - if(s.includeLinkedNotebooks.isSet()) { + if (s.includeLinkedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includeLinkedNotebooks"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.includeLinkedNotebooks.ref()); w.writeFieldEnd(); } - if(s.includeExpunged.isSet()) { + if (s.includeExpunged.isSet()) { w.writeFieldBegin(QStringLiteral("includeExpunged"), ThriftFieldType::T_BOOL, 9); w.writeBool(s.includeExpunged.ref()); w.writeFieldEnd(); } - if(s.includeNoteApplicationDataFullMap.isSet()) { + if (s.includeNoteApplicationDataFullMap.isSet()) { w.writeFieldBegin(QStringLiteral("includeNoteApplicationDataFullMap"), ThriftFieldType::T_BOOL, 10); w.writeBool(s.includeNoteApplicationDataFullMap.ref()); w.writeFieldEnd(); } - if(s.includeResourceApplicationDataFullMap.isSet()) { + if (s.includeResourceApplicationDataFullMap.isSet()) { w.writeFieldBegin(QStringLiteral("includeResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 12); w.writeBool(s.includeResourceApplicationDataFullMap.ref()); w.writeFieldEnd(); } - if(s.includeNoteResourceApplicationDataFullMap.isSet()) { + if (s.includeNoteResourceApplicationDataFullMap.isSet()) { w.writeFieldBegin(QStringLiteral("includeNoteResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 13); w.writeBool(s.includeNoteResourceApplicationDataFullMap.ref()); w.writeFieldEnd(); } - if(s.includeSharedNotes.isSet()) { + if (s.includeSharedNotes.isSet()) { w.writeFieldBegin(QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 17); w.writeBool(s.includeSharedNotes.ref()); w.writeFieldEnd(); } - if(s.omitSharedNotebooks.isSet()) { + if (s.omitSharedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("omitSharedNotebooks"), ThriftFieldType::T_BOOL, 16); w.writeBool(s.omitSharedNotebooks.ref()); w.writeFieldEnd(); } - if(s.requireNoteContentClass.isSet()) { + if (s.requireNoteContentClass.isSet()) { w.writeFieldBegin(QStringLiteral("requireNoteContentClass"), ThriftFieldType::T_STRING, 11); w.writeString(s.requireNoteContentClass.ref()); w.writeFieldEnd(); } - if(s.notebookGuids.isSet()) { + if (s.notebookGuids.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuids"), ThriftFieldType::T_SET, 15); w.writeSetBegin(ThriftFieldType::T_STRING, s.notebookGuids.ref().count()); - for(QSet< QString >::const_iterator it = s.notebookGuids.ref().constBegin(), end = s.notebookGuids.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.notebookGuids.ref())) { + w.writeString(value); } w.writeSetEnd(); w.writeFieldEnd(); @@ -1057,71 +1059,71 @@ void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeStructBegin(QStringLiteral("NoteFilter")); - if(s.order.isSet()) { + if (s.order.isSet()) { w.writeFieldBegin(QStringLiteral("order"), ThriftFieldType::T_I32, 1); w.writeI32(s.order.ref()); w.writeFieldEnd(); } - if(s.ascending.isSet()) { + if (s.ascending.isSet()) { w.writeFieldBegin(QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.ascending.ref()); w.writeFieldEnd(); } - if(s.words.isSet()) { + if (s.words.isSet()) { w.writeFieldBegin(QStringLiteral("words"), ThriftFieldType::T_STRING, 3); w.writeString(s.words.ref()); w.writeFieldEnd(); } - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 4); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.tagGuids.isSet()) { + if (s.tagGuids.isSet()) { w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); - for(QList< Guid >::const_iterator it = s.tagGuids.ref().constBegin(), end = s.tagGuids.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.tagGuids.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.timeZone.isSet()) { + if (s.timeZone.isSet()) { w.writeFieldBegin(QStringLiteral("timeZone"), ThriftFieldType::T_STRING, 6); w.writeString(s.timeZone.ref()); w.writeFieldEnd(); } - if(s.inactive.isSet()) { + if (s.inactive.isSet()) { w.writeFieldBegin(QStringLiteral("inactive"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.inactive.ref()); w.writeFieldEnd(); } - if(s.emphasized.isSet()) { + if (s.emphasized.isSet()) { w.writeFieldBegin(QStringLiteral("emphasized"), ThriftFieldType::T_STRING, 8); w.writeString(s.emphasized.ref()); w.writeFieldEnd(); } - if(s.includeAllReadableNotebooks.isSet()) { + if (s.includeAllReadableNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includeAllReadableNotebooks"), ThriftFieldType::T_BOOL, 9); w.writeBool(s.includeAllReadableNotebooks.ref()); w.writeFieldEnd(); } - if(s.includeAllReadableWorkspaces.isSet()) { + if (s.includeAllReadableWorkspaces.isSet()) { w.writeFieldBegin(QStringLiteral("includeAllReadableWorkspaces"), ThriftFieldType::T_BOOL, 15); w.writeBool(s.includeAllReadableWorkspaces.ref()); w.writeFieldEnd(); } - if(s.context.isSet()) { + if (s.context.isSet()) { w.writeFieldBegin(QStringLiteral("context"), ThriftFieldType::T_STRING, 10); w.writeString(s.context.ref()); w.writeFieldEnd(); } - if(s.rawWords.isSet()) { + if (s.rawWords.isSet()) { w.writeFieldBegin(QStringLiteral("rawWords"), ThriftFieldType::T_STRING, 11); w.writeString(s.rawWords.ref()); w.writeFieldEnd(); } - if(s.searchContextBytes.isSet()) { + if (s.searchContextBytes.isSet()) { w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 12); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); @@ -1284,40 +1286,40 @@ void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeFieldEnd(); w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); - for(QList< Note >::const_iterator it = s.notes.constBegin(), end = s.notes.constEnd(); it != end; ++it) { - writeNote(w, *it); + for(const auto & value: qAsConst(s.notes)) { + writeNote(w, value); } w.writeListEnd(); w.writeFieldEnd(); - if(s.stoppedWords.isSet()) { + if (s.stoppedWords.isSet()) { w.writeFieldBegin(QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); - for(QStringList::const_iterator it = s.stoppedWords.ref().constBegin(), end = s.stoppedWords.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.stoppedWords.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.searchedWords.isSet()) { + if (s.searchedWords.isSet()) { w.writeFieldBegin(QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); - for(QStringList::const_iterator it = s.searchedWords.ref().constBegin(), end = s.searchedWords.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.searchedWords.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.updateCount.isSet()) { + if (s.updateCount.isSet()) { w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); w.writeI32(s.updateCount.ref()); w.writeFieldEnd(); } - if(s.searchContextBytes.isSet()) { + if (s.searchContextBytes.isSet()) { w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); } - if(s.debugInfo.isSet()) { + if (s.debugInfo.isSet()) { w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 8); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); @@ -1459,61 +1461,61 @@ void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid); w.writeFieldEnd(); - if(s.title.isSet()) { + if (s.title.isSet()) { w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } - if(s.contentLength.isSet()) { + if (s.contentLength.isSet()) { w.writeFieldBegin(QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); w.writeI32(s.contentLength.ref()); w.writeFieldEnd(); } - if(s.created.isSet()) { + if (s.created.isSet()) { w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 6); w.writeI64(s.created.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 7); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } - if(s.deleted.isSet()) { + if (s.deleted.isSet()) { w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.tagGuids.isSet()) { + if (s.tagGuids.isSet()) { w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); - for(QList< Guid >::const_iterator it = s.tagGuids.ref().constBegin(), end = s.tagGuids.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.tagGuids.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.attributes.isSet()) { + if (s.attributes.isSet()) { w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); writeNoteAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } - if(s.largestResourceMime.isSet()) { + if (s.largestResourceMime.isSet()) { w.writeFieldBegin(QStringLiteral("largestResourceMime"), ThriftFieldType::T_STRING, 20); w.writeString(s.largestResourceMime.ref()); w.writeFieldEnd(); } - if(s.largestResourceSize.isSet()) { + if (s.largestResourceSize.isSet()) { w.writeFieldBegin(QStringLiteral("largestResourceSize"), ThriftFieldType::T_I32, 21); w.writeI32(s.largestResourceSize.ref()); w.writeFieldEnd(); @@ -1670,40 +1672,40 @@ void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataLis w.writeFieldEnd(); w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); - for(QList< NoteMetadata >::const_iterator it = s.notes.constBegin(), end = s.notes.constEnd(); it != end; ++it) { - writeNoteMetadata(w, *it); + for(const auto & value: qAsConst(s.notes)) { + writeNoteMetadata(w, value); } w.writeListEnd(); w.writeFieldEnd(); - if(s.stoppedWords.isSet()) { + if (s.stoppedWords.isSet()) { w.writeFieldBegin(QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); - for(QStringList::const_iterator it = s.stoppedWords.ref().constBegin(), end = s.stoppedWords.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.stoppedWords.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.searchedWords.isSet()) { + if (s.searchedWords.isSet()) { w.writeFieldBegin(QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); - for(QStringList::const_iterator it = s.searchedWords.ref().constBegin(), end = s.searchedWords.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.searchedWords.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.updateCount.isSet()) { + if (s.updateCount.isSet()) { w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); w.writeI32(s.updateCount.ref()); w.writeFieldEnd(); } - if(s.searchContextBytes.isSet()) { + if (s.searchContextBytes.isSet()) { w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); } - if(s.debugInfo.isSet()) { + if (s.debugInfo.isSet()) { w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 9); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); @@ -1842,57 +1844,57 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s) { w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); - if(s.includeTitle.isSet()) { + if (s.includeTitle.isSet()) { w.writeFieldBegin(QStringLiteral("includeTitle"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.includeTitle.ref()); w.writeFieldEnd(); } - if(s.includeContentLength.isSet()) { + if (s.includeContentLength.isSet()) { w.writeFieldBegin(QStringLiteral("includeContentLength"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.includeContentLength.ref()); w.writeFieldEnd(); } - if(s.includeCreated.isSet()) { + if (s.includeCreated.isSet()) { w.writeFieldBegin(QStringLiteral("includeCreated"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.includeCreated.ref()); w.writeFieldEnd(); } - if(s.includeUpdated.isSet()) { + if (s.includeUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("includeUpdated"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.includeUpdated.ref()); w.writeFieldEnd(); } - if(s.includeDeleted.isSet()) { + if (s.includeDeleted.isSet()) { w.writeFieldBegin(QStringLiteral("includeDeleted"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.includeDeleted.ref()); w.writeFieldEnd(); } - if(s.includeUpdateSequenceNum.isSet()) { + if (s.includeUpdateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("includeUpdateSequenceNum"), ThriftFieldType::T_BOOL, 10); w.writeBool(s.includeUpdateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.includeNotebookGuid.isSet()) { + if (s.includeNotebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("includeNotebookGuid"), ThriftFieldType::T_BOOL, 11); w.writeBool(s.includeNotebookGuid.ref()); w.writeFieldEnd(); } - if(s.includeTagGuids.isSet()) { + if (s.includeTagGuids.isSet()) { w.writeFieldBegin(QStringLiteral("includeTagGuids"), ThriftFieldType::T_BOOL, 12); w.writeBool(s.includeTagGuids.ref()); w.writeFieldEnd(); } - if(s.includeAttributes.isSet()) { + if (s.includeAttributes.isSet()) { w.writeFieldBegin(QStringLiteral("includeAttributes"), ThriftFieldType::T_BOOL, 14); w.writeBool(s.includeAttributes.ref()); w.writeFieldEnd(); } - if(s.includeLargestResourceMime.isSet()) { + if (s.includeLargestResourceMime.isSet()) { w.writeFieldBegin(QStringLiteral("includeLargestResourceMime"), ThriftFieldType::T_BOOL, 20); w.writeBool(s.includeLargestResourceMime.ref()); w.writeFieldEnd(); } - if(s.includeLargestResourceSize.isSet()) { + if (s.includeLargestResourceSize.isSet()) { w.writeFieldBegin(QStringLiteral("includeLargestResourceSize"), ThriftFieldType::T_BOOL, 21); w.writeBool(s.includeLargestResourceSize.ref()); w.writeFieldEnd(); @@ -2019,27 +2021,27 @@ void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResu void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectionCounts & s) { w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); - if(s.notebookCounts.isSet()) { + if (s.notebookCounts.isSet()) { w.writeFieldBegin(QStringLiteral("notebookCounts"), ThriftFieldType::T_MAP, 1); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); - for(QMap< Guid, qint32 >::const_iterator it = s.notebookCounts.ref().constBegin(), end = s.notebookCounts.ref().constEnd(); it != end; ++it) { + for(const auto & it: toRange(s.notebookCounts.ref())) { w.writeString(it.key()); w.writeI32(it.value()); } w.writeMapEnd(); w.writeFieldEnd(); } - if(s.tagCounts.isSet()) { + if (s.tagCounts.isSet()) { w.writeFieldBegin(QStringLiteral("tagCounts"), ThriftFieldType::T_MAP, 2); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); - for(QMap< Guid, qint32 >::const_iterator it = s.tagCounts.ref().constBegin(), end = s.tagCounts.ref().constEnd(); it != end; ++it) { + for(const auto & it: toRange(s.tagCounts.ref())) { w.writeString(it.key()); w.writeI32(it.value()); } w.writeMapEnd(); w.writeFieldEnd(); } - if(s.trashCount.isSet()) { + if (s.trashCount.isSet()) { w.writeFieldBegin(QStringLiteral("trashCount"), ThriftFieldType::T_I32, 3); w.writeI32(s.trashCount.ref()); w.writeFieldEnd(); @@ -2120,42 +2122,42 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s) { w.writeStructBegin(QStringLiteral("NoteResultSpec")); - if(s.includeContent.isSet()) { + if (s.includeContent.isSet()) { w.writeFieldBegin(QStringLiteral("includeContent"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.includeContent.ref()); w.writeFieldEnd(); } - if(s.includeResourcesData.isSet()) { + if (s.includeResourcesData.isSet()) { w.writeFieldBegin(QStringLiteral("includeResourcesData"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.includeResourcesData.ref()); w.writeFieldEnd(); } - if(s.includeResourcesRecognition.isSet()) { + if (s.includeResourcesRecognition.isSet()) { w.writeFieldBegin(QStringLiteral("includeResourcesRecognition"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.includeResourcesRecognition.ref()); w.writeFieldEnd(); } - if(s.includeResourcesAlternateData.isSet()) { + if (s.includeResourcesAlternateData.isSet()) { w.writeFieldBegin(QStringLiteral("includeResourcesAlternateData"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.includeResourcesAlternateData.ref()); w.writeFieldEnd(); } - if(s.includeSharedNotes.isSet()) { + if (s.includeSharedNotes.isSet()) { w.writeFieldBegin(QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.includeSharedNotes.ref()); w.writeFieldEnd(); } - if(s.includeNoteAppDataValues.isSet()) { + if (s.includeNoteAppDataValues.isSet()) { w.writeFieldBegin(QStringLiteral("includeNoteAppDataValues"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.includeNoteAppDataValues.ref()); w.writeFieldEnd(); } - if(s.includeResourceAppDataValues.isSet()) { + if (s.includeResourceAppDataValues.isSet()) { w.writeFieldBegin(QStringLiteral("includeResourceAppDataValues"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.includeResourceAppDataValues.ref()); w.writeFieldEnd(); } - if(s.includeAccountLimits.isSet()) { + if (s.includeAccountLimits.isSet()) { w.writeFieldBegin(QStringLiteral("includeAccountLimits"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.includeAccountLimits.ref()); w.writeFieldEnd(); @@ -2255,40 +2257,40 @@ void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s) { void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParameters & s) { w.writeStructBegin(QStringLiteral("NoteEmailParameters")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.note.isSet()) { + if (s.note.isSet()) { w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); writeNote(w, s.note.ref()); w.writeFieldEnd(); } - if(s.toAddresses.isSet()) { + if (s.toAddresses.isSet()) { w.writeFieldBegin(QStringLiteral("toAddresses"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRING, s.toAddresses.ref().length()); - for(QStringList::const_iterator it = s.toAddresses.ref().constBegin(), end = s.toAddresses.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.toAddresses.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.ccAddresses.isSet()) { + if (s.ccAddresses.isSet()) { w.writeFieldBegin(QStringLiteral("ccAddresses"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRING, s.ccAddresses.ref().length()); - for(QStringList::const_iterator it = s.ccAddresses.ref().constBegin(), end = s.ccAddresses.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.ccAddresses.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.subject.isSet()) { + if (s.subject.isSet()) { w.writeFieldBegin(QStringLiteral("subject"), ThriftFieldType::T_STRING, 5); w.writeString(s.subject.ref()); w.writeFieldEnd(); } - if(s.message.isSet()) { + if (s.message.isSet()) { w.writeFieldBegin(QStringLiteral("message"), ThriftFieldType::T_STRING, 6); w.writeString(s.message.ref()); w.writeFieldEnd(); @@ -2402,7 +2404,7 @@ void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 4); w.writeString(s.title); w.writeFieldEnd(); - if(s.lastEditorId.isSet()) { + if (s.lastEditorId.isSet()) { w.writeFieldBegin(QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 5); w.writeI32(s.lastEditorId.ref()); w.writeFieldEnd(); @@ -2487,32 +2489,32 @@ void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s) { void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s) { w.writeStructBegin(QStringLiteral("RelatedQuery")); - if(s.noteGuid.isSet()) { + if (s.noteGuid.isSet()) { w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } - if(s.plainText.isSet()) { + if (s.plainText.isSet()) { w.writeFieldBegin(QStringLiteral("plainText"), ThriftFieldType::T_STRING, 2); w.writeString(s.plainText.ref()); w.writeFieldEnd(); } - if(s.filter.isSet()) { + if (s.filter.isSet()) { w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 3); writeNoteFilter(w, s.filter.ref()); w.writeFieldEnd(); } - if(s.referenceUri.isSet()) { + if (s.referenceUri.isSet()) { w.writeFieldBegin(QStringLiteral("referenceUri"), ThriftFieldType::T_STRING, 4); w.writeString(s.referenceUri.ref()); w.writeFieldEnd(); } - if(s.context.isSet()) { + if (s.context.isSet()) { w.writeFieldBegin(QStringLiteral("context"), ThriftFieldType::T_STRING, 5); w.writeString(s.context.ref()); w.writeFieldEnd(); } - if(s.cacheKey.isSet()) { + if (s.cacheKey.isSet()) { w.writeFieldBegin(QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 6); w.writeString(s.cacheKey.ref()); w.writeFieldEnd(); @@ -2594,71 +2596,71 @@ void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s) { void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeStructBegin(QStringLiteral("RelatedResult")); - if(s.notes.isSet()) { + if (s.notes.isSet()) { w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); - for(QList< Note >::const_iterator it = s.notes.ref().constBegin(), end = s.notes.ref().constEnd(); it != end; ++it) { - writeNote(w, *it); + for(const auto & value: qAsConst(s.notes.ref())) { + writeNote(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.notebooks.isSet()) { + if (s.notebooks.isSet()) { w.writeFieldBegin(QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); - for(QList< Notebook >::const_iterator it = s.notebooks.ref().constBegin(), end = s.notebooks.ref().constEnd(); it != end; ++it) { - writeNotebook(w, *it); + for(const auto & value: qAsConst(s.notebooks.ref())) { + writeNotebook(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.tags.isSet()) { + if (s.tags.isSet()) { w.writeFieldBegin(QStringLiteral("tags"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); - for(QList< Tag >::const_iterator it = s.tags.ref().constBegin(), end = s.tags.ref().constEnd(); it != end; ++it) { - writeTag(w, *it); + for(const auto & value: qAsConst(s.tags.ref())) { + writeTag(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.containingNotebooks.isSet()) { + if (s.containingNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("containingNotebooks"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.containingNotebooks.ref().length()); - for(QList< NotebookDescriptor >::const_iterator it = s.containingNotebooks.ref().constBegin(), end = s.containingNotebooks.ref().constEnd(); it != end; ++it) { - writeNotebookDescriptor(w, *it); + for(const auto & value: qAsConst(s.containingNotebooks.ref())) { + writeNotebookDescriptor(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.debugInfo.isSet()) { + if (s.debugInfo.isSet()) { w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 5); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); } - if(s.experts.isSet()) { + if (s.experts.isSet()) { w.writeFieldBegin(QStringLiteral("experts"), ThriftFieldType::T_LIST, 6); w.writeListBegin(ThriftFieldType::T_STRUCT, s.experts.ref().length()); - for(QList< UserProfile >::const_iterator it = s.experts.ref().constBegin(), end = s.experts.ref().constEnd(); it != end; ++it) { - writeUserProfile(w, *it); + for(const auto & value: qAsConst(s.experts.ref())) { + writeUserProfile(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.relatedContent.isSet()) { + if (s.relatedContent.isSet()) { w.writeFieldBegin(QStringLiteral("relatedContent"), ThriftFieldType::T_LIST, 7); w.writeListBegin(ThriftFieldType::T_STRUCT, s.relatedContent.ref().length()); - for(QList< RelatedContent >::const_iterator it = s.relatedContent.ref().constBegin(), end = s.relatedContent.ref().constEnd(); it != end; ++it) { - writeRelatedContent(w, *it); + for(const auto & value: qAsConst(s.relatedContent.ref())) { + writeRelatedContent(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.cacheKey.isSet()) { + if (s.cacheKey.isSet()) { w.writeFieldBegin(QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 8); w.writeString(s.cacheKey.ref()); w.writeFieldEnd(); } - if(s.cacheExpires.isSet()) { + if (s.cacheExpires.isSet()) { w.writeFieldBegin(QStringLiteral("cacheExpires"), ThriftFieldType::T_I32, 9); w.writeI32(s.cacheExpires.ref()); w.writeFieldEnd(); @@ -2827,51 +2829,51 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpec & s) { w.writeStructBegin(QStringLiteral("RelatedResultSpec")); - if(s.maxNotes.isSet()) { + if (s.maxNotes.isSet()) { w.writeFieldBegin(QStringLiteral("maxNotes"), ThriftFieldType::T_I32, 1); w.writeI32(s.maxNotes.ref()); w.writeFieldEnd(); } - if(s.maxNotebooks.isSet()) { + if (s.maxNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("maxNotebooks"), ThriftFieldType::T_I32, 2); w.writeI32(s.maxNotebooks.ref()); w.writeFieldEnd(); } - if(s.maxTags.isSet()) { + if (s.maxTags.isSet()) { w.writeFieldBegin(QStringLiteral("maxTags"), ThriftFieldType::T_I32, 3); w.writeI32(s.maxTags.ref()); w.writeFieldEnd(); } - if(s.writableNotebooksOnly.isSet()) { + if (s.writableNotebooksOnly.isSet()) { w.writeFieldBegin(QStringLiteral("writableNotebooksOnly"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.writableNotebooksOnly.ref()); w.writeFieldEnd(); } - if(s.includeContainingNotebooks.isSet()) { + if (s.includeContainingNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includeContainingNotebooks"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.includeContainingNotebooks.ref()); w.writeFieldEnd(); } - if(s.includeDebugInfo.isSet()) { + if (s.includeDebugInfo.isSet()) { w.writeFieldBegin(QStringLiteral("includeDebugInfo"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.includeDebugInfo.ref()); w.writeFieldEnd(); } - if(s.maxExperts.isSet()) { + if (s.maxExperts.isSet()) { w.writeFieldBegin(QStringLiteral("maxExperts"), ThriftFieldType::T_I32, 7); w.writeI32(s.maxExperts.ref()); w.writeFieldEnd(); } - if(s.maxRelatedContent.isSet()) { + if (s.maxRelatedContent.isSet()) { w.writeFieldBegin(QStringLiteral("maxRelatedContent"), ThriftFieldType::T_I32, 8); w.writeI32(s.maxRelatedContent.ref()); w.writeFieldEnd(); } - if(s.relatedContentTypes.isSet()) { + if (s.relatedContentTypes.isSet()) { w.writeFieldBegin(QStringLiteral("relatedContentTypes"), ThriftFieldType::T_SET, 9); w.writeSetBegin(ThriftFieldType::T_I32, s.relatedContentTypes.ref().count()); - for(QSet< RelatedContentType::type >::const_iterator it = s.relatedContentTypes.ref().constBegin(), end = s.relatedContentTypes.ref().constEnd(); it != end; ++it) { - w.writeI32(static_cast(*it)); + for(const auto & value: qAsConst(s.relatedContentTypes.ref())) { + w.writeI32(static_cast(value)); } w.writeSetEnd(); w.writeFieldEnd(); @@ -2963,14 +2965,14 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_SET) { - QSet< RelatedContentType::type > v; + QSet< RelatedContentType > v; qint32 size; ThriftFieldType::type elemType; r.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect set type (RelatedResultSpec.relatedContentTypes)")); for(qint32 i = 0; i < size; i++) { - RelatedContentType::type elem; + RelatedContentType elem; readEnumRelatedContentType(r, elem); v.insert(elem); } @@ -2990,12 +2992,12 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s) { w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); - if(s.note.isSet()) { + if (s.note.isSet()) { w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 1); writeNote(w, s.note.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.updated.ref()); w.writeFieldEnd(); @@ -3041,22 +3043,22 @@ void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIf void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const ShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); - if(s.noSetReadOnly.isSet()) { + if (s.noSetReadOnly.isSet()) { w.writeFieldBegin(QStringLiteral("noSetReadOnly"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.noSetReadOnly.ref()); w.writeFieldEnd(); } - if(s.noSetReadPlusActivity.isSet()) { + if (s.noSetReadPlusActivity.isSet()) { w.writeFieldBegin(QStringLiteral("noSetReadPlusActivity"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.noSetReadPlusActivity.ref()); w.writeFieldEnd(); } - if(s.noSetModify.isSet()) { + if (s.noSetModify.isSet()) { w.writeFieldBegin(QStringLiteral("noSetModify"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.noSetModify.ref()); w.writeFieldEnd(); } - if(s.noSetFullAccess.isSet()) { + if (s.noSetFullAccess.isSet()) { w.writeFieldBegin(QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.noSetFullAccess.ref()); w.writeFieldEnd(); @@ -3120,22 +3122,22 @@ void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelati void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const InvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("InvitationShareRelationship")); - if(s.displayName.isSet()) { + if (s.displayName.isSet()) { w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } - if(s.recipientUserIdentity.isSet()) { + if (s.recipientUserIdentity.isSet()) { w.writeFieldBegin(QStringLiteral("recipientUserIdentity"), ThriftFieldType::T_STRUCT, 2); writeUserIdentity(w, s.recipientUserIdentity.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.sharerUserId.isSet()) { + if (s.sharerUserId.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); @@ -3173,7 +3175,7 @@ void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationSha } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - ShareRelationshipPrivilegeLevel::type v; + ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(r, v); s.privilege = v; } else { @@ -3199,32 +3201,32 @@ void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationSha void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("MemberShareRelationship")); - if(s.displayName.isSet()) { + if (s.displayName.isSet()) { w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } - if(s.recipientUserId.isSet()) { + if (s.recipientUserId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } - if(s.bestPrivilege.isSet()) { + if (s.bestPrivilege.isSet()) { w.writeFieldBegin(QStringLiteral("bestPrivilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.bestPrivilege.ref())); w.writeFieldEnd(); } - if(s.individualPrivilege.isSet()) { + if (s.individualPrivilege.isSet()) { w.writeFieldBegin(QStringLiteral("individualPrivilege"), ThriftFieldType::T_I32, 4); w.writeI32(static_cast(s.individualPrivilege.ref())); w.writeFieldEnd(); } - if(s.restrictions.isSet()) { + if (s.restrictions.isSet()) { w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 5); writeShareRelationshipRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } - if(s.sharerUserId.isSet()) { + if (s.sharerUserId.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 6); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); @@ -3262,7 +3264,7 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - ShareRelationshipPrivilegeLevel::type v; + ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(r, v); s.bestPrivilege = v; } else { @@ -3271,7 +3273,7 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { - ShareRelationshipPrivilegeLevel::type v; + ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(r, v); s.individualPrivilege = v; } else { @@ -3306,25 +3308,25 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationships & s) { w.writeStructBegin(QStringLiteral("ShareRelationships")); - if(s.invitations.isSet()) { + if (s.invitations.isSet()) { w.writeFieldBegin(QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); - for(QList< InvitationShareRelationship >::const_iterator it = s.invitations.ref().constBegin(), end = s.invitations.ref().constEnd(); it != end; ++it) { - writeInvitationShareRelationship(w, *it); + for(const auto & value: qAsConst(s.invitations.ref())) { + writeInvitationShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.memberships.isSet()) { + if (s.memberships.isSet()) { w.writeFieldBegin(QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); - for(QList< MemberShareRelationship >::const_iterator it = s.memberships.ref().constBegin(), end = s.memberships.ref().constEnd(); it != end; ++it) { - writeMemberShareRelationship(w, *it); + for(const auto & value: qAsConst(s.memberships.ref())) { + writeMemberShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.invitationRestrictions.isSet()) { + if (s.invitationRestrictions.isSet()) { w.writeFieldBegin(QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); writeShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); w.writeFieldEnd(); @@ -3399,39 +3401,39 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.inviteMessage.isSet()) { + if (s.inviteMessage.isSet()) { w.writeFieldBegin(QStringLiteral("inviteMessage"), ThriftFieldType::T_STRING, 2); w.writeString(s.inviteMessage.ref()); w.writeFieldEnd(); } - if(s.membershipsToUpdate.isSet()) { + if (s.membershipsToUpdate.isSet()) { w.writeFieldBegin(QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); - for(QList< MemberShareRelationship >::const_iterator it = s.membershipsToUpdate.ref().constBegin(), end = s.membershipsToUpdate.ref().constEnd(); it != end; ++it) { - writeMemberShareRelationship(w, *it); + for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { + writeMemberShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.invitationsToCreateOrUpdate.isSet()) { + if (s.invitationsToCreateOrUpdate.isSet()) { w.writeFieldBegin(QStringLiteral("invitationsToCreateOrUpdate"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToCreateOrUpdate.ref().length()); - for(QList< InvitationShareRelationship >::const_iterator it = s.invitationsToCreateOrUpdate.ref().constBegin(), end = s.invitationsToCreateOrUpdate.ref().constEnd(); it != end; ++it) { - writeInvitationShareRelationship(w, *it); + for(const auto & value: qAsConst(s.invitationsToCreateOrUpdate.ref())) { + writeInvitationShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.unshares.isSet()) { + if (s.unshares.isSet()) { w.writeFieldBegin(QStringLiteral("unshares"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRUCT, s.unshares.ref().length()); - for(QList< UserIdentity >::const_iterator it = s.unshares.ref().constBegin(), end = s.unshares.ref().constEnd(); it != end; ++it) { - writeUserIdentity(w, *it); + for(const auto & value: qAsConst(s.unshares.ref())) { + writeUserIdentity(w, value); } w.writeListEnd(); w.writeFieldEnd(); @@ -3534,17 +3536,17 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote void writeManageNotebookSharesError(ThriftBinaryBufferWriter & w, const ManageNotebookSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); - if(s.userIdentity.isSet()) { + if (s.userIdentity.isSet()) { w.writeFieldBegin(QStringLiteral("userIdentity"), ThriftFieldType::T_STRUCT, 1); writeUserIdentity(w, s.userIdentity.ref()); w.writeFieldEnd(); } - if(s.userException.isSet()) { + if (s.userException.isSet()) { w.writeFieldBegin(QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 2); writeEDAMUserException(w, s.userException.ref()); w.writeFieldEnd(); } - if(s.notFoundException.isSet()) { + if (s.notFoundException.isSet()) { w.writeFieldBegin(QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 3); writeEDAMNotFoundException(w, s.notFoundException.ref()); w.writeFieldEnd(); @@ -3599,11 +3601,11 @@ void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookS void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); - if(s.errors.isSet()) { + if (s.errors.isSet()) { w.writeFieldBegin(QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); - for(QList< ManageNotebookSharesError >::const_iterator it = s.errors.ref().constBegin(), end = s.errors.ref().constEnd(); it != end; ++it) { - writeManageNotebookSharesError(w, *it); + for(const auto & value: qAsConst(s.errors.ref())) { + writeManageNotebookSharesError(w, value); } w.writeListEnd(); w.writeFieldEnd(); @@ -3650,26 +3652,26 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTemplate & s) { w.writeStructBegin(QStringLiteral("SharedNoteTemplate")); - if(s.noteGuid.isSet()) { + if (s.noteGuid.isSet()) { w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } - if(s.recipientThreadId.isSet()) { + if (s.recipientThreadId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); w.writeI64(s.recipientThreadId.ref()); w.writeFieldEnd(); } - if(s.recipientContacts.isSet()) { + if (s.recipientContacts.isSet()) { w.writeFieldBegin(QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); - for(QList< Contact >::const_iterator it = s.recipientContacts.ref().constBegin(), end = s.recipientContacts.ref().constEnd(); it != end; ++it) { - writeContact(w, *it); + for(const auto & value: qAsConst(s.recipientContacts.ref())) { + writeContact(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); @@ -3726,7 +3728,7 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotePrivilegeLevel::type v; + SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(r, v); s.privilege = v; } else { @@ -3743,26 +3745,26 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShareTemplate & s) { w.writeStructBegin(QStringLiteral("NotebookShareTemplate")); - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.recipientThreadId.isSet()) { + if (s.recipientThreadId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); w.writeI64(s.recipientThreadId.ref()); w.writeFieldEnd(); } - if(s.recipientContacts.isSet()) { + if (s.recipientContacts.isSet()) { w.writeFieldBegin(QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); - for(QList< Contact >::const_iterator it = s.recipientContacts.ref().constBegin(), end = s.recipientContacts.ref().constEnd(); it != end; ++it) { - writeContact(w, *it); + for(const auto & value: qAsConst(s.recipientContacts.ref())) { + writeContact(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); @@ -3819,7 +3821,7 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotebookPrivilegeLevel::type v; + SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(r, v); s.privilege = v; } else { @@ -3836,16 +3838,16 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const CreateOrUpdateNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 1); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.matchingShares.isSet()) { + if (s.matchingShares.isSet()) { w.writeFieldBegin(QStringLiteral("matchingShares"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.matchingShares.ref().length()); - for(QList< SharedNotebook >::const_iterator it = s.matchingShares.ref().constBegin(), end = s.matchingShares.ref().constEnd(); it != end; ++it) { - writeSharedNotebook(w, *it); + for(const auto & value: qAsConst(s.matchingShares.ref())) { + writeSharedNotebook(w, value); } w.writeListEnd(); w.writeFieldEnd(); @@ -3901,17 +3903,17 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const NoteShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); - if(s.noSetReadNote.isSet()) { + if (s.noSetReadNote.isSet()) { w.writeFieldBegin(QStringLiteral("noSetReadNote"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.noSetReadNote.ref()); w.writeFieldEnd(); } - if(s.noSetModifyNote.isSet()) { + if (s.noSetModifyNote.isSet()) { w.writeFieldBegin(QStringLiteral("noSetModifyNote"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.noSetModifyNote.ref()); w.writeFieldEnd(); } - if(s.noSetFullAccess.isSet()) { + if (s.noSetFullAccess.isSet()) { w.writeFieldBegin(QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.noSetFullAccess.ref()); w.writeFieldEnd(); @@ -3966,27 +3968,27 @@ void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteSha void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); - if(s.displayName.isSet()) { + if (s.displayName.isSet()) { w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } - if(s.recipientUserId.isSet()) { + if (s.recipientUserId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.restrictions.isSet()) { + if (s.restrictions.isSet()) { w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 4); writeNoteShareRelationshipRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } - if(s.sharerUserId.isSet()) { + if (s.sharerUserId.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); @@ -4024,7 +4026,7 @@ void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberSha } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotePrivilegeLevel::type v; + SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(r, v); s.privilege = v; } else { @@ -4059,22 +4061,22 @@ void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberSha void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const NoteInvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); - if(s.displayName.isSet()) { + if (s.displayName.isSet()) { w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } - if(s.recipientIdentityId.isSet()) { + if (s.recipientIdentityId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 2); w.writeI64(s.recipientIdentityId.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.sharerUserId.isSet()) { + if (s.sharerUserId.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); @@ -4112,7 +4114,7 @@ void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvit } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotePrivilegeLevel::type v; + SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(r, v); s.privilege = v; } else { @@ -4138,25 +4140,25 @@ void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvit void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRelationships & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationships")); - if(s.invitations.isSet()) { + if (s.invitations.isSet()) { w.writeFieldBegin(QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); - for(QList< NoteInvitationShareRelationship >::const_iterator it = s.invitations.ref().constBegin(), end = s.invitations.ref().constEnd(); it != end; ++it) { - writeNoteInvitationShareRelationship(w, *it); + for(const auto & value: qAsConst(s.invitations.ref())) { + writeNoteInvitationShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.memberships.isSet()) { + if (s.memberships.isSet()) { w.writeFieldBegin(QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); - for(QList< NoteMemberShareRelationship >::const_iterator it = s.memberships.ref().constBegin(), end = s.memberships.ref().constEnd(); it != end; ++it) { - writeNoteMemberShareRelationship(w, *it); + for(const auto & value: qAsConst(s.memberships.ref())) { + writeNoteMemberShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.invitationRestrictions.isSet()) { + if (s.invitationRestrictions.isSet()) { w.writeFieldBegin(QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); writeNoteShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); w.writeFieldEnd(); @@ -4231,43 +4233,43 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageNoteSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); - if(s.noteGuid.isSet()) { + if (s.noteGuid.isSet()) { w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } - if(s.membershipsToUpdate.isSet()) { + if (s.membershipsToUpdate.isSet()) { w.writeFieldBegin(QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); - for(QList< NoteMemberShareRelationship >::const_iterator it = s.membershipsToUpdate.ref().constBegin(), end = s.membershipsToUpdate.ref().constEnd(); it != end; ++it) { - writeNoteMemberShareRelationship(w, *it); + for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { + writeNoteMemberShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.invitationsToUpdate.isSet()) { + if (s.invitationsToUpdate.isSet()) { w.writeFieldBegin(QStringLiteral("invitationsToUpdate"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToUpdate.ref().length()); - for(QList< NoteInvitationShareRelationship >::const_iterator it = s.invitationsToUpdate.ref().constBegin(), end = s.invitationsToUpdate.ref().constEnd(); it != end; ++it) { - writeNoteInvitationShareRelationship(w, *it); + for(const auto & value: qAsConst(s.invitationsToUpdate.ref())) { + writeNoteInvitationShareRelationship(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.membershipsToUnshare.isSet()) { + if (s.membershipsToUnshare.isSet()) { w.writeFieldBegin(QStringLiteral("membershipsToUnshare"), ThriftFieldType::T_LIST, 4); w.writeListBegin(ThriftFieldType::T_I32, s.membershipsToUnshare.ref().length()); - for(QList< UserID >::const_iterator it = s.membershipsToUnshare.ref().constBegin(), end = s.membershipsToUnshare.ref().constEnd(); it != end; ++it) { - w.writeI32(*it); + for(const auto & value: qAsConst(s.membershipsToUnshare.ref())) { + w.writeI32(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.invitationsToUnshare.isSet()) { + if (s.invitationsToUnshare.isSet()) { w.writeFieldBegin(QStringLiteral("invitationsToUnshare"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_I64, s.invitationsToUnshare.ref().length()); - for(QList< IdentityID >::const_iterator it = s.invitationsToUnshare.ref().constBegin(), end = s.invitationsToUnshare.ref().constEnd(); it != end; ++it) { - w.writeI64(*it); + for(const auto & value: qAsConst(s.invitationsToUnshare.ref())) { + w.writeI64(value); } w.writeListEnd(); w.writeFieldEnd(); @@ -4380,22 +4382,22 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesError")); - if(s.identityID.isSet()) { + if (s.identityID.isSet()) { w.writeFieldBegin(QStringLiteral("identityID"), ThriftFieldType::T_I64, 1); w.writeI64(s.identityID.ref()); w.writeFieldEnd(); } - if(s.userID.isSet()) { + if (s.userID.isSet()) { w.writeFieldBegin(QStringLiteral("userID"), ThriftFieldType::T_I32, 2); w.writeI32(s.userID.ref()); w.writeFieldEnd(); } - if(s.userException.isSet()) { + if (s.userException.isSet()) { w.writeFieldBegin(QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 3); writeEDAMUserException(w, s.userException.ref()); w.writeFieldEnd(); } - if(s.notFoundException.isSet()) { + if (s.notFoundException.isSet()) { w.writeFieldBegin(QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 4); writeEDAMNotFoundException(w, s.notFoundException.ref()); w.writeFieldEnd(); @@ -4459,11 +4461,11 @@ void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesErr void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); - if(s.errors.isSet()) { + if (s.errors.isSet()) { w.writeFieldBegin(QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); - for(QList< ManageNoteSharesError >::const_iterator it = s.errors.ref().constBegin(), end = s.errors.ref().constEnd(); it != end; ++it) { - writeManageNoteSharesError(w, *it); + for(const auto & value: qAsConst(s.errors.ref())) { + writeManageNoteSharesError(w, value); } w.writeListEnd(); w.writeFieldEnd(); @@ -4510,17 +4512,17 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe void writeData(ThriftBinaryBufferWriter & w, const Data & s) { w.writeStructBegin(QStringLiteral("Data")); - if(s.bodyHash.isSet()) { + if (s.bodyHash.isSet()) { w.writeFieldBegin(QStringLiteral("bodyHash"), ThriftFieldType::T_STRING, 1); w.writeBinary(s.bodyHash.ref()); w.writeFieldEnd(); } - if(s.size.isSet()) { + if (s.size.isSet()) { w.writeFieldBegin(QStringLiteral("size"), ThriftFieldType::T_I32, 2); w.writeI32(s.size.ref()); w.writeFieldEnd(); } - if(s.body.isSet()) { + if (s.body.isSet()) { w.writeFieldBegin(QStringLiteral("body"), ThriftFieldType::T_STRING, 3); w.writeBinary(s.body.ref()); w.writeFieldEnd(); @@ -4575,185 +4577,185 @@ void readData(ThriftBinaryBufferReader & r, Data & s) { void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) { w.writeStructBegin(QStringLiteral("UserAttributes")); - if(s.defaultLocationName.isSet()) { + if (s.defaultLocationName.isSet()) { w.writeFieldBegin(QStringLiteral("defaultLocationName"), ThriftFieldType::T_STRING, 1); w.writeString(s.defaultLocationName.ref()); w.writeFieldEnd(); } - if(s.defaultLatitude.isSet()) { + if (s.defaultLatitude.isSet()) { w.writeFieldBegin(QStringLiteral("defaultLatitude"), ThriftFieldType::T_DOUBLE, 2); w.writeDouble(s.defaultLatitude.ref()); w.writeFieldEnd(); } - if(s.defaultLongitude.isSet()) { + if (s.defaultLongitude.isSet()) { w.writeFieldBegin(QStringLiteral("defaultLongitude"), ThriftFieldType::T_DOUBLE, 3); w.writeDouble(s.defaultLongitude.ref()); w.writeFieldEnd(); } - if(s.preactivation.isSet()) { + if (s.preactivation.isSet()) { w.writeFieldBegin(QStringLiteral("preactivation"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.preactivation.ref()); w.writeFieldEnd(); } - if(s.viewedPromotions.isSet()) { + if (s.viewedPromotions.isSet()) { w.writeFieldBegin(QStringLiteral("viewedPromotions"), ThriftFieldType::T_LIST, 5); w.writeListBegin(ThriftFieldType::T_STRING, s.viewedPromotions.ref().length()); - for(QStringList::const_iterator it = s.viewedPromotions.ref().constBegin(), end = s.viewedPromotions.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.viewedPromotions.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.incomingEmailAddress.isSet()) { + if (s.incomingEmailAddress.isSet()) { w.writeFieldBegin(QStringLiteral("incomingEmailAddress"), ThriftFieldType::T_STRING, 6); w.writeString(s.incomingEmailAddress.ref()); w.writeFieldEnd(); } - if(s.recentMailedAddresses.isSet()) { + if (s.recentMailedAddresses.isSet()) { w.writeFieldBegin(QStringLiteral("recentMailedAddresses"), ThriftFieldType::T_LIST, 7); w.writeListBegin(ThriftFieldType::T_STRING, s.recentMailedAddresses.ref().length()); - for(QStringList::const_iterator it = s.recentMailedAddresses.ref().constBegin(), end = s.recentMailedAddresses.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.recentMailedAddresses.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.comments.isSet()) { + if (s.comments.isSet()) { w.writeFieldBegin(QStringLiteral("comments"), ThriftFieldType::T_STRING, 9); w.writeString(s.comments.ref()); w.writeFieldEnd(); } - if(s.dateAgreedToTermsOfService.isSet()) { + if (s.dateAgreedToTermsOfService.isSet()) { w.writeFieldBegin(QStringLiteral("dateAgreedToTermsOfService"), ThriftFieldType::T_I64, 11); w.writeI64(s.dateAgreedToTermsOfService.ref()); w.writeFieldEnd(); } - if(s.maxReferrals.isSet()) { + if (s.maxReferrals.isSet()) { w.writeFieldBegin(QStringLiteral("maxReferrals"), ThriftFieldType::T_I32, 12); w.writeI32(s.maxReferrals.ref()); w.writeFieldEnd(); } - if(s.referralCount.isSet()) { + if (s.referralCount.isSet()) { w.writeFieldBegin(QStringLiteral("referralCount"), ThriftFieldType::T_I32, 13); w.writeI32(s.referralCount.ref()); w.writeFieldEnd(); } - if(s.refererCode.isSet()) { + if (s.refererCode.isSet()) { w.writeFieldBegin(QStringLiteral("refererCode"), ThriftFieldType::T_STRING, 14); w.writeString(s.refererCode.ref()); w.writeFieldEnd(); } - if(s.sentEmailDate.isSet()) { + if (s.sentEmailDate.isSet()) { w.writeFieldBegin(QStringLiteral("sentEmailDate"), ThriftFieldType::T_I64, 15); w.writeI64(s.sentEmailDate.ref()); w.writeFieldEnd(); } - if(s.sentEmailCount.isSet()) { + if (s.sentEmailCount.isSet()) { w.writeFieldBegin(QStringLiteral("sentEmailCount"), ThriftFieldType::T_I32, 16); w.writeI32(s.sentEmailCount.ref()); w.writeFieldEnd(); } - if(s.dailyEmailLimit.isSet()) { + if (s.dailyEmailLimit.isSet()) { w.writeFieldBegin(QStringLiteral("dailyEmailLimit"), ThriftFieldType::T_I32, 17); w.writeI32(s.dailyEmailLimit.ref()); w.writeFieldEnd(); } - if(s.emailOptOutDate.isSet()) { + if (s.emailOptOutDate.isSet()) { w.writeFieldBegin(QStringLiteral("emailOptOutDate"), ThriftFieldType::T_I64, 18); w.writeI64(s.emailOptOutDate.ref()); w.writeFieldEnd(); } - if(s.partnerEmailOptInDate.isSet()) { + if (s.partnerEmailOptInDate.isSet()) { w.writeFieldBegin(QStringLiteral("partnerEmailOptInDate"), ThriftFieldType::T_I64, 19); w.writeI64(s.partnerEmailOptInDate.ref()); w.writeFieldEnd(); } - if(s.preferredLanguage.isSet()) { + if (s.preferredLanguage.isSet()) { w.writeFieldBegin(QStringLiteral("preferredLanguage"), ThriftFieldType::T_STRING, 20); w.writeString(s.preferredLanguage.ref()); w.writeFieldEnd(); } - if(s.preferredCountry.isSet()) { + if (s.preferredCountry.isSet()) { w.writeFieldBegin(QStringLiteral("preferredCountry"), ThriftFieldType::T_STRING, 21); w.writeString(s.preferredCountry.ref()); w.writeFieldEnd(); } - if(s.clipFullPage.isSet()) { + if (s.clipFullPage.isSet()) { w.writeFieldBegin(QStringLiteral("clipFullPage"), ThriftFieldType::T_BOOL, 22); w.writeBool(s.clipFullPage.ref()); w.writeFieldEnd(); } - if(s.twitterUserName.isSet()) { + if (s.twitterUserName.isSet()) { w.writeFieldBegin(QStringLiteral("twitterUserName"), ThriftFieldType::T_STRING, 23); w.writeString(s.twitterUserName.ref()); w.writeFieldEnd(); } - if(s.twitterId.isSet()) { + if (s.twitterId.isSet()) { w.writeFieldBegin(QStringLiteral("twitterId"), ThriftFieldType::T_STRING, 24); w.writeString(s.twitterId.ref()); w.writeFieldEnd(); } - if(s.groupName.isSet()) { + if (s.groupName.isSet()) { w.writeFieldBegin(QStringLiteral("groupName"), ThriftFieldType::T_STRING, 25); w.writeString(s.groupName.ref()); w.writeFieldEnd(); } - if(s.recognitionLanguage.isSet()) { + if (s.recognitionLanguage.isSet()) { w.writeFieldBegin(QStringLiteral("recognitionLanguage"), ThriftFieldType::T_STRING, 26); w.writeString(s.recognitionLanguage.ref()); w.writeFieldEnd(); } - if(s.referralProof.isSet()) { + if (s.referralProof.isSet()) { w.writeFieldBegin(QStringLiteral("referralProof"), ThriftFieldType::T_STRING, 28); w.writeString(s.referralProof.ref()); w.writeFieldEnd(); } - if(s.educationalDiscount.isSet()) { + if (s.educationalDiscount.isSet()) { w.writeFieldBegin(QStringLiteral("educationalDiscount"), ThriftFieldType::T_BOOL, 29); w.writeBool(s.educationalDiscount.ref()); w.writeFieldEnd(); } - if(s.businessAddress.isSet()) { + if (s.businessAddress.isSet()) { w.writeFieldBegin(QStringLiteral("businessAddress"), ThriftFieldType::T_STRING, 30); w.writeString(s.businessAddress.ref()); w.writeFieldEnd(); } - if(s.hideSponsorBilling.isSet()) { + if (s.hideSponsorBilling.isSet()) { w.writeFieldBegin(QStringLiteral("hideSponsorBilling"), ThriftFieldType::T_BOOL, 31); w.writeBool(s.hideSponsorBilling.ref()); w.writeFieldEnd(); } - if(s.useEmailAutoFiling.isSet()) { + if (s.useEmailAutoFiling.isSet()) { w.writeFieldBegin(QStringLiteral("useEmailAutoFiling"), ThriftFieldType::T_BOOL, 33); w.writeBool(s.useEmailAutoFiling.ref()); w.writeFieldEnd(); } - if(s.reminderEmailConfig.isSet()) { + if (s.reminderEmailConfig.isSet()) { w.writeFieldBegin(QStringLiteral("reminderEmailConfig"), ThriftFieldType::T_I32, 34); w.writeI32(static_cast(s.reminderEmailConfig.ref())); w.writeFieldEnd(); } - if(s.emailAddressLastConfirmed.isSet()) { + if (s.emailAddressLastConfirmed.isSet()) { w.writeFieldBegin(QStringLiteral("emailAddressLastConfirmed"), ThriftFieldType::T_I64, 35); w.writeI64(s.emailAddressLastConfirmed.ref()); w.writeFieldEnd(); } - if(s.passwordUpdated.isSet()) { + if (s.passwordUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("passwordUpdated"), ThriftFieldType::T_I64, 36); w.writeI64(s.passwordUpdated.ref()); w.writeFieldEnd(); } - if(s.salesforcePushEnabled.isSet()) { + if (s.salesforcePushEnabled.isSet()) { w.writeFieldBegin(QStringLiteral("salesforcePushEnabled"), ThriftFieldType::T_BOOL, 37); w.writeBool(s.salesforcePushEnabled.ref()); w.writeFieldEnd(); } - if(s.shouldLogClientEvent.isSet()) { + if (s.shouldLogClientEvent.isSet()) { w.writeFieldBegin(QStringLiteral("shouldLogClientEvent"), ThriftFieldType::T_BOOL, 38); w.writeBool(s.shouldLogClientEvent.ref()); w.writeFieldEnd(); } - if(s.optOutMachineLearning.isSet()) { + if (s.optOutMachineLearning.isSet()) { w.writeFieldBegin(QStringLiteral("optOutMachineLearning"), ThriftFieldType::T_BOOL, 39); w.writeBool(s.optOutMachineLearning.ref()); w.writeFieldEnd(); @@ -5054,7 +5056,7 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { } else if (fieldId == 34) { if (fieldType == ThriftFieldType::T_I32) { - ReminderEmailConfig::type v; + ReminderEmailConfig v; readEnumReminderEmailConfig(r, v); s.reminderEmailConfig = v; } else { @@ -5116,37 +5118,37 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s) { w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); - if(s.title.isSet()) { + if (s.title.isSet()) { w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 1); w.writeString(s.title.ref()); w.writeFieldEnd(); } - if(s.location.isSet()) { + if (s.location.isSet()) { w.writeFieldBegin(QStringLiteral("location"), ThriftFieldType::T_STRING, 2); w.writeString(s.location.ref()); w.writeFieldEnd(); } - if(s.department.isSet()) { + if (s.department.isSet()) { w.writeFieldBegin(QStringLiteral("department"), ThriftFieldType::T_STRING, 3); w.writeString(s.department.ref()); w.writeFieldEnd(); } - if(s.mobilePhone.isSet()) { + if (s.mobilePhone.isSet()) { w.writeFieldBegin(QStringLiteral("mobilePhone"), ThriftFieldType::T_STRING, 4); w.writeString(s.mobilePhone.ref()); w.writeFieldEnd(); } - if(s.linkedInProfileUrl.isSet()) { + if (s.linkedInProfileUrl.isSet()) { w.writeFieldBegin(QStringLiteral("linkedInProfileUrl"), ThriftFieldType::T_STRING, 5); w.writeString(s.linkedInProfileUrl.ref()); w.writeFieldEnd(); } - if(s.workPhone.isSet()) { + if (s.workPhone.isSet()) { w.writeFieldBegin(QStringLiteral("workPhone"), ThriftFieldType::T_STRING, 6); w.writeString(s.workPhone.ref()); w.writeFieldEnd(); } - if(s.companyStartDate.isSet()) { + if (s.companyStartDate.isSet()) { w.writeFieldBegin(QStringLiteral("companyStartDate"), ThriftFieldType::T_I64, 7); w.writeI64(s.companyStartDate.ref()); w.writeFieldEnd(); @@ -5237,117 +5239,117 @@ void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttrib void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { w.writeStructBegin(QStringLiteral("Accounting")); - if(s.uploadLimitEnd.isSet()) { + if (s.uploadLimitEnd.isSet()) { w.writeFieldBegin(QStringLiteral("uploadLimitEnd"), ThriftFieldType::T_I64, 2); w.writeI64(s.uploadLimitEnd.ref()); w.writeFieldEnd(); } - if(s.uploadLimitNextMonth.isSet()) { + if (s.uploadLimitNextMonth.isSet()) { w.writeFieldBegin(QStringLiteral("uploadLimitNextMonth"), ThriftFieldType::T_I64, 3); w.writeI64(s.uploadLimitNextMonth.ref()); w.writeFieldEnd(); } - if(s.premiumServiceStatus.isSet()) { + if (s.premiumServiceStatus.isSet()) { w.writeFieldBegin(QStringLiteral("premiumServiceStatus"), ThriftFieldType::T_I32, 4); w.writeI32(static_cast(s.premiumServiceStatus.ref())); w.writeFieldEnd(); } - if(s.premiumOrderNumber.isSet()) { + if (s.premiumOrderNumber.isSet()) { w.writeFieldBegin(QStringLiteral("premiumOrderNumber"), ThriftFieldType::T_STRING, 5); w.writeString(s.premiumOrderNumber.ref()); w.writeFieldEnd(); } - if(s.premiumCommerceService.isSet()) { + if (s.premiumCommerceService.isSet()) { w.writeFieldBegin(QStringLiteral("premiumCommerceService"), ThriftFieldType::T_STRING, 6); w.writeString(s.premiumCommerceService.ref()); w.writeFieldEnd(); } - if(s.premiumServiceStart.isSet()) { + if (s.premiumServiceStart.isSet()) { w.writeFieldBegin(QStringLiteral("premiumServiceStart"), ThriftFieldType::T_I64, 7); w.writeI64(s.premiumServiceStart.ref()); w.writeFieldEnd(); } - if(s.premiumServiceSKU.isSet()) { + if (s.premiumServiceSKU.isSet()) { w.writeFieldBegin(QStringLiteral("premiumServiceSKU"), ThriftFieldType::T_STRING, 8); w.writeString(s.premiumServiceSKU.ref()); w.writeFieldEnd(); } - if(s.lastSuccessfulCharge.isSet()) { + if (s.lastSuccessfulCharge.isSet()) { w.writeFieldBegin(QStringLiteral("lastSuccessfulCharge"), ThriftFieldType::T_I64, 9); w.writeI64(s.lastSuccessfulCharge.ref()); w.writeFieldEnd(); } - if(s.lastFailedCharge.isSet()) { + if (s.lastFailedCharge.isSet()) { w.writeFieldBegin(QStringLiteral("lastFailedCharge"), ThriftFieldType::T_I64, 10); w.writeI64(s.lastFailedCharge.ref()); w.writeFieldEnd(); } - if(s.lastFailedChargeReason.isSet()) { + if (s.lastFailedChargeReason.isSet()) { w.writeFieldBegin(QStringLiteral("lastFailedChargeReason"), ThriftFieldType::T_STRING, 11); w.writeString(s.lastFailedChargeReason.ref()); w.writeFieldEnd(); } - if(s.nextPaymentDue.isSet()) { + if (s.nextPaymentDue.isSet()) { w.writeFieldBegin(QStringLiteral("nextPaymentDue"), ThriftFieldType::T_I64, 12); w.writeI64(s.nextPaymentDue.ref()); w.writeFieldEnd(); } - if(s.premiumLockUntil.isSet()) { + if (s.premiumLockUntil.isSet()) { w.writeFieldBegin(QStringLiteral("premiumLockUntil"), ThriftFieldType::T_I64, 13); w.writeI64(s.premiumLockUntil.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 14); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } - if(s.premiumSubscriptionNumber.isSet()) { + if (s.premiumSubscriptionNumber.isSet()) { w.writeFieldBegin(QStringLiteral("premiumSubscriptionNumber"), ThriftFieldType::T_STRING, 16); w.writeString(s.premiumSubscriptionNumber.ref()); w.writeFieldEnd(); } - if(s.lastRequestedCharge.isSet()) { + if (s.lastRequestedCharge.isSet()) { w.writeFieldBegin(QStringLiteral("lastRequestedCharge"), ThriftFieldType::T_I64, 17); w.writeI64(s.lastRequestedCharge.ref()); w.writeFieldEnd(); } - if(s.currency.isSet()) { + if (s.currency.isSet()) { w.writeFieldBegin(QStringLiteral("currency"), ThriftFieldType::T_STRING, 18); w.writeString(s.currency.ref()); w.writeFieldEnd(); } - if(s.unitPrice.isSet()) { + if (s.unitPrice.isSet()) { w.writeFieldBegin(QStringLiteral("unitPrice"), ThriftFieldType::T_I32, 19); w.writeI32(s.unitPrice.ref()); w.writeFieldEnd(); } - if(s.businessId.isSet()) { + if (s.businessId.isSet()) { w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 20); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } - if(s.businessName.isSet()) { + if (s.businessName.isSet()) { w.writeFieldBegin(QStringLiteral("businessName"), ThriftFieldType::T_STRING, 21); w.writeString(s.businessName.ref()); w.writeFieldEnd(); } - if(s.businessRole.isSet()) { + if (s.businessRole.isSet()) { w.writeFieldBegin(QStringLiteral("businessRole"), ThriftFieldType::T_I32, 22); w.writeI32(static_cast(s.businessRole.ref())); w.writeFieldEnd(); } - if(s.unitDiscount.isSet()) { + if (s.unitDiscount.isSet()) { w.writeFieldBegin(QStringLiteral("unitDiscount"), ThriftFieldType::T_I32, 23); w.writeI32(s.unitDiscount.ref()); w.writeFieldEnd(); } - if(s.nextChargeDate.isSet()) { + if (s.nextChargeDate.isSet()) { w.writeFieldBegin(QStringLiteral("nextChargeDate"), ThriftFieldType::T_I64, 24); w.writeI64(s.nextChargeDate.ref()); w.writeFieldEnd(); } - if(s.availablePoints.isSet()) { + if (s.availablePoints.isSet()) { w.writeFieldBegin(QStringLiteral("availablePoints"), ThriftFieldType::T_I32, 25); w.writeI32(s.availablePoints.ref()); w.writeFieldEnd(); @@ -5385,7 +5387,7 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { - PremiumOrderStatus::type v; + PremiumOrderStatus v; readEnumPremiumOrderStatus(r, v); s.premiumServiceStatus = v; } else { @@ -5538,7 +5540,7 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_I32) { - BusinessUserRole::type v; + BusinessUserRole v; readEnumBusinessUserRole(r, v); s.businessRole = v; } else { @@ -5582,27 +5584,27 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo & s) { w.writeStructBegin(QStringLiteral("BusinessUserInfo")); - if(s.businessId.isSet()) { + if (s.businessId.isSet()) { w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } - if(s.businessName.isSet()) { + if (s.businessName.isSet()) { w.writeFieldBegin(QStringLiteral("businessName"), ThriftFieldType::T_STRING, 2); w.writeString(s.businessName.ref()); w.writeFieldEnd(); } - if(s.role.isSet()) { + if (s.role.isSet()) { w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } - if(s.email.isSet()) { + if (s.email.isSet()) { w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 4); w.writeString(s.email.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 5); w.writeI64(s.updated.ref()); w.writeFieldEnd(); @@ -5640,7 +5642,7 @@ void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - BusinessUserRole::type v; + BusinessUserRole v; readEnumBusinessUserRole(r, v); s.role = v; } else { @@ -5675,57 +5677,57 @@ void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s) { w.writeStructBegin(QStringLiteral("AccountLimits")); - if(s.userMailLimitDaily.isSet()) { + if (s.userMailLimitDaily.isSet()) { w.writeFieldBegin(QStringLiteral("userMailLimitDaily"), ThriftFieldType::T_I32, 1); w.writeI32(s.userMailLimitDaily.ref()); w.writeFieldEnd(); } - if(s.noteSizeMax.isSet()) { + if (s.noteSizeMax.isSet()) { w.writeFieldBegin(QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 2); w.writeI64(s.noteSizeMax.ref()); w.writeFieldEnd(); } - if(s.resourceSizeMax.isSet()) { + if (s.resourceSizeMax.isSet()) { w.writeFieldBegin(QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); w.writeI64(s.resourceSizeMax.ref()); w.writeFieldEnd(); } - if(s.userLinkedNotebookMax.isSet()) { + if (s.userLinkedNotebookMax.isSet()) { w.writeFieldBegin(QStringLiteral("userLinkedNotebookMax"), ThriftFieldType::T_I32, 4); w.writeI32(s.userLinkedNotebookMax.ref()); w.writeFieldEnd(); } - if(s.uploadLimit.isSet()) { + if (s.uploadLimit.isSet()) { w.writeFieldBegin(QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 5); w.writeI64(s.uploadLimit.ref()); w.writeFieldEnd(); } - if(s.userNoteCountMax.isSet()) { + if (s.userNoteCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("userNoteCountMax"), ThriftFieldType::T_I32, 6); w.writeI32(s.userNoteCountMax.ref()); w.writeFieldEnd(); } - if(s.userNotebookCountMax.isSet()) { + if (s.userNotebookCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("userNotebookCountMax"), ThriftFieldType::T_I32, 7); w.writeI32(s.userNotebookCountMax.ref()); w.writeFieldEnd(); } - if(s.userTagCountMax.isSet()) { + if (s.userTagCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("userTagCountMax"), ThriftFieldType::T_I32, 8); w.writeI32(s.userTagCountMax.ref()); w.writeFieldEnd(); } - if(s.noteTagCountMax.isSet()) { + if (s.noteTagCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("noteTagCountMax"), ThriftFieldType::T_I32, 9); w.writeI32(s.noteTagCountMax.ref()); w.writeFieldEnd(); } - if(s.userSavedSearchesMax.isSet()) { + if (s.userSavedSearchesMax.isSet()) { w.writeFieldBegin(QStringLiteral("userSavedSearchesMax"), ThriftFieldType::T_I32, 10); w.writeI32(s.userSavedSearchesMax.ref()); w.writeFieldEnd(); } - if(s.noteResourceCountMax.isSet()) { + if (s.noteResourceCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 11); w.writeI32(s.noteResourceCountMax.ref()); w.writeFieldEnd(); @@ -5852,92 +5854,92 @@ void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s) { void writeUser(ThriftBinaryBufferWriter & w, const User & s) { w.writeStructBegin(QStringLiteral("User")); - if(s.id.isSet()) { + if (s.id.isSet()) { w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I32, 1); w.writeI32(s.id.ref()); w.writeFieldEnd(); } - if(s.username.isSet()) { + if (s.username.isSet()) { w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 2); w.writeString(s.username.ref()); w.writeFieldEnd(); } - if(s.email.isSet()) { + if (s.email.isSet()) { w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 3); w.writeString(s.email.ref()); w.writeFieldEnd(); } - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 4); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.timezone.isSet()) { + if (s.timezone.isSet()) { w.writeFieldBegin(QStringLiteral("timezone"), ThriftFieldType::T_STRING, 6); w.writeString(s.timezone.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 7); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.serviceLevel.isSet()) { + if (s.serviceLevel.isSet()) { w.writeFieldBegin(QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 21); w.writeI32(static_cast(s.serviceLevel.ref())); w.writeFieldEnd(); } - if(s.created.isSet()) { + if (s.created.isSet()) { w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 9); w.writeI64(s.created.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 10); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } - if(s.deleted.isSet()) { + if (s.deleted.isSet()) { w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 11); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } - if(s.active.isSet()) { + if (s.active.isSet()) { w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 13); w.writeBool(s.active.ref()); w.writeFieldEnd(); } - if(s.shardId.isSet()) { + if (s.shardId.isSet()) { w.writeFieldBegin(QStringLiteral("shardId"), ThriftFieldType::T_STRING, 14); w.writeString(s.shardId.ref()); w.writeFieldEnd(); } - if(s.attributes.isSet()) { + if (s.attributes.isSet()) { w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 15); writeUserAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } - if(s.accounting.isSet()) { + if (s.accounting.isSet()) { w.writeFieldBegin(QStringLiteral("accounting"), ThriftFieldType::T_STRUCT, 16); writeAccounting(w, s.accounting.ref()); w.writeFieldEnd(); } - if(s.businessUserInfo.isSet()) { + if (s.businessUserInfo.isSet()) { w.writeFieldBegin(QStringLiteral("businessUserInfo"), ThriftFieldType::T_STRUCT, 18); writeBusinessUserInfo(w, s.businessUserInfo.ref()); w.writeFieldEnd(); } - if(s.photoUrl.isSet()) { + if (s.photoUrl.isSet()) { w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 19); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } - if(s.photoLastUpdated.isSet()) { + if (s.photoLastUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 20); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } - if(s.accountLimits.isSet()) { + if (s.accountLimits.isSet()) { w.writeFieldBegin(QStringLiteral("accountLimits"), ThriftFieldType::T_STRUCT, 22); writeAccountLimits(w, s.accountLimits.ref()); w.writeFieldEnd(); @@ -6002,7 +6004,7 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { - PrivilegeLevel::type v; + PrivilegeLevel v; readEnumPrivilegeLevel(r, v); s.privilege = v; } else { @@ -6011,7 +6013,7 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_I32) { - ServiceLevel::type v; + ServiceLevel v; readEnumServiceLevel(r, v); s.serviceLevel = v; } else { @@ -6127,37 +6129,37 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { void writeContact(ThriftBinaryBufferWriter & w, const Contact & s) { w.writeStructBegin(QStringLiteral("Contact")); - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 1); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.id.isSet()) { + if (s.id.isSet()) { w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_STRING, 2); w.writeString(s.id.ref()); w.writeFieldEnd(); } - if(s.type.isSet()) { + if (s.type.isSet()) { w.writeFieldBegin(QStringLiteral("type"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.type.ref())); w.writeFieldEnd(); } - if(s.photoUrl.isSet()) { + if (s.photoUrl.isSet()) { w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 4); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } - if(s.photoLastUpdated.isSet()) { + if (s.photoLastUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 5); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } - if(s.messagingPermit.isSet()) { + if (s.messagingPermit.isSet()) { w.writeFieldBegin(QStringLiteral("messagingPermit"), ThriftFieldType::T_STRING, 6); w.writeBinary(s.messagingPermit.ref()); w.writeFieldEnd(); } - if(s.messagingPermitExpires.isSet()) { + if (s.messagingPermitExpires.isSet()) { w.writeFieldBegin(QStringLiteral("messagingPermitExpires"), ThriftFieldType::T_I64, 7); w.writeI64(s.messagingPermitExpires.ref()); w.writeFieldEnd(); @@ -6195,7 +6197,7 @@ void readContact(ThriftBinaryBufferReader & r, Contact & s) { } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - ContactType::type v; + ContactType v; readEnumContactType(r, v); s.type = v; } else { @@ -6251,37 +6253,37 @@ void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s) { w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I64, 1); w.writeI64(s.id); w.writeFieldEnd(); - if(s.contact.isSet()) { + if (s.contact.isSet()) { w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 2); writeContact(w, s.contact.ref()); w.writeFieldEnd(); } - if(s.userId.isSet()) { + if (s.userId.isSet()) { w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 3); w.writeI32(s.userId.ref()); w.writeFieldEnd(); } - if(s.deactivated.isSet()) { + if (s.deactivated.isSet()) { w.writeFieldBegin(QStringLiteral("deactivated"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.deactivated.ref()); w.writeFieldEnd(); } - if(s.sameBusiness.isSet()) { + if (s.sameBusiness.isSet()) { w.writeFieldBegin(QStringLiteral("sameBusiness"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.sameBusiness.ref()); w.writeFieldEnd(); } - if(s.blocked.isSet()) { + if (s.blocked.isSet()) { w.writeFieldBegin(QStringLiteral("blocked"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.blocked.ref()); w.writeFieldEnd(); } - if(s.userConnected.isSet()) { + if (s.userConnected.isSet()) { w.writeFieldBegin(QStringLiteral("userConnected"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.userConnected.ref()); w.writeFieldEnd(); } - if(s.eventId.isSet()) { + if (s.eventId.isSet()) { w.writeFieldBegin(QStringLiteral("eventId"), ThriftFieldType::T_I64, 8); w.writeI64(s.eventId.ref()); w.writeFieldEnd(); @@ -6384,22 +6386,22 @@ void readIdentity(ThriftBinaryBufferReader & r, Identity & s) { void writeTag(ThriftBinaryBufferWriter & w, const Tag & s) { w.writeStructBegin(QStringLiteral("Tag")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.parentGuid.isSet()) { + if (s.parentGuid.isSet()) { w.writeFieldBegin(QStringLiteral("parentGuid"), ThriftFieldType::T_STRING, 3); w.writeString(s.parentGuid.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 4); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); @@ -6463,19 +6465,19 @@ void readTag(ThriftBinaryBufferReader & r, Tag & s) { void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeStructBegin(QStringLiteral("LazyMap")); - if(s.keysOnly.isSet()) { + if (s.keysOnly.isSet()) { w.writeFieldBegin(QStringLiteral("keysOnly"), ThriftFieldType::T_SET, 1); w.writeSetBegin(ThriftFieldType::T_STRING, s.keysOnly.ref().count()); - for(QSet< QString >::const_iterator it = s.keysOnly.ref().constBegin(), end = s.keysOnly.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.keysOnly.ref())) { + w.writeString(value); } w.writeSetEnd(); w.writeFieldEnd(); } - if(s.fullMap.isSet()) { + if (s.fullMap.isSet()) { w.writeFieldBegin(QStringLiteral("fullMap"), ThriftFieldType::T_MAP, 2); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.fullMap.ref().size()); - for(QMap< QString, QString >::const_iterator it = s.fullMap.ref().constBegin(), end = s.fullMap.ref().constEnd(); it != end; ++it) { + for(const auto & it: toRange(s.fullMap.ref())) { w.writeString(it.key()); w.writeString(it.value()); } @@ -6546,62 +6548,62 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttributes & s) { w.writeStructBegin(QStringLiteral("ResourceAttributes")); - if(s.sourceURL.isSet()) { + if (s.sourceURL.isSet()) { w.writeFieldBegin(QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 1); w.writeString(s.sourceURL.ref()); w.writeFieldEnd(); } - if(s.timestamp.isSet()) { + if (s.timestamp.isSet()) { w.writeFieldBegin(QStringLiteral("timestamp"), ThriftFieldType::T_I64, 2); w.writeI64(s.timestamp.ref()); w.writeFieldEnd(); } - if(s.latitude.isSet()) { + if (s.latitude.isSet()) { w.writeFieldBegin(QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 3); w.writeDouble(s.latitude.ref()); w.writeFieldEnd(); } - if(s.longitude.isSet()) { + if (s.longitude.isSet()) { w.writeFieldBegin(QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 4); w.writeDouble(s.longitude.ref()); w.writeFieldEnd(); } - if(s.altitude.isSet()) { + if (s.altitude.isSet()) { w.writeFieldBegin(QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 5); w.writeDouble(s.altitude.ref()); w.writeFieldEnd(); } - if(s.cameraMake.isSet()) { + if (s.cameraMake.isSet()) { w.writeFieldBegin(QStringLiteral("cameraMake"), ThriftFieldType::T_STRING, 6); w.writeString(s.cameraMake.ref()); w.writeFieldEnd(); } - if(s.cameraModel.isSet()) { + if (s.cameraModel.isSet()) { w.writeFieldBegin(QStringLiteral("cameraModel"), ThriftFieldType::T_STRING, 7); w.writeString(s.cameraModel.ref()); w.writeFieldEnd(); } - if(s.clientWillIndex.isSet()) { + if (s.clientWillIndex.isSet()) { w.writeFieldBegin(QStringLiteral("clientWillIndex"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.clientWillIndex.ref()); w.writeFieldEnd(); } - if(s.recoType.isSet()) { + if (s.recoType.isSet()) { w.writeFieldBegin(QStringLiteral("recoType"), ThriftFieldType::T_STRING, 9); w.writeString(s.recoType.ref()); w.writeFieldEnd(); } - if(s.fileName.isSet()) { + if (s.fileName.isSet()) { w.writeFieldBegin(QStringLiteral("fileName"), ThriftFieldType::T_STRING, 10); w.writeString(s.fileName.ref()); w.writeFieldEnd(); } - if(s.attachment.isSet()) { + if (s.attachment.isSet()) { w.writeFieldBegin(QStringLiteral("attachment"), ThriftFieldType::T_BOOL, 11); w.writeBool(s.attachment.ref()); w.writeFieldEnd(); } - if(s.applicationData.isSet()) { + if (s.applicationData.isSet()) { w.writeFieldBegin(QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 12); writeLazyMap(w, s.applicationData.ref()); w.writeFieldEnd(); @@ -6737,62 +6739,62 @@ void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s void writeResource(ThriftBinaryBufferWriter & w, const Resource & s) { w.writeStructBegin(QStringLiteral("Resource")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.noteGuid.isSet()) { + if (s.noteGuid.isSet()) { w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } - if(s.data.isSet()) { + if (s.data.isSet()) { w.writeFieldBegin(QStringLiteral("data"), ThriftFieldType::T_STRUCT, 3); writeData(w, s.data.ref()); w.writeFieldEnd(); } - if(s.mime.isSet()) { + if (s.mime.isSet()) { w.writeFieldBegin(QStringLiteral("mime"), ThriftFieldType::T_STRING, 4); w.writeString(s.mime.ref()); w.writeFieldEnd(); } - if(s.width.isSet()) { + if (s.width.isSet()) { w.writeFieldBegin(QStringLiteral("width"), ThriftFieldType::T_I16, 5); w.writeI16(s.width.ref()); w.writeFieldEnd(); } - if(s.height.isSet()) { + if (s.height.isSet()) { w.writeFieldBegin(QStringLiteral("height"), ThriftFieldType::T_I16, 6); w.writeI16(s.height.ref()); w.writeFieldEnd(); } - if(s.duration.isSet()) { + if (s.duration.isSet()) { w.writeFieldBegin(QStringLiteral("duration"), ThriftFieldType::T_I16, 7); w.writeI16(s.duration.ref()); w.writeFieldEnd(); } - if(s.active.isSet()) { + if (s.active.isSet()) { w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.active.ref()); w.writeFieldEnd(); } - if(s.recognition.isSet()) { + if (s.recognition.isSet()) { w.writeFieldBegin(QStringLiteral("recognition"), ThriftFieldType::T_STRUCT, 9); writeData(w, s.recognition.ref()); w.writeFieldEnd(); } - if(s.attributes.isSet()) { + if (s.attributes.isSet()) { w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 11); writeResourceAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 12); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.alternateData.isSet()) { + if (s.alternateData.isSet()) { w.writeFieldBegin(QStringLiteral("alternateData"), ThriftFieldType::T_STRUCT, 13); writeData(w, s.alternateData.ref()); w.writeFieldEnd(); @@ -6928,117 +6930,117 @@ void readResource(ThriftBinaryBufferReader & r, Resource & s) { void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) { w.writeStructBegin(QStringLiteral("NoteAttributes")); - if(s.subjectDate.isSet()) { + if (s.subjectDate.isSet()) { w.writeFieldBegin(QStringLiteral("subjectDate"), ThriftFieldType::T_I64, 1); w.writeI64(s.subjectDate.ref()); w.writeFieldEnd(); } - if(s.latitude.isSet()) { + if (s.latitude.isSet()) { w.writeFieldBegin(QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 10); w.writeDouble(s.latitude.ref()); w.writeFieldEnd(); } - if(s.longitude.isSet()) { + if (s.longitude.isSet()) { w.writeFieldBegin(QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 11); w.writeDouble(s.longitude.ref()); w.writeFieldEnd(); } - if(s.altitude.isSet()) { + if (s.altitude.isSet()) { w.writeFieldBegin(QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 12); w.writeDouble(s.altitude.ref()); w.writeFieldEnd(); } - if(s.author.isSet()) { + if (s.author.isSet()) { w.writeFieldBegin(QStringLiteral("author"), ThriftFieldType::T_STRING, 13); w.writeString(s.author.ref()); w.writeFieldEnd(); } - if(s.source.isSet()) { + if (s.source.isSet()) { w.writeFieldBegin(QStringLiteral("source"), ThriftFieldType::T_STRING, 14); w.writeString(s.source.ref()); w.writeFieldEnd(); } - if(s.sourceURL.isSet()) { + if (s.sourceURL.isSet()) { w.writeFieldBegin(QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 15); w.writeString(s.sourceURL.ref()); w.writeFieldEnd(); } - if(s.sourceApplication.isSet()) { + if (s.sourceApplication.isSet()) { w.writeFieldBegin(QStringLiteral("sourceApplication"), ThriftFieldType::T_STRING, 16); w.writeString(s.sourceApplication.ref()); w.writeFieldEnd(); } - if(s.shareDate.isSet()) { + if (s.shareDate.isSet()) { w.writeFieldBegin(QStringLiteral("shareDate"), ThriftFieldType::T_I64, 17); w.writeI64(s.shareDate.ref()); w.writeFieldEnd(); } - if(s.reminderOrder.isSet()) { + if (s.reminderOrder.isSet()) { w.writeFieldBegin(QStringLiteral("reminderOrder"), ThriftFieldType::T_I64, 18); w.writeI64(s.reminderOrder.ref()); w.writeFieldEnd(); } - if(s.reminderDoneTime.isSet()) { + if (s.reminderDoneTime.isSet()) { w.writeFieldBegin(QStringLiteral("reminderDoneTime"), ThriftFieldType::T_I64, 19); w.writeI64(s.reminderDoneTime.ref()); w.writeFieldEnd(); } - if(s.reminderTime.isSet()) { + if (s.reminderTime.isSet()) { w.writeFieldBegin(QStringLiteral("reminderTime"), ThriftFieldType::T_I64, 20); w.writeI64(s.reminderTime.ref()); w.writeFieldEnd(); } - if(s.placeName.isSet()) { + if (s.placeName.isSet()) { w.writeFieldBegin(QStringLiteral("placeName"), ThriftFieldType::T_STRING, 21); w.writeString(s.placeName.ref()); w.writeFieldEnd(); } - if(s.contentClass.isSet()) { + if (s.contentClass.isSet()) { w.writeFieldBegin(QStringLiteral("contentClass"), ThriftFieldType::T_STRING, 22); w.writeString(s.contentClass.ref()); w.writeFieldEnd(); } - if(s.applicationData.isSet()) { + if (s.applicationData.isSet()) { w.writeFieldBegin(QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 23); writeLazyMap(w, s.applicationData.ref()); w.writeFieldEnd(); } - if(s.lastEditedBy.isSet()) { + if (s.lastEditedBy.isSet()) { w.writeFieldBegin(QStringLiteral("lastEditedBy"), ThriftFieldType::T_STRING, 24); w.writeString(s.lastEditedBy.ref()); w.writeFieldEnd(); } - if(s.classifications.isSet()) { + if (s.classifications.isSet()) { w.writeFieldBegin(QStringLiteral("classifications"), ThriftFieldType::T_MAP, 26); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.classifications.ref().size()); - for(QMap< QString, QString >::const_iterator it = s.classifications.ref().constBegin(), end = s.classifications.ref().constEnd(); it != end; ++it) { + for(const auto & it: toRange(s.classifications.ref())) { w.writeString(it.key()); w.writeString(it.value()); } w.writeMapEnd(); w.writeFieldEnd(); } - if(s.creatorId.isSet()) { + if (s.creatorId.isSet()) { w.writeFieldBegin(QStringLiteral("creatorId"), ThriftFieldType::T_I32, 27); w.writeI32(s.creatorId.ref()); w.writeFieldEnd(); } - if(s.lastEditorId.isSet()) { + if (s.lastEditorId.isSet()) { w.writeFieldBegin(QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 28); w.writeI32(s.lastEditorId.ref()); w.writeFieldEnd(); } - if(s.sharedWithBusiness.isSet()) { + if (s.sharedWithBusiness.isSet()) { w.writeFieldBegin(QStringLiteral("sharedWithBusiness"), ThriftFieldType::T_BOOL, 29); w.writeBool(s.sharedWithBusiness.ref()); w.writeFieldEnd(); } - if(s.conflictSourceNoteGuid.isSet()) { + if (s.conflictSourceNoteGuid.isSet()) { w.writeFieldBegin(QStringLiteral("conflictSourceNoteGuid"), ThriftFieldType::T_STRING, 30); w.writeString(s.conflictSourceNoteGuid.ref()); w.writeFieldEnd(); } - if(s.noteTitleQuality.isSet()) { + if (s.noteTitleQuality.isSet()) { w.writeFieldBegin(QStringLiteral("noteTitleQuality"), ThriftFieldType::T_I32, 31); w.writeI32(s.noteTitleQuality.ref()); w.writeFieldEnd(); @@ -7277,32 +7279,32 @@ void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s) { w.writeStructBegin(QStringLiteral("SharedNote")); - if(s.sharerUserID.isSet()) { + if (s.sharerUserID.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserID"), ThriftFieldType::T_I32, 1); w.writeI32(s.sharerUserID.ref()); w.writeFieldEnd(); } - if(s.recipientIdentity.isSet()) { + if (s.recipientIdentity.isSet()) { w.writeFieldBegin(QStringLiteral("recipientIdentity"), ThriftFieldType::T_STRUCT, 2); writeIdentity(w, s.recipientIdentity.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.serviceCreated.isSet()) { + if (s.serviceCreated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 4); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } - if(s.serviceUpdated.isSet()) { + if (s.serviceUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 5); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } - if(s.serviceAssigned.isSet()) { + if (s.serviceAssigned.isSet()) { w.writeFieldBegin(QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 6); w.writeI64(s.serviceAssigned.ref()); w.writeFieldEnd(); @@ -7340,7 +7342,7 @@ void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotePrivilegeLevel::type v; + SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(r, v); s.privilege = v; } else { @@ -7384,27 +7386,27 @@ void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteRestrictions")); - if(s.noUpdateTitle.isSet()) { + if (s.noUpdateTitle.isSet()) { w.writeFieldBegin(QStringLiteral("noUpdateTitle"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.noUpdateTitle.ref()); w.writeFieldEnd(); } - if(s.noUpdateContent.isSet()) { + if (s.noUpdateContent.isSet()) { w.writeFieldBegin(QStringLiteral("noUpdateContent"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.noUpdateContent.ref()); w.writeFieldEnd(); } - if(s.noEmail.isSet()) { + if (s.noEmail.isSet()) { w.writeFieldBegin(QStringLiteral("noEmail"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.noEmail.ref()); w.writeFieldEnd(); } - if(s.noShare.isSet()) { + if (s.noShare.isSet()) { w.writeFieldBegin(QStringLiteral("noShare"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.noShare.ref()); w.writeFieldEnd(); } - if(s.noSharePublicly.isSet()) { + if (s.noSharePublicly.isSet()) { w.writeFieldBegin(QStringLiteral("noSharePublicly"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.noSharePublicly.ref()); w.writeFieldEnd(); @@ -7477,27 +7479,27 @@ void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s) { void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s) { w.writeStructBegin(QStringLiteral("NoteLimits")); - if(s.noteResourceCountMax.isSet()) { + if (s.noteResourceCountMax.isSet()) { w.writeFieldBegin(QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 1); w.writeI32(s.noteResourceCountMax.ref()); w.writeFieldEnd(); } - if(s.uploadLimit.isSet()) { + if (s.uploadLimit.isSet()) { w.writeFieldBegin(QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 2); w.writeI64(s.uploadLimit.ref()); w.writeFieldEnd(); } - if(s.resourceSizeMax.isSet()) { + if (s.resourceSizeMax.isSet()) { w.writeFieldBegin(QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); w.writeI64(s.resourceSizeMax.ref()); w.writeFieldEnd(); } - if(s.noteSizeMax.isSet()) { + if (s.noteSizeMax.isSet()) { w.writeFieldBegin(QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 4); w.writeI64(s.noteSizeMax.ref()); w.writeFieldEnd(); } - if(s.uploaded.isSet()) { + if (s.uploaded.isSet()) { w.writeFieldBegin(QStringLiteral("uploaded"), ThriftFieldType::T_I64, 5); w.writeI64(s.uploaded.ref()); w.writeFieldEnd(); @@ -7570,108 +7572,108 @@ void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s) { void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeStructBegin(QStringLiteral("Note")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.title.isSet()) { + if (s.title.isSet()) { w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } - if(s.content.isSet()) { + if (s.content.isSet()) { w.writeFieldBegin(QStringLiteral("content"), ThriftFieldType::T_STRING, 3); w.writeString(s.content.ref()); w.writeFieldEnd(); } - if(s.contentHash.isSet()) { + if (s.contentHash.isSet()) { w.writeFieldBegin(QStringLiteral("contentHash"), ThriftFieldType::T_STRING, 4); w.writeBinary(s.contentHash.ref()); w.writeFieldEnd(); } - if(s.contentLength.isSet()) { + if (s.contentLength.isSet()) { w.writeFieldBegin(QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); w.writeI32(s.contentLength.ref()); w.writeFieldEnd(); } - if(s.created.isSet()) { + if (s.created.isSet()) { w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 6); w.writeI64(s.created.ref()); w.writeFieldEnd(); } - if(s.updated.isSet()) { + if (s.updated.isSet()) { w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 7); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } - if(s.deleted.isSet()) { + if (s.deleted.isSet()) { w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } - if(s.active.isSet()) { + if (s.active.isSet()) { w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 9); w.writeBool(s.active.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.tagGuids.isSet()) { + if (s.tagGuids.isSet()) { w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); - for(QList< Guid >::const_iterator it = s.tagGuids.ref().constBegin(), end = s.tagGuids.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.tagGuids.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.resources.isSet()) { + if (s.resources.isSet()) { w.writeFieldBegin(QStringLiteral("resources"), ThriftFieldType::T_LIST, 13); w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); - for(QList< Resource >::const_iterator it = s.resources.ref().constBegin(), end = s.resources.ref().constEnd(); it != end; ++it) { - writeResource(w, *it); + for(const auto & value: qAsConst(s.resources.ref())) { + writeResource(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.attributes.isSet()) { + if (s.attributes.isSet()) { w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); writeNoteAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } - if(s.tagNames.isSet()) { + if (s.tagNames.isSet()) { w.writeFieldBegin(QStringLiteral("tagNames"), ThriftFieldType::T_LIST, 15); w.writeListBegin(ThriftFieldType::T_STRING, s.tagNames.ref().length()); - for(QStringList::const_iterator it = s.tagNames.ref().constBegin(), end = s.tagNames.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.tagNames.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.sharedNotes.isSet()) { + if (s.sharedNotes.isSet()) { w.writeFieldBegin(QStringLiteral("sharedNotes"), ThriftFieldType::T_LIST, 16); w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotes.ref().length()); - for(QList< SharedNote >::const_iterator it = s.sharedNotes.ref().constBegin(), end = s.sharedNotes.ref().constEnd(); it != end; ++it) { - writeSharedNote(w, *it); + for(const auto & value: qAsConst(s.sharedNotes.ref())) { + writeSharedNote(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.restrictions.isSet()) { + if (s.restrictions.isSet()) { w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); writeNoteRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } - if(s.limits.isSet()) { + if (s.limits.isSet()) { w.writeFieldBegin(QStringLiteral("limits"), ThriftFieldType::T_STRUCT, 18); writeNoteLimits(w, s.limits.ref()); w.writeFieldEnd(); @@ -7901,22 +7903,22 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s) { w.writeStructBegin(QStringLiteral("Publishing")); - if(s.uri.isSet()) { + if (s.uri.isSet()) { w.writeFieldBegin(QStringLiteral("uri"), ThriftFieldType::T_STRING, 1); w.writeString(s.uri.ref()); w.writeFieldEnd(); } - if(s.order.isSet()) { + if (s.order.isSet()) { w.writeFieldBegin(QStringLiteral("order"), ThriftFieldType::T_I32, 2); w.writeI32(static_cast(s.order.ref())); w.writeFieldEnd(); } - if(s.ascending.isSet()) { + if (s.ascending.isSet()) { w.writeFieldBegin(QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.ascending.ref()); w.writeFieldEnd(); } - if(s.publicDescription.isSet()) { + if (s.publicDescription.isSet()) { w.writeFieldBegin(QStringLiteral("publicDescription"), ThriftFieldType::T_STRING, 4); w.writeString(s.publicDescription.ref()); w.writeFieldEnd(); @@ -7945,7 +7947,7 @@ void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { - NoteSortOrder::type v; + NoteSortOrder v; readEnumNoteSortOrder(r, v); s.order = v; } else { @@ -7980,17 +7982,17 @@ void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook & s) { w.writeStructBegin(QStringLiteral("BusinessNotebook")); - if(s.notebookDescription.isSet()) { + if (s.notebookDescription.isSet()) { w.writeFieldBegin(QStringLiteral("notebookDescription"), ThriftFieldType::T_STRING, 1); w.writeString(s.notebookDescription.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 2); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.recommended.isSet()) { + if (s.recommended.isSet()) { w.writeFieldBegin(QStringLiteral("recommended"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.recommended.ref()); w.writeFieldEnd(); @@ -8019,7 +8021,7 @@ void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotebookPrivilegeLevel::type v; + SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(r, v); s.privilege = v; } else { @@ -8045,17 +8047,17 @@ void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope & s) { w.writeStructBegin(QStringLiteral("SavedSearchScope")); - if(s.includeAccount.isSet()) { + if (s.includeAccount.isSet()) { w.writeFieldBegin(QStringLiteral("includeAccount"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.includeAccount.ref()); w.writeFieldEnd(); } - if(s.includePersonalLinkedNotebooks.isSet()) { + if (s.includePersonalLinkedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includePersonalLinkedNotebooks"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.includePersonalLinkedNotebooks.ref()); w.writeFieldEnd(); } - if(s.includeBusinessLinkedNotebooks.isSet()) { + if (s.includeBusinessLinkedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("includeBusinessLinkedNotebooks"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.includeBusinessLinkedNotebooks.ref()); w.writeFieldEnd(); @@ -8110,32 +8112,32 @@ void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s) { void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s) { w.writeStructBegin(QStringLiteral("SavedSearch")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.query.isSet()) { + if (s.query.isSet()) { w.writeFieldBegin(QStringLiteral("query"), ThriftFieldType::T_STRING, 3); w.writeString(s.query.ref()); w.writeFieldEnd(); } - if(s.format.isSet()) { + if (s.format.isSet()) { w.writeFieldBegin(QStringLiteral("format"), ThriftFieldType::T_I32, 4); w.writeI32(static_cast(s.format.ref())); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.scope.isSet()) { + if (s.scope.isSet()) { w.writeFieldBegin(QStringLiteral("scope"), ThriftFieldType::T_STRUCT, 6); writeSavedSearchScope(w, s.scope.ref()); w.writeFieldEnd(); @@ -8182,7 +8184,7 @@ void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { - QueryFormat::type v; + QueryFormat v; readEnumQueryFormat(r, v); s.format = v; } else { @@ -8217,12 +8219,12 @@ void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const SharedNotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); - if(s.reminderNotifyEmail.isSet()) { + if (s.reminderNotifyEmail.isSet()) { w.writeFieldBegin(QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.reminderNotifyEmail.ref()); w.writeFieldEnd(); } - if(s.reminderNotifyInApp.isSet()) { + if (s.reminderNotifyInApp.isSet()) { w.writeFieldBegin(QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.reminderNotifyInApp.ref()); w.writeFieldEnd(); @@ -8268,27 +8270,27 @@ void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNot void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const NotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); - if(s.reminderNotifyEmail.isSet()) { + if (s.reminderNotifyEmail.isSet()) { w.writeFieldBegin(QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.reminderNotifyEmail.ref()); w.writeFieldEnd(); } - if(s.reminderNotifyInApp.isSet()) { + if (s.reminderNotifyInApp.isSet()) { w.writeFieldBegin(QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.reminderNotifyInApp.ref()); w.writeFieldEnd(); } - if(s.inMyList.isSet()) { + if (s.inMyList.isSet()) { w.writeFieldBegin(QStringLiteral("inMyList"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.inMyList.ref()); w.writeFieldEnd(); } - if(s.stack.isSet()) { + if (s.stack.isSet()) { w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 4); w.writeString(s.stack.ref()); w.writeFieldEnd(); } - if(s.recipientStatus.isSet()) { + if (s.recipientStatus.isSet()) { w.writeFieldBegin(QStringLiteral("recipientStatus"), ThriftFieldType::T_I32, 5); w.writeI32(static_cast(s.recipientStatus.ref())); w.writeFieldEnd(); @@ -8344,7 +8346,7 @@ void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipie } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { - RecipientStatus::type v; + RecipientStatus v; readEnumRecipientStatus(r, v); s.recipientStatus = v; } else { @@ -8361,82 +8363,82 @@ void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipie void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s) { w.writeStructBegin(QStringLiteral("SharedNotebook")); - if(s.id.isSet()) { + if (s.id.isSet()) { w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I64, 1); w.writeI64(s.id.ref()); w.writeFieldEnd(); } - if(s.userId.isSet()) { + if (s.userId.isSet()) { w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 2); w.writeI32(s.userId.ref()); w.writeFieldEnd(); } - if(s.notebookGuid.isSet()) { + if (s.notebookGuid.isSet()) { w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 3); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } - if(s.email.isSet()) { + if (s.email.isSet()) { w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 4); w.writeString(s.email.ref()); w.writeFieldEnd(); } - if(s.recipientIdentityId.isSet()) { + if (s.recipientIdentityId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 18); w.writeI64(s.recipientIdentityId.ref()); w.writeFieldEnd(); } - if(s.notebookModifiable.isSet()) { + if (s.notebookModifiable.isSet()) { w.writeFieldBegin(QStringLiteral("notebookModifiable"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.notebookModifiable.ref()); w.writeFieldEnd(); } - if(s.serviceCreated.isSet()) { + if (s.serviceCreated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } - if(s.serviceUpdated.isSet()) { + if (s.serviceUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 10); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } - if(s.globalId.isSet()) { + if (s.globalId.isSet()) { w.writeFieldBegin(QStringLiteral("globalId"), ThriftFieldType::T_STRING, 8); w.writeString(s.globalId.ref()); w.writeFieldEnd(); } - if(s.username.isSet()) { + if (s.username.isSet()) { w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 9); w.writeString(s.username.ref()); w.writeFieldEnd(); } - if(s.privilege.isSet()) { + if (s.privilege.isSet()) { w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 11); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } - if(s.recipientSettings.isSet()) { + if (s.recipientSettings.isSet()) { w.writeFieldBegin(QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 13); writeSharedNotebookRecipientSettings(w, s.recipientSettings.ref()); w.writeFieldEnd(); } - if(s.sharerUserId.isSet()) { + if (s.sharerUserId.isSet()) { w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 14); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } - if(s.recipientUsername.isSet()) { + if (s.recipientUsername.isSet()) { w.writeFieldBegin(QStringLiteral("recipientUsername"), ThriftFieldType::T_STRING, 15); w.writeString(s.recipientUsername.ref()); w.writeFieldEnd(); } - if(s.recipientUserId.isSet()) { + if (s.recipientUserId.isSet()) { w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 17); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } - if(s.serviceAssigned.isSet()) { + if (s.serviceAssigned.isSet()) { w.writeFieldBegin(QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 16); w.writeI64(s.serviceAssigned.ref()); w.writeFieldEnd(); @@ -8546,7 +8548,7 @@ void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotebookPrivilegeLevel::type v; + SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(r, v); s.privilege = v; } else { @@ -8608,7 +8610,7 @@ void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const CanMoveToContainerRestrictions & s) { w.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); - if(s.canMoveToContainer.isSet()) { + if (s.canMoveToContainer.isSet()) { w.writeFieldBegin(QStringLiteral("canMoveToContainer"), ThriftFieldType::T_I32, 1); w.writeI32(static_cast(s.canMoveToContainer.ref())); w.writeFieldEnd(); @@ -8628,7 +8630,7 @@ void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToC if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { - CanMoveToContainerStatus::type v; + CanMoveToContainerStatus v; readEnumCanMoveToContainerStatus(r, v); s.canMoveToContainer = v; } else { @@ -8645,147 +8647,147 @@ void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToC void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestrictions & s) { w.writeStructBegin(QStringLiteral("NotebookRestrictions")); - if(s.noReadNotes.isSet()) { + if (s.noReadNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noReadNotes"), ThriftFieldType::T_BOOL, 1); w.writeBool(s.noReadNotes.ref()); w.writeFieldEnd(); } - if(s.noCreateNotes.isSet()) { + if (s.noCreateNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noCreateNotes"), ThriftFieldType::T_BOOL, 2); w.writeBool(s.noCreateNotes.ref()); w.writeFieldEnd(); } - if(s.noUpdateNotes.isSet()) { + if (s.noUpdateNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noUpdateNotes"), ThriftFieldType::T_BOOL, 3); w.writeBool(s.noUpdateNotes.ref()); w.writeFieldEnd(); } - if(s.noExpungeNotes.isSet()) { + if (s.noExpungeNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noExpungeNotes"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.noExpungeNotes.ref()); w.writeFieldEnd(); } - if(s.noShareNotes.isSet()) { + if (s.noShareNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noShareNotes"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.noShareNotes.ref()); w.writeFieldEnd(); } - if(s.noEmailNotes.isSet()) { + if (s.noEmailNotes.isSet()) { w.writeFieldBegin(QStringLiteral("noEmailNotes"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.noEmailNotes.ref()); w.writeFieldEnd(); } - if(s.noSendMessageToRecipients.isSet()) { + if (s.noSendMessageToRecipients.isSet()) { w.writeFieldBegin(QStringLiteral("noSendMessageToRecipients"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.noSendMessageToRecipients.ref()); w.writeFieldEnd(); } - if(s.noUpdateNotebook.isSet()) { + if (s.noUpdateNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("noUpdateNotebook"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.noUpdateNotebook.ref()); w.writeFieldEnd(); } - if(s.noExpungeNotebook.isSet()) { + if (s.noExpungeNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("noExpungeNotebook"), ThriftFieldType::T_BOOL, 9); w.writeBool(s.noExpungeNotebook.ref()); w.writeFieldEnd(); } - if(s.noSetDefaultNotebook.isSet()) { + if (s.noSetDefaultNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("noSetDefaultNotebook"), ThriftFieldType::T_BOOL, 10); w.writeBool(s.noSetDefaultNotebook.ref()); w.writeFieldEnd(); } - if(s.noSetNotebookStack.isSet()) { + if (s.noSetNotebookStack.isSet()) { w.writeFieldBegin(QStringLiteral("noSetNotebookStack"), ThriftFieldType::T_BOOL, 11); w.writeBool(s.noSetNotebookStack.ref()); w.writeFieldEnd(); } - if(s.noPublishToPublic.isSet()) { + if (s.noPublishToPublic.isSet()) { w.writeFieldBegin(QStringLiteral("noPublishToPublic"), ThriftFieldType::T_BOOL, 12); w.writeBool(s.noPublishToPublic.ref()); w.writeFieldEnd(); } - if(s.noPublishToBusinessLibrary.isSet()) { + if (s.noPublishToBusinessLibrary.isSet()) { w.writeFieldBegin(QStringLiteral("noPublishToBusinessLibrary"), ThriftFieldType::T_BOOL, 13); w.writeBool(s.noPublishToBusinessLibrary.ref()); w.writeFieldEnd(); } - if(s.noCreateTags.isSet()) { + if (s.noCreateTags.isSet()) { w.writeFieldBegin(QStringLiteral("noCreateTags"), ThriftFieldType::T_BOOL, 14); w.writeBool(s.noCreateTags.ref()); w.writeFieldEnd(); } - if(s.noUpdateTags.isSet()) { + if (s.noUpdateTags.isSet()) { w.writeFieldBegin(QStringLiteral("noUpdateTags"), ThriftFieldType::T_BOOL, 15); w.writeBool(s.noUpdateTags.ref()); w.writeFieldEnd(); } - if(s.noExpungeTags.isSet()) { + if (s.noExpungeTags.isSet()) { w.writeFieldBegin(QStringLiteral("noExpungeTags"), ThriftFieldType::T_BOOL, 16); w.writeBool(s.noExpungeTags.ref()); w.writeFieldEnd(); } - if(s.noSetParentTag.isSet()) { + if (s.noSetParentTag.isSet()) { w.writeFieldBegin(QStringLiteral("noSetParentTag"), ThriftFieldType::T_BOOL, 17); w.writeBool(s.noSetParentTag.ref()); w.writeFieldEnd(); } - if(s.noCreateSharedNotebooks.isSet()) { + if (s.noCreateSharedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("noCreateSharedNotebooks"), ThriftFieldType::T_BOOL, 18); w.writeBool(s.noCreateSharedNotebooks.ref()); w.writeFieldEnd(); } - if(s.updateWhichSharedNotebookRestrictions.isSet()) { + if (s.updateWhichSharedNotebookRestrictions.isSet()) { w.writeFieldBegin(QStringLiteral("updateWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 19); w.writeI32(static_cast(s.updateWhichSharedNotebookRestrictions.ref())); w.writeFieldEnd(); } - if(s.expungeWhichSharedNotebookRestrictions.isSet()) { + if (s.expungeWhichSharedNotebookRestrictions.isSet()) { w.writeFieldBegin(QStringLiteral("expungeWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 20); w.writeI32(static_cast(s.expungeWhichSharedNotebookRestrictions.ref())); w.writeFieldEnd(); } - if(s.noShareNotesWithBusiness.isSet()) { + if (s.noShareNotesWithBusiness.isSet()) { w.writeFieldBegin(QStringLiteral("noShareNotesWithBusiness"), ThriftFieldType::T_BOOL, 21); w.writeBool(s.noShareNotesWithBusiness.ref()); w.writeFieldEnd(); } - if(s.noRenameNotebook.isSet()) { + if (s.noRenameNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("noRenameNotebook"), ThriftFieldType::T_BOOL, 22); w.writeBool(s.noRenameNotebook.ref()); w.writeFieldEnd(); } - if(s.noSetInMyList.isSet()) { + if (s.noSetInMyList.isSet()) { w.writeFieldBegin(QStringLiteral("noSetInMyList"), ThriftFieldType::T_BOOL, 23); w.writeBool(s.noSetInMyList.ref()); w.writeFieldEnd(); } - if(s.noChangeContact.isSet()) { + if (s.noChangeContact.isSet()) { w.writeFieldBegin(QStringLiteral("noChangeContact"), ThriftFieldType::T_BOOL, 24); w.writeBool(s.noChangeContact.ref()); w.writeFieldEnd(); } - if(s.canMoveToContainerRestrictions.isSet()) { + if (s.canMoveToContainerRestrictions.isSet()) { w.writeFieldBegin(QStringLiteral("canMoveToContainerRestrictions"), ThriftFieldType::T_STRUCT, 26); writeCanMoveToContainerRestrictions(w, s.canMoveToContainerRestrictions.ref()); w.writeFieldEnd(); } - if(s.noSetReminderNotifyEmail.isSet()) { + if (s.noSetReminderNotifyEmail.isSet()) { w.writeFieldBegin(QStringLiteral("noSetReminderNotifyEmail"), ThriftFieldType::T_BOOL, 27); w.writeBool(s.noSetReminderNotifyEmail.ref()); w.writeFieldEnd(); } - if(s.noSetReminderNotifyInApp.isSet()) { + if (s.noSetReminderNotifyInApp.isSet()) { w.writeFieldBegin(QStringLiteral("noSetReminderNotifyInApp"), ThriftFieldType::T_BOOL, 28); w.writeBool(s.noSetReminderNotifyInApp.ref()); w.writeFieldEnd(); } - if(s.noSetRecipientSettingsStack.isSet()) { + if (s.noSetRecipientSettingsStack.isSet()) { w.writeFieldBegin(QStringLiteral("noSetRecipientSettingsStack"), ThriftFieldType::T_BOOL, 29); w.writeBool(s.noSetRecipientSettingsStack.ref()); w.writeFieldEnd(); } - if(s.noCanMoveNote.isSet()) { + if (s.noCanMoveNote.isSet()) { w.writeFieldBegin(QStringLiteral("noCanMoveNote"), ThriftFieldType::T_BOOL, 30); w.writeBool(s.noCanMoveNote.ref()); w.writeFieldEnd(); @@ -8967,7 +8969,7 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotebookInstanceRestrictions::type v; + SharedNotebookInstanceRestrictions v; readEnumSharedNotebookInstanceRestrictions(r, v); s.updateWhichSharedNotebookRestrictions = v; } else { @@ -8976,7 +8978,7 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I32) { - SharedNotebookInstanceRestrictions::type v; + SharedNotebookInstanceRestrictions v; readEnumSharedNotebookInstanceRestrictions(r, v); s.expungeWhichSharedNotebookRestrictions = v; } else { @@ -9074,85 +9076,85 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeStructBegin(QStringLiteral("Notebook")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.defaultNotebook.isSet()) { + if (s.defaultNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("defaultNotebook"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.defaultNotebook.ref()); w.writeFieldEnd(); } - if(s.serviceCreated.isSet()) { + if (s.serviceCreated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } - if(s.serviceUpdated.isSet()) { + if (s.serviceUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 8); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } - if(s.publishing.isSet()) { + if (s.publishing.isSet()) { w.writeFieldBegin(QStringLiteral("publishing"), ThriftFieldType::T_STRUCT, 10); writePublishing(w, s.publishing.ref()); w.writeFieldEnd(); } - if(s.published.isSet()) { + if (s.published.isSet()) { w.writeFieldBegin(QStringLiteral("published"), ThriftFieldType::T_BOOL, 11); w.writeBool(s.published.ref()); w.writeFieldEnd(); } - if(s.stack.isSet()) { + if (s.stack.isSet()) { w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 12); w.writeString(s.stack.ref()); w.writeFieldEnd(); } - if(s.sharedNotebookIds.isSet()) { + if (s.sharedNotebookIds.isSet()) { w.writeFieldBegin(QStringLiteral("sharedNotebookIds"), ThriftFieldType::T_LIST, 13); w.writeListBegin(ThriftFieldType::T_I64, s.sharedNotebookIds.ref().length()); - for(QList< qint64 >::const_iterator it = s.sharedNotebookIds.ref().constBegin(), end = s.sharedNotebookIds.ref().constEnd(); it != end; ++it) { - w.writeI64(*it); + for(const auto & value: qAsConst(s.sharedNotebookIds.ref())) { + w.writeI64(value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.sharedNotebooks.isSet()) { + if (s.sharedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("sharedNotebooks"), ThriftFieldType::T_LIST, 14); w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotebooks.ref().length()); - for(QList< SharedNotebook >::const_iterator it = s.sharedNotebooks.ref().constBegin(), end = s.sharedNotebooks.ref().constEnd(); it != end; ++it) { - writeSharedNotebook(w, *it); + for(const auto & value: qAsConst(s.sharedNotebooks.ref())) { + writeSharedNotebook(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.businessNotebook.isSet()) { + if (s.businessNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("businessNotebook"), ThriftFieldType::T_STRUCT, 15); writeBusinessNotebook(w, s.businessNotebook.ref()); w.writeFieldEnd(); } - if(s.contact.isSet()) { + if (s.contact.isSet()) { w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 16); writeUser(w, s.contact.ref()); w.writeFieldEnd(); } - if(s.restrictions.isSet()) { + if (s.restrictions.isSet()) { w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); writeNotebookRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } - if(s.recipientSettings.isSet()) { + if (s.recipientSettings.isSet()) { w.writeFieldBegin(QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 18); writeNotebookRecipientSettings(w, s.recipientSettings.ref()); w.writeFieldEnd(); @@ -9335,57 +9337,57 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s) { w.writeStructBegin(QStringLiteral("LinkedNotebook")); - if(s.shareName.isSet()) { + if (s.shareName.isSet()) { w.writeFieldBegin(QStringLiteral("shareName"), ThriftFieldType::T_STRING, 2); w.writeString(s.shareName.ref()); w.writeFieldEnd(); } - if(s.username.isSet()) { + if (s.username.isSet()) { w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 3); w.writeString(s.username.ref()); w.writeFieldEnd(); } - if(s.shardId.isSet()) { + if (s.shardId.isSet()) { w.writeFieldBegin(QStringLiteral("shardId"), ThriftFieldType::T_STRING, 4); w.writeString(s.shardId.ref()); w.writeFieldEnd(); } - if(s.sharedNotebookGlobalId.isSet()) { + if (s.sharedNotebookGlobalId.isSet()) { w.writeFieldBegin(QStringLiteral("sharedNotebookGlobalId"), ThriftFieldType::T_STRING, 5); w.writeString(s.sharedNotebookGlobalId.ref()); w.writeFieldEnd(); } - if(s.uri.isSet()) { + if (s.uri.isSet()) { w.writeFieldBegin(QStringLiteral("uri"), ThriftFieldType::T_STRING, 6); w.writeString(s.uri.ref()); w.writeFieldEnd(); } - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 7); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.updateSequenceNum.isSet()) { + if (s.updateSequenceNum.isSet()) { w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 8); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } - if(s.noteStoreUrl.isSet()) { + if (s.noteStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 9); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } - if(s.webApiUrlPrefix.isSet()) { + if (s.webApiUrlPrefix.isSet()) { w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 10); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } - if(s.stack.isSet()) { + if (s.stack.isSet()) { w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 11); w.writeString(s.stack.ref()); w.writeFieldEnd(); } - if(s.businessId.isSet()) { + if (s.businessId.isSet()) { w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 12); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); @@ -9512,27 +9514,27 @@ void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s) { void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescriptor & s) { w.writeStructBegin(QStringLiteral("NotebookDescriptor")); - if(s.guid.isSet()) { + if (s.guid.isSet()) { w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } - if(s.notebookDisplayName.isSet()) { + if (s.notebookDisplayName.isSet()) { w.writeFieldBegin(QStringLiteral("notebookDisplayName"), ThriftFieldType::T_STRING, 2); w.writeString(s.notebookDisplayName.ref()); w.writeFieldEnd(); } - if(s.contactName.isSet()) { + if (s.contactName.isSet()) { w.writeFieldBegin(QStringLiteral("contactName"), ThriftFieldType::T_STRING, 3); w.writeString(s.contactName.ref()); w.writeFieldEnd(); } - if(s.hasSharedNotebook.isSet()) { + if (s.hasSharedNotebook.isSet()) { w.writeFieldBegin(QStringLiteral("hasSharedNotebook"), ThriftFieldType::T_BOOL, 4); w.writeBool(s.hasSharedNotebook.ref()); w.writeFieldEnd(); } - if(s.joinedUserCount.isSet()) { + if (s.joinedUserCount.isSet()) { w.writeFieldBegin(QStringLiteral("joinedUserCount"), ThriftFieldType::T_I32, 5); w.writeI32(s.joinedUserCount.ref()); w.writeFieldEnd(); @@ -9605,52 +9607,52 @@ void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s) { w.writeStructBegin(QStringLiteral("UserProfile")); - if(s.id.isSet()) { + if (s.id.isSet()) { w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I32, 1); w.writeI32(s.id.ref()); w.writeFieldEnd(); } - if(s.name.isSet()) { + if (s.name.isSet()) { w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } - if(s.email.isSet()) { + if (s.email.isSet()) { w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 3); w.writeString(s.email.ref()); w.writeFieldEnd(); } - if(s.username.isSet()) { + if (s.username.isSet()) { w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 4); w.writeString(s.username.ref()); w.writeFieldEnd(); } - if(s.attributes.isSet()) { + if (s.attributes.isSet()) { w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 5); writeBusinessUserAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } - if(s.joined.isSet()) { + if (s.joined.isSet()) { w.writeFieldBegin(QStringLiteral("joined"), ThriftFieldType::T_I64, 6); w.writeI64(s.joined.ref()); w.writeFieldEnd(); } - if(s.photoLastUpdated.isSet()) { + if (s.photoLastUpdated.isSet()) { w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 7); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } - if(s.photoUrl.isSet()) { + if (s.photoUrl.isSet()) { w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 8); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } - if(s.role.isSet()) { + if (s.role.isSet()) { w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 9); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } - if(s.status.isSet()) { + if (s.status.isSet()) { w.writeFieldBegin(QStringLiteral("status"), ThriftFieldType::T_I32, 10); w.writeI32(static_cast(s.status.ref())); w.writeFieldEnd(); @@ -9742,7 +9744,7 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { - BusinessUserRole::type v; + BusinessUserRole v; readEnumBusinessUserRole(r, v); s.role = v; } else { @@ -9751,7 +9753,7 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { - BusinessUserStatus::type v; + BusinessUserStatus v; readEnumBusinessUserStatus(r, v); s.status = v; } else { @@ -9768,27 +9770,27 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContentImage & s) { w.writeStructBegin(QStringLiteral("RelatedContentImage")); - if(s.url.isSet()) { + if (s.url.isSet()) { w.writeFieldBegin(QStringLiteral("url"), ThriftFieldType::T_STRING, 1); w.writeString(s.url.ref()); w.writeFieldEnd(); } - if(s.width.isSet()) { + if (s.width.isSet()) { w.writeFieldBegin(QStringLiteral("width"), ThriftFieldType::T_I32, 2); w.writeI32(s.width.ref()); w.writeFieldEnd(); } - if(s.height.isSet()) { + if (s.height.isSet()) { w.writeFieldBegin(QStringLiteral("height"), ThriftFieldType::T_I32, 3); w.writeI32(s.height.ref()); w.writeFieldEnd(); } - if(s.pixelRatio.isSet()) { + if (s.pixelRatio.isSet()) { w.writeFieldBegin(QStringLiteral("pixelRatio"), ThriftFieldType::T_DOUBLE, 4); w.writeDouble(s.pixelRatio.ref()); w.writeFieldEnd(); } - if(s.fileSize.isSet()) { + if (s.fileSize.isSet()) { w.writeFieldBegin(QStringLiteral("fileSize"), ThriftFieldType::T_I32, 5); w.writeI32(s.fileSize.ref()); w.writeFieldEnd(); @@ -9861,90 +9863,90 @@ void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) { w.writeStructBegin(QStringLiteral("RelatedContent")); - if(s.contentId.isSet()) { + if (s.contentId.isSet()) { w.writeFieldBegin(QStringLiteral("contentId"), ThriftFieldType::T_STRING, 1); w.writeString(s.contentId.ref()); w.writeFieldEnd(); } - if(s.title.isSet()) { + if (s.title.isSet()) { w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } - if(s.url.isSet()) { + if (s.url.isSet()) { w.writeFieldBegin(QStringLiteral("url"), ThriftFieldType::T_STRING, 3); w.writeString(s.url.ref()); w.writeFieldEnd(); } - if(s.sourceId.isSet()) { + if (s.sourceId.isSet()) { w.writeFieldBegin(QStringLiteral("sourceId"), ThriftFieldType::T_STRING, 4); w.writeString(s.sourceId.ref()); w.writeFieldEnd(); } - if(s.sourceUrl.isSet()) { + if (s.sourceUrl.isSet()) { w.writeFieldBegin(QStringLiteral("sourceUrl"), ThriftFieldType::T_STRING, 5); w.writeString(s.sourceUrl.ref()); w.writeFieldEnd(); } - if(s.sourceFaviconUrl.isSet()) { + if (s.sourceFaviconUrl.isSet()) { w.writeFieldBegin(QStringLiteral("sourceFaviconUrl"), ThriftFieldType::T_STRING, 6); w.writeString(s.sourceFaviconUrl.ref()); w.writeFieldEnd(); } - if(s.sourceName.isSet()) { + if (s.sourceName.isSet()) { w.writeFieldBegin(QStringLiteral("sourceName"), ThriftFieldType::T_STRING, 7); w.writeString(s.sourceName.ref()); w.writeFieldEnd(); } - if(s.date.isSet()) { + if (s.date.isSet()) { w.writeFieldBegin(QStringLiteral("date"), ThriftFieldType::T_I64, 8); w.writeI64(s.date.ref()); w.writeFieldEnd(); } - if(s.teaser.isSet()) { + if (s.teaser.isSet()) { w.writeFieldBegin(QStringLiteral("teaser"), ThriftFieldType::T_STRING, 9); w.writeString(s.teaser.ref()); w.writeFieldEnd(); } - if(s.thumbnails.isSet()) { + if (s.thumbnails.isSet()) { w.writeFieldBegin(QStringLiteral("thumbnails"), ThriftFieldType::T_LIST, 10); w.writeListBegin(ThriftFieldType::T_STRUCT, s.thumbnails.ref().length()); - for(QList< RelatedContentImage >::const_iterator it = s.thumbnails.ref().constBegin(), end = s.thumbnails.ref().constEnd(); it != end; ++it) { - writeRelatedContentImage(w, *it); + for(const auto & value: qAsConst(s.thumbnails.ref())) { + writeRelatedContentImage(w, value); } w.writeListEnd(); w.writeFieldEnd(); } - if(s.contentType.isSet()) { + if (s.contentType.isSet()) { w.writeFieldBegin(QStringLiteral("contentType"), ThriftFieldType::T_I32, 11); w.writeI32(static_cast(s.contentType.ref())); w.writeFieldEnd(); } - if(s.accessType.isSet()) { + if (s.accessType.isSet()) { w.writeFieldBegin(QStringLiteral("accessType"), ThriftFieldType::T_I32, 12); w.writeI32(static_cast(s.accessType.ref())); w.writeFieldEnd(); } - if(s.visibleUrl.isSet()) { + if (s.visibleUrl.isSet()) { w.writeFieldBegin(QStringLiteral("visibleUrl"), ThriftFieldType::T_STRING, 13); w.writeString(s.visibleUrl.ref()); w.writeFieldEnd(); } - if(s.clipUrl.isSet()) { + if (s.clipUrl.isSet()) { w.writeFieldBegin(QStringLiteral("clipUrl"), ThriftFieldType::T_STRING, 14); w.writeString(s.clipUrl.ref()); w.writeFieldEnd(); } - if(s.contact.isSet()) { + if (s.contact.isSet()) { w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 15); writeContact(w, s.contact.ref()); w.writeFieldEnd(); } - if(s.authors.isSet()) { + if (s.authors.isSet()) { w.writeFieldBegin(QStringLiteral("authors"), ThriftFieldType::T_LIST, 16); w.writeListBegin(ThriftFieldType::T_STRING, s.authors.ref().length()); - for(QStringList::const_iterator it = s.authors.ref().constBegin(), end = s.authors.ref().constEnd(); it != end; ++it) { - w.writeString(*it); + for(const auto & value: qAsConst(s.authors.ref())) { + w.writeString(value); } w.writeListEnd(); w.writeFieldEnd(); @@ -10064,7 +10066,7 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { - RelatedContentType::type v; + RelatedContentType v; readEnumRelatedContentType(r, v); s.contentType = v; } else { @@ -10073,7 +10075,7 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { - RelatedContentAccess::type v; + RelatedContentAccess v; readEnumRelatedContentAccess(r, v); s.accessType = v; } else { @@ -10136,42 +10138,42 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitation & s) { w.writeStructBegin(QStringLiteral("BusinessInvitation")); - if(s.businessId.isSet()) { + if (s.businessId.isSet()) { w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } - if(s.email.isSet()) { + if (s.email.isSet()) { w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 2); w.writeString(s.email.ref()); w.writeFieldEnd(); } - if(s.role.isSet()) { + if (s.role.isSet()) { w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 3); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } - if(s.status.isSet()) { + if (s.status.isSet()) { w.writeFieldBegin(QStringLiteral("status"), ThriftFieldType::T_I32, 4); w.writeI32(static_cast(s.status.ref())); w.writeFieldEnd(); } - if(s.requesterId.isSet()) { + if (s.requesterId.isSet()) { w.writeFieldBegin(QStringLiteral("requesterId"), ThriftFieldType::T_I32, 5); w.writeI32(s.requesterId.ref()); w.writeFieldEnd(); } - if(s.fromWorkChat.isSet()) { + if (s.fromWorkChat.isSet()) { w.writeFieldBegin(QStringLiteral("fromWorkChat"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.fromWorkChat.ref()); w.writeFieldEnd(); } - if(s.created.isSet()) { + if (s.created.isSet()) { w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 7); w.writeI64(s.created.ref()); w.writeFieldEnd(); } - if(s.mostRecentReminder.isSet()) { + if (s.mostRecentReminder.isSet()) { w.writeFieldBegin(QStringLiteral("mostRecentReminder"), ThriftFieldType::T_I64, 8); w.writeI64(s.mostRecentReminder.ref()); w.writeFieldEnd(); @@ -10209,7 +10211,7 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { - BusinessUserRole::type v; + BusinessUserRole v; readEnumBusinessUserRole(r, v); s.role = v; } else { @@ -10218,7 +10220,7 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { - BusinessInvitationStatus::type v; + BusinessInvitationStatus v; readEnumBusinessInvitationStatus(r, v); s.status = v; } else { @@ -10271,17 +10273,17 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s) { w.writeStructBegin(QStringLiteral("UserIdentity")); - if(s.type.isSet()) { + if (s.type.isSet()) { w.writeFieldBegin(QStringLiteral("type"), ThriftFieldType::T_I32, 1); w.writeI32(static_cast(s.type.ref())); w.writeFieldEnd(); } - if(s.stringIdentifier.isSet()) { + if (s.stringIdentifier.isSet()) { w.writeFieldBegin(QStringLiteral("stringIdentifier"), ThriftFieldType::T_STRING, 2); w.writeString(s.stringIdentifier.ref()); w.writeFieldEnd(); } - if(s.longIdentifier.isSet()) { + if (s.longIdentifier.isSet()) { w.writeFieldBegin(QStringLiteral("longIdentifier"), ThriftFieldType::T_I64, 3); w.writeI64(s.longIdentifier.ref()); w.writeFieldEnd(); @@ -10301,7 +10303,7 @@ void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s) { if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { - UserIdentityType::type v; + UserIdentityType v; readEnumUserIdentityType(r, v); s.type = v; } else { @@ -10339,22 +10341,22 @@ void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s) w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 1); w.writeI32(s.userId); w.writeFieldEnd(); - if(s.serviceLevel.isSet()) { + if (s.serviceLevel.isSet()) { w.writeFieldBegin(QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 7); w.writeI32(static_cast(s.serviceLevel.ref())); w.writeFieldEnd(); } - if(s.username.isSet()) { + if (s.username.isSet()) { w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 4); w.writeString(s.username.ref()); w.writeFieldEnd(); } - if(s.noteStoreUrl.isSet()) { + if (s.noteStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 5); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } - if(s.webApiUrlPrefix.isSet()) { + if (s.webApiUrlPrefix.isSet()) { w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 6); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); @@ -10385,7 +10387,7 @@ void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { - ServiceLevel::type v; + ServiceLevel v; readEnumServiceLevel(r, v); s.serviceLevel = v; } else { @@ -10430,32 +10432,32 @@ void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s) { w.writeStructBegin(QStringLiteral("UserUrls")); - if(s.noteStoreUrl.isSet()) { + if (s.noteStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 1); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } - if(s.webApiUrlPrefix.isSet()) { + if (s.webApiUrlPrefix.isSet()) { w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 2); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } - if(s.userStoreUrl.isSet()) { + if (s.userStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("userStoreUrl"), ThriftFieldType::T_STRING, 3); w.writeString(s.userStoreUrl.ref()); w.writeFieldEnd(); } - if(s.utilityUrl.isSet()) { + if (s.utilityUrl.isSet()) { w.writeFieldBegin(QStringLiteral("utilityUrl"), ThriftFieldType::T_STRING, 4); w.writeString(s.utilityUrl.ref()); w.writeFieldEnd(); } - if(s.messageStoreUrl.isSet()) { + if (s.messageStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("messageStoreUrl"), ThriftFieldType::T_STRING, 5); w.writeString(s.messageStoreUrl.ref()); w.writeFieldEnd(); } - if(s.userWebSocketUrl.isSet()) { + if (s.userWebSocketUrl.isSet()) { w.writeFieldBegin(QStringLiteral("userWebSocketUrl"), ThriftFieldType::T_STRING, 6); w.writeString(s.userWebSocketUrl.ref()); w.writeFieldEnd(); @@ -10546,37 +10548,37 @@ void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const Authenticatio w.writeFieldBegin(QStringLiteral("expiration"), ThriftFieldType::T_I64, 3); w.writeI64(s.expiration); w.writeFieldEnd(); - if(s.user.isSet()) { + if (s.user.isSet()) { w.writeFieldBegin(QStringLiteral("user"), ThriftFieldType::T_STRUCT, 4); writeUser(w, s.user.ref()); w.writeFieldEnd(); } - if(s.publicUserInfo.isSet()) { + if (s.publicUserInfo.isSet()) { w.writeFieldBegin(QStringLiteral("publicUserInfo"), ThriftFieldType::T_STRUCT, 5); writePublicUserInfo(w, s.publicUserInfo.ref()); w.writeFieldEnd(); } - if(s.noteStoreUrl.isSet()) { + if (s.noteStoreUrl.isSet()) { w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 6); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } - if(s.webApiUrlPrefix.isSet()) { + if (s.webApiUrlPrefix.isSet()) { w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 7); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } - if(s.secondFactorRequired.isSet()) { + if (s.secondFactorRequired.isSet()) { w.writeFieldBegin(QStringLiteral("secondFactorRequired"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.secondFactorRequired.ref()); w.writeFieldEnd(); } - if(s.secondFactorDeliveryHint.isSet()) { + if (s.secondFactorDeliveryHint.isSet()) { w.writeFieldBegin(QStringLiteral("secondFactorDeliveryHint"), ThriftFieldType::T_STRING, 9); w.writeString(s.secondFactorDeliveryHint.ref()); w.writeFieldEnd(); } - if(s.urls.isSet()) { + if (s.urls.isSet()) { w.writeFieldBegin(QStringLiteral("urls"), ThriftFieldType::T_STRUCT, 10); writeUserUrls(w, s.urls.ref()); w.writeFieldEnd(); @@ -10715,52 +10717,52 @@ void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSetting w.writeFieldBegin(QStringLiteral("accountEmailDomain"), ThriftFieldType::T_STRING, 4); w.writeString(s.accountEmailDomain); w.writeFieldEnd(); - if(s.enableFacebookSharing.isSet()) { + if (s.enableFacebookSharing.isSet()) { w.writeFieldBegin(QStringLiteral("enableFacebookSharing"), ThriftFieldType::T_BOOL, 5); w.writeBool(s.enableFacebookSharing.ref()); w.writeFieldEnd(); } - if(s.enableGiftSubscriptions.isSet()) { + if (s.enableGiftSubscriptions.isSet()) { w.writeFieldBegin(QStringLiteral("enableGiftSubscriptions"), ThriftFieldType::T_BOOL, 6); w.writeBool(s.enableGiftSubscriptions.ref()); w.writeFieldEnd(); } - if(s.enableSupportTickets.isSet()) { + if (s.enableSupportTickets.isSet()) { w.writeFieldBegin(QStringLiteral("enableSupportTickets"), ThriftFieldType::T_BOOL, 7); w.writeBool(s.enableSupportTickets.ref()); w.writeFieldEnd(); } - if(s.enableSharedNotebooks.isSet()) { + if (s.enableSharedNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("enableSharedNotebooks"), ThriftFieldType::T_BOOL, 8); w.writeBool(s.enableSharedNotebooks.ref()); w.writeFieldEnd(); } - if(s.enableSingleNoteSharing.isSet()) { + if (s.enableSingleNoteSharing.isSet()) { w.writeFieldBegin(QStringLiteral("enableSingleNoteSharing"), ThriftFieldType::T_BOOL, 9); w.writeBool(s.enableSingleNoteSharing.ref()); w.writeFieldEnd(); } - if(s.enableSponsoredAccounts.isSet()) { + if (s.enableSponsoredAccounts.isSet()) { w.writeFieldBegin(QStringLiteral("enableSponsoredAccounts"), ThriftFieldType::T_BOOL, 10); w.writeBool(s.enableSponsoredAccounts.ref()); w.writeFieldEnd(); } - if(s.enableTwitterSharing.isSet()) { + if (s.enableTwitterSharing.isSet()) { w.writeFieldBegin(QStringLiteral("enableTwitterSharing"), ThriftFieldType::T_BOOL, 11); w.writeBool(s.enableTwitterSharing.ref()); w.writeFieldEnd(); } - if(s.enableLinkedInSharing.isSet()) { + if (s.enableLinkedInSharing.isSet()) { w.writeFieldBegin(QStringLiteral("enableLinkedInSharing"), ThriftFieldType::T_BOOL, 12); w.writeBool(s.enableLinkedInSharing.ref()); w.writeFieldEnd(); } - if(s.enablePublicNotebooks.isSet()) { + if (s.enablePublicNotebooks.isSet()) { w.writeFieldBegin(QStringLiteral("enablePublicNotebooks"), ThriftFieldType::T_BOOL, 13); w.writeBool(s.enablePublicNotebooks.ref()); w.writeFieldEnd(); } - if(s.enableGoogle.isSet()) { + if (s.enableGoogle.isSet()) { w.writeFieldBegin(QStringLiteral("enableGoogle"), ThriftFieldType::T_BOOL, 16); w.writeBool(s.enableGoogle.ref()); w.writeFieldEnd(); @@ -10981,8 +10983,8 @@ void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s) { w.writeStructBegin(QStringLiteral("BootstrapInfo")); w.writeFieldBegin(QStringLiteral("profiles"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.profiles.length()); - for(QList< BootstrapProfile >::const_iterator it = s.profiles.constBegin(), end = s.profiles.constEnd(); it != end; ++it) { - writeBootstrapProfile(w, *it); + for(const auto & value: qAsConst(s.profiles)) { + writeBootstrapProfile(w, value); } w.writeListEnd(); w.writeFieldEnd(); @@ -11041,7 +11043,7 @@ void writeEDAMUserException(ThriftBinaryBufferWriter & w, const EDAMUserExceptio w.writeFieldBegin(QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); w.writeI32(static_cast(s.errorCode)); w.writeFieldEnd(); - if(s.parameter.isSet()) { + if (s.parameter.isSet()) { w.writeFieldBegin(QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); w.writeString(s.parameter.ref()); w.writeFieldEnd(); @@ -11063,7 +11065,7 @@ void readEDAMUserException(ThriftBinaryBufferReader & r, EDAMUserException & s) if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { errorCode_isset = true; - EDAMErrorCode::type v; + EDAMErrorCode v; readEnumEDAMErrorCode(r, v); s.errorCode = v; } else { @@ -11101,12 +11103,12 @@ void writeEDAMSystemException(ThriftBinaryBufferWriter & w, const EDAMSystemExce w.writeFieldBegin(QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); w.writeI32(static_cast(s.errorCode)); w.writeFieldEnd(); - if(s.message.isSet()) { + if (s.message.isSet()) { w.writeFieldBegin(QStringLiteral("message"), ThriftFieldType::T_STRING, 2); w.writeString(s.message.ref()); w.writeFieldEnd(); } - if(s.rateLimitDuration.isSet()) { + if (s.rateLimitDuration.isSet()) { w.writeFieldBegin(QStringLiteral("rateLimitDuration"), ThriftFieldType::T_I32, 3); w.writeI32(s.rateLimitDuration.ref()); w.writeFieldEnd(); @@ -11128,7 +11130,7 @@ void readEDAMSystemException(ThriftBinaryBufferReader & r, EDAMSystemException & if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { errorCode_isset = true; - EDAMErrorCode::type v; + EDAMErrorCode v; readEnumEDAMErrorCode(r, v); s.errorCode = v; } else { @@ -11171,12 +11173,12 @@ EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) } void writeEDAMNotFoundException(ThriftBinaryBufferWriter & w, const EDAMNotFoundException & s) { w.writeStructBegin(QStringLiteral("EDAMNotFoundException")); - if(s.identifier.isSet()) { + if (s.identifier.isSet()) { w.writeFieldBegin(QStringLiteral("identifier"), ThriftFieldType::T_STRING, 1); w.writeString(s.identifier.ref()); w.writeFieldEnd(); } - if(s.key.isSet()) { + if (s.key.isSet()) { w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 2); w.writeString(s.key.ref()); w.writeFieldEnd(); @@ -11232,21 +11234,21 @@ void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMI w.writeStructBegin(QStringLiteral("EDAMInvalidContactsException")); w.writeFieldBegin(QStringLiteral("contacts"), ThriftFieldType::T_LIST, 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.contacts.length()); - for(QList< Contact >::const_iterator it = s.contacts.constBegin(), end = s.contacts.constEnd(); it != end; ++it) { - writeContact(w, *it); + for(const auto & value: qAsConst(s.contacts)) { + writeContact(w, value); } w.writeListEnd(); w.writeFieldEnd(); - if(s.parameter.isSet()) { + if (s.parameter.isSet()) { w.writeFieldBegin(QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); w.writeString(s.parameter.ref()); w.writeFieldEnd(); } - if(s.reasons.isSet()) { + if (s.reasons.isSet()) { w.writeFieldBegin(QStringLiteral("reasons"), ThriftFieldType::T_LIST, 3); w.writeListBegin(ThriftFieldType::T_I32, s.reasons.ref().length()); - for(QList< EDAMInvalidContactReason::type >::const_iterator it = s.reasons.ref().constBegin(), end = s.reasons.ref().constEnd(); it != end; ++it) { - w.writeI32(static_cast(*it)); + for(const auto & value: qAsConst(s.reasons.ref())) { + w.writeI32(static_cast(value)); } w.writeListEnd(); w.writeFieldEnd(); @@ -11296,14 +11298,14 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { - QList< EDAMInvalidContactReason::type > v; + QList< EDAMInvalidContactReason > v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); if(elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (EDAMInvalidContactsException.reasons)")); for(qint32 i = 0; i < size; i++) { - EDAMInvalidContactReason::type elem; + EDAMInvalidContactReason elem; readEnumEDAMInvalidContactReason(r, elem); v.append(elem); } diff --git a/QEverCloud/src/generated/types_impl.h b/QEverCloud/src/generated/Types_io.h similarity index 93% rename from QEverCloud/src/generated/types_impl.h rename to QEverCloud/src/generated/Types_io.h index 14477a4e..f0785452 100644 --- a/QEverCloud/src/generated/types_impl.h +++ b/QEverCloud/src/generated/Types_io.h @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms of MIT license: * https://opensource.org/licenses/MIT @@ -8,21 +8,14 @@ * This file was generated from Evernote Thrift API */ +#ifndef QEVERCLOUD_GENERATED_TYPES_IO_H +#define QEVERCLOUD_GENERATED_TYPES_IO_H -#ifndef QEVERCLOUD_GENERATED_TYPES_IMPL_H -#define QEVERCLOUD_GENERATED_TYPES_IMPL_H + +#include +#include "../Impl.h" #include -#include -#include "../impl.h" -#include -#include -#include -#include -#include -#include -#include -#include namespace qevercloud { @@ -185,31 +178,31 @@ void readEDAMNotFoundException(ThriftBinaryBufferReader & r, EDAMNotFoundExcepti void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMInvalidContactsException & s); void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidContactsException & s); -void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode::type & e); -void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason::type & e); -void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel::type & e); -void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel::type & e); -void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel::type & e); -void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat::type & e); -void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder::type & e); -void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus::type & e); -void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel::type & e); -void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel::type & e); -void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole::type & e); -void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole::type & e); -void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus::type & e); -void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions::type & e); -void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig::type & e); -void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus::type & e); -void readEnumContactType(ThriftBinaryBufferReader & r, ContactType::type & e); -void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType::type & e); -void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus::type & e); -void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus::type & e); -void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType::type & e); -void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess::type & e); -void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType::type & e); +void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode & e); +void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason & e); +void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel & e); +void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel & e); +void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel & e); +void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat & e); +void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder & e); +void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus & e); +void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel & e); +void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel & e); +void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole & e); +void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole & e); +void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus & e); +void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions & e); +void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig & e); +void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus & e); +void readEnumContactType(ThriftBinaryBufferReader & r, ContactType & e); +void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType & e); +void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus & e); +void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus & e); +void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType & e); +void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess & e); +void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e); /** @endcond */ } // namespace qevercloud -#endif // QEVERCLOUD_GENERATED_TYPES_IMPL_H +#endif // QEVERCLOUD_GENERATED_TYPES_IO_H From b4e32d6090232c326263abc99ad43343233719ee Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 16 Aug 2019 07:54:49 +0300 Subject: [PATCH 002/188] Some formatting improvements --- QEverCloud/headers/generated/EDAMErrorCode.h | 3 +-- QEverCloud/headers/generated/Services.h | 18 +++++++++--------- QEverCloud/headers/generated/Types.h | 14 +++++++------- QEverCloud/src/generated/Types_io.h | 4 +--- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index de963bf2..796002c0 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -13,9 +13,8 @@ #include "../Export.h" - -#include #include +#include namespace qevercloud { diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 2b4cd4dc..fbec8813 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -13,7 +13,6 @@ #include "../Export.h" - #include "../AsyncResult.h" #include "../Optional.h" #include "Constants.h" @@ -2867,13 +2866,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject }; } // namespace qevercloud -Q_DECLARE_METATYPE(QList< qevercloud::Notebook >) -Q_DECLARE_METATYPE(QList< qevercloud::Tag >) -Q_DECLARE_METATYPE(QList< qevercloud::SavedSearch >) -Q_DECLARE_METATYPE(QList< qevercloud::NoteVersionId >) -Q_DECLARE_METATYPE(QList< qevercloud::SharedNotebook >) -Q_DECLARE_METATYPE(QList< qevercloud::LinkedNotebook >) -Q_DECLARE_METATYPE(QList< qevercloud::BusinessInvitation >) -Q_DECLARE_METATYPE(QList< qevercloud::UserProfile >) + +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QList) #endif // QEVERCLOUD_GENERATED_SERVICES_H diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 1aa13b45..2b3581cf 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -13,18 +13,17 @@ #include "../Export.h" - -#include "EDAMErrorCode.h" #include "../Optional.h" -#include -#include +#include "EDAMErrorCode.h" +#include +#include #include #include +#include +#include #include +#include #include -#include -#include -#include namespace qevercloud { @@ -5756,6 +5755,7 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { } // namespace qevercloud + Q_DECLARE_METATYPE(qevercloud::SyncState) Q_DECLARE_METATYPE(qevercloud::SyncChunkFilter) Q_DECLARE_METATYPE(qevercloud::NoteFilter) diff --git a/QEverCloud/src/generated/Types_io.h b/QEverCloud/src/generated/Types_io.h index f0785452..200686d4 100644 --- a/QEverCloud/src/generated/Types_io.h +++ b/QEverCloud/src/generated/Types_io.h @@ -11,11 +11,9 @@ #ifndef QEVERCLOUD_GENERATED_TYPES_IO_H #define QEVERCLOUD_GENERATED_TYPES_IO_H - - -#include #include "../Impl.h" #include +#include namespace qevercloud { From a62871e30cbaa9db774b2015da6a33612e636fd3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 6 Sep 2019 07:36:48 +0300 Subject: [PATCH 003/188] Convert one enum to enum class + small stylistic changes --- QEverCloud/headers/Exceptions.h | 34 ++++++------ QEverCloud/headers/Globals.h | 4 +- QEverCloud/headers/InkNoteImageDownloader.h | 3 +- QEverCloud/headers/OAuth.h | 60 ++++++++++++--------- QEverCloud/src/Exceptions.cpp | 12 ++--- QEverCloud/src/Globals.cpp | 12 ++--- QEverCloud/src/InkNoteImageDownloader.cpp | 35 +++++++----- 7 files changed, 89 insertions(+), 71 deletions(-) diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index ad993fb1..a8e94b25 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -28,32 +28,30 @@ namespace qevercloud { class QEVERCLOUD_EXPORT ThriftException: public EverCloudException { public: - struct Type { - enum type { - UNKNOWN = 0, - UNKNOWN_METHOD = 1, - INVALID_MESSAGE_TYPE = 2, - WRONG_METHOD_NAME = 3, - BAD_SEQUENCE_ID = 4, - MISSING_RESULT = 5, - INTERNAL_ERROR = 6, - PROTOCOL_ERROR = 7, - INVALID_DATA = 8 - }; + enum class Type { + UNKNOWN = 0, + UNKNOWN_METHOD = 1, + INVALID_MESSAGE_TYPE = 2, + WRONG_METHOD_NAME = 3, + BAD_SEQUENCE_ID = 4, + MISSING_RESULT = 5, + INTERNAL_ERROR = 6, + PROTOCOL_ERROR = 7, + INVALID_DATA = 8 }; ThriftException(); - ThriftException(Type::type type); - ThriftException(Type::type type, QString message); + ThriftException(Type type); + ThriftException(Type type, QString message); - Type::type type() const; + Type type() const; const char * what() const throw() Q_DECL_OVERRIDE; virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; protected: - Type::type m_type; + Type m_type; }; /** Asynchronous API conterpart of ThriftException. See EverCloudExceptionData for more details.*/ @@ -62,11 +60,11 @@ class QEVERCLOUD_EXPORT ThriftExceptionData: public EverCloudExceptionData Q_OBJECT Q_DISABLE_COPY(ThriftExceptionData) public: - explicit ThriftExceptionData(QString error, ThriftException::Type::type type); + explicit ThriftExceptionData(QString error, ThriftException::Type type); virtual void throwException() const Q_DECL_OVERRIDE; protected: - ThriftException::Type::type m_type; + ThriftException::Type m_type; }; inline QSharedPointer ThriftException::exceptionData() const diff --git a/QEverCloud/headers/Globals.h b/QEverCloud/headers/Globals.h index b7ffdf31..23ab705e 100644 --- a/QEverCloud/headers/Globals.h +++ b/QEverCloud/headers/Globals.h @@ -29,12 +29,12 @@ QEVERCLOUD_EXPORT QNetworkAccessManager * evernoteNetworkAccessManager(); /** * Network request timeout in milliseconds */ -QEVERCLOUD_EXPORT int connectionTimeout(); +QEVERCLOUD_EXPORT int requestTimeout(); /** * Set network request timeout; negative values mean no timeout */ -QEVERCLOUD_EXPORT void setConnectionTimeout(int timeout); +QEVERCLOUD_EXPORT void setRequestTimeout(int timeout); /** * qevercloud library version. diff --git a/QEverCloud/headers/InkNoteImageDownloader.h b/QEverCloud/headers/InkNoteImageDownloader.h index 4927a02c..9c83477e 100644 --- a/QEverCloud/headers/InkNoteImageDownloader.h +++ b/QEverCloud/headers/InkNoteImageDownloader.h @@ -60,7 +60,8 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader * @param height * Height of the ink note's resource */ - InkNoteImageDownloader(QString host, QString shardId, QString authenticationToken, int width, int height); + InkNoteImageDownloader(QString host, QString shardId, + QString authenticationToken, int width, int height); virtual ~InkNoteImageDownloader(); diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index 0eac3a19..c1e3aaef 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -21,24 +21,19 @@ #include #include -#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010 -// VS2010 is supposed to be C++11 but does not fulfull the entire standard. -#ifdef QStringLiteral -#undef QStringLiteral -#define QStringLiteral(str) QString::fromUtf8("" str "", sizeof(str) - 1) -#endif -#endif - namespace qevercloud { /** * @brief Sets the function to use for nonce generation for OAuth authentication. * - * The default algorithm uses qrand() so do not forget to call qsrand() in your application! + * The default algorithm uses qrand() so do not forget to call qsrand() in your + * application! * - * qrand() is not guaranteed to be cryptographically strong. I try to amend the fact by using - * QUuid::createUuid() which uses /dev/urandom if it's available. But this is no guarantee either. - * So if you want total control over nonce generation you can write you own algorithm. + * qrand() is not guaranteed to be cryptographically strong. I try to amend + * the fact by using QUuid::createUuid() which uses /dev/urandom if it's + * available. But this is no guarantee either. + * So if you want total control over nonce generation you can write you own + * algorithm. * * setNonceGenerator is NOT thread safe. */ @@ -65,9 +60,11 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget EvernoteOAuthWebView(QWidget * parent = Q_NULLPTR); /** - * This function starts the OAuth sequence. In the end of the sequence will be emitted one of the signals: authenticationSuceeded or authenticationFailed. + * This function starts the OAuth sequence. In the end of the sequence will + * be emitted one of the signals: authenticationSuceeded or authenticationFailed. * - * Do not call the function while its call is in effect, i.e. one of the signals is not emitted. + * Do not call the function while its call is in effect, i.e. one of + * the signals is not emitted. * * @param host * Evernote host to authorize with. You need one of this: @@ -91,7 +88,8 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget /** Holds data that is returned by Evernote on a successful authentication */ struct OAuthResult { - QString noteStoreUrl; ///< note store url for the user; no need to question UserStore::getNoteStoreUrl for it. + QString noteStoreUrl; ///< note store url for the user; no need to + /// question UserStore::getNoteStoreUrl for it. Timestamp expires; ///< authenticationToken time of expiration. QString shardId; ///< usually is not used UserID userId; ///< same as PublicUserInfo::userId @@ -111,10 +109,16 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget /** Emitted when the OAuth sequence started with authenticate() call is finished */ void authenticationFinished(bool success); - /** Emitted when the OAuth sequence is successfully finished. Call oauthResult() to get the data.*/ + /** + * Emitted when the OAuth sequence is successfully finished. Call + * oauthResult() to get the data. + */ void authenticationSuceeded(); - /** Emitted when the OAuth sequence is finished with a failure. Some error info may be available with errorText().*/ + /** + * Emitted when the OAuth sequence is finished with a failure. Some error + * info may be available with errorText(). + */ void authenticationFailed(); private: @@ -127,7 +131,8 @@ class EvernoteOAuthDialogPrivate; /** @endcond */ /** - * @brief Authorizes your app with the Evernote service by means of OAuth authentication. + * @brief Authorizes your app with the Evernote service by means of OAuth + * authentication. * * Intended usage: * @@ -149,8 +154,10 @@ if(d.exec() == QDialog::Accepted) { * * %Note that you have to include QEverCloudOAuth.h header. * - * By default EvernoteOAuthDialog uses qrand() for generating nonce so do not forget to call qsrand() - * in your application. See @link setNonceGenerator @endlink If you want more control over nonce generation. + * By default EvernoteOAuthDialog uses qrand() for generating nonce so do not + * forget to call qsrand() in your application. + * See @link setNonceGenerator @endlink If you want more control over nonce + * generation. */ class QEVERCLOUD_EXPORT EvernoteOAuthDialog: public QDialog @@ -172,24 +179,27 @@ class QEVERCLOUD_EXPORT EvernoteOAuthDialog: public QDialog * @param consumerSecret * along with this */ - EvernoteOAuthDialog(QString consumerKey, QString consumerSecret, QString host = QStringLiteral("www.evernote.com"), QWidget * parent = Q_NULLPTR); + EvernoteOAuthDialog(QString consumerKey, QString consumerSecret, + QString host = QStringLiteral("www.evernote.com"), + QWidget * parent = Q_NULLPTR); ~EvernoteOAuthDialog(); /** - * The dialog adjusts its initial size automatically based on the contained QWebView preffered size. - * Use this method to set the size. + * The dialog adjusts its initial size automatically based on the contained + * QWebView preffered size. Use this method to set the size. * * @param sizeHint will be used as the preffered size of the contained QWebView. */ void setWebViewSizeHint(QSize sizeHint); /** @return true in case of a successful authentication. - * You probably better chech exec() return value instead. + * You probably better check exec() return value instead. */ bool isSucceeded() const; /** - * @return In case of an authentification error may return some information about the error. + * @return In case of an authentification error may return some information + * about the error. */ QString oauthError() const; diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 85c9cb85..1f1f0ca8 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -20,17 +20,17 @@ ThriftException::ThriftException() : m_type(Type::UNKNOWN) {} -ThriftException::ThriftException(ThriftException::Type::type type) : +ThriftException::ThriftException(ThriftException::Type type) : EverCloudException(), m_type(type) {} -ThriftException::ThriftException(ThriftException::Type::type type, QString message) : +ThriftException::ThriftException(ThriftException::Type type, QString message) : EverCloudException(message), m_type(type) {} -ThriftException::Type::type ThriftException::type() const +ThriftException::Type ThriftException::type() const { return m_type; } @@ -139,7 +139,7 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) reader.readStructBegin(name); QString error; - ThriftException::Type::type type = ThriftException::Type::UNKNOWN; + ThriftException::Type type = ThriftException::Type::UNKNOWN; while(true) { @@ -164,7 +164,7 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) if (fieldType == ThriftFieldType::T_I32) { qint32 t; reader.readI32(t); - type = static_cast(t); + type = static_cast(t); } else { reader.skip(fieldType); @@ -360,7 +360,7 @@ void EDAMSystemExceptionAuthExpiredData::throwException() const throw exception; } -ThriftExceptionData::ThriftExceptionData(QString error, ThriftException::Type::type type) : +ThriftExceptionData::ThriftExceptionData(QString error, ThriftException::Type type) : EverCloudExceptionData(error), m_type(type) {} diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 8aaf3b7e..8c0f3e01 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -25,21 +25,21 @@ QNetworkAccessManager * evernoteNetworkAccessManager() return pNetworkAccessManager.data(); } -static int qevercloudConnectionTimeout = 180000; +static int qevercloudRequestTimeout = 180000; -int connectionTimeout() +int requestTimeout() { - return qevercloudConnectionTimeout; + return qevercloudRequestTimeout; } -void setConnectionTimeout(int timeout) +void setRequestTimeout(int timeout) { - qevercloudConnectionTimeout = timeout; + qevercloudRequestTimeout = timeout; } int libraryVersion() { - return 4*10000 + 0*100 + 0; + return 5*10000 + 0*100 + 0; } } // namespace qevercloud diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index 15d8510b..c0fd316d 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -21,7 +21,8 @@ class InkNoteImageDownloaderPrivate { public: QPair createPostRequest(const QString & urlPart, - const int sliceNumber, const bool isPublic = false); + const int sliceNumber, + const bool isPublic = false); QString m_host; QString m_shardId; @@ -34,7 +35,8 @@ InkNoteImageDownloader::InkNoteImageDownloader() : d_ptr(new InkNoteImageDownloaderPrivate) {} -InkNoteImageDownloader::InkNoteImageDownloader(QString host, QString shardId, QString authenticationToken, +InkNoteImageDownloader::InkNoteImageDownloader(QString host, QString shardId, + QString authenticationToken, int width, int height) : d_ptr(new InkNoteImageDownloaderPrivate) { @@ -62,7 +64,8 @@ InkNoteImageDownloader & InkNoteImageDownloader::setShardId(QString shardId) return *this; } -InkNoteImageDownloader & InkNoteImageDownloader::setAuthenticationToken(QString authenticationToken) +InkNoteImageDownloader & InkNoteImageDownloader::setAuthenticationToken( + QString authenticationToken) { d_ptr->m_authenticationToken = authenticationToken; return *this; @@ -95,12 +98,15 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) while(true) { int httpStatusCode = 0; - QPair postRequest = d->createPostRequest(urlPart, sliceCounter, isPublic); + QPair postRequest = + d->createPostRequest(urlPart, sliceCounter, isPublic); - QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), postRequest.first, - postRequest.second, &httpStatusCode); + QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), + postRequest.first, postRequest.second, + &httpStatusCode); if (httpStatusCode != 200) { - throw EverCloudException(QStringLiteral("HTTP Status Code = %1").arg(httpStatusCode)); + throw EverCloudException( + QStringLiteral("HTTP Status Code = %1").arg(httpStatusCode)); } QImage replyImagePart; @@ -108,7 +114,9 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) if (replyImagePart.isNull()) { if (Q_UNLIKELY(inkNoteImage.isNull())) { - throw EverCloudException(QStringLiteral("Ink note's image part is null before even starting to assemble")); + throw EverCloudException( + QStringLiteral("Ink note's image part is null before even " + "starting to assemble")); } break; @@ -118,7 +126,8 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) inkNoteImage = inkNoteImage.convertToFormat(replyImagePart.format()); } - QRect painterCurrentRect(0, painterPosition, replyImagePart.width(), replyImagePart.height()); + QRect painterCurrentRect(0, painterPosition, replyImagePart.width(), + replyImagePart.height()); painterPosition += replyImagePart.height(); QPainter painter(&inkNoteImage); @@ -141,13 +150,13 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) return imageData; } -QPair InkNoteImageDownloaderPrivate::createPostRequest(const QString & urlPart, - const int sliceNumber, - const bool isPublic) +QPair InkNoteImageDownloaderPrivate::createPostRequest( + const QString & urlPart, const int sliceNumber, const bool isPublic) { QNetworkRequest request; request.setUrl(QUrl(urlPart + QString::number(sliceNumber))); - request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded")); + request.setHeader(QNetworkRequest::ContentTypeHeader, + QStringLiteral("application/x-www-form-urlencoded")); QByteArray postData = ""; // not QByteArray()! or else ReplyFetcher will not work. if (!isPublic) { From b846c21ad65076ddab8f9ee0086c3410ea0d7f70 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 10 Sep 2019 07:44:49 +0300 Subject: [PATCH 004/188] Limit columnar width of non-generated code --- QEverCloud/headers/AsyncResult.h | 36 ++++--- QEverCloud/headers/EventLoopFinisher.h | 8 +- QEverCloud/headers/EverCloudException.h | 101 ++++++++++++-------- QEverCloud/headers/Exceptions.h | 100 +++++++++++++------ QEverCloud/headers/Export.h | 6 +- QEverCloud/headers/Globals.h | 4 +- QEverCloud/headers/InkNoteImageDownloader.h | 59 +++++++----- QEverCloud/headers/OAuth.h | 17 ++-- QEverCloud/headers/Optional.h | 90 ++++++++++------- QEverCloud/headers/QEverCloud.h | 4 +- QEverCloud/headers/QEverCloudOAuth.h | 6 +- QEverCloud/headers/Thumbnail.h | 50 ++++++---- QEverCloud/headers/VersionInfo.h.in | 8 +- QEverCloud/src/Http.cpp | 2 +- 14 files changed, 306 insertions(+), 185 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 702cfee5..a6d3dcf5 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_ASYNC_RESULT_H @@ -31,14 +31,18 @@ QT_FORWARD_DECLARE_CLASS(AsyncResultPrivate) NoteStore* ns; Note note; ... -QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, [ns](QVariant result, QSharedPointer error) { - if(!error.isNull()) { - // do something in case of an error - } else { - Note note = result.value(); - // process returned result - } -}); +QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, + [ns](QVariant result, + QSharedPointer error) + { + if(!error.isNull()) { + // do something in case of an error + } + else { + Note note = result.value(); + // process returned result + } + }); @endcode */ class QEVERCLOUD_EXPORT AsyncResult: public QObject @@ -51,10 +55,12 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject public: typedef QVariant (*ReadFunctionType)(QByteArray replyData); - AsyncResult(QString url, QByteArray postData, ReadFunctionType readFunction = AsyncResult::asIs, + AsyncResult(QString url, QByteArray postData, + ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = Q_NULLPTR); - AsyncResult(QNetworkRequest request, QByteArray postData, ReadFunctionType readFunction = AsyncResult::asIs, + AsyncResult(QNetworkRequest request, QByteArray postData, + ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = Q_NULLPTR); ~AsyncResult(); @@ -72,9 +78,11 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * @brief Emitted upon asyncronous call completition. * @param result * @param error - * error.isNull() != true in case of an error. See EverCloudExceptionData for more details. + * error.isNull() != true in case of an error. See EverCloudExceptionData + * for more details. * - * AsyncResult deletes itself after emitting this signal. You don't have to manage it's lifetime explicitly. + * AsyncResult deletes itself after emitting this signal. You don't have to + * manage it's lifetime explicitly. */ void finished(QVariant result, QSharedPointer error); diff --git a/QEverCloud/headers/EventLoopFinisher.h b/QEverCloud/headers/EventLoopFinisher.h index 8ef57378..1edd9f5a 100644 --- a/QEverCloud/headers/EventLoopFinisher.h +++ b/QEverCloud/headers/EventLoopFinisher.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_EVENT_LOOP_FINISHER_H @@ -23,7 +23,9 @@ class QEVERCLOUD_EXPORT EventLoopFinisher: public QObject { Q_OBJECT public: - explicit EventLoopFinisher(QEventLoop * loop, int exitCode, QObject * parent = Q_NULLPTR); + explicit EventLoopFinisher( + QEventLoop * loop, int exitCode, QObject * parent = Q_NULLPTR); + ~EventLoopFinisher(); public Q_SLOTS: diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index 2d4f5ae4..4463d5d4 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_EVER_CLOUD_EXCEPTION_H @@ -45,44 +45,65 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception /** * @brief EverCloudException counterpart for asynchronous API. * - * Asynchronous functions cannot throw exceptions so descendants of EverCloudExceptionData are retunded instead - * in case of an error. Every exception class has its own counterpart. - * The EverCloudExceptionData descendants hierarchy is a copy of the EverCloudException descendants hierarchy. + * Asynchronous functions cannot throw exceptions so descendants of + * EverCloudExceptionData are retunded instead in case of an error. Every + * exception class has its own counterpart. The EverCloudExceptionData + * descendants hierarchy is a copy of the EverCloudException descendants + * hierarchy. * - * The main reason not to use exception classes directly is that dynamic_cast does not work across module (exe, dll, etc) boundaries - * in general, while `qobject_cast` do work as expected. That's why I decided to inherit my error classes from QObject. + * The main reason not to use exception classes directly is that dynamic_cast + * does not work across module (exe, dll, etc) boundaries in general, while + * `qobject_cast` do work as expected. That's why I decided to inherit my error + * classes from QObject. * * In general error checking in asynchronous API look like this: * * @code NoteStore* ns; ... -QObject::connect(ns->getNotebook(notebookGuid), &AsyncResult::finished, [](QVariant result, QSharedPointer error) { - if(!error.isNull()) { - QSharedPointer errorNotFound = error.objectCast(); - QSharedPointer errorUser = error.objectCast(); - QSharedPointer errorSystem = error.objectCast(); - if(!errorNotFound.isNull()) { - qDebug() << "notebook not found" << errorNotFound.identifier << errorNotFound.key; - } else if(!errorUser.isNull()) { - qDebug() << errorUser.errorMessage; - } else if(!errorSystem.isNull()) { - if(errorSystem.errorCode == EDAMErrorCode::RATE_LIMIT_REACHED) { - qDebug() << "Evernote API rate limits are reached"; - } else if(errorSystem.errorCode == EDAMErrorCode::AUTH_EXPIRED) { - qDebug() << "Authorization token is inspired"; - } else { - // some other Evernote trouble - qDebug() << errorSystem.errorMessage; - } - } else { - // some unexpected error - qDebug() << error.errorMessage; - } - } else { - // success - } -}); +QObject::connect(ns->getNotebook(notebookGuid), &AsyncResult::finished, + [](QVariant result, + QSharedPointer error) + { + if(!error.isNull()) { + QSharedPointer errorNotFound = + error.objectCast(); + QSharedPointer errorUser = + error.objectCast(); + QSharedPointer errorSystem = + error.objectCast(); + if(!errorNotFound.isNull()) { + qDebug() << "notebook not found" + << errorNotFound.identifier << errorNotFound.key; + } + else if(!errorUser.isNull()) { + qDebug() << errorUser.errorMessage; + } + else if(!errorSystem.isNull()) { + if(errorSystem.errorCode == + EDAMErrorCode::RATE_LIMIT_REACHED) + { + qDebug() << "Evernote API rate limits are reached"; + } + else if(errorSystem.errorCode == + EDAMErrorCode::AUTH_EXPIRED) + { + qDebug() << "Authorization token is inspired"; + } + else { + // some other Evernote trouble + qDebug() << errorSystem.errorMessage; + } + } + else { + // some unexpected error + qDebug() << error.errorMessage; + } + } + else { + // success + } + }); @endcode */ @@ -99,15 +120,16 @@ class QEVERCLOUD_EXPORT EverCloudExceptionData: public QObject explicit EverCloudExceptionData(QString error); /** - * If you want to throw an exception that corresponds to a recrived EverCloudExceptionData - * descendant than call this function. Do not use `throw` statement, it's not polymorphic. + * If you want to throw an exception that corresponds to a received + * EverCloudExceptionData descendant than call this function. Do not use + * `throw` statement, it's not polymorphic. */ virtual void throwException() const; }; /** - * All exception sent by Evernote servers (as opposed to other error conditions, for example http errors) are - * descendants of this class. + * All exception sent by Evernote servers (as opposed to other error conditions, + * for example http errors) are descendants of this class. */ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException { @@ -120,7 +142,10 @@ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; }; -/** Asynchronous API conterpart of EvernoteException. See EverCloudExceptionData for more details.*/ +/** + * Asynchronous API conterpart of EvernoteException. See EverCloudExceptionData + * for more details. + */ class QEVERCLOUD_EXPORT EvernoteExceptionData: public EverCloudExceptionData { Q_OBJECT diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index a8e94b25..237c702e 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_EXCEPTIONS_H @@ -54,7 +54,10 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException Type m_type; }; -/** Asynchronous API conterpart of ThriftException. See EverCloudExceptionData for more details.*/ +/** + * Asynchronous API conterpart of ThriftException. See EverCloudExceptionData + * for more details. + */ class QEVERCLOUD_EXPORT ThriftExceptionData: public EverCloudExceptionData { Q_OBJECT @@ -69,45 +72,62 @@ class QEVERCLOUD_EXPORT ThriftExceptionData: public EverCloudExceptionData inline QSharedPointer ThriftException::exceptionData() const { - return QSharedPointer(new ThriftExceptionData(QString::fromUtf8(what()), type())); + return QSharedPointer( + new ThriftExceptionData(QString::fromUtf8(what()), type())); } -/** Asynchronous API conterpart of EDAMUserException. See EverCloudExceptionData for more details.*/ +/** + * Asynchronous API conterpart of EDAMUserException. See EverCloudExceptionData + * for more details. + */ class QEVERCLOUD_EXPORT EDAMUserExceptionData: public EvernoteExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMUserExceptionData) public: - explicit EDAMUserExceptionData(QString error, EDAMErrorCode errorCode, Optional parameter); + explicit EDAMUserExceptionData( + QString error, EDAMErrorCode errorCode, Optional parameter); + virtual void throwException() const Q_DECL_OVERRIDE; protected: - EDAMErrorCode m_errorCode; - Optional m_parameter; + EDAMErrorCode m_errorCode; + Optional m_parameter; }; -/** Asynchronous API conterpart of EDAMSystemException. See EverCloudExceptionData for more details.*/ +/** + * Asynchronous API conterpart of EDAMSystemException. + * See EverCloudExceptionData for more details. + */ class QEVERCLOUD_EXPORT EDAMSystemExceptionData: public EvernoteExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionData) public: - explicit EDAMSystemExceptionData(QString err, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); + explicit EDAMSystemExceptionData( + QString err, EDAMErrorCode errorCode, Optional message, + Optional rateLimitDuration); + virtual void throwException() const Q_DECL_OVERRIDE; protected: - EDAMErrorCode m_errorCode; - Optional m_message; - Optional m_rateLimitDuration; + EDAMErrorCode m_errorCode; + Optional m_message; + Optional m_rateLimitDuration; }; -/** Asynchronous API conterpart of EDAMNotFoundException. See EverCloudExceptionData for more details.*/ +/** + * Asynchronous API conterpart of EDAMNotFoundException. + * See EverCloudExceptionData for more details. + */ class QEVERCLOUD_EXPORT EDAMNotFoundExceptionData: public EvernoteExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMNotFoundExceptionData) public: - explicit EDAMNotFoundExceptionData(QString error, Optional identifier, Optional key); + explicit EDAMNotFoundExceptionData( + QString error, Optional identifier, Optional key); + virtual void throwException() const Q_DECL_OVERRIDE; protected: @@ -115,38 +135,52 @@ class QEVERCLOUD_EXPORT EDAMNotFoundExceptionData: public EvernoteExceptionData Optional m_key; }; -/** Asynchronous API conterpart of EDAMInvalidContactsException. See EverCloudExceptionData for more details.*/ -class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: public EvernoteExceptionData +/** + * Asynchronous API conterpart of EDAMInvalidContactsException. + * See EverCloudExceptionData for more details. + */ +class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: + public EvernoteExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMInvalidContactsExceptionData) public: - explicit EDAMInvalidContactsExceptionData(QList contacts, Optional parameter, Optional > reasons); + explicit EDAMInvalidContactsExceptionData( + QList contacts, Optional parameter, + Optional > reasons); + virtual void throwException() const Q_DECL_OVERRIDE; protected: - QList< Contact > m_contacts; - Optional< QString > m_parameter; - Optional< QList< EDAMInvalidContactReason > > m_reasons; + QList m_contacts; + Optional m_parameter; + Optional> m_reasons; }; /** * EDAMSystemException for `errorCode = RATE_LIMIT_REACHED` */ -class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: public EDAMSystemException +class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: + public EDAMSystemException { public: virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; }; -/** Asynchronous API conterpart of EDAMSystemExceptionRateLimitReached. See EverCloudExceptionData for more details.*/ -class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: public EDAMSystemExceptionData +/** + * Asynchronous API conterpart of EDAMSystemExceptionRateLimitReached. + * See EverCloudExceptionData for more details. + */ +class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: + public EDAMSystemExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionRateLimitReachedData) public: - explicit EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode errorCode, Optional message, - Optional rateLimitDuration); + explicit EDAMSystemExceptionRateLimitReachedData( + QString error, EDAMErrorCode errorCode, Optional message, + Optional rateLimitDuration); + virtual void throwException() const Q_DECL_OVERRIDE; }; @@ -159,14 +193,20 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpired: public EDAMSystemExcepti virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; }; -/** Asynchronous API conterpart of EDAMSystemExceptionAuthExpired. See EverCloudExceptionData for more details.*/ -class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpiredData: public EDAMSystemExceptionData +/** + * Asynchronous API conterpart of EDAMSystemExceptionAuthExpired. + * See EverCloudExceptionData for more details. + */ +class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpiredData: + public EDAMSystemExceptionData { Q_OBJECT Q_DISABLE_COPY(EDAMSystemExceptionAuthExpiredData) public: - explicit EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode errorCode, Optional message, - Optional rateLimitDuration); + explicit EDAMSystemExceptionAuthExpiredData( + QString error, EDAMErrorCode errorCode, Optional message, + Optional rateLimitDuration); + virtual void throwException() const Q_DECL_OVERRIDE; }; diff --git a/QEverCloud/headers/Export.h b/QEverCloud/headers/Export.h index d9fe6f6f..4fbf5aeb 100644 --- a/QEverCloud/headers/Export.h +++ b/QEverCloud/headers/Export.h @@ -1,9 +1,9 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2017 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_EXPORT_H diff --git a/QEverCloud/headers/Globals.h b/QEverCloud/headers/Globals.h index 23ab705e..3ab053c2 100644 --- a/QEverCloud/headers/Globals.h +++ b/QEverCloud/headers/Globals.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_GLOBALS_H diff --git a/QEverCloud/headers/InkNoteImageDownloader.h b/QEverCloud/headers/InkNoteImageDownloader.h index 9c83477e..53fb76fe 100644 --- a/QEverCloud/headers/InkNoteImageDownloader.h +++ b/QEverCloud/headers/InkNoteImageDownloader.h @@ -1,8 +1,8 @@ /** * Copyright (c) 2016-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOD_INK_NOTE_IMAGE_DOWNLOADER_H @@ -23,17 +23,20 @@ class InkNoteImageDownloaderPrivate; /** @endcond */ /** - * @brief the class is for downloading the images of ink notes which can be created - * with the official Evernote client on Windows (only with it, at least at the time - * of this writing). + * @brief the InkNoteImageDownloader class is for downloading the images of ink + * notes which can be created with the official Evernote client on Windows + * (only with it, at least at the time of this writing). * * On all other platforms the most one can get instead of the actual ink note - * is its non-editable image. This class retrieves just these, exclusively in PNG format. + * is its non-editable image. This class retrieves just these, exclusively in + * PNG format. * * NOTE: almost the entirety of this class' content represents an ad-hoc solution * to a completely undocumented feature of Evernote service. A very small glimpse - * of information can be found e.g. here - * but it is practically all one can find. + * of information was once available on Evernote forums but it's deleted now... + * I collected an even smaller glimpse of information in this SO question: + * https://stackoverflow.com/q/39179012/1217285. For all practical purposes + * it is the only piece of information on this feature in existence now. */ class QEVERCLOUD_EXPORT InkNoteImageDownloader { @@ -41,8 +44,8 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader /** * @brief Default constructor. * - * host, shardId, authenticationToken, width, height have to be specified before calling - * @link download @endlink or @link createPostRequest @endlink + * host, shardId, authenticationToken, width, height have to be specified + * before calling @link download @endlink or @link createPostRequest @endlink */ InkNoteImageDownloader(); @@ -51,7 +54,8 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader * @param host * www.evernote.com or sandbox.evernote.com * @param shardId - * You can get the value from UserStore service or as a result of an authentication. + * You can get the value from UserStore service or as a result of an + * authentication. * @param authenticationToken * For working private ink notes you must supply a valid authentication token. * For public resources the value specified is not used. @@ -60,8 +64,9 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader * @param height * Height of the ink note's resource */ - InkNoteImageDownloader(QString host, QString shardId, - QString authenticationToken, int width, int height); + InkNoteImageDownloader( + QString host, QString shardId, QString authenticationToken, int width, + int height); virtual ~InkNoteImageDownloader(); @@ -73,7 +78,8 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader /** * @param shardId - * You can get the value from UserStore service or as a result of an authentication. + * You can get the value from UserStore service or as a result of an + * authentication. */ InkNoteImageDownloader & setShardId(QString shardId); @@ -99,22 +105,23 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader /** * @brief Downloads the image for the ink note. * - * Unlike other pieces of QEverCloud API, downloading of ink note images is currently - * synchronous only. The reason for that is that AsyncResult is bounded to a single - * QNetworkRequest object but downloading of the ink note image might take multiple - * requests for several ink note image's vertical stripes which are then merged - * together to form a single image. Downloading the entire ink note's image - * via a single request works sometimes but sometimes Evernote replies to such request - * with messed up data which cannot be loaded into a QImage. The reason for that behaviour - * is unknown at the moment, and, given the state of official documentation - missing - - * it is likely to stay so. if someone has an idea how to make it more reliable, - * please let me know. + * Unlike other pieces of QEverCloud API, downloading of ink note images is + * currently synchronous only. The reason for that is that AsyncResult is + * bounded to a single QNetworkRequest object but downloading of the ink + * note image might take multiple requests for several ink note image's + * vertical stripes which are then merged together to form a single image. + * Downloading the entire ink note's image via a single request works + * sometimes but sometimes Evernote replies to such request with messed up + * data which cannot be loaded into a QImage. The reason for that behaviour + * is unknown at the moment, and, given the state of official documentation + * - missing - it is likely to stay so. if someone has an idea how to make + * it more reliable, please let me know. * * @param guid * The guid of the ink note's resource * @param isPublic - * Specify true for public ink notes. In this case authentication token is not sent to - * with the request as it shoud be according to the docs. + * Specify true for public ink notes. In this case authentication token is + * not sent to with the request as it shoud be according to the docs. * @return downloaded data. * */ diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index c1e3aaef..c0a7fcda 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_OAUTH_H @@ -46,12 +46,14 @@ class EvernoteOAuthWebViewPrivate; /** * @brief The class is tailored specifically for OAuth authorization with Evernote. * - * While it is functional by itself you probably will prefer to use EvernoteOAuthDialog. + * While it is functional by itself you probably will prefer to use + * EvernoteOAuthDialog. * * %Note that you have to include QEverCloudOAuth.h header. * - * By deafult EvernoteOAuthWebView uses qrand() for generating nonce so do not forget to call qsrand() - * in your application. See @link setNonceGenerator @endlink If you want more control over nonce generation. + * By deafult EvernoteOAuthWebView uses qrand() for generating nonce so do not + * forget to call qsrand() in your application. See @link setNonceGenerator @endlink + * If you want more control over nonce generation. */ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget { @@ -79,7 +81,10 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget */ void authenticate(QString host, QString consumerKey, QString consumerSecret); - /** @return true if the last call to authenticate resulted in a successful authentication. */ + /** + * @return true if the last call to authenticate resulted in a successful + * authentication. + */ bool isSucceeded() const; /** @return error message resulted from the last call to authenticate */ diff --git a/QEverCloud/headers/Optional.h b/QEverCloud/headers/Optional.h index 79af8c07..8d6f0223 100644 --- a/QEverCloud/headers/Optional.h +++ b/QEverCloud/headers/Optional.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_OPTIONAL_H @@ -18,20 +18,25 @@ namespace qevercloud { /** * Supports optional values. * - * Most of the fields in the Evernote API structs are optional. But C++ does not support this notion directly. + * Most of the fields in the Evernote API structs are optional. But C++ does not + * support this notion directly. * - * To implement the concept of optional values conventional Thrift C++ wrapper uses a special field of a struct type - * where each field is of type bool with the same name as a field in the struct. This bool flag indicated was - * the field with the same name in the outer struct assigned or not. + * To implement the concept of optional values conventional Thrift C++ wrapper + * uses a special field of a struct type where each field is of type bool with + * the same name as a field in the struct. This bool flag indicated was the field + * with the same name in the outer struct assigned or not. * - * While this method have its advantages (obviousness and simplicity) I found it very inconvenient to work with. - * You have to check by hand that both values (value itself and its __isset flag) are in sync. - * There is no checks whatsoever against an error and such an error is too easy to make. + * While this method have its advantages (obviousness and simplicity) I found + * it very inconvenient to work with. You have to check by hand that both values + * (value itself and its __isset flag) are in sync. There is no checks whatsoever + * against an error and such an error is too easy to make. * - * So for my library I created a special class that supports the optional value notion explicitly. - * Basically Optional class just holds a bool value that tracks the fact that a value was assigned. But this tracking - * is done automatically and attempts to use unassigned values throw exceptions. In this way errors are much harder to - * make and it's harder for them to slip through testing unnoticed too. + * So for my library I created a special class that supports the optional value + * notion explicitly. Basically Optional class just holds a bool value that + * tracks the fact that a value was assigned. But this tracking is done + * automatically and attempts to use unassigned values throw exceptions. In this + * way errors are much harder to make and it's harder for them to slip through + * testing unnoticed too. * */ template @@ -55,7 +60,8 @@ class Optional {} /** - * Template copy constructor. Allows to be initialized with Optional of any compatible type. + * Template copy constructor. Allows to be initialized with Optional of any + * compatible type. */ template Optional(const Optional & o) : @@ -130,7 +136,8 @@ class Optional operator const T&() const { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return m_value; @@ -144,7 +151,8 @@ class Optional operator T&() { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return m_value; @@ -159,7 +167,8 @@ class Optional const T & ref() const { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return m_value; @@ -168,7 +177,8 @@ class Optional /** * Returs reference to the holded value. * - * There are contexts in C++ where impicit type conversions can't help. For example: + * There are contexts in C++ where impicit type conversions can't help. + * For example: * * @code Optional l; @@ -184,7 +194,8 @@ class Optional * * ... but this is indeed ugly as hell. * - * So I implemented ref() function that returns a reference to the holded value. + * So I implemented ref() function that returns a reference to the holded + * value. * @code Optional l; for(auto s : l.ref()); // not ideal but OK @@ -193,7 +204,8 @@ class Optional T & ref() { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return m_value; @@ -258,11 +270,13 @@ class Optional } /** - * Two syntatic constructs come to mind to use for implementation of access to a struct's/class's field directly from Optional. + * Two syntatic constructs come to mind to use for implementation of access + * to a struct's/class's field directly from Optional. * * One is the dereference operator. * This is what boost::optional uses. While it's conceptually nice - * I found it to be not a very convenient way to refer to structs, especially nested ones. + * I found it to be not a very convenient way to refer to structs, + * especially nested ones. * So I overloaded the operator-> and use smart pointer semantics. * * @code @@ -276,19 +290,24 @@ class Optional @endcode * - * I admit, boost::optional is much more elegant overall. It uses pointer semantics quite clearly and - * in an instantly understandable way. It's universal (* works for any type and not just structs). There is - * no need for implicit type concersions and so there is no subtleties because of it. And so on. + * I admit, boost::optional is much more elegant overall. It uses pointer + * semantics quite clearly and in an instantly understandable way. It's + * universal (works for any type and not just structs). There is no need for + * implicit type concersions and so there is no subtleties because of it. + * And so on. * - * But then referring to struct fields is a chore. And this is the most common use case of Optionals in QEverCloud. + * But then referring to struct fields is a chore. And this is the most + * common use case of Optionals in QEverCloud. * - * So I decided to use non-obvious-on-the-first-sight semantics for my Optional. IMO it's much more convenient when gotten used to. + * So I decided to use non-obvious-on-the-first-sight semantics for my + * Optional. IMO it's much more convenient when gotten used to. * */ T * operator->() { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return &m_value; @@ -300,14 +319,16 @@ class Optional const T * operator->() const { if (!m_isSet) { - throw EverCloudException("qevercloud::Optional: nonexistent value access"); + throw EverCloudException( + "qevercloud::Optional: nonexistent value access"); } return &m_value; } /** - * The function is sometimes useful to simplify checking for the value being set. + * The function is sometimes useful to simplify checking for the value being + * set. * @param defaultValue * The value to return if Optional is not set. * @return Optional value if set and defaultValue otherwise. @@ -321,9 +342,11 @@ class Optional * Two optionals are equal if they are both not set or have * equal values. * - * I do not define `operator==` due to not easily resolvable conflicts with `operator T&`. + * I do not define `operator==` due to not easily resolvable conflicts with + * `operator T&`. * - * Note that `optional == other_optional` may throw but `optional.isEqual(other_optional)` will not. + * Note that `optional == other_optional` may throw but + * `optional.isEqual(other_optional)` will not. */ bool isEqual(const Optional & other) const { @@ -340,7 +363,8 @@ class Optional swap(first.m_value, second.m_value); } -// Visual C++ does not to generate implicit move constructors so this stuff doesn't work with even recent MSVC compilers +// Visual C++ does not to generate implicit move constructors so this stuff +// doesn't work with even recent MSVC compilers #if defined(Q_COMPILER_RVALUE_REFS) && !defined(_MSC_VER) Optional(Optional && other) { diff --git a/QEverCloud/headers/QEverCloud.h b/QEverCloud/headers/QEverCloud.h index 4fe269b7..a3624f82 100644 --- a/QEverCloud/headers/QEverCloud.h +++ b/QEverCloud/headers/QEverCloud.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_INFTHEADER_H diff --git a/QEverCloud/headers/QEverCloudOAuth.h b/QEverCloud/headers/QEverCloudOAuth.h index 94498e3e..3b541c52 100644 --- a/QEverCloud/headers/QEverCloudOAuth.h +++ b/QEverCloud/headers/QEverCloudOAuth.h @@ -1,9 +1,9 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUDOAUTH_INFTHEADER_H diff --git a/QEverCloud/headers/Thumbnail.h b/QEverCloud/headers/Thumbnail.h index ffde2251..4e6d0cf4 100644 --- a/QEverCloud/headers/Thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -2,8 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_THUMBNAIL_H @@ -24,9 +24,11 @@ class ThumbnailPrivate; /** @endcond */ /** - * @brief The class is for downloading thumbnails for notes and resources from Evernote servers. + * @brief The class is for downloading thumbnails for notes and resources from + * Evernote servers. * - * These thumbnails are not available with general EDAM Thrift interface as explained in the + * These thumbnails are not available with general EDAM Thrift interface as + * explained in the * documentation. * * Usage: @@ -64,12 +66,15 @@ class QEVERCLOUD_EXPORT Thumbnail * @param host * www.evernote.com or sandbox.evernote.com * @param shardId - * You can get the value from UserStore service or as a result of an authentication. + * You can get the value from UserStore service or as a result of an + * authentication. * @param authenticationToken - * For working private notes/resources you must supply a valid authentication token. + * For working private notes/resources you must supply a valid + * authentication token. * For public resources the value specified is not used. * @param size - * The size of the thumbnail. Evernote supports values from from 1 to 300. By defualt 300 is used. + * The size of the thumbnail. Evernote supports values from from 1 to 300. + * By default 300 is used. * @param imageType * Thumbnail image type. See ImageType. By default PNG is used. */ @@ -86,20 +91,23 @@ class QEVERCLOUD_EXPORT Thumbnail /** * @param shardId - * You can get the value from UserStore service or as a result of an authentication. + * You can get the value from UserStore service or as a result of an + * authentication. */ Thumbnail & setShardId(QString shardId); /** * @param authenticationToken - * For working private notes/resources you must supply a valid authentication token. + * For working private notes/resources you must supply a valid + * authentication token. * For public resources the value specified is not used. */ Thumbnail & setAuthenticationToken(QString authenticationToken); /** * @param size - * The size of the thumbnail. Evernote supports values from from 1 to 300. By defualt 300 is used. + * The size of the thumbnail. Evernote supports values from from 1 to 300. + * By defualt 300 is used. */ Thumbnail & setSize(int size); @@ -114,32 +122,34 @@ class QEVERCLOUD_EXPORT Thumbnail * @param guid * The note or resource guid * @param isPublic - * Specify true for public notes/resources. In this case authentication token is not sent to - * with the request as it shoud be according to the docs. + * Specify true for public notes/resources. In this case authentication + * token is not sent to with the request as it shoud be according to the docs. * @param isResourceGuid * true if guid denotes a resource and false if it denotes a note. * @return downloaded data. * */ - QByteArray download(Guid guid, bool isPublic = false, bool isResourceGuid = false); + QByteArray download( + Guid guid, bool isPublic = false, bool isResourceGuid = false); /** Asynchronous version of @link download @endlink function*/ - AsyncResult * downloadAsync(Guid guid, bool isPublic = false, bool isResourceGuid = false); + AsyncResult * downloadAsync( + Guid guid, bool isPublic = false, bool isResourceGuid = false); /** * @brief Prepares a POST request for a thumbnail download. * @param guid * The note or resource guid * @param isPublic - * Specify true for public notes/resources. In this case authentication token is not sent to - * with the request as it shoud be according to the docs. + * Specify true for public notes/resources. In this case authentication + * token is not sent to with the request as it shoud be according to the docs. * @param isResourceGuid * true if guid denotes a resource and false if it denotes a note. - * @return a pair of QNetworkRequest for the POST request and data that must be posted with the request. + * @return a pair of QNetworkRequest for the POST request and data that must + * be posted with the request. */ - QPair createPostRequest(qevercloud::Guid guid, - bool isPublic = false, - bool isResourceGuid = false); + QPair createPostRequest( + qevercloud::Guid guid, bool isPublic = false, bool isResourceGuid = false); private: ThumbnailPrivate * const d_ptr; diff --git a/QEverCloud/headers/VersionInfo.h.in b/QEverCloud/headers/VersionInfo.h.in index 4b45e2c1..c5a606d0 100644 --- a/QEverCloud/headers/VersionInfo.h.in +++ b/QEverCloud/headers/VersionInfo.h.in @@ -1,8 +1,8 @@ /** * Copyright (c) 2017-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: - * https://opensource.org/licenses/MIT + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT */ #ifndef QEVERCLOUD_VERSION_INFO_H @@ -19,8 +19,8 @@ @QEVERCLOUD_HAS_OAUTH@ /** - * This macro tells whether QEverCloud library uses QtWebEngine backend for OAuth support - * (if it was built with OAuth support) + * This macro tells whether QEverCloud library uses QtWebEngine backend for + * OAuth support (if it was built with OAuth support) */ @QEVERCLOUD_USES_QT_WEB_ENGINE@ diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 66d89680..592af21e 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -68,7 +68,7 @@ void ReplyFetcher::onDownloadProgress(qint64, qint64) void ReplyFetcher::checkForTimeout() { - const int timeout = connectionTimeout(); + const int timeout = requestTimeout(); if (timeout < 0) { return; } From 380c682ef65d42e01588578066ad3edd24c4a0c8 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 17 Sep 2019 07:57:16 +0300 Subject: [PATCH 005/188] Limit columnar width of some more non-generated code --- QEverCloud/src/AsyncResult.cpp | 46 +++++++--- QEverCloud/src/EventLoopFinisher.cpp | 7 +- QEverCloud/src/EverCloudException.cpp | 12 ++- QEverCloud/src/Exceptions.cpp | 73 +++++++++------ QEverCloud/src/Globals.cpp | 6 +- QEverCloud/src/Http.cpp | 69 +++++++++----- QEverCloud/src/Http.h | 20 +++-- QEverCloud/src/Impl.h | 9 +- QEverCloud/src/InkNoteImageDownloader.cpp | 3 +- QEverCloud/src/OAuth.cpp | 33 ++++--- QEverCloud/src/ServicesNonGenerated.cpp | 9 +- QEverCloud/src/Thrift.h | 105 ++++++++++++++++------ QEverCloud/src/Thumbnail.cpp | 21 +++-- 13 files changed, 286 insertions(+), 127 deletions(-) diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 03e4ef25..d0b84b9c 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -21,10 +22,12 @@ namespace qevercloud { class AsyncResultPrivate { public: - explicit AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, + explicit AsyncResultPrivate(QString url, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); - explicit AsyncResultPrivate(QNetworkRequest request, QByteArray postData, AsyncResult::ReadFunctionType readFunction, + explicit AsyncResultPrivate(QNetworkRequest request, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); @@ -39,7 +42,8 @@ class AsyncResultPrivate Q_DECLARE_PUBLIC(AsyncResult) }; -AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, +AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : m_request(createEvernoteRequest(url)), m_postData(postData), @@ -48,7 +52,9 @@ AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, AsyncRe q_ptr(q) {} -AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, QByteArray postData, AsyncResult::ReadFunctionType readFunction, +AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, + QByteArray postData, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : m_request(request), m_postData(postData), @@ -66,7 +72,8 @@ QVariant AsyncResult::asIs(QByteArray replyData) return replyData; } -AsyncResult::AsyncResult(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, +AsyncResult::AsyncResult(QString url, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate(url, postData, readFunction, autoDelete, this)) @@ -74,7 +81,8 @@ AsyncResult::AsyncResult(QString url, QByteArray postData, AsyncResult::ReadFunc QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); } -AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, qevercloud::AsyncResult::ReadFunctionType readFunction, +AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, + qevercloud::AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate(request, postData, readFunction, autoDelete, this)) @@ -90,7 +98,9 @@ AsyncResult::~AsyncResult() bool AsyncResult::waitForFinished(int timeout) { QEventLoop loop; - QObject::connect(this, SIGNAL(finished(QVariant,QSharedPointer)), &loop, SLOT(quit())); + QObject::connect(this, + SIGNAL(finished(QVariant,QSharedPointer)), + &loop, SLOT(quit())); if(timeout >= 0) { QTimer timer; @@ -111,7 +121,8 @@ void AsyncResult::start() ReplyFetcher * replyFetcher = new ReplyFetcher; QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &AsyncResult::onReplyFetched); - replyFetcher->start(evernoteNetworkAccessManager(), d->m_request, d->m_postData); + replyFetcher->start( + evernoteNetworkAccessManager(), d->m_request, d->m_postData); } void AsyncResult::onReplyFetched(QObject * rp) @@ -125,10 +136,14 @@ void AsyncResult::onReplyFetched(QObject * rp) try { if (reply->isError()) { - error = QSharedPointer(new EverCloudExceptionData(reply->errorText())); + error = QSharedPointer( + new EverCloudExceptionData(reply->errorText())); } else if(reply->httpStatusCode() != 200) { - error = QSharedPointer(new EverCloudExceptionData(QStringLiteral("HTTP Status Code = %1").arg(reply->httpStatusCode()))); + error = QSharedPointer( + new EverCloudExceptionData( + QString::fromUtf8("HTTP Status Code = %1") + .arg(reply->httpStatusCode()))); } else { result = d->m_readFunction(reply->receivedData()); @@ -138,11 +153,14 @@ void AsyncResult::onReplyFetched(QObject * rp) error = e.exceptionData(); } catch(const std::exception & e) { - error = QSharedPointer(new EverCloudExceptionData(QStringLiteral("Exception of type \"%1\" with the message: %2") - .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); + error = QSharedPointer( + new EverCloudExceptionData( + QString::fromUtf8("Exception of type \"%1\" with the message: %2") + .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); } catch(...) { - error = QSharedPointer(new EverCloudExceptionData(QStringLiteral("Unknown exception"))); + error = QSharedPointer( + new EverCloudExceptionData(QStringLiteral("Unknown exception"))); } emit finished(result, error); diff --git a/QEverCloud/src/EventLoopFinisher.cpp b/QEverCloud/src/EventLoopFinisher.cpp index 7cb688c0..316bbda3 100644 --- a/QEverCloud/src/EventLoopFinisher.cpp +++ b/QEverCloud/src/EventLoopFinisher.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -22,7 +23,9 @@ class EventLoopFinisherPrivate int m_exitCode; }; -qevercloud::EventLoopFinisher::EventLoopFinisher(QEventLoop * loop, int exitCode, QObject * parent) : +qevercloud::EventLoopFinisher::EventLoopFinisher(QEventLoop * loop, + int exitCode, + QObject * parent) : QObject(parent), d_ptr(new EventLoopFinisherPrivate(loop, exitCode)) {} diff --git a/QEverCloud/src/EverCloudException.cpp b/QEverCloud/src/EverCloudException.cpp index 6f5c3d14..4b25c2a5 100644 --- a/QEverCloud/src/EverCloudException.cpp +++ b/QEverCloud/src/EverCloudException.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -34,9 +35,11 @@ const char * EverCloudException::what() const throw() return m_error.constData(); } -QSharedPointer QEVERCLOUD_EXPORT EverCloudException::exceptionData() const +QSharedPointer +QEVERCLOUD_EXPORT EverCloudException::exceptionData() const { - return QSharedPointer(new EverCloudExceptionData(QString::fromUtf8(what()))); + return QSharedPointer( + new EverCloudExceptionData(QString::fromUtf8(what()))); } EverCloudExceptionData::EverCloudExceptionData(QString error) : @@ -66,7 +69,8 @@ EvernoteException::EvernoteException(const char * error) : QSharedPointer EvernoteException::exceptionData() const { - return QSharedPointer(new EvernoteExceptionData(QString::fromUtf8(what()))); + return QSharedPointer( + new EvernoteExceptionData(QString::fromUtf8(what()))); } EvernoteExceptionData::EvernoteExceptionData(QString error) : diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 1f1f0ca8..25983934 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -106,7 +107,8 @@ const char * EDAMSystemException::what() const throw() } if (rateLimitDuration.isSet()) { - m_error += QStringLiteral(" rateLimitDuration= %1 sec.").arg(rateLimitDuration).toUtf8(); + m_error += QString::fromUtf8(" rateLimitDuration= %1 sec.") + .arg(rateLimitDuration).toUtf8(); } } @@ -183,13 +185,16 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) return ThriftException(type, error); } -QSharedPointer EDAMInvalidContactsException::exceptionData() const +QSharedPointer +EDAMInvalidContactsException::exceptionData() const { - return QSharedPointer(new EDAMInvalidContactsExceptionData(this->contacts, this->parameter, this->reasons)); + return QSharedPointer( + new EDAMInvalidContactsExceptionData(contacts, parameter, reasons)); } -EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData(QList contacts, Optional parameter, - Optional > reasons) : +EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData( + QList contacts, Optional parameter, + Optional > reasons) : EvernoteExceptionData(QStringLiteral("EDAMInvalidContactsExceptionData")), m_contacts(contacts), m_parameter(parameter), @@ -212,7 +217,8 @@ void EDAMInvalidContactsExceptionData::throwException() const QSharedPointer EDAMUserException::exceptionData() const { - return QSharedPointer(new EDAMUserExceptionData(QString::fromUtf8(what()), this->errorCode, this->parameter)); + return QSharedPointer( + new EDAMUserExceptionData(QString::fromUtf8(what()), errorCode, parameter)); } void EDAMUserExceptionData::throwException() const @@ -225,11 +231,15 @@ void EDAMUserExceptionData::throwException() const QSharedPointer EDAMSystemException::exceptionData() const { - return QSharedPointer(new EDAMSystemExceptionData(QString::fromUtf8(what()), this->errorCode, this->message, - this->rateLimitDuration)); + return QSharedPointer( + new EDAMSystemExceptionData( + QString::fromUtf8(what()), errorCode, message, + rateLimitDuration)); } -EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, EDAMErrorCode errorCode, Optional message, +EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, + EDAMErrorCode errorCode, + Optional message, Optional rateLimitDuration) : EvernoteExceptionData(error), m_errorCode(errorCode), @@ -246,9 +256,9 @@ void EDAMSystemExceptionData::throwException() const throw exception; } -EDAMSystemExceptionRateLimitReachedData::EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode errorCode, - Optional message, - Optional rateLimitDuration) : +EDAMSystemExceptionRateLimitReachedData::EDAMSystemExceptionRateLimitReachedData( + QString error, EDAMErrorCode errorCode, Optional message, + Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) {} @@ -263,10 +273,13 @@ void EDAMSystemExceptionRateLimitReachedData::throwException() const QSharedPointer EDAMNotFoundException::exceptionData() const { - return QSharedPointer(new EDAMNotFoundExceptionData(QString::fromUtf8(what()), identifier, key)); + return QSharedPointer( + new EDAMNotFoundExceptionData(QString::fromUtf8(what()), identifier, key)); } -EDAMNotFoundExceptionData::EDAMNotFoundExceptionData(QString error, Optional identifier, Optional key) : +EDAMNotFoundExceptionData::EDAMNotFoundExceptionData(QString error, + Optional identifier, + Optional key) : EvernoteExceptionData(error), m_identifier(identifier), m_key(key) @@ -331,23 +344,27 @@ void throwEDAMSystemException(const EDAMSystemException & baseException) throw baseException; } -QSharedPointer EDAMSystemExceptionRateLimitReached::exceptionData() const +QSharedPointer +EDAMSystemExceptionRateLimitReached::exceptionData() const { - return QSharedPointer(new EDAMSystemExceptionRateLimitReachedData(QString::fromUtf8(what()), this->errorCode, - this->message, - this->rateLimitDuration)); + return QSharedPointer( + new EDAMSystemExceptionRateLimitReachedData(QString::fromUtf8(what()), + errorCode, message, + rateLimitDuration)); } -QSharedPointer EDAMSystemExceptionAuthExpired::exceptionData() const +QSharedPointer +EDAMSystemExceptionAuthExpired::exceptionData() const { - return QSharedPointer(new EDAMSystemExceptionAuthExpiredData(QString::fromUtf8(what()), this->errorCode, - this->message, - this->rateLimitDuration)); + return QSharedPointer( + new EDAMSystemExceptionAuthExpiredData(QString::fromUtf8(what()), + errorCode, message, + rateLimitDuration)); } -EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode errorCode, - Optional message, - Optional rateLimitDuration) : +EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData( + QString error, EDAMErrorCode errorCode, Optional message, + Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) {} @@ -370,7 +387,9 @@ void ThriftExceptionData::throwException() const throw ThriftException(m_type, errorMessage); } -EDAMUserExceptionData::EDAMUserExceptionData(QString error, EDAMErrorCode errorCode, Optional parameter) : +EDAMUserExceptionData::EDAMUserExceptionData(QString error, + EDAMErrorCode errorCode, + Optional parameter) : EvernoteExceptionData(error), m_errorCode(errorCode), m_parameter(parameter) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 8c0f3e01..2dcac313 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -20,7 +21,8 @@ QNetworkAccessManager * evernoteNetworkAccessManager() static QMutex networkAccessManagerMutex; QMutexLocker mutexLocker(&networkAccessManagerMutex); if (pNetworkAccessManager.isNull()) { - pNetworkAccessManager = QSharedPointer(new QNetworkAccessManager); + pNetworkAccessManager = QSharedPointer( + new QNetworkAccessManager); } return pNetworkAccessManager.data(); } diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 592af21e..4db5492d 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -27,7 +28,8 @@ ReplyFetcher::ReplyFetcher(QObject * parent) : m_httpStatusCode(0) { m_ticker = new QTimer(this); - QObject::connect(m_ticker, &QTimer::timeout, this, &ReplyFetcher::checkForTimeout); + QObject::connect(m_ticker, &QTimer::timeout, + this, &ReplyFetcher::checkForTimeout); } void ReplyFetcher::start(QNetworkAccessManager * nam, QUrl url) @@ -37,28 +39,36 @@ void ReplyFetcher::start(QNetworkAccessManager * nam, QUrl url) start(nam, request); } -void ReplyFetcher::start(QNetworkAccessManager * nam, QNetworkRequest request, QByteArray postData) +void ReplyFetcher::start( + QNetworkAccessManager * nam, QNetworkRequest request, QByteArray postData) { m_httpStatusCode= 0; m_errorText.clear(); m_receivedData.clear(); - m_success = true; // not in finished() signal handler, it might not be called according to the docs + m_success = true; // not in finished() signal handler, it might not be + // called according to the docs // besides, I've added timeout feature m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); m_ticker->start(1000); if (postData.isNull()) { - m_reply = QSharedPointer(nam->get(request), &QObject::deleteLater); + m_reply = QSharedPointer( + nam->get(request), &QObject::deleteLater); } else { - m_reply = QSharedPointer(nam->post(request, postData), &QObject::deleteLater); + m_reply = QSharedPointer( + nam->post(request, postData), &QObject::deleteLater); } - QObject::connect(m_reply.data(), &QNetworkReply::finished, this, &ReplyFetcher::onFinished); - QObject::connect(m_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onError(QNetworkReply::NetworkError))); - QObject::connect(m_reply.data(), &QNetworkReply::sslErrors, this, &ReplyFetcher::onSslErrors); - QObject::connect(m_reply.data(), &QNetworkReply::downloadProgress, this, &ReplyFetcher::onDownloadProgress); + QObject::connect(m_reply.data(), &QNetworkReply::finished, + this, &ReplyFetcher::onFinished); + QObject::connect(m_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), + this, SLOT(onError(QNetworkReply::NetworkError))); + QObject::connect(m_reply.data(), &QNetworkReply::sslErrors, + this, &ReplyFetcher::onSslErrors); + QObject::connect(m_reply.data(), &QNetworkReply::downloadProgress, + this, &ReplyFetcher::onDownloadProgress); } void ReplyFetcher::onDownloadProgress(qint64, qint64) @@ -87,7 +97,8 @@ void ReplyFetcher::onFinished() } m_receivedData = m_reply->readAll(); - m_httpStatusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_httpStatusCode = m_reply->attribute( + QNetworkRequest::HttpStatusCodeAttribute).toInt(); QObject::disconnect(m_reply.data()); emit replyFetched(this); @@ -125,9 +136,11 @@ QByteArray simpleDownload(QNetworkAccessManager* nam, QNetworkRequest request, { ReplyFetcher * fetcher = new ReplyFetcher; QEventLoop loop; - QObject::connect(fetcher, SIGNAL(replyFetched(QObject*)), &loop, SLOT(quit())); + QObject::connect(fetcher, SIGNAL(replyFetched(QObject*)), + &loop, SLOT(quit())); - ReplyFetcherLauncher * fetcherLauncher = new ReplyFetcherLauncher(fetcher, nam, request, postData); + ReplyFetcherLauncher * fetcherLauncher = + new ReplyFetcherLauncher(fetcher, nam, request, postData); QTimer::singleShot(0, fetcherLauncher, SLOT(start())); loop.exec(QEventLoop::ExcludeUserInputEvents); @@ -152,12 +165,21 @@ QNetworkRequest createEvernoteRequest(QString url) { QNetworkRequest request; request.setUrl(url); - request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-thrift")); + request.setHeader(QNetworkRequest::ContentTypeHeader, + QStringLiteral("application/x-thrift")); #if QT_VERSION < 0x050000 - request.setRawHeader("User-Agent", QString::fromUtf8("QEverCloud %1.%2").arg(libraryVersion() / 10000).arg(libraryVersion() % 10000).toLatin1()); + request.setRawHeader( + "User-Agent", + QString::fromUtf8("QEverCloud %1.%2") + .arg(libraryVersion() / 10000) + .arg(libraryVersion() % 10000).toLatin1()); #else - request.setHeader(QNetworkRequest::UserAgentHeader, QStringLiteral("QEverCloud %1.%2").arg(libraryVersion() / 10000).arg(libraryVersion() % 10000)); + request.setHeader( + QNetworkRequest::UserAgentHeader, + QString::fromUtf8("QEverCloud %1.%2") + .arg(libraryVersion() / 10000) + .arg(libraryVersion() % 10000)); #endif request.setRawHeader("Accept", "application/x-thrift"); @@ -167,17 +189,24 @@ QNetworkRequest createEvernoteRequest(QString url) QByteArray askEvernote(QString url, QByteArray postData) { int httpStatusCode = 0; - QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), createEvernoteRequest(url), postData, &httpStatusCode); + QByteArray reply = simpleDownload( + evernoteNetworkAccessManager(), + createEvernoteRequest(url), + postData, + &httpStatusCode); if (httpStatusCode != 200) { - throw EverCloudException(QStringLiteral("HTTP Status Code = %1").arg(httpStatusCode)); + throw EverCloudException( + QString::fromUtf8("HTTP Status Code = %1").arg(httpStatusCode)); } return reply; } -ReplyFetcherLauncher::ReplyFetcherLauncher(ReplyFetcher * fetcher, QNetworkAccessManager * nam, - const QNetworkRequest & request, const QByteArray & postData) : +ReplyFetcherLauncher::ReplyFetcherLauncher(ReplyFetcher * fetcher, + QNetworkAccessManager * nam, + const QNetworkRequest & request, + const QByteArray & postData) : QObject(nam), m_fetcher(fetcher), m_nam(nam), diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index 8adf409e..4101c519 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -36,11 +37,17 @@ class ReplyFetcher: public QObject ReplyFetcher(QObject * parent = Q_NULLPTR); void start(QNetworkAccessManager * nam, QUrl url); + // if !postData.isNull() then POST will be issued instead of GET - void start(QNetworkAccessManager * nam, QNetworkRequest request, QByteArray postData = QByteArray()); + void start(QNetworkAccessManager * nam, QNetworkRequest request, + QByteArray postData = QByteArray()); + bool isError() { return !m_success; } + QString errorText() { return m_errorText; } + QByteArray receivedData() { return m_receivedData; } + int httpStatusCode() { return m_httpStatusCode; } Q_SIGNALS: @@ -71,14 +78,17 @@ QNetworkRequest createEvernoteRequest(QString url); QByteArray askEvernote(QString url, QByteArray postData); QByteArray simpleDownload(QNetworkAccessManager * nam, QNetworkRequest request, - QByteArray postData = QByteArray(), int * httpStatusCode = Q_NULLPTR); + QByteArray postData = QByteArray(), + int * httpStatusCode = Q_NULLPTR); class ReplyFetcherLauncher: public QObject { Q_OBJECT public: - explicit ReplyFetcherLauncher(ReplyFetcher * fetcher, QNetworkAccessManager * nam, - const QNetworkRequest & request, const QByteArray & postData); + explicit ReplyFetcherLauncher(ReplyFetcher * fetcher, + QNetworkAccessManager * nam, + const QNetworkRequest & request, + const QByteArray & postData); public Q_SLOTS: void start(); diff --git a/QEverCloud/src/Impl.h b/QEverCloud/src/Impl.h index 0fdb3b3b..3a5552b9 100644 --- a/QEverCloud/src/Impl.h +++ b/QEverCloud/src/Impl.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -21,10 +22,12 @@ @mainpage About QEverCloud This library presents complete Evernote SDK for Qt. -All the functionality that is described on Evernote site +All the functionality that is described on +Evernote site is implemented and ready to use. In particular OAuth autentication is implemented. -Include *QEverCloud.h* or *QEverCloudOAuth.h* to use the library. The latter header is needed if you use OAuth functionality. +Include *QEverCloud.h* or *QEverCloudOAuth.h* to use the library. The latter +header is needed if you use OAuth functionality. QEverCloud on GitHub diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index c0fd316d..aa09f2ed 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -1,7 +1,8 @@ /** * Copyright (c) 2016-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index dc1fd1da..b9f20fee 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -41,7 +42,8 @@ namespace { quint64 random; std::memcpy(&random, &randomData.constData()[0], sizeof(random)); res ^= random; - std::memcpy(&random, &randomData.constData()[sizeof(random)], sizeof(random)); + std::memcpy(&random, &randomData.constData()[sizeof(random)], + sizeof(random)); res ^= random; return res; @@ -130,7 +132,8 @@ EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : setLayout(pLayout); } -void EvernoteOAuthWebView::authenticate(QString host, QString consumerKey, QString consumerSecret) +void EvernoteOAuthWebView::authenticate( + QString host, QString consumerKey, QString consumerSecret) { Q_D(EvernoteOAuthWebView); d->m_host = host; @@ -140,8 +143,12 @@ void EvernoteOAuthWebView::authenticate(QString host, QString consumerKey, QStri qint64 timestamp = QDateTime::currentMSecsSinceEpoch()/1000; quint64 nonce = nonceGenerator()(); - d->m_oauthUrlBase = QStringLiteral("https://%1/oauth?oauth_consumer_key=%2&oauth_signature=%3&oauth_signature_method=PLAINTEXT&oauth_timestamp=%4&oauth_nonce=%5") - .arg(host, consumerKey, consumerSecret).arg(timestamp).arg(nonce); + d->m_oauthUrlBase = + QString::fromUtf8("https://%1/oauth?oauth_consumer_key=%2&" + "oauth_signature=%3&" + "oauth_signature_method=PLAINTEXT&" + "oauth_timestamp=%4&oauth_nonce=%5") + .arg(host, consumerKey, consumerSecret).arg(timestamp).arg(nonce); // step 1: acquire temporary token ReplyFetcher * replyFetcher = new ReplyFetcher(); @@ -202,7 +209,8 @@ void EvernoteOAuthWebViewPrivate::temporaryFinished(QObject * rf) // step 2: directing a user to the login page QObject::connect(this, &EvernoteOAuthWebViewPrivate::urlChanged, this, &EvernoteOAuthWebViewPrivate::onUrlChanged); - QUrl loginUrl(QStringLiteral("https://%1//OAuth.action?%2").arg(m_host, token)); + QUrl loginUrl(QString::fromUtf8("https://%1//OAuth.action?%2") + .arg(m_host, token)); setUrl(loginUrl); } @@ -264,10 +272,12 @@ void EvernoteOAuthWebViewPrivate::permanentFinished(QObject * rf) } m_oauthResult.noteStoreUrl = params[QStringLiteral("edam_noteStoreUrl")]; - m_oauthResult.expires = Timestamp(params[QStringLiteral("edam_expires")].toLongLong()); + m_oauthResult.expires = + Timestamp(params[QStringLiteral("edam_expires")].toLongLong()); m_oauthResult.shardId = params[QStringLiteral("edam_shard")]; m_oauthResult.userId = params[QStringLiteral("edam_userId")].toInt(); - m_oauthResult.webApiUrlPrefix = params[QStringLiteral("edam_webApiUrlPrefix")]; + m_oauthResult.webApiUrlPrefix = + params[QStringLiteral("edam_webApiUrlPrefix")]; m_oauthResult.authenticationToken = params[QStringLiteral("oauth_token")]; emit authenticationFinished(true); @@ -285,7 +295,8 @@ void EvernoteOAuthWebViewPrivate::clearHtml() class EvernoteOAuthDialogPrivate { public: - EvernoteOAuthDialogPrivate(const QString & host, const QString & consumerKey, const QString & consumerSecret) : + EvernoteOAuthDialogPrivate(const QString & host, const QString & consumerKey, + const QString & consumerSecret) : m_pWebView(Q_NULLPTR), m_host(host), m_consumerKey(consumerKey), @@ -298,7 +309,9 @@ class EvernoteOAuthDialogPrivate QString m_consumerSecret; }; -EvernoteOAuthDialog::EvernoteOAuthDialog(QString consumerKey, QString consumerSecret, QString host, QWidget *parent) : +EvernoteOAuthDialog::EvernoteOAuthDialog(QString consumerKey, + QString consumerSecret, + QString host, QWidget *parent) : QDialog(parent), d_ptr(new EvernoteOAuthDialogPrivate(host, consumerKey, consumerSecret)) { diff --git a/QEverCloud/src/ServicesNonGenerated.cpp b/QEverCloud/src/ServicesNonGenerated.cpp index 2eef8cec..ddc3a1d7 100644 --- a/QEverCloud/src/ServicesNonGenerated.cpp +++ b/QEverCloud/src/ServicesNonGenerated.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -39,7 +40,8 @@ UserStore::UserStore(QString host, QString authenticationToken, QObject * parent * This token that will be used as the default token. * */ -NoteStore::NoteStore(QString noteStoreUrl, QString authenticationToken, QObject * parent) : +NoteStore::NoteStore(QString noteStoreUrl, QString authenticationToken, + QObject * parent) : QObject(parent) { setNoteStoreUrl(noteStoreUrl); @@ -49,7 +51,8 @@ NoteStore::NoteStore(QString noteStoreUrl, QString authenticationToken, QObject /** * Constructs NoteStore object. * - * noteStoreUrl and possibly authenticationToken are expected to be specified later. + * noteStoreUrl and possibly authenticationToken are expected to be specified + * later. */ NoteStore::NoteStore(QObject * parent) : QObject(parent) diff --git a/QEverCloud/src/Thrift.h b/QEverCloud/src/Thrift.h index 803957e3..e6e4370e 100644 --- a/QEverCloud/src/Thrift.h +++ b/QEverCloud/src/Thrift.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -122,7 +123,9 @@ class ThriftBinaryBufferWriter QByteArray buffer() { return m_buf; } - quint32 writeMessageBegin(QString name, const ThriftMessageType::type messageType, const qint32 seqid) + quint32 writeMessageBegin(QString name, + const ThriftMessageType::type messageType, + const qint32 seqid) { if (m_strict) { @@ -153,7 +156,9 @@ class ThriftBinaryBufferWriter inline quint32 writeStructEnd() { return 0; } - inline quint32 writeFieldBegin(QString name, const ThriftFieldType::type fieldType, const qint16 fieldId) + inline quint32 writeFieldBegin(QString name, + const ThriftFieldType::type fieldType, + const qint16 fieldId) { Q_UNUSED(name); quint32 wsize = 0; @@ -163,9 +168,15 @@ class ThriftBinaryBufferWriter } inline quint32 writeFieldEnd() { return 0; } - inline quint32 writeFieldStop() { return writeByte((qint8)ThriftFieldType::T_STOP); } - inline quint32 writeMapBegin(const ThriftFieldType::type keyType, const ThriftFieldType::type valType, const qint32 size) + inline quint32 writeFieldStop() + { + return writeByte((qint8)ThriftFieldType::T_STOP); + } + + inline quint32 writeMapBegin(const ThriftFieldType::type keyType, + const ThriftFieldType::type valType, + const qint32 size) { quint32 wsize = 0; wsize += writeByte(static_cast(keyType)); @@ -176,7 +187,8 @@ class ThriftBinaryBufferWriter inline quint32 writeMapEnd() { return 0; } - inline quint32 writeListBegin(const ThriftFieldType::type elemType, const qint32 size) + inline quint32 writeListBegin(const ThriftFieldType::type elemType, + const qint32 size) { quint32 wsize = 0; wsize += writeByte(static_cast(elemType)); @@ -186,7 +198,8 @@ class ThriftBinaryBufferWriter inline quint32 writeListEnd() { return 0; } - inline quint32 writeSetBegin(const ThriftFieldType::type elemType, const qint32 size) + inline quint32 writeSetBegin(const ThriftFieldType::type elemType, + const qint32 size) { return writeListBegin(elemType, size); } @@ -232,7 +245,9 @@ class ThriftBinaryBufferWriter inline quint32 writeDouble(const double dub) { - Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && std::numeric_limits::is_iec559, "incompatible double type"); + Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && + std::numeric_limits::is_iec559, + "incompatible double type"); quint64 bits = bitwise_cast(dub); qToBigEndian(bits, reinterpret_cast(&bits)); @@ -250,7 +265,8 @@ class ThriftBinaryBufferWriter { qint32 size = static_cast(bytes.length()); if (size > std::numeric_limits::max()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("The data is too big")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The data is too big")); } quint32 result = writeI32(static_cast(size)); @@ -275,14 +291,17 @@ class ThriftBinaryBufferReader void read(quint8 * dest, qint32 bytesCount) { if (Q_UNLIKELY((m_pos + bytesCount) > m_buf.length())) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Unexpected end of data")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } if (Q_UNLIKELY(bytesCount < 0)) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Negative bytes count")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative bytes count")); } - std::memcpy(dest, m_buf.mid(m_pos, bytesCount).constData(), static_cast(bytesCount)); + std::memcpy(dest, m_buf.mid(m_pos, bytesCount).constData(), + static_cast(bytesCount)); m_pos += bytesCount; } @@ -296,7 +315,9 @@ class ThriftBinaryBufferReader void setStringLimit(qint32 limit) { m_stringLimit = limit; } void setStrictMode(bool on) { m_strict = on; } - quint32 readMessageBegin(QString & name, ThriftMessageType::type & messageType, qint32 & seqid) + quint32 readMessageBegin(QString & name, + ThriftMessageType::type & messageType, + qint32 & seqid) { quint32 result = 0; qint32 sz; @@ -307,7 +328,8 @@ class ThriftBinaryBufferReader // Check for correct version number qint32 version = sz & VERSION_MASK; if (version != VERSION_1) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Bad version identifier")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Bad version identifier")); } messageType = static_cast(sz & 0x000000ff); @@ -317,7 +339,10 @@ class ThriftBinaryBufferReader else { if (m_strict) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("No version identifier... old protocol client in strict mode?")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("No version identifier... " + "old protocol client in " + "strict mode?")); } else { // Handle pre-versioned input @@ -337,7 +362,10 @@ class ThriftBinaryBufferReader inline quint32 readStructBegin(QString & name) { name.clear(); return 0; } inline quint32 readStructEnd() { return 0; } - inline quint32 readFieldBegin(QString & name, ThriftFieldType::type & fieldType, qint16 & fieldId) + + inline quint32 readFieldBegin(QString & name, + ThriftFieldType::type & fieldType, + qint16 & fieldId) { Q_UNUSED(name) quint32 result = 0; @@ -356,7 +384,9 @@ class ThriftBinaryBufferReader inline quint32 readFieldEnd() { return 0; } - inline quint32 readMapBegin(ThriftFieldType::type & keyType, ThriftFieldType::type & valType, qint32 & size) + inline quint32 readMapBegin(ThriftFieldType::type & keyType, + ThriftFieldType::type & valType, + qint32 & size) { qint8 k, v; quint32 result = 0; @@ -367,10 +397,12 @@ class ThriftBinaryBufferReader valType = static_cast(v); result += readI32(sizei); if (sizei < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Negative size!")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } else if (m_stringLimit > 0 && sizei > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("The size limit is exceeded.")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } size = sizei; return result; @@ -387,17 +419,24 @@ class ThriftBinaryBufferReader elemType = static_cast(e); result += readI32(sizei); if (sizei < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Negative size!")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } else if (m_stringLimit > 0 && sizei > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("The size limit is exceeded.")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } size = sizei; return result; } inline quint32 readListEnd() { return 0; } - inline quint32 readSetBegin(ThriftFieldType::type & elemType, qint32 & size) { return readListBegin(elemType, size); } + + inline quint32 readSetBegin(ThriftFieldType::type & elemType, qint32 & size) + { + return readListBegin(elemType, size); + } + inline quint32 readSetEnd() { return 0; } inline quint32 readBool(bool & value) @@ -454,7 +493,9 @@ class ThriftBinaryBufferReader inline quint32 readDouble(double & dub) { - Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && std::numeric_limits::is_iec559, "incompatible double type"); + Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && + std::numeric_limits::is_iec559, + "incompatible double type"); union bytes { quint8 b[8]; @@ -474,11 +515,13 @@ class ThriftBinaryBufferReader result = readI32(size); if (size < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Negative size!")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } if (m_stringLimit > 0 && size > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("The size limit is exceeded.")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } // Catch empty string case @@ -488,7 +531,8 @@ class ThriftBinaryBufferReader } if ((m_pos + size) > m_buf.length()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Unexpected end of data")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } str = QString::fromUtf8(m_buf.constData() + m_pos, size); @@ -505,11 +549,13 @@ class ThriftBinaryBufferReader result = readI32(size); if (size < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Negative size!")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } if (m_stringLimit > 0 && size > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("The size limit is exceeded.")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } // Catch empty string case @@ -519,7 +565,8 @@ class ThriftBinaryBufferReader } if ((m_pos + size) > m_buf.length()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, QStringLiteral("Unexpected end of data")); + throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } str = m_buf.mid(m_pos, size); diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 79894ddb..0cc76eba 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT */ @@ -79,12 +80,14 @@ Thumbnail & Thumbnail::setImageType(ImageType::type imageType) QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) { int httpStatusCode = 0; - QPair request = createPostRequest(guid, isPublic, isResourceGuid); + QPair request = + createPostRequest(guid, isPublic, isResourceGuid); QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), request.first, request.second, &httpStatusCode); if (httpStatusCode != 200) { - throw EverCloudException(QStringLiteral("HTTP Status Code = %1").arg(httpStatusCode)); + throw EverCloudException( + QString::fromUtf8("HTTP Status Code = %1").arg(httpStatusCode)); } return reply; @@ -92,11 +95,13 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) AsyncResult* Thumbnail::downloadAsync(Guid guid, bool isPublic, bool isResourceGuid) { - QPair pair = createPostRequest(guid, isPublic, isResourceGuid); + QPair pair = + createPostRequest(guid, isPublic, isResourceGuid); return new AsyncResult(pair.first, pair.second); } -QPair Thumbnail::createPostRequest(Guid guid, bool isPublic, bool isResourceGuid) +QPair Thumbnail::createPostRequest( + Guid guid, bool isPublic, bool isResourceGuid) { Q_D(Thumbnail); @@ -136,10 +141,12 @@ QPair Thumbnail::createPostRequest(Guid guid, bool } request.setUrl(QUrl(url)); - request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded")); + request.setHeader(QNetworkRequest::ContentTypeHeader, + QStringLiteral("application/x-www-form-urlencoded")); if (!isPublic) { - postData = QByteArray("auth=")+ QUrl::toPercentEncoding(d->m_authenticationToken); + postData = + QByteArray("auth=") + QUrl::toPercentEncoding(d->m_authenticationToken); } return qMakePair(request, postData); From cda58bace87e398631df5bbc80040ffc4d33a155 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 24 Sep 2019 07:56:56 +0300 Subject: [PATCH 006/188] Update of generated code --- QEverCloud/headers/generated/Constants.h | 11 +- QEverCloud/headers/generated/EDAMErrorCode.h | 3 +- QEverCloud/headers/generated/Services.h | 827 ++- QEverCloud/headers/generated/Types.h | 1129 ++-- QEverCloud/src/generated/Constants.cpp | 55 +- QEverCloud/src/generated/EDAMErrorCode.cpp | 3 +- QEverCloud/src/generated/Services.cpp | 6047 ++++++++++++------ QEverCloud/src/generated/Types.cpp | 3059 +++++++-- QEverCloud/src/generated/Types_io.h | 3 +- 9 files changed, 7721 insertions(+), 3416 deletions(-) diff --git a/QEverCloud/headers/generated/Constants.h b/QEverCloud/headers/generated/Constants.h index f3c59879..07c3c2c7 100644 --- a/QEverCloud/headers/generated/Constants.h +++ b/QEverCloud/headers/generated/Constants.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -212,7 +213,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_MIME_TYPE_DEFAULT; * The set of resource MIME types that are expected to be handled * correctly by all of the major Evernote client applications. */ -QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_MIME_TYPES; +QEVERCLOUD_EXPORT extern const QSet EDAM_MIME_TYPES; // Limits.thrift /** @@ -220,7 +221,7 @@ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_MIME_TYPES; * searching. With exception of images, PDFs and plain text files, * which are handled in a different way. */ -QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPES; +QEVERCLOUD_EXPORT extern const QSet EDAM_INDEXABLE_RESOURCE_MIME_TYPES; // Limits.thrift /** @@ -228,7 +229,7 @@ QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPE * for searching. The MIME types which start with "text/" will be handled * separately by each client (i.e. hard-coded in each client). */ -QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES; +QEVERCLOUD_EXPORT extern const QSet EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES; // Limits.thrift /** @@ -499,7 +500,7 @@ QEVERCLOUD_EXPORT extern const QString EDAM_PUBLISHING_URI_REGEX; /** * The set of strings that may not be used as a publishing URI */ -QEVERCLOUD_EXPORT extern const QSet< QString > EDAM_PUBLISHING_URI_PROHIBITED; +QEVERCLOUD_EXPORT extern const QSet EDAM_PUBLISHING_URI_PROHIBITED; // Limits.thrift /** diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 796002c0..e06c79a8 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index fbec8813..c9a7dcf3 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -52,23 +53,43 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject Q_OBJECT Q_DISABLE_COPY(NoteStore) public: - explicit NoteStore(QString noteStoreUrl = QString(), QString authenticationToken = QString(), QObject * parent = nullptr); + explicit NoteStore( + QString noteStoreUrl = QString(), + QString authenticationToken = QString(), + QObject * parent = nullptr); + explicit NoteStore(QObject * parent); - void setNoteStoreUrl(QString noteStoreUrl) { m_url = noteStoreUrl; } - QString noteStoreUrl() { return m_url; } + void setNoteStoreUrl(QString noteStoreUrl) + { + m_url = noteStoreUrl; + } + + QString noteStoreUrl() + { + return m_url; + } - void setAuthenticationToken(QString authenticationToken) { m_authenticationToken = authenticationToken; } - QString authenticationToken() { return m_authenticationToken; } + void setAuthenticationToken(QString authenticationToken) + { + m_authenticationToken = authenticationToken; + } + + QString authenticationToken() + { + return m_authenticationToken; + } /** * Asks the NoteStore to provide information about the status of the user * account corresponding to the provided authentication token. */ - SyncState getSyncState(QString authenticationToken = QString()); + SyncState getSyncState( + QString authenticationToken = QString()); /** Asynchronous version of @link getSyncState @endlink */ - AsyncResult * getSyncStateAsync(QString authenticationToken = QString()); + AsyncResult * getSyncStateAsync( + QString authenticationToken = QString()); /** * Asks the NoteStore to provide the state of the account in order of @@ -103,10 +124,18 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncChunk getFilteredSyncChunk(qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter& filter, QString authenticationToken = QString()); + SyncChunk getFilteredSyncChunk( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter& filter, + QString authenticationToken = QString()); /** Asynchronous version of @link getFilteredSyncChunk @endlink */ - AsyncResult * getFilteredSyncChunkAsync(qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter& filter, QString authenticationToken = QString()); + AsyncResult * getFilteredSyncChunkAsync( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter& filter, + QString authenticationToken = QString()); /** * Asks the NoteStore to provide information about the status of a linked @@ -149,10 +178,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncState getLinkedNotebookSyncState(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + SyncState getLinkedNotebookSyncState( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** Asynchronous version of @link getLinkedNotebookSyncState @endlink */ - AsyncResult * getLinkedNotebookSyncStateAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + AsyncResult * getLinkedNotebookSyncStateAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** * Asks the NoteStore to provide information about the contents of a linked @@ -218,18 +251,30 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncChunk getLinkedNotebookSyncChunk(const LinkedNotebook& linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, QString authenticationToken = QString()); + SyncChunk getLinkedNotebookSyncChunk( + const LinkedNotebook& linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + QString authenticationToken = QString()); /** Asynchronous version of @link getLinkedNotebookSyncChunk @endlink */ - AsyncResult * getLinkedNotebookSyncChunkAsync(const LinkedNotebook& linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, QString authenticationToken = QString()); + AsyncResult * getLinkedNotebookSyncChunkAsync( + const LinkedNotebook& linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + QString authenticationToken = QString()); /** * Returns a list of all of the notebooks in the account. */ - QList< Notebook > listNotebooks(QString authenticationToken = QString()); + QList listNotebooks( + QString authenticationToken = QString()); /** Asynchronous version of @link listNotebooks @endlink */ - AsyncResult * listNotebooksAsync(QString authenticationToken = QString()); + AsyncResult * listNotebooksAsync( + QString authenticationToken = QString()); /** * Returns a list of all the notebooks in a business that the user has permission to access, @@ -244,10 +289,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * business auth token. * */ - QList< Notebook > listAccessibleBusinessNotebooks(QString authenticationToken = QString()); + QList listAccessibleBusinessNotebooks( + QString authenticationToken = QString()); /** Asynchronous version of @link listAccessibleBusinessNotebooks @endlink */ - AsyncResult * listAccessibleBusinessNotebooksAsync(QString authenticationToken = QString()); + AsyncResult * listAccessibleBusinessNotebooksAsync( + QString authenticationToken = QString()); /** * Returns the current state of the notebook with the provided GUID. @@ -268,19 +315,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Notebook getNotebook(Guid guid, QString authenticationToken = QString()); + Notebook getNotebook( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getNotebook @endlink */ - AsyncResult * getNotebookAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getNotebookAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns the notebook that should be used to store new notes in the * user's account when no other notebooks are specified. */ - Notebook getDefaultNotebook(QString authenticationToken = QString()); + Notebook getDefaultNotebook( + QString authenticationToken = QString()); /** Asynchronous version of @link getDefaultNotebook @endlink */ - AsyncResult * getDefaultNotebookAsync(QString authenticationToken = QString()); + AsyncResult * getDefaultNotebookAsync( + QString authenticationToken = QString()); /** * Asks the service to make a notebook with the provided name. @@ -316,10 +369,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Notebook createNotebook(const Notebook& notebook, QString authenticationToken = QString()); + Notebook createNotebook( + const Notebook& notebook, + QString authenticationToken = QString()); /** Asynchronous version of @link createNotebook @endlink */ - AsyncResult * createNotebookAsync(const Notebook& notebook, QString authenticationToken = QString()); + AsyncResult * createNotebookAsync( + const Notebook& notebook, + QString authenticationToken = QString()); /** * Submits notebook changes to the service. The provided data must include the @@ -360,10 +417,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateNotebook(const Notebook& notebook, QString authenticationToken = QString()); + qint32 updateNotebook( + const Notebook& notebook, + QString authenticationToken = QString()); /** Asynchronous version of @link updateNotebook @endlink */ - AsyncResult * updateNotebookAsync(const Notebook& notebook, QString authenticationToken = QString()); + AsyncResult * updateNotebookAsync( + const Notebook& notebook, + QString authenticationToken = QString()); /** * Permanently removes the notebook from the user's account. @@ -390,19 +451,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeNotebook(Guid guid, QString authenticationToken = QString()); + qint32 expungeNotebook( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link expungeNotebook @endlink */ - AsyncResult * expungeNotebookAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * expungeNotebookAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns a list of the tags in the account. Evernote does not support * the undeletion of tags, so this will only include active tags. */ - QList< Tag > listTags(QString authenticationToken = QString()); + QList listTags( + QString authenticationToken = QString()); /** Asynchronous version of @link listTags @endlink */ - AsyncResult * listTagsAsync(QString authenticationToken = QString()); + AsyncResult * listTagsAsync( + QString authenticationToken = QString()); /** * Returns a list of the tags that are applied to at least one note within @@ -417,10 +484,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QList< Tag > listTagsByNotebook(Guid notebookGuid, QString authenticationToken = QString()); + QList listTagsByNotebook( + Guid notebookGuid, + QString authenticationToken = QString()); /** Asynchronous version of @link listTagsByNotebook @endlink */ - AsyncResult * listTagsByNotebookAsync(Guid notebookGuid, QString authenticationToken = QString()); + AsyncResult * listTagsByNotebookAsync( + Guid notebookGuid, + QString authenticationToken = QString()); /** * Returns the current state of the Tag with the provided GUID. @@ -440,10 +511,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Tag getTag(Guid guid, QString authenticationToken = QString()); + Tag getTag( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getTag @endlink */ - AsyncResult * getTagAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getTagAsync( + Guid guid, + QString authenticationToken = QString()); /** * Asks the service to make a tag with a set of information. @@ -473,10 +548,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Tag createTag(const Tag& tag, QString authenticationToken = QString()); + Tag createTag( + const Tag& tag, + QString authenticationToken = QString()); /** Asynchronous version of @link createTag @endlink */ - AsyncResult * createTagAsync(const Tag& tag, QString authenticationToken = QString()); + AsyncResult * createTagAsync( + const Tag& tag, + QString authenticationToken = QString()); /** * Submits tag changes to the service. The provided data must include @@ -509,10 +588,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateTag(const Tag& tag, QString authenticationToken = QString()); + qint32 updateTag( + const Tag& tag, + QString authenticationToken = QString()); /** Asynchronous version of @link updateTag @endlink */ - AsyncResult * updateTagAsync(const Tag& tag, QString authenticationToken = QString()); + AsyncResult * updateTagAsync( + const Tag& tag, + QString authenticationToken = QString()); /** * Removes the provided tag from every note that is currently tagged with @@ -540,10 +623,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - void untagAll(Guid guid, QString authenticationToken = QString()); + void untagAll( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link untagAll @endlink */ - AsyncResult * untagAllAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * untagAllAsync( + Guid guid, + QString authenticationToken = QString()); /** * Permanently deletes the tag with the provided GUID, if present. @@ -570,19 +657,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeTag(Guid guid, QString authenticationToken = QString()); + qint32 expungeTag( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link expungeTag @endlink */ - AsyncResult * expungeTagAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * expungeTagAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns a list of the searches in the account. Evernote does not support * the undeletion of searches, so this will only include active searches. */ - QList< SavedSearch > listSearches(QString authenticationToken = QString()); + QList listSearches( + QString authenticationToken = QString()); /** Asynchronous version of @link listSearches @endlink */ - AsyncResult * listSearchesAsync(QString authenticationToken = QString()); + AsyncResult * listSearchesAsync( + QString authenticationToken = QString()); /** * Returns the current state of the search with the provided GUID. @@ -601,10 +694,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SavedSearch getSearch(Guid guid, QString authenticationToken = QString()); + SavedSearch getSearch( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getSearch @endlink */ - AsyncResult * getSearchAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getSearchAsync( + Guid guid, + QString authenticationToken = QString()); /** * Asks the service to make a saved search with a set of information. @@ -630,10 +727,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SavedSearch createSearch(const SavedSearch& search, QString authenticationToken = QString()); + SavedSearch createSearch( + const SavedSearch& search, + QString authenticationToken = QString()); /** Asynchronous version of @link createSearch @endlink */ - AsyncResult * createSearchAsync(const SavedSearch& search, QString authenticationToken = QString()); + AsyncResult * createSearchAsync( + const SavedSearch& search, + QString authenticationToken = QString()); /** * Submits search changes to the service. The provided data must include @@ -662,10 +763,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateSearch(const SavedSearch& search, QString authenticationToken = QString()); + qint32 updateSearch( + const SavedSearch& search, + QString authenticationToken = QString()); /** Asynchronous version of @link updateSearch @endlink */ - AsyncResult * updateSearchAsync(const SavedSearch& search, QString authenticationToken = QString()); + AsyncResult * updateSearchAsync( + const SavedSearch& search, + QString authenticationToken = QString()); /** * Permanently deletes the saved search with the provided GUID, if present. @@ -692,10 +797,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeSearch(Guid guid, QString authenticationToken = QString()); + qint32 expungeSearch( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link expungeSearch @endlink */ - AsyncResult * expungeSearchAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * expungeSearchAsync( + Guid guid, + QString authenticationToken = QString()); /** * Finds the position of a note within a sorted subset of all of the user's @@ -738,10 +847,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 findNoteOffset(const NoteFilter& filter, Guid guid, QString authenticationToken = QString()); + qint32 findNoteOffset( + const NoteFilter& filter, + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link findNoteOffset @endlink */ - AsyncResult * findNoteOffsetAsync(const NoteFilter& filter, Guid guid, QString authenticationToken = QString()); + AsyncResult * findNoteOffsetAsync( + const NoteFilter& filter, + Guid guid, + QString authenticationToken = QString()); /** * Used to find the high-level information about a set of the notes from a @@ -800,10 +915,20 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - NotesMetadataList findNotesMetadata(const NoteFilter& filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec& resultSpec, QString authenticationToken = QString()); + NotesMetadataList findNotesMetadata( + const NoteFilter& filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec& resultSpec, + QString authenticationToken = QString()); /** Asynchronous version of @link findNotesMetadata @endlink */ - AsyncResult * findNotesMetadataAsync(const NoteFilter& filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec& resultSpec, QString authenticationToken = QString()); + AsyncResult * findNotesMetadataAsync( + const NoteFilter& filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec& resultSpec, + QString authenticationToken = QString()); /** * This function is used to determine how many notes are found for each @@ -836,10 +961,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "Notebook.guid" - not found, by GUID
  • * */ - NoteCollectionCounts findNoteCounts(const NoteFilter& filter, bool withTrash, QString authenticationToken = QString()); + NoteCollectionCounts findNoteCounts( + const NoteFilter& filter, + bool withTrash, + QString authenticationToken = QString()); /** Asynchronous version of @link findNoteCounts @endlink */ - AsyncResult * findNoteCountsAsync(const NoteFilter& filter, bool withTrash, QString authenticationToken = QString()); + AsyncResult * findNoteCountsAsync( + const NoteFilter& filter, + bool withTrash, + QString authenticationToken = QString()); /** * Returns the current state of the note in the service with the provided @@ -872,10 +1003,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note getNoteWithResultSpec(Guid guid, const NoteResultSpec& resultSpec, QString authenticationToken = QString()); + Note getNoteWithResultSpec( + Guid guid, + const NoteResultSpec& resultSpec, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteWithResultSpec @endlink */ - AsyncResult * getNoteWithResultSpecAsync(Guid guid, const NoteResultSpec& resultSpec, QString authenticationToken = QString()); + AsyncResult * getNoteWithResultSpecAsync( + Guid guid, + const NoteResultSpec& resultSpec, + QString authenticationToken = QString()); /** * DEPRECATED. See getNoteWithResultSpec. @@ -884,10 +1021,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * 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. */ - Note getNote(Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken = QString()); + Note getNote( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken = QString()); /** Asynchronous version of @link getNote @endlink */ - AsyncResult * getNoteAsync(Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken = QString()); + AsyncResult * getNoteAsync( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken = QString()); /** * Get all of the application data for the note identified by GUID, @@ -897,10 +1046,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * only needs to fetch its own applicationData entry, use * getNoteApplicationDataEntry instead. */ - LazyMap getNoteApplicationData(Guid guid, QString authenticationToken = QString()); + LazyMap getNoteApplicationData( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteApplicationData @endlink */ - AsyncResult * getNoteApplicationDataAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getNoteApplicationDataAsync( + Guid guid, + QString authenticationToken = QString()); /** * Get the value of a single entry in the applicationData map @@ -911,29 +1064,49 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "NoteAttributes.applicationData.key" - note not found, by key
  • * */ - QString getNoteApplicationDataEntry(Guid guid, QString key, QString authenticationToken = QString()); + QString getNoteApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteApplicationDataEntry @endlink */ - AsyncResult * getNoteApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken = QString()); + AsyncResult * getNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken = QString()); /** * Update, or create, an entry in the applicationData map for * the note identified by guid. */ - qint32 setNoteApplicationDataEntry(Guid guid, QString key, QString value, QString authenticationToken = QString()); + qint32 setNoteApplicationDataEntry( + Guid guid, + QString key, + QString value, + QString authenticationToken = QString()); /** Asynchronous version of @link setNoteApplicationDataEntry @endlink */ - AsyncResult * setNoteApplicationDataEntryAsync(Guid guid, QString key, QString value, QString authenticationToken = QString()); + AsyncResult * setNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + QString authenticationToken = QString()); /** * 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. */ - qint32 unsetNoteApplicationDataEntry(Guid guid, QString key, QString authenticationToken = QString()); + qint32 unsetNoteApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken = QString()); /** Asynchronous version of @link unsetNoteApplicationDataEntry @endlink */ - AsyncResult * unsetNoteApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken = QString()); + AsyncResult * unsetNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken = QString()); /** * Returns XHTML contents of the note with the provided GUID. @@ -955,10 +1128,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getNoteContent(Guid guid, QString authenticationToken = QString()); + QString getNoteContent( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteContent @endlink */ - AsyncResult * getNoteContentAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getNoteContentAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns a block of the extracted plain text contents of the note with the @@ -994,10 +1171,18 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getNoteSearchText(Guid guid, bool noteOnly, bool tokenizeForIndexing, QString authenticationToken = QString()); + QString getNoteSearchText( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteSearchText @endlink */ - AsyncResult * getNoteSearchTextAsync(Guid guid, bool noteOnly, bool tokenizeForIndexing, QString authenticationToken = QString()); + AsyncResult * getNoteSearchTextAsync( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + QString authenticationToken = QString()); /** * Returns a block of the extracted plain text contents of the resource with @@ -1023,10 +1208,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getResourceSearchText(Guid guid, QString authenticationToken = QString()); + QString getResourceSearchText( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceSearchText @endlink */ - AsyncResult * getResourceSearchTextAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceSearchTextAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns a list of the names of the tags for the note with the provided @@ -1046,10 +1235,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QStringList getNoteTagNames(Guid guid, QString authenticationToken = QString()); + QStringList getNoteTagNames( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteTagNames @endlink */ - AsyncResult * getNoteTagNamesAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getNoteTagNamesAsync( + Guid guid, + QString authenticationToken = QString()); /** * Asks the service to make a note with the provided set of information. @@ -1114,10 +1307,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note createNote(const Note& note, QString authenticationToken = QString()); + Note createNote( + const Note& note, + QString authenticationToken = QString()); /** Asynchronous version of @link createNote @endlink */ - AsyncResult * createNoteAsync(const Note& note, QString authenticationToken = QString()); + AsyncResult * createNoteAsync( + const Note& note, + QString authenticationToken = QString()); /** * Submit a set of changes to a note to the service. The provided data @@ -1190,10 +1387,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note updateNote(const Note& note, QString authenticationToken = QString()); + Note updateNote( + const Note& note, + QString authenticationToken = QString()); /** Asynchronous version of @link updateNote @endlink */ - AsyncResult * updateNoteAsync(const Note& note, QString authenticationToken = QString()); + AsyncResult * updateNoteAsync( + const Note& note, + QString authenticationToken = QString()); /** * Moves the note into the trash. The note may still be undeleted, unless it @@ -1221,10 +1422,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 deleteNote(Guid guid, QString authenticationToken = QString()); + qint32 deleteNote( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link deleteNote @endlink */ - AsyncResult * deleteNoteAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * deleteNoteAsync( + Guid guid, + QString authenticationToken = QString()); /** * Permanently removes a Note, and all of its Resources, @@ -1250,10 +1455,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeNote(Guid guid, QString authenticationToken = QString()); + qint32 expungeNote( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link expungeNote @endlink */ - AsyncResult * expungeNoteAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * expungeNoteAsync( + Guid guid, + QString authenticationToken = QString()); /** * Performs a deep copy of the Note with the provided GUID 'noteGuid' into @@ -1297,10 +1506,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note copyNote(Guid noteGuid, Guid toNotebookGuid, QString authenticationToken = QString()); + Note copyNote( + Guid noteGuid, + Guid toNotebookGuid, + QString authenticationToken = QString()); /** Asynchronous version of @link copyNote @endlink */ - AsyncResult * copyNoteAsync(Guid noteGuid, Guid toNotebookGuid, QString authenticationToken = QString()); + AsyncResult * copyNoteAsync( + Guid noteGuid, + Guid toNotebookGuid, + QString authenticationToken = QString()); /** * Returns a list of the prior versions of a particular note that are @@ -1324,10 +1539,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QList< NoteVersionId > listNoteVersions(Guid noteGuid, QString authenticationToken = QString()); + QList listNoteVersions( + Guid noteGuid, + QString authenticationToken = QString()); /** Asynchronous version of @link listNoteVersions @endlink */ - AsyncResult * listNoteVersionsAsync(Guid noteGuid, QString authenticationToken = QString()); + AsyncResult * listNoteVersionsAsync( + Guid noteGuid, + QString authenticationToken = QString()); /** * This can be used to retrieve a previous version of a Note after it has been @@ -1372,10 +1591,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note getNoteVersion(Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken = QString()); + Note getNoteVersion( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken = QString()); /** Asynchronous version of @link getNoteVersion @endlink */ - AsyncResult * getNoteVersionAsync(Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken = QString()); + AsyncResult * getNoteVersionAsync( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken = QString()); /** * Returns the current state of the resource in the service with the @@ -1414,10 +1645,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Resource getResource(Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, QString authenticationToken = QString()); + Resource getResource( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + QString authenticationToken = QString()); /** Asynchronous version of @link getResource @endlink */ - AsyncResult * getResourceAsync(Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, QString authenticationToken = QString()); + AsyncResult * getResourceAsync( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + QString authenticationToken = QString()); /** * Get all of the application data for the Resource identified by GUID, @@ -1427,10 +1670,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * only needs to fetch its own applicationData entry, use * getResourceApplicationDataEntry instead. */ - LazyMap getResourceApplicationData(Guid guid, QString authenticationToken = QString()); + LazyMap getResourceApplicationData( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceApplicationData @endlink */ - AsyncResult * getResourceApplicationDataAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceApplicationDataAsync( + Guid guid, + QString authenticationToken = QString()); /** * Get the value of a single entry in the applicationData map @@ -1441,28 +1688,48 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "ResourceAttributes.applicationData.key" - Resource not found, by key
  • * */ - QString getResourceApplicationDataEntry(Guid guid, QString key, QString authenticationToken = QString()); + QString getResourceApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceApplicationDataEntry @endlink */ - AsyncResult * getResourceApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken = QString()); + AsyncResult * getResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken = QString()); /** * Update, or create, an entry in the applicationData map for * the Resource identified by guid. */ - qint32 setResourceApplicationDataEntry(Guid guid, QString key, QString value, QString authenticationToken = QString()); + qint32 setResourceApplicationDataEntry( + Guid guid, + QString key, + QString value, + QString authenticationToken = QString()); /** Asynchronous version of @link setResourceApplicationDataEntry @endlink */ - AsyncResult * setResourceApplicationDataEntryAsync(Guid guid, QString key, QString value, QString authenticationToken = QString()); + AsyncResult * setResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + QString authenticationToken = QString()); /** * Remove an entry identified by 'key' from the applicationData map for * the Resource identified by 'guid'. */ - qint32 unsetResourceApplicationDataEntry(Guid guid, QString key, QString authenticationToken = QString()); + qint32 unsetResourceApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken = QString()); /** Asynchronous version of @link unsetResourceApplicationDataEntry @endlink */ - AsyncResult * unsetResourceApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken = QString()); + AsyncResult * unsetResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken = QString()); /** * Submit a set of changes to a resource to the service. This can be used @@ -1513,10 +1780,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateResource(const Resource& resource, QString authenticationToken = QString()); + qint32 updateResource( + const Resource& resource, + QString authenticationToken = QString()); /** Asynchronous version of @link updateResource @endlink */ - AsyncResult * updateResourceAsync(const Resource& resource, QString authenticationToken = QString()); + AsyncResult * updateResourceAsync( + const Resource& resource, + QString authenticationToken = QString()); /** * Returns binary data of the resource with the provided GUID. For @@ -1540,10 +1811,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceData(Guid guid, QString authenticationToken = QString()); + QByteArray getResourceData( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceData @endlink */ - AsyncResult * getResourceDataAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceDataAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns the current state of a resource, referenced by containing @@ -1586,10 +1861,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Resource getResourceByHash(Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, QString authenticationToken = QString()); + Resource getResourceByHash( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceByHash @endlink */ - AsyncResult * getResourceByHashAsync(Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, QString authenticationToken = QString()); + AsyncResult * getResourceByHashAsync( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + QString authenticationToken = QString()); /** * Returns the binary contents of the recognition index for the resource @@ -1615,10 +1902,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceRecognition(Guid guid, QString authenticationToken = QString()); + QByteArray getResourceRecognition( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceRecognition @endlink */ - AsyncResult * getResourceRecognitionAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceRecognitionAsync( + Guid guid, + QString authenticationToken = QString()); /** * If the Resource with the provided GUID has an alternate data representation @@ -1644,10 +1935,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceAlternateData(Guid guid, QString authenticationToken = QString()); + QByteArray getResourceAlternateData( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceAlternateData @endlink */ - AsyncResult * getResourceAlternateDataAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceAlternateDataAsync( + Guid guid, + QString authenticationToken = QString()); /** * Returns the set of attributes for the Resource with the provided GUID. @@ -1669,10 +1964,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - ResourceAttributes getResourceAttributes(Guid guid, QString authenticationToken = QString()); + ResourceAttributes getResourceAttributes( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link getResourceAttributes @endlink */ - AsyncResult * getResourceAttributesAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * getResourceAttributesAsync( + Guid guid, + QString authenticationToken = QString()); /** *

    @@ -1708,10 +2007,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * down for the requester because of an IP-based country lookup. * */ - Notebook getPublicNotebook(UserID userId, QString publicUri); + Notebook getPublicNotebook( + UserID userId, + QString publicUri); /** Asynchronous version of @link getPublicNotebook @endlink */ - AsyncResult * getPublicNotebookAsync(UserID userId, QString publicUri); + AsyncResult * getPublicNotebookAsync( + UserID userId, + QString publicUri); /** * @Deprecated for first-party clients. See createOrUpdateNotebookShares. @@ -1790,10 +2093,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SharedNotebook shareNotebook(const SharedNotebook& sharedNotebook, QString message, QString authenticationToken = QString()); + SharedNotebook shareNotebook( + const SharedNotebook& sharedNotebook, + QString message, + QString authenticationToken = QString()); /** Asynchronous version of @link shareNotebook @endlink */ - AsyncResult * shareNotebookAsync(const SharedNotebook& sharedNotebook, QString message, QString authenticationToken = QString()); + AsyncResult * shareNotebookAsync( + const SharedNotebook& sharedNotebook, + QString message, + QString authenticationToken = QString()); /** * Share a notebook by a messaging thread ID or a list of contacts. This function is @@ -1849,18 +2158,26 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * specified, but no thread with that ID exists * */ - CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares(const NotebookShareTemplate& shareTemplate, QString authenticationToken = QString()); + CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( + const NotebookShareTemplate& shareTemplate, + QString authenticationToken = QString()); /** Asynchronous version of @link createOrUpdateNotebookShares @endlink */ - AsyncResult * createOrUpdateNotebookSharesAsync(const NotebookShareTemplate& shareTemplate, QString authenticationToken = QString()); + AsyncResult * createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate& shareTemplate, + QString authenticationToken = QString()); /** * @Deprecated See createOrUpdateNotebookShares and manageNotebookShares. */ - qint32 updateSharedNotebook(const SharedNotebook& sharedNotebook, QString authenticationToken = QString()); + qint32 updateSharedNotebook( + const SharedNotebook& sharedNotebook, + QString authenticationToken = QString()); /** Asynchronous version of @link updateSharedNotebook @endlink */ - AsyncResult * updateSharedNotebookAsync(const SharedNotebook& sharedNotebook, QString authenticationToken = QString()); + AsyncResult * updateSharedNotebookAsync( + const SharedNotebook& sharedNotebook, + QString authenticationToken = QString()); /** * Set values for the recipient settings associated with a notebook share. Only the @@ -1898,10 +2215,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * to false and any of reminder* settings to true. * */ - Notebook setNotebookRecipientSettings(QString notebookGuid, const NotebookRecipientSettings& recipientSettings, QString authenticationToken = QString()); + Notebook setNotebookRecipientSettings( + QString notebookGuid, + const NotebookRecipientSettings& recipientSettings, + QString authenticationToken = QString()); /** Asynchronous version of @link setNotebookRecipientSettings @endlink */ - AsyncResult * setNotebookRecipientSettingsAsync(QString notebookGuid, const NotebookRecipientSettings& recipientSettings, QString authenticationToken = QString()); + AsyncResult * setNotebookRecipientSettingsAsync( + QString notebookGuid, + const NotebookRecipientSettings& recipientSettings, + QString authenticationToken = QString()); /** * Lists the collection of shared notebooks for all notebooks in the @@ -1910,10 +2233,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * @return * The list of all SharedNotebooks for the user */ - QList< SharedNotebook > listSharedNotebooks(QString authenticationToken = QString()); + QList listSharedNotebooks( + QString authenticationToken = QString()); /** Asynchronous version of @link listSharedNotebooks @endlink */ - AsyncResult * listSharedNotebooksAsync(QString authenticationToken = QString()); + AsyncResult * listSharedNotebooksAsync( + QString authenticationToken = QString()); /** * Asks the service to make a linked notebook with the provided name, username @@ -1952,10 +2277,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - LinkedNotebook createLinkedNotebook(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + LinkedNotebook createLinkedNotebook( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** Asynchronous version of @link createLinkedNotebook @endlink */ - AsyncResult * createLinkedNotebookAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + AsyncResult * createLinkedNotebookAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** * @param linkedNotebook @@ -1973,18 +2302,24 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateLinkedNotebook(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + qint32 updateLinkedNotebook( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** Asynchronous version of @link updateLinkedNotebook @endlink */ - AsyncResult * updateLinkedNotebookAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken = QString()); + AsyncResult * updateLinkedNotebookAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken = QString()); /** * Returns a list of linked notebooks */ - QList< LinkedNotebook > listLinkedNotebooks(QString authenticationToken = QString()); + QList listLinkedNotebooks( + QString authenticationToken = QString()); /** Asynchronous version of @link listLinkedNotebooks @endlink */ - AsyncResult * listLinkedNotebooksAsync(QString authenticationToken = QString()); + AsyncResult * listLinkedNotebooksAsync( + QString authenticationToken = QString()); /** * Permanently expunges the linked notebook from the account. @@ -1997,10 +2332,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * The LinkedNotebook.guid field of the LinkedNotebook to permanently remove * from the account. */ - qint32 expungeLinkedNotebook(Guid guid, QString authenticationToken = QString()); + qint32 expungeLinkedNotebook( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link expungeLinkedNotebook @endlink */ - AsyncResult * expungeLinkedNotebookAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * expungeLinkedNotebookAsync( + Guid guid, + QString authenticationToken = QString()); /** * Asks the service to produce an authentication token that can be used to @@ -2052,10 +2391,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - AuthenticationResult authenticateToSharedNotebook(QString shareKeyOrGlobalId, QString authenticationToken = QString()); + AuthenticationResult authenticateToSharedNotebook( + QString shareKeyOrGlobalId, + QString authenticationToken = QString()); /** Asynchronous version of @link authenticateToSharedNotebook @endlink */ - AsyncResult * authenticateToSharedNotebookAsync(QString shareKeyOrGlobalId, QString authenticationToken = QString()); + AsyncResult * authenticateToSharedNotebookAsync( + QString shareKeyOrGlobalId, + QString authenticationToken = QString()); /** * This function is used to retrieve extended information about a shared @@ -2082,10 +2425,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SharedNotebook getSharedNotebookByAuth(QString authenticationToken = QString()); + SharedNotebook getSharedNotebookByAuth( + QString authenticationToken = QString()); /** Asynchronous version of @link getSharedNotebookByAuth @endlink */ - AsyncResult * getSharedNotebookByAuthAsync(QString authenticationToken = QString()); + AsyncResult * getSharedNotebookByAuthAsync( + QString authenticationToken = QString()); /** * Attempts to send a single note to one or more email recipients. @@ -2136,10 +2481,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - void emailNote(const NoteEmailParameters& parameters, QString authenticationToken = QString()); + void emailNote( + const NoteEmailParameters& parameters, + QString authenticationToken = QString()); /** Asynchronous version of @link emailNote @endlink */ - AsyncResult * emailNoteAsync(const NoteEmailParameters& parameters, QString authenticationToken = QString()); + AsyncResult * emailNoteAsync( + const NoteEmailParameters& parameters, + QString authenticationToken = QString()); /** * If this note is not already shared publicly (via its own direct URL), then this @@ -2164,10 +2513,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *

  • "Note.guid" - not found, by GUID
  • * */ - QString shareNote(Guid guid, QString authenticationToken = QString()); + QString shareNote( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link shareNote @endlink */ - AsyncResult * shareNoteAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * shareNoteAsync( + Guid guid, + QString authenticationToken = QString()); /** * If this note is shared publicly then this will stop sharing that note @@ -2191,10 +2544,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "Note.guid" - not found, by GUID
  • * */ - void stopSharingNote(Guid guid, QString authenticationToken = QString()); + void stopSharingNote( + Guid guid, + QString authenticationToken = QString()); /** Asynchronous version of @link stopSharingNote @endlink */ - AsyncResult * stopSharingNoteAsync(Guid guid, QString authenticationToken = QString()); + AsyncResult * stopSharingNoteAsync( + Guid guid, + QString authenticationToken = QString()); /** * Asks the service to produce an authentication token that can be used to @@ -2238,10 +2595,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - AuthenticationResult authenticateToSharedNote(QString guid, QString noteKey, QString authenticationToken = QString()); + AuthenticationResult authenticateToSharedNote( + QString guid, + QString noteKey, + QString authenticationToken = QString()); /** Asynchronous version of @link authenticateToSharedNote @endlink */ - AsyncResult * authenticateToSharedNoteAsync(QString guid, QString noteKey, QString authenticationToken = QString()); + AsyncResult * authenticateToSharedNoteAsync( + QString guid, + QString noteKey, + QString authenticationToken = QString()); /** * Identify related entities on the service, such as notes, @@ -2292,10 +2655,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - RelatedResult findRelated(const RelatedQuery& query, const RelatedResultSpec& resultSpec, QString authenticationToken = QString()); + RelatedResult findRelated( + const RelatedQuery& query, + const RelatedResultSpec& resultSpec, + QString authenticationToken = QString()); /** Asynchronous version of @link findRelated @endlink */ - AsyncResult * findRelatedAsync(const RelatedQuery& query, const RelatedResultSpec& resultSpec, QString authenticationToken = QString()); + AsyncResult * findRelatedAsync( + const RelatedQuery& query, + const RelatedResultSpec& resultSpec, + QString authenticationToken = QString()); /** * Perform the same operation as updateNote() would provided that the update @@ -2324,10 +2693,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * not happen if your client is working correctly. * */ - UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches(const Note& note, QString authenticationToken = QString()); + UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( + const Note& note, + QString authenticationToken = QString()); /** Asynchronous version of @link updateNoteIfUsnMatches @endlink */ - AsyncResult * updateNoteIfUsnMatchesAsync(const Note& note, QString authenticationToken = QString()); + AsyncResult * updateNoteIfUsnMatchesAsync( + const Note& note, + QString authenticationToken = QString()); /** * Manage invitations and memberships associated with a given notebook. @@ -2345,10 +2718,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * shares. * */ - ManageNotebookSharesResult manageNotebookShares(const ManageNotebookSharesParameters& parameters, QString authenticationToken = QString()); + ManageNotebookSharesResult manageNotebookShares( + const ManageNotebookSharesParameters& parameters, + QString authenticationToken = QString()); /** Asynchronous version of @link manageNotebookShares @endlink */ - AsyncResult * manageNotebookSharesAsync(const ManageNotebookSharesParameters& parameters, QString authenticationToken = QString()); + AsyncResult * manageNotebookSharesAsync( + const ManageNotebookSharesParameters& parameters, + QString authenticationToken = QString()); /** * Return the share relationships for the given notebook, including @@ -2358,10 +2735,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * limited use by Evernote clients that have discussed using this * routine with the platform team. */ - ShareRelationships getNotebookShares(QString notebookGuid, QString authenticationToken = QString()); + ShareRelationships getNotebookShares( + QString notebookGuid, + QString authenticationToken = QString()); /** Asynchronous version of @link getNotebookShares @endlink */ - AsyncResult * getNotebookSharesAsync(QString notebookGuid, QString authenticationToken = QString()); + AsyncResult * getNotebookSharesAsync( + QString notebookGuid, + QString authenticationToken = QString()); private: QString m_url; @@ -2392,10 +2773,20 @@ class QEVERCLOUD_EXPORT UserStore: public QObject Q_OBJECT Q_DISABLE_COPY(UserStore) public: - explicit UserStore(QString host, QString authenticationToken = QString(), QObject * parent = nullptr); + explicit UserStore( + QString host, + QString authenticationToken = QString(), + QObject * parent = nullptr); + + void setAuthenticationToken(QString authenticationToken) + { + m_authenticationToken = authenticationToken; + } - void setAuthenticationToken(QString authenticationToken) { m_authenticationToken = authenticationToken; } - QString authenticationToken() { return m_authenticationToken; } + QString authenticationToken() + { + return m_authenticationToken; + } /** * This should be the first call made by a client to the EDAM service. It @@ -2423,10 +2814,16 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * client. This should be the current value of the EDAM_VERSION_MINOR * constant for the client. */ - bool checkVersion(QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR); + bool checkVersion( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR); /** Asynchronous version of @link checkVersion @endlink */ - AsyncResult * checkVersionAsync(QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR); + AsyncResult * checkVersionAsync( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR); /** * This provides bootstrap information to the client. Various bootstrap @@ -2440,10 +2837,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * @return * The bootstrap information suitable for this client. */ - BootstrapInfo getBootstrapInfo(QString locale); + BootstrapInfo getBootstrapInfo( + QString locale); /** Asynchronous version of @link getBootstrapInfo @endlink */ - AsyncResult * getBootstrapInfoAsync(QString locale); + AsyncResult * getBootstrapInfoAsync( + QString locale); /** * This is used to check a username and password in order to create a @@ -2531,10 +2930,24 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • AUTH_EXPIRED "password" - user password is expired * */ - AuthenticationResult authenticateLongSession(QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor); + AuthenticationResult authenticateLongSession( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor); /** Asynchronous version of @link authenticateLongSession @endlink */ - AsyncResult * authenticateLongSessionAsync(QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor); + AsyncResult * authenticateLongSessionAsync( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor); /** * Complete the authentication process when a second factor is required. This @@ -2574,10 +2987,18 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * two-factor authentication.
  • * */ - AuthenticationResult completeTwoFactorAuthentication(QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken = QString()); + AuthenticationResult completeTwoFactorAuthentication( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + QString authenticationToken = QString()); /** Asynchronous version of @link completeTwoFactorAuthentication @endlink */ - AsyncResult * completeTwoFactorAuthenticationAsync(QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken = QString()); + AsyncResult * completeTwoFactorAuthenticationAsync( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + QString authenticationToken = QString()); /** * Revoke an existing long lived authentication token. This can be used to @@ -2597,10 +3018,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * is already revoked. * */ - void revokeLongSession(QString authenticationToken = QString()); + void revokeLongSession( + QString authenticationToken = QString()); /** Asynchronous version of @link revokeLongSession @endlink */ - AsyncResult * revokeLongSessionAsync(QString authenticationToken = QString()); + AsyncResult * revokeLongSessionAsync( + QString authenticationToken = QString()); /** * This is used to take an existing authentication token that grants access @@ -2635,10 +3058,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * sign-on before authenticating to the business. * */ - AuthenticationResult authenticateToBusiness(QString authenticationToken = QString()); + AuthenticationResult authenticateToBusiness( + QString authenticationToken = QString()); /** Asynchronous version of @link authenticateToBusiness @endlink */ - AsyncResult * authenticateToBusinessAsync(QString authenticationToken = QString()); + AsyncResult * authenticateToBusinessAsync( + QString authenticationToken = QString()); /** * Returns the User corresponding to the provided authentication token, @@ -2647,10 +3072,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * the access level granted by the token, so a web service client may receive * fewer fields than an integrated desktop client. */ - User getUser(QString authenticationToken = QString()); + User getUser( + QString authenticationToken = QString()); /** Asynchronous version of @link getUser @endlink */ - AsyncResult * getUserAsync(QString authenticationToken = QString()); + AsyncResult * getUserAsync( + QString authenticationToken = QString()); /** * Asks the UserStore about the publicly available location information for @@ -2660,10 +3087,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • DATA_REQUIRED "username" - username is empty * */ - PublicUserInfo getPublicUserInfo(QString username); + PublicUserInfo getPublicUserInfo( + QString username); /** Asynchronous version of @link getPublicUserInfo @endlink */ - AsyncResult * getPublicUserInfoAsync(QString username); + AsyncResult * getPublicUserInfoAsync( + QString username); /** *

    Returns the URLs that should be used when sending requests to the service on @@ -2674,10 +3103,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * UserStore#authenticateLongSession(). This method is typically only needed to look up * the correct URLs for an existing long-lived authentication token.

    */ - UserUrls getUserUrls(QString authenticationToken = QString()); + UserUrls getUserUrls( + QString authenticationToken = QString()); /** Asynchronous version of @link getUserUrls @endlink */ - AsyncResult * getUserUrlsAsync(QString authenticationToken = QString()); + AsyncResult * getUserUrlsAsync( + QString authenticationToken = QString()); /** * Invite a user to join an Evernote Business account. @@ -2722,10 +3153,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * user limit.
  • * */ - void inviteToBusiness(QString emailAddress, QString authenticationToken = QString()); + void inviteToBusiness( + QString emailAddress, + QString authenticationToken = QString()); /** Asynchronous version of @link inviteToBusiness @endlink */ - AsyncResult * inviteToBusinessAsync(QString emailAddress, QString authenticationToken = QString()); + AsyncResult * inviteToBusinessAsync( + QString emailAddress, + QString authenticationToken = QString()); /** * Remove a user from an Evernote Business account. Once removed, the user will no @@ -2751,10 +3186,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * business or that user was not invited via external provisioning. * */ - void removeFromBusiness(QString emailAddress, QString authenticationToken = QString()); + void removeFromBusiness( + QString emailAddress, + QString authenticationToken = QString()); /** Asynchronous version of @link removeFromBusiness @endlink */ - AsyncResult * removeFromBusinessAsync(QString emailAddress, QString authenticationToken = QString()); + AsyncResult * removeFromBusinessAsync( + QString emailAddress, + QString authenticationToken = QString()); /** * Update the email address used to uniquely identify an Evernote Business user. @@ -2798,10 +3237,16 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * in the business. * */ - void updateBusinessUserIdentifier(QString oldEmailAddress, QString newEmailAddress, QString authenticationToken = QString()); + void updateBusinessUserIdentifier( + QString oldEmailAddress, + QString newEmailAddress, + QString authenticationToken = QString()); /** Asynchronous version of @link updateBusinessUserIdentifier @endlink */ - AsyncResult * updateBusinessUserIdentifierAsync(QString oldEmailAddress, QString newEmailAddress, QString authenticationToken = QString()); + AsyncResult * updateBusinessUserIdentifierAsync( + QString oldEmailAddress, + QString newEmailAddress, + QString authenticationToken = QString()); /** * Returns a list of active business users in a given business. @@ -2821,10 +3266,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * A business authentication token returned by authenticateToBusiness or with sufficient * privileges to manage Evernote Business membership. */ - QList< UserProfile > listBusinessUsers(QString authenticationToken = QString()); + QList listBusinessUsers( + QString authenticationToken = QString()); /** Asynchronous version of @link listBusinessUsers @endlink */ - AsyncResult * listBusinessUsersAsync(QString authenticationToken = QString()); + AsyncResult * listBusinessUsersAsync( + QString authenticationToken = QString()); /** * Returns a list of outstanding invitations to join an Evernote Business account. @@ -2840,10 +3287,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * in the returned list. If false, only invitations with a status of * BusinessInvitationStatus.APPROVED will be included. */ - QList< BusinessInvitation > listBusinessInvitations(bool includeRequestedInvitations, QString authenticationToken = QString()); + QList listBusinessInvitations( + bool includeRequestedInvitations, + QString authenticationToken = QString()); /** Asynchronous version of @link listBusinessInvitations @endlink */ - AsyncResult * listBusinessInvitationsAsync(bool includeRequestedInvitations, QString authenticationToken = QString()); + AsyncResult * listBusinessInvitationsAsync( + bool includeRequestedInvitations, + QString authenticationToken = QString()); /** * Retrieve the standard account limits for a given service level. This should only be @@ -2855,10 +3306,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • DATA_REQUIRED "serviceLevel" - serviceLevel is null
  • * */ - AccountLimits getAccountLimits(ServiceLevel serviceLevel); + AccountLimits getAccountLimits( + ServiceLevel serviceLevel); /** Asynchronous version of @link getAccountLimits @endlink */ - AsyncResult * getAccountLimitsAsync(ServiceLevel serviceLevel); + AsyncResult * getAccountLimitsAsync( + ServiceLevel serviceLevel); private: QString m_url; diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 2b3581cf..6a2c8022 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -122,7 +123,7 @@ struct QEVERCLOUD_EXPORT SyncState { This value may not be present if the SyncState has been retrieved by a caller that only has read access to the account. */ - Optional< qint64 > uploaded; + Optional uploaded; /** 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: @@ -142,7 +143,7 @@ struct QEVERCLOUD_EXPORT SyncState {
  • Update previousValue = SyncState.userLastUpdated
  • */ - Optional< Timestamp > userLastUpdated; + Optional userLastUpdated; /** 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 @@ -150,7 +151,7 @@ struct QEVERCLOUD_EXPORT SyncState { MessageStore. This value will be omitted if the user has never sent or received a message. */ - Optional< MessageEventID > userMaxMessageEventId; + Optional userMaxMessageEventId; bool operator==(const SyncState & other) const { @@ -181,31 +182,31 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { /** If true, then the server will include the SyncChunks.notes field */ - Optional< bool > includeNotes; + Optional includeNotes; /** 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. */ - Optional< bool > includeNoteResources; + Optional includeNoteResources; /** 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. */ - Optional< bool > includeNoteAttributes; + Optional includeNoteAttributes; /** If true, then the server will include the SyncChunks.notebooks field */ - Optional< bool > includeNotebooks; + Optional includeNotebooks; /** If true, then the server will include the SyncChunks.tags field */ - Optional< bool > includeTags; + Optional includeTags; /** If true, then the server will include the SyncChunks.searches field */ - Optional< bool > includeSearches; + Optional includeSearches; /** If true, then the server will include the SyncChunks.resources field. Since the Resources are also provided with their Note @@ -213,52 +214,52 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { want to watch for changes to individual Resources due to recognition data being added. */ - Optional< bool > includeResources; + Optional includeResources; /** If true, then the server will include the SyncChunks.linkedNotebooks field. */ - Optional< bool > includeLinkedNotebooks; + Optional includeLinkedNotebooks; /** 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. */ - Optional< bool > includeExpunged; + Optional includeExpunged; /** 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. */ - Optional< bool > includeNoteApplicationDataFullMap; + Optional includeNoteApplicationDataFullMap; /** 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. */ - Optional< bool > includeResourceApplicationDataFullMap; + Optional includeResourceApplicationDataFullMap; /** 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. */ - Optional< bool > includeNoteResourceApplicationDataFullMap; + Optional includeNoteResourceApplicationDataFullMap; /** 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. */ - Optional< bool > includeSharedNotes; + Optional includeSharedNotes; /** NOT DOCUMENTED */ - Optional< bool > omitSharedNotebooks; + Optional omitSharedNotebooks; /** 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. */ - Optional< QString > requireNoteContentClass; + Optional requireNoteContentClass; /** If set, then restrict the returned notebooks, notes, and resources to those associated with one of the notebooks whose @@ -276,7 +277,7 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { includeNotebooks, includeNoteAttributes, includeNoteResources, and maybe some of the "FullMap" fields. */ - Optional< QSet< QString > > notebookGuids; + Optional> notebookGuids; bool operator==(const SyncChunkFilter & other) const { @@ -317,27 +318,27 @@ struct QEVERCLOUD_EXPORT NoteFilter { The NoteSortOrder value indicating what criterion should be used to sort the results of the filter. */ - Optional< qint32 > order; + Optional order; /** If true, the results will be ascending in the requested sort order. If false, the results will be descending. */ - Optional< bool > ascending; + Optional ascending; /** 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. */ - Optional< QString > words; + Optional words; /** If present, the Guid of the notebook that must contain the notes. */ - Optional< Guid > notebookGuid; + Optional notebookGuid; /** If present, the list of tags (by GUID) that must be present on the notes. */ - Optional< QList< Guid > > tagGuids; + Optional> tagGuids; /** 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 @@ -347,50 +348,50 @@ struct QEVERCLOUD_EXPORT NoteFilter { The format must be encoded as a standard zone ID such as "America/Los_Angeles". */ - Optional< QString > timeZone; + Optional timeZone; /** 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. */ - Optional< bool > inactive; + Optional inactive; /** 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. */ - Optional< QString > emphasized; + Optional emphasized; /** 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. */ - Optional< bool > includeAllReadableNotebooks; + Optional includeAllReadableNotebooks; /** 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. */ - Optional< bool > includeAllReadableWorkspaces; + Optional includeAllReadableWorkspaces; /** 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. */ - Optional< QString > context; + Optional context; /** If present, the raw user query input. Accepts the full search grammar documented in the Evernote API Overview. */ - Optional< QString > rawWords; + Optional rawWords; /** 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. */ - Optional< QByteArray > searchContextBytes; + Optional searchContextBytes; bool operator==(const NoteFilter & other) const { @@ -432,27 +433,27 @@ struct QEVERCLOUD_EXPORT NoteFilter { */ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec { /** NOT DOCUMENTED */ - Optional< bool > includeTitle; + Optional includeTitle; /** NOT DOCUMENTED */ - Optional< bool > includeContentLength; + Optional includeContentLength; /** NOT DOCUMENTED */ - Optional< bool > includeCreated; + Optional includeCreated; /** NOT DOCUMENTED */ - Optional< bool > includeUpdated; + Optional includeUpdated; /** NOT DOCUMENTED */ - Optional< bool > includeDeleted; + Optional includeDeleted; /** NOT DOCUMENTED */ - Optional< bool > includeUpdateSequenceNum; + Optional includeUpdateSequenceNum; /** NOT DOCUMENTED */ - Optional< bool > includeNotebookGuid; + Optional includeNotebookGuid; /** NOT DOCUMENTED */ - Optional< bool > includeTagGuids; + Optional includeTagGuids; /** NOT DOCUMENTED */ - Optional< bool > includeAttributes; + Optional includeAttributes; /** NOT DOCUMENTED */ - Optional< bool > includeLargestResourceMime; + Optional includeLargestResourceMime; /** NOT DOCUMENTED */ - Optional< bool > includeLargestResourceSize; + Optional includeLargestResourceSize; bool operator==(const NotesMetadataResultSpec & other) const { @@ -487,19 +488,19 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts { A mapping from the Notebook GUID to the number of notes (from some selection) that are in the corresponding notebook. */ - Optional< QMap< Guid, qint32 > > notebookCounts; + Optional> notebookCounts; /** A mapping from the Tag GUID to the number of notes (from some selection) that have the corresponding tag. */ - Optional< QMap< Guid, qint32 > > tagCounts; + Optional> tagCounts; /** 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.) */ - Optional< qint32 > trashCount; + Optional trashCount; bool operator==(const NoteCollectionCounts & other) const { @@ -530,38 +531,38 @@ struct QEVERCLOUD_EXPORT NoteResultSpec { /** If true, the Note.content field will be populated with the note's ENML contents. */ - Optional< bool > includeContent; + Optional includeContent; /** If true, any Resource elements will include the binary contents of their 'data' field's body. */ - Optional< bool > includeResourcesData; + Optional includeResourcesData; /** If true, any Resource elements will include the binary contents of their 'recognition' field's body if recognition data is available. */ - Optional< bool > includeResourcesRecognition; + Optional includeResourcesRecognition; /** If true, any Resource elements will include the binary contents of their 'alternateData' field's body, if an alternate form is available. */ - Optional< bool > includeResourcesAlternateData; + Optional includeResourcesAlternateData; /** If true, the Note.sharedNotes field will be populated with the note's shares. */ - Optional< bool > includeSharedNotes; + Optional includeSharedNotes; /** If true, the Note.attributes.applicationData.fullMap field will be populated. */ - Optional< bool > includeNoteAppDataValues; + Optional includeNoteAppDataValues; /** If true, the Note.resource.attributes.applicationData.fullMap field will be populated. */ - Optional< bool > includeResourceAppDataValues; + Optional includeResourceAppDataValues; /** If true, the Note.limits field will be populated with the note owner's account limits. */ - Optional< bool > includeAccountLimits; + Optional includeAccountLimits; bool operator==(const NoteResultSpec & other) const { @@ -618,7 +619,7 @@ struct QEVERCLOUD_EXPORT NoteVersionId { 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. */ - Optional< UserID > lastEditorId; + Optional lastEditorId; bool operator==(const NoteVersionId & other) const { @@ -650,31 +651,31 @@ struct QEVERCLOUD_EXPORT RelatedQuery { The GUID of an existing note in your account for which related entities will be found. */ - Optional< QString > noteGuid; + Optional noteGuid; /** 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. */ - Optional< QString > plainText; + Optional plainText; /** 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. */ - Optional< NoteFilter > filter; + Optional filter; /** 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. */ - Optional< QString > referenceUri; + Optional referenceUri; /** 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. */ - Optional< QString > context; + Optional context; /** 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 @@ -686,7 +687,7 @@ struct QEVERCLOUD_EXPORT RelatedQuery { If not set, the server will not attempt to generate a cache key at all. */ - Optional< QString > cacheKey; + Optional cacheKey; bool operator==(const RelatedQuery & other) const { @@ -720,57 +721,57 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { will be silently capped. If you do not set this field, then no notes will be returned. */ - Optional< qint32 > maxNotes; + Optional maxNotes; /** 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. */ - Optional< qint32 > maxNotebooks; + Optional maxNotebooks; /** 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. */ - Optional< qint32 > maxTags; + Optional maxTags; /** 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. */ - Optional< bool > writableNotebooksOnly; + Optional writableNotebooksOnly; /** 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. */ - Optional< bool > includeContainingNotebooks; + Optional includeContainingNotebooks; /** 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. */ - Optional< bool > includeDebugInfo; + Optional includeDebugInfo; /** 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. */ - Optional< qint32 > maxExperts; + Optional maxExperts; /** 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. */ - Optional< qint32 > maxRelatedContent; + Optional maxRelatedContent; /** Specifies the types of Related Content that should be returned. */ - Optional< QSet< RelatedContentType > > relatedContentTypes; + Optional> relatedContentTypes; bool operator==(const RelatedResultSpec & other) const { @@ -796,13 +797,13 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { /** NOT DOCUMENTED */ - Optional< bool > noSetReadOnly; + Optional noSetReadOnly; /** NOT DOCUMENTED */ - Optional< bool > noSetReadPlusActivity; + Optional noSetReadPlusActivity; /** NOT DOCUMENTED */ - Optional< bool > noSetModify; + Optional noSetModify; /** NOT DOCUMENTED */ - Optional< bool > noSetFullAccess; + Optional noSetFullAccess; bool operator==(const ShareRelationshipRestrictions & other) const { @@ -830,11 +831,11 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { The string that clients should show to users to represent this member. */ - Optional< QString > displayName; + Optional displayName; /** The Evernote User ID of the recipient of this notebook share. */ - Optional< UserID > recipientUserId; + Optional recipientUserId; /** The privilege at which the member can access the notebook, which is the best privilege granted either individually or to a @@ -842,7 +843,7 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { used by the service to convey information to the user, so clients should treat it as read-only. */ - Optional< ShareRelationshipPrivilegeLevel > bestPrivilege; + Optional bestPrivilege; /** The individually granted privilege for the member, which does not take GROUP privileges into account. This value may be unset if @@ -852,12 +853,12 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { should present to users for selection are given via the the 'restrictions' field. */ - Optional< ShareRelationshipPrivilegeLevel > individualPrivilege; + Optional individualPrivilege; /** The restrictions on which privileges may be individually assigned to the recipient of this share relationship. */ - Optional< ShareRelationshipRestrictions > restrictions; + Optional restrictions; /** The user id of the user who most recently shared the notebook to this user. This field is currently unset for a MemberShareRelationship @@ -866,7 +867,7 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { This field is used by the service to convey information to the user, so clients should treat it as read-only. */ - Optional< UserID > sharerUserId; + Optional sharerUserId; bool operator==(const MemberShareRelationship & other) const { @@ -897,17 +898,17 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions { This value is true if the user is not allowed to set the privilege level to SharedNotePrivilegeLevel.READ_NOTE. */ - Optional< bool > noSetReadNote; + Optional noSetReadNote; /** This value is true if the user is not allowed to set the privilege level to SharedNotePrivilegeLevel.MODIFY_NOTE. */ - Optional< bool > noSetModifyNote; + Optional noSetModifyNote; /** This value is true if the user is not allowed to set the privilege level to SharedNotePrivilegeLevel.FULL_ACCESS. */ - Optional< bool > noSetFullAccess; + Optional noSetFullAccess; bool operator==(const NoteShareRelationshipRestrictions & other) const { @@ -934,11 +935,11 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { The string that clients should show to users to represent this member. */ - Optional< QString > displayName; + Optional displayName; /** The Evernote UserID of the user who is a member to the note. */ - Optional< UserID > recipientUserId; + Optional recipientUserId; /** The privilege at which the member can access the note, which is the best privilege granted to the user across all of their @@ -946,20 +947,20 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { to convey information to the user, so clients should treat it as read-only. */ - Optional< SharedNotePrivilegeLevel > privilege; + Optional privilege; /** 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. */ - Optional< NoteShareRelationshipRestrictions > restrictions; + Optional restrictions; /** 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. */ - Optional< UserID > sharerUserId; + Optional sharerUserId; bool operator==(const NoteMemberShareRelationship & other) const { @@ -988,7 +989,7 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { The string that clients should show to users to represent this invitation. */ - Optional< QString > displayName; + Optional displayName; /** Identifies the identity of the invitation recipient. Once the identity has been claimed by an Evernote user and they have accessed @@ -996,19 +997,19 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { longer be returned by the service to clients. Instead, that recipient will be included in the list of NoteMemberShareRelationships. */ - Optional< IdentityID > recipientIdentityId; + Optional recipientIdentityId; /** 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. */ - Optional< SharedNotePrivilegeLevel > privilege; + Optional privilege; /** 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. */ - Optional< UserID > sharerUserId; + Optional sharerUserId; bool operator==(const NoteInvitationShareRelationship & other) const { @@ -1038,15 +1039,15 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships { A list of open invitations that can be redeemed into memberships to the note. */ - Optional< QList< NoteInvitationShareRelationship > > invitations; + Optional> invitations; /** A list of memberships of the noteb. A member is identified by their Evernote UserID and has rights to access the note. */ - Optional< QList< NoteMemberShareRelationship > > memberships; + Optional> memberships; /** NOT DOCUMENTED */ - Optional< NoteShareRelationshipRestrictions > invitationRestrictions; + Optional invitationRestrictions; bool operator==(const NoteShareRelationships & other) const { @@ -1077,7 +1078,7 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { /** The GUID of the note whose shares are being managed. */ - Optional< QString > noteGuid; + Optional noteGuid; /** A list of existing memberships to update. This field is not meant to be the full set of memberships for the note. Clients @@ -1085,7 +1086,7 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { to modify. To remove an existing membership, see the unshares field. */ - Optional< QList< NoteMemberShareRelationship > > membershipsToUpdate; + Optional> membershipsToUpdate; /** The list of outstanding invitations to update, as matched by the identity field of the NoteInvitationShareRelatioship instances. @@ -1093,15 +1094,15 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { note. Clients should only include those existing invitations that they wish to modify. */ - Optional< QList< NoteInvitationShareRelationship > > invitationsToUpdate; + Optional> invitationsToUpdate; /** A list of existing memberships to expunge from the service. */ - Optional< QList< UserID > > membershipsToUnshare; + Optional> membershipsToUnshare; /** A list of outstanding invitations to expunge from the service. */ - Optional< QList< IdentityID > > invitationsToUnshare; + Optional> invitationsToUnshare; bool operator==(const ManageNoteSharesParameters & other) const { @@ -1135,11 +1136,11 @@ struct QEVERCLOUD_EXPORT Data { data body, in binary form. The hash function is MD5
    Length: EDAM_HASH_LEN (exactly) */ - Optional< QByteArray > bodyHash; + Optional bodyHash; /** The length, in bytes, of the data body. */ - Optional< qint32 > size; + Optional size; /** This field is set to contain the binary contents of the data whenever the resource is being transferred. If only metadata is @@ -1147,7 +1148,7 @@ struct QEVERCLOUD_EXPORT Data { notify the service about the change to an attribute for a resource without transmitting the binary resource contents. */ - Optional< QByteArray > body; + Optional body; bool operator==(const Data & other) const { @@ -1176,30 +1177,30 @@ struct QEVERCLOUD_EXPORT UserAttributes { specified.
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > defaultLocationName; + Optional defaultLocationName; /** if set, this is the latitude that should be assigned to any notes that have no other latitude information. */ - Optional< double > defaultLatitude; + Optional defaultLatitude; /** if set, this is the longitude that should be assigned to any notes that have no other longitude information. */ - Optional< double > defaultLongitude; + Optional defaultLongitude; /** 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. */ - Optional< bool > preactivation; + Optional preactivation; /** 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 */ - Optional< QStringList > viewedPromotions; + Optional viewedPromotions; /** if set, this is the email address that the user may send email to in order to add an email note directly into the @@ -1208,7 +1209,7 @@ struct QEVERCLOUD_EXPORT UserAttributes { If this is not set, the user may not add notes via the gateway.
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > incomingEmailAddress; + Optional incomingEmailAddress; /** if set, this will contain a list of email addresses that have recently been used as recipients @@ -1218,97 +1219,97 @@ struct QEVERCLOUD_EXPORT UserAttributes { Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each
    Max: EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries */ - Optional< QStringList > recentMailedAddresses; + Optional recentMailedAddresses; /** Free-form text field that may hold general support information, etc.
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > comments; + Optional comments; /** The date/time when the user agreed to the terms of service. This can be used as the effective "start date" for the account. */ - Optional< Timestamp > dateAgreedToTermsOfService; + Optional dateAgreedToTermsOfService; /** The number of referrals that the user is permitted to make. */ - Optional< qint32 > maxReferrals; + Optional maxReferrals; /** The number of referrals sent from this account. */ - Optional< qint32 > referralCount; + Optional referralCount; /** A code indicating where the user was sent from. AKA promotion code */ - Optional< QString > refererCode; + Optional refererCode; /** 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. */ - Optional< Timestamp > sentEmailDate; + Optional sentEmailDate; /** 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. */ - Optional< qint32 > sentEmailCount; + Optional sentEmailCount; /** 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. */ - Optional< qint32 > dailyEmailLimit; + Optional dailyEmailLimit; /** 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. */ - Optional< Timestamp > emailOptOutDate; + Optional emailOptOutDate; /** 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. */ - Optional< Timestamp > partnerEmailOptInDate; + Optional partnerEmailOptInDate; /** 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). */ - Optional< QString > preferredLanguage; + Optional preferredLanguage; /** Preferred country code based on ISO 3166-1-alpha-2 indicating the users preferred country */ - Optional< QString > preferredCountry; + Optional preferredCountry; /** Boolean flag set to true if the user wants to clip full pages by default when they use the web clipper without a selection. */ - Optional< bool > clipFullPage; + Optional clipFullPage; /** 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. */ - Optional< QString > twitterUserName; + Optional twitterUserName; /** The unique identifier of the user's Twitter account if that user has chosen to enable Twittering into Evernote. */ - Optional< QString > twitterId; + Optional twitterId; /** A name identifier used to identify a particular set of branding and light customization. */ - Optional< QString > groupName; + Optional groupName; /** a 2 character language codes based on: http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt @@ -1316,25 +1317,25 @@ struct QEVERCLOUD_EXPORT UserAttributes { when processing images and PDF files to find text. If not set, then the 'preferredLanguage' will be used. */ - Optional< QString > recognitionLanguage; + Optional recognitionLanguage; /** NOT DOCUMENTED */ - Optional< QString > referralProof; + Optional referralProof; /** NOT DOCUMENTED */ - Optional< bool > educationalDiscount; + Optional educationalDiscount; /** A string recording the business address of a Sponsored Account user who has requested invoicing. */ - Optional< QString > businessAddress; + Optional businessAddress; /** A flag indicating whether to hide the billing information on a sponsored account owner's settings page */ - Optional< bool > hideSponsorBilling; + Optional hideSponsorBilling; /** A flag indicating whether the user chooses to allow Evernote to automatically file and tag emailed notes */ - Optional< bool > useEmailAutoFiling; + Optional useEmailAutoFiling; /** Configuration state for whether or not the user wishes to receive reminder e-mail. This setting applies to both the reminder e-mail sent @@ -1342,31 +1343,31 @@ struct QEVERCLOUD_EXPORT UserAttributes { notes in the user's business notebooks that the user has configured for e-mail notifications. */ - Optional< ReminderEmailConfig > reminderEmailConfig; + Optional reminderEmailConfig; /** 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. */ - Optional< Timestamp > emailAddressLastConfirmed; + Optional emailAddressLastConfirmed; /** 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. */ - Optional< Timestamp > passwordUpdated; + Optional passwordUpdated; /** NOT DOCUMENTED */ - Optional< bool > salesforcePushEnabled; + Optional salesforcePushEnabled; /** If set to True, the server will record LogRequest send from clients of this user as ClientEventLog. */ - Optional< bool > shouldLogClientEvent; + Optional shouldLogClientEvent; /** If set to True, no Machine Learning nor human review will be done to this user's note contents. */ - Optional< bool > optOutMachineLearning; + Optional optOutMachineLearning; bool operator==(const UserAttributes & other) const { @@ -1424,32 +1425,32 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes { /** Free form text of this user's title in the business */ - Optional< QString > title; + Optional title; /** City, State (for US) or City / Province for other countries */ - Optional< QString > location; + Optional location; /** Free form text of the department this user belongs to. */ - Optional< QString > department; + Optional department; /** User's mobile phone number. Stored as plain text without any formatting. */ - Optional< QString > mobilePhone; + Optional mobilePhone; /** 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/". */ - Optional< QString > linkedInProfileUrl; + Optional linkedInProfileUrl; /** User's work phone number. Stored as plain text without any formatting. */ - Optional< QString > workPhone; + Optional workPhone; /** The date on which the user started working at their company. */ - Optional< Timestamp > companyStartDate; + Optional companyStartDate; bool operator==(const BusinessUserAttributes & other) const { @@ -1481,108 +1482,108 @@ struct QEVERCLOUD_EXPORT Accounting { limit is imposed. This date and time is exclusive, so this is effectively the start of the new month. */ - Optional< Timestamp > uploadLimitEnd; + Optional uploadLimitEnd; /** When uploadLimitEnd is reached, the service will change uploadLimit to uploadLimitNextMonth. If a premium account is canceled, this mechanism will reset the quota appropriately. */ - Optional< qint64 > uploadLimitNextMonth; + Optional uploadLimitNextMonth; /** Indicates the phases of a premium account during the billing process. */ - Optional< PremiumOrderStatus > premiumServiceStatus; + Optional premiumServiceStatus; /** The order number used by the commerce system to process recurring payments */ - Optional< QString > premiumOrderNumber; + Optional premiumOrderNumber; /** The commerce system used (paypal, Google checkout, etc) */ - Optional< QString > premiumCommerceService; + Optional premiumCommerceService; /** The start date when this premium promotion began (this number will get overwritten if a premium service is canceled and then re-activated). */ - Optional< Timestamp > premiumServiceStart; + Optional premiumServiceStart; /** The code associated with the purchase eg. monthly or annual purchase. Clients should interpret this value and localize it. */ - Optional< QString > premiumServiceSKU; + Optional premiumServiceSKU; /** Date the last time the user was charged. Null if never charged. */ - Optional< Timestamp > lastSuccessfulCharge; + Optional lastSuccessfulCharge; /** Date the last time a charge was attempted and failed. */ - Optional< Timestamp > lastFailedCharge; + Optional lastFailedCharge; /** Reason provided for the charge failure */ - Optional< QString > lastFailedChargeReason; + Optional lastFailedChargeReason; /** The end of the billing cycle. This could be in the past if there are failed charges. */ - Optional< Timestamp > nextPaymentDue; + Optional nextPaymentDue; /** An internal variable to manage locking operations on the commerce variables. */ - Optional< Timestamp > premiumLockUntil; + Optional premiumLockUntil; /** The date any modification where made to this record. */ - Optional< Timestamp > updated; + Optional updated; /** The number number identifying the recurring subscription used to make the recurring charges. */ - Optional< QString > premiumSubscriptionNumber; + Optional premiumSubscriptionNumber; /** Date charge last attempted */ - Optional< Timestamp > lastRequestedCharge; + Optional lastRequestedCharge; /** ISO 4217 currency code */ - Optional< QString > currency; + Optional currency; /** charge in the smallest unit of the currency (e.g. cents for USD) */ - Optional< qint32 > unitPrice; + Optional unitPrice; /** DEPRECATED:See BusinessUserInfo. */ - Optional< qint32 > businessId; + Optional businessId; /** DEPRECATED:See BusinessUserInfo. */ - Optional< QString > businessName; + Optional businessName; /** DEPRECATED:See BusinessUserInfo. */ - Optional< BusinessUserRole > businessRole; + Optional businessRole; /** discount per seat in negative amount and smallest unit of the currency (e.g. cents for USD) */ - Optional< qint32 > unitDiscount; + Optional unitDiscount; /** The next time the user will be charged, may or may not be the same as nextPaymentDue */ - Optional< Timestamp > nextChargeDate; + Optional nextChargeDate; /** NOT DOCUMENTED */ - Optional< qint32 > availablePoints; + Optional availablePoints; bool operator==(const Accounting & other) const { @@ -1631,14 +1632,14 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { The human-readable name of the Evernote Business account that the user is a member of. */ - Optional< qint32 > businessId; + Optional businessId; /** NOT DOCUMENTED */ - Optional< QString > businessName; + Optional businessName; /** The role of the user within the Evernote Business account that they are a member of. */ - Optional< BusinessUserRole > role; + Optional role; /** 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 @@ -1646,11 +1647,11 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { your business, etc. The business e-mail cannot be used for identification purposes such as for logging into the service. */ - Optional< QString > email; + Optional email; /** Last time the business user or business user attributes were updated. */ - Optional< Timestamp > updated; + Optional updated; bool operator==(const BusinessUserInfo & other) const { @@ -1678,22 +1679,22 @@ struct QEVERCLOUD_EXPORT AccountLimits { service per day. If an email is sent to two different recipients, this counts as two emails. */ - Optional< qint32 > userMailLimitDaily; + Optional userMailLimitDaily; /** 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). */ - Optional< qint64 > noteSizeMax; + Optional noteSizeMax; /** Maximum size of a resource, in bytes */ - Optional< qint64 > resourceSizeMax; + Optional resourceSizeMax; /** Maximum number of linked notebooks per account. */ - Optional< qint32 > userLinkedNotebookMax; + Optional userLinkedNotebookMax; /** 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 @@ -1702,31 +1703,31 @@ struct QEVERCLOUD_EXPORT AccountLimits { length and the new length (if this is greater than 0) plus the size of each new resource. */ - Optional< qint64 > uploadLimit; + Optional uploadLimit; /** Maximum number of Notes per user */ - Optional< qint32 > userNoteCountMax; + Optional userNoteCountMax; /** Maximum number of Notebooks per user */ - Optional< qint32 > userNotebookCountMax; + Optional userNotebookCountMax; /** Maximum number of Tags per account */ - Optional< qint32 > userTagCountMax; + Optional userTagCountMax; /** Maximum number of Tags per Note */ - Optional< qint32 > noteTagCountMax; + Optional noteTagCountMax; /** Maximum number of SavedSearches per account */ - Optional< qint32 > userSavedSearchesMax; + Optional userSavedSearchesMax; /** The maximum number of Resources per Note */ - Optional< qint32 > noteResourceCountMax; + Optional noteResourceCountMax; bool operator==(const AccountLimits & other) const { @@ -1759,7 +1760,7 @@ struct QEVERCLOUD_EXPORT User { The unique numeric identifier for the account, which will not change for the lifetime of the account. */ - Optional< UserID > id; + Optional id; /** The name that uniquely identifies a single user account. This name may be presented by the user, along with their password, to log into @@ -1770,7 +1771,7 @@ struct QEVERCLOUD_EXPORT User {
    Regex: EDAM_USER_USERNAME_REGEX */ - Optional< QString > username; + Optional username; /** The email address registered for the user. Must comply with RFC 2821 and RFC 2822.
    @@ -1780,7 +1781,7 @@ struct QEVERCLOUD_EXPORT User {
    Regex: EDAM_EMAIL_REGEX */ - Optional< QString > email; + Optional email; /** The printable name of the user, which may be a combination of given and family names. This is used instead of separate "first" @@ -1792,7 +1793,7 @@ struct QEVERCLOUD_EXPORT User {
    Regex: EDAM_USER_NAME_REGEX */ - Optional< QString > name; + Optional name; /** 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 @@ -1804,71 +1805,71 @@ struct QEVERCLOUD_EXPORT User {
    Regex: EDAM_TIMEZONE_REGEX */ - Optional< QString > timezone; + Optional timezone; /** NOT DOCUMENTED */ - Optional< PrivilegeLevel > privilege; + Optional privilege; /** The level of service the user currently receives. This will always be populated for users retrieved from the Evernote service. */ - Optional< ServiceLevel > serviceLevel; + Optional serviceLevel; /** The date and time when this user account was created in the service. */ - Optional< Timestamp > created; + Optional created; /** The date and time when this user account was last modified in the service. */ - Optional< Timestamp > updated; + Optional updated; /** 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. */ - Optional< Timestamp > deleted; + Optional deleted; /** If the user account is available for login and synchronization, this flag will be set to true. */ - Optional< bool > active; + Optional active; /** DEPRECATED - Client applications should have no need to use this field. */ - Optional< QString > shardId; + Optional shardId; /** If present, this will contain a list of the attributes for this user account. */ - Optional< UserAttributes > attributes; + Optional attributes; /** Bookkeeping information for the user's subscription. */ - Optional< Accounting > accounting; + Optional accounting; /** 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. */ - Optional< BusinessUserInfo > businessUserInfo; + Optional businessUserInfo; /** 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. */ - Optional< QString > photoUrl; + Optional photoUrl; /** 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. */ - Optional< Timestamp > photoLastUpdated; + Optional photoLastUpdated; /** Account limits applicable for this user. */ - Optional< AccountLimits > accountLimits; + Optional accountLimits; bool operator==(const User & other) const { @@ -1910,26 +1911,26 @@ struct QEVERCLOUD_EXPORT Contact { The displayable name of this contact. This field is filled in by the service and is read-only to clients. */ - Optional< QString > name; + Optional name; /** A unique identifier for this ContactType. */ - Optional< QString > id; + Optional id; /** What service does this contact come from? */ - Optional< ContactType > type; + Optional type; /** A URL of a profile photo representing this Contact. This field is filled in by the service and is read-only to clients. */ - Optional< QString > photoUrl; + Optional photoUrl; /** 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. */ - Optional< Timestamp > photoLastUpdated; + Optional photoLastUpdated; /** 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 @@ -1937,14 +1938,14 @@ struct QEVERCLOUD_EXPORT Contact { 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. */ - Optional< QByteArray > messagingPermit; + Optional messagingPermit; /** 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. */ - Optional< Timestamp > messagingPermitExpires; + Optional messagingPermitExpires; bool operator==(const Contact & other) const { @@ -1976,13 +1977,13 @@ struct QEVERCLOUD_EXPORT Identity { */ IdentityID id; /** NOT DOCUMENTED */ - Optional< Contact > contact; + Optional contact; /** 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. */ - Optional< UserID > userId; + Optional userId; /** Indicates that the contact for this identity is no longer active and should not be used when creating new threads using Destination.recipients, @@ -1990,16 +1991,16 @@ struct QEVERCLOUD_EXPORT Identity { that is active. If you are connected to the user (see userConnected), you can still create threads using their Evernote-type contact. */ - Optional< bool > deactivated; + Optional deactivated; /** Does this Identity belong to someone who is in the same business as the caller? */ - Optional< bool > sameBusiness; + Optional sameBusiness; /** Has the caller blocked the Evernote user this Identity represents? */ - Optional< bool > blocked; + Optional blocked; /** Indicates that the caller is "connected" to the user of this identity via this identity. When you have a connection via an @@ -2016,12 +2017,12 @@ struct QEVERCLOUD_EXPORT Identity { sending messages to yourself, but you will obviously see your own profile information. */ - Optional< bool > userConnected; + Optional userConnected; /** A server-assigned sequence number for the events in the messages subsystem. */ - Optional< MessageEventID > eventId; + Optional eventId; bool operator==(const Identity & other) const { @@ -2056,7 +2057,7 @@ struct QEVERCLOUD_EXPORT Tag {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** A sequence of characters representing the tag's identifier. Case is preserved, but is ignored for comparisons. @@ -2069,7 +2070,7 @@ struct QEVERCLOUD_EXPORT Tag {
    Regex: EDAM_TAG_NAME_REGEX */ - Optional< QString > name; + Optional name; /** If this is set, then this is the GUID of the tag that holds this tag within the tag organizational hierarchy. If this is @@ -2081,14 +2082,14 @@ struct QEVERCLOUD_EXPORT Tag {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > parentGuid; + Optional parentGuid; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; bool operator==(const Tag & other) const { @@ -2130,11 +2131,11 @@ struct QEVERCLOUD_EXPORT LazyMap { The set of keys for the map. This field is ignored by the server when set. */ - Optional< QSet< QString > > keysOnly; + Optional> keysOnly; /** The complete map, including all keys and values. */ - Optional< QMap< QString, QString > > fullMap; + Optional> fullMap; bool operator==(const LazyMap & other) const { @@ -2159,60 +2160,60 @@ struct QEVERCLOUD_EXPORT ResourceAttributes {
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > sourceURL; + Optional sourceURL; /** 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) */ - Optional< Timestamp > timestamp; + Optional timestamp; /** the latitude where the resource was captured */ - Optional< double > latitude; + Optional latitude; /** the longitude where the resource was captured */ - Optional< double > longitude; + Optional longitude; /** the altitude where the resource was captured */ - Optional< double > altitude; + Optional altitude; /** 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 */ - Optional< QString > cameraMake; + Optional 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 */ - Optional< QString > cameraModel; + Optional cameraModel; /** if true, then the original client that submitted the resource plans to submit the recognition index for this resource at a later time. */ - Optional< bool > clientWillIndex; + Optional clientWillIndex; /** DEPRECATED - this field is no longer set by the service, so should be ignored. */ - Optional< QString > recoType; + Optional recoType; /** 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. */ - Optional< QString > fileName; + Optional fileName; /** this will be true if the resource should be displayed as an attachment, or false if the resource should be displayed inline (if possible). */ - Optional< bool > attachment; + Optional attachment; /** 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 @@ -2229,7 +2230,7 @@ struct QEVERCLOUD_EXPORT ResourceAttributes {
    Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX */ - Optional< LazyMap > applicationData; + Optional applicationData; bool operator==(const ResourceAttributes & other) const { @@ -2269,7 +2270,7 @@ struct QEVERCLOUD_EXPORT Resource {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** The unique identifier of the Note that holds this Resource. Will be set whenever the resource is retrieved from the service, @@ -2279,13 +2280,13 @@ struct QEVERCLOUD_EXPORT Resource {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > noteGuid; + Optional noteGuid; /** 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. */ - Optional< Data > data; + Optional data; /** The MIME type for the embedded resource. E.g. "image/gif"
    @@ -2293,41 +2294,41 @@ struct QEVERCLOUD_EXPORT Resource {
    Regex: EDAM_MIME_REGEX */ - Optional< QString > mime; + Optional mime; /** If set, this contains the display width of this resource, in pixels. */ - Optional< qint16 > width; + Optional width; /** If set, this contains the display height of this resource, in pixels. */ - Optional< qint16 > height; + Optional height; /** DEPRECATED: ignored. */ - Optional< qint16 > duration; + Optional duration; /** If the resource is active or not. */ - Optional< bool > active; + Optional active; /** If set, this will hold the encoded data that provides information on search and recognition within this resource. */ - Optional< Data > recognition; + Optional recognition; /** A list of the attributes for this resource. */ - Optional< ResourceAttributes > attributes; + Optional attributes; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** Some Resources may be assigned an alternate data format by the service which may be more appropriate for indexing or rendering than the original @@ -2335,7 +2336,7 @@ struct QEVERCLOUD_EXPORT Resource { be available via this Data element. If a Resource has no alternate form, this field will be unset. */ - Optional< Data > alternateData; + Optional alternateData; bool operator==(const Resource & other) const { @@ -2368,39 +2369,39 @@ struct QEVERCLOUD_EXPORT NoteAttributes { /** time that the note refers to */ - Optional< Timestamp > subjectDate; + Optional subjectDate; /** the latitude where the note was taken */ - Optional< double > latitude; + Optional latitude; /** the longitude where the note was taken */ - Optional< double > longitude; + Optional longitude; /** the altitude where the note was taken */ - Optional< double > altitude; + Optional altitude; /** the author of the content of the note
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > author; + Optional author; /** 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 */ - Optional< QString > source; + Optional source; /** 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 */ - Optional< QString > sourceURL; + Optional sourceURL; /** an identifying string for the application that created this note. This string does not have a guaranteed syntax or @@ -2408,7 +2409,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes {
    Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX */ - Optional< QString > sourceApplication; + Optional sourceApplication; /** 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 @@ -2416,7 +2417,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { is treated as "read-only" for clients; the server will ignore changes to this field from an external client. */ - Optional< Timestamp > shareDate; + Optional shareDate; /** The set of notes with this parameter set are considered "reminders" and are to be treated specially by clients to give them @@ -2443,14 +2444,14 @@ struct QEVERCLOUD_EXPORT NoteAttributes { reminderOrder is not set, the server will fill in the current server time for the reminderOrder field. */ - Optional< qint64 > reminderOrder; + Optional reminderOrder; /** 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. */ - Optional< Timestamp > reminderDoneTime; + Optional reminderDoneTime; /** 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 @@ -2461,7 +2462,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { cleared. This should happen regardless of any existing reminder time that may have previously existed on the note. */ - Optional< Timestamp > reminderTime; + Optional reminderTime; /** Allows the user to assign a human-readable location name associated with a note. Users may assign values like 'Home' and 'Work'. Place @@ -2473,7 +2474,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { more useful than a simple automated lookup based on the note's latitude and longitude. */ - Optional< QString > placeName; + Optional placeName; /** The class (or type) of note. This field is used to indicate to clients that special structured information is represented within @@ -2496,7 +2497,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes {
    Regex: EDAM_NOTE_CONTENT_CLASS_REGEX */ - Optional< QString > contentClass; + Optional contentClass; /** 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 @@ -2513,7 +2514,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes {
    Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX */ - Optional< LazyMap > applicationData; + Optional applicationData; /** 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 @@ -2525,21 +2526,21 @@ struct QEVERCLOUD_EXPORT NoteAttributes { it will be left unset. This field is read-only by clients. The server will ignore all values set by clients into this field. */ - Optional< QString > lastEditedBy; + Optional lastEditedBy; /** 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_. */ - Optional< QMap< QString, QString > > classifications; + Optional> classifications; /** The numeric user ID of the user who originally created the note. */ - Optional< UserID > creatorId; + Optional creatorId; /** The numeric user ID of the user described in lastEditedBy. */ - Optional< UserID > lastEditorId; + Optional lastEditorId; /** 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 @@ -2548,7 +2549,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { To share a note with the business, use NoteStore.shareNoteWithBusiness and to stop sharing a note with the business, use NoteStore.stopSharingNoteWithBusiness. */ - Optional< bool > sharedWithBusiness; + Optional sharedWithBusiness; /** 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 @@ -2557,7 +2558,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { conflict. This allows clients to provide a customized user experience for note conflicts. */ - Optional< Guid > conflictSourceNoteGuid; + Optional conflictSourceNoteGuid; /** 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 @@ -2570,7 +2571,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes { When a user edits a note's title, clients MUST unset this value. */ - Optional< qint32 > noteTitleQuality; + Optional noteTitleQuality; bool operator==(const NoteAttributes & other) const { @@ -2616,30 +2617,30 @@ struct QEVERCLOUD_EXPORT SharedNote { /** The user ID of the user who shared the note with the recipient. */ - Optional< UserID > sharerUserID; + Optional sharerUserID; /** 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. */ - Optional< Identity > recipientIdentity; + Optional recipientIdentity; /** The privilege level that the share grants to the recipient. */ - Optional< SharedNotePrivilegeLevel > privilege; + Optional privilege; /** The time at which the share was created. */ - Optional< Timestamp > serviceCreated; + Optional serviceCreated; /** The time at which the share was last updated. */ - Optional< Timestamp > serviceUpdated; + Optional serviceUpdated; /** The time at which the share was assigned to a specific recipient user ID. */ - Optional< Timestamp > serviceAssigned; + Optional serviceAssigned; bool operator==(const SharedNote & other) const { @@ -2700,22 +2701,22 @@ struct QEVERCLOUD_EXPORT NoteRestrictions { /** The client may not update the note's title (Note.title). */ - Optional< bool > noUpdateTitle; + Optional noUpdateTitle; /** NOT DOCUMENTED */ - Optional< bool > noUpdateContent; + Optional noUpdateContent; /** The client may not email the note (NoteStore.emailNote). */ - Optional< bool > noEmail; + Optional noEmail; /** The client may not share the note with specific recipients (NoteStore.createOrUpdateSharedNotes). */ - Optional< bool > noShare; + Optional noShare; /** The client may not make the note public (NoteStore.shareNote). */ - Optional< bool > noSharePublicly; + Optional noSharePublicly; bool operator==(const NoteRestrictions & other) const { @@ -2744,15 +2745,15 @@ struct QEVERCLOUD_EXPORT NoteRestrictions { */ struct QEVERCLOUD_EXPORT NoteLimits { /** NOT DOCUMENTED */ - Optional< qint32 > noteResourceCountMax; + Optional noteResourceCountMax; /** NOT DOCUMENTED */ - Optional< qint64 > uploadLimit; + Optional uploadLimit; /** NOT DOCUMENTED */ - Optional< qint64 > resourceSizeMax; + Optional resourceSizeMax; /** NOT DOCUMENTED */ - Optional< qint64 > noteSizeMax; + Optional noteSizeMax; /** NOT DOCUMENTED */ - Optional< qint64 > uploaded; + Optional uploaded; bool operator==(const NoteLimits & other) const { @@ -2784,7 +2785,7 @@ struct QEVERCLOUD_EXPORT Note {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** The subject of the note. Can't begin or end with a space.
    @@ -2792,7 +2793,7 @@ struct QEVERCLOUD_EXPORT Note {
    Regex: EDAM_NOTE_TITLE_REGEX */ - Optional< QString > title; + Optional title; /** The XHTML block that makes up the note. This is the canonical form of the note's contents, so will include abstract @@ -2803,7 +2804,7 @@ struct QEVERCLOUD_EXPORT Note {
    Length: EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX */ - Optional< QString > content; + Optional content; /** 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 @@ -2811,13 +2812,13 @@ struct QEVERCLOUD_EXPORT Note {
    Length: EDAM_HASH_LEN (exactly) */ - Optional< QByteArray > contentHash; + Optional contentHash; /** 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. */ - Optional< qint32 > contentLength; + Optional contentLength; /** 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 @@ -2827,14 +2828,14 @@ struct QEVERCLOUD_EXPORT Note { ordering between notes. Notes created directly through the service (e.g. via the web GUI) will have an absolutely ordered "created" value. */ - Optional< Timestamp > created; + Optional created; /** 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. */ - Optional< Timestamp > updated; + Optional updated; /** If present, the note is considered "deleted", and this stores the date and time when the note was deleted by one of the clients. @@ -2842,19 +2843,19 @@ struct QEVERCLOUD_EXPORT Note { deleted, but this field may be unreliable due to the possibility of client clock errors. */ - Optional< Timestamp > deleted; + Optional deleted; /** If the note is available for normal actions and viewing, this flag will be set to true. */ - Optional< bool > active; + Optional active; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** The unique identifier of the notebook that contains this note. If no notebookGuid is provided on a call to createNote(), the @@ -2864,7 +2865,7 @@ struct QEVERCLOUD_EXPORT Note {
    Regex: EDAM_GUID_REGEX */ - Optional< QString > notebookGuid; + Optional notebookGuid; /** 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 @@ -2875,7 +2876,7 @@ struct QEVERCLOUD_EXPORT Note { the server will assume that no changes have been made to the resources. Maximum: EDAM_NOTE_TAGS_MAX tags per note */ - Optional< QList< Guid > > tagGuids; + Optional> tagGuids; /** The list of resources that are embedded within this note. If the list of resources are omitted on a call to updateNote(), then @@ -2885,13 +2886,13 @@ struct QEVERCLOUD_EXPORT Note { the Note is returned in the future. Maximum: EDAM_NOTE_RESOURCES_MAX resources per note */ - Optional< QList< Resource > > resources; + Optional> resources; /** 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. */ - Optional< NoteAttributes > attributes; + Optional attributes; /** May be provided by clients during calls to createNote() as an alternative to providing the tagGuids of existing tags. If any tagNames @@ -2899,14 +2900,14 @@ struct QEVERCLOUD_EXPORT Note { don't already exist. Created tags will have no parent (they will be at the top level of the tag panel). */ - Optional< QStringList > tagNames; + Optional tagNames; /** 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. */ - Optional< QList< SharedNote > > sharedNotes; + Optional> sharedNotes; /** 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 @@ -2915,9 +2916,9 @@ struct QEVERCLOUD_EXPORT Note { note-specific restrictions. However, a client may still be limited based on the user's notebook permissions. */ - Optional< NoteRestrictions > restrictions; + Optional restrictions; /** NOT DOCUMENTED */ - Optional< NoteLimits > limits; + Optional limits; bool operator==(const Note & other) const { @@ -2966,18 +2967,18 @@ struct QEVERCLOUD_EXPORT Publishing {
    Regex: EDAM_PUBLISHING_URI_REGEX */ - Optional< QString > uri; + Optional uri; /** When the notes are publicly displayed, they will be sorted based on the requested criteria. */ - Optional< NoteSortOrder > order; + Optional order; /** 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). */ - Optional< bool > ascending; + Optional ascending; /** This field may be used to provide a short description of the notebook, which may be displayed when (e.g.) the @@ -2988,7 +2989,7 @@ struct QEVERCLOUD_EXPORT Publishing {
    Regex: EDAM_PUBLISHING_DESCRIPTION_REGEX */ - Optional< QString > publicDescription; + Optional publicDescription; bool operator==(const Publishing & other) const { @@ -3024,17 +3025,17 @@ struct QEVERCLOUD_EXPORT BusinessNotebook {
    Regex: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX */ - Optional< QString > notebookDescription; + Optional notebookDescription; /** The privileges that will be granted to users who join the notebook through the business library. */ - Optional< SharedNotebookPrivilegeLevel > privilege; + Optional privilege; /** Whether the notebook should be "recommended" when displayed in the business library user interface. */ - Optional< bool > recommended; + Optional recommended; bool operator==(const BusinessNotebook & other) const { @@ -3059,18 +3060,18 @@ struct QEVERCLOUD_EXPORT SavedSearchScope { /** The search should include notes from the account that contains the SavedSearch. */ - Optional< bool > includeAccount; + Optional includeAccount; /** The search should include notes within those shared notebooks that the user has joined that are NOT business notebooks. */ - Optional< bool > includePersonalLinkedNotebooks; + Optional includePersonalLinkedNotebooks; /** 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. */ - Optional< bool > includeBusinessLinkedNotebooks; + Optional includeBusinessLinkedNotebooks; bool operator==(const SavedSearchScope & other) const { @@ -3099,7 +3100,7 @@ struct QEVERCLOUD_EXPORT SavedSearch {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** The name of the saved search to display in the GUI. The account may only contain one search with a given name (case-insensitive @@ -3109,25 +3110,25 @@ struct QEVERCLOUD_EXPORT SavedSearch {
    Regex: EDAM_SAVED_SEARCH_NAME_REGEX */ - Optional< QString > name; + Optional name; /** A string expressing the search to be performed.
    Length: EDAM_SAVED_SEARCH_QUERY_LEN_MIN - EDAM_SAVED_SEARCH_QUERY_LEN_MAX */ - Optional< QString > query; + Optional query; /** The format of the query string, to determine how to parse and process it. */ - Optional< QueryFormat > format; + Optional format; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /**

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

    @@ -3141,7 +3142,7 @@ struct QEVERCLOUD_EXPORT SavedSearch { context. If a client cannot search any of the desired scopes, it should refuse to execute the search.

    */ - Optional< SavedSearchScope > scope; + Optional scope; bool operator==(const SavedSearch & other) const { @@ -3182,14 +3183,14 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings { 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. */ - Optional< bool > reminderNotifyEmail; + Optional reminderNotifyEmail; /** 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. */ - Optional< bool > reminderNotifyInApp; + Optional reminderNotifyInApp; bool operator==(const SharedNotebookRecipientSettings & other) const { @@ -3223,32 +3224,32 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings { which the user is a member. You may only set this value on a notebook in your business. This value will initially be unset. */ - Optional< bool > reminderNotifyEmail; + Optional reminderNotifyEmail; /** 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. */ - Optional< bool > reminderNotifyInApp; + Optional reminderNotifyInApp; /** DEPRECATED: Use recipientStatus instead. The notebook is on the recipient's notebook list (formerly, we would say that the recipient has "joined" the notebook) */ - Optional< bool > inMyList; + Optional inMyList; /** 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. */ - Optional< QString > stack; + Optional stack; /** 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 */ - Optional< RecipientStatus > recipientStatus; + Optional recipientStatus; bool operator==(const NotebookRecipientSettings & other) const { @@ -3275,36 +3276,36 @@ struct QEVERCLOUD_EXPORT SharedNotebook { /** The primary identifier of the share, which is not globally unique. */ - Optional< qint64 > id; + Optional id; /** The user id of the owner of the notebook. */ - Optional< UserID > userId; + Optional userId; /** The GUID of the notebook that has been shared. */ - Optional< Guid > notebookGuid; + Optional notebookGuid; /** 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. */ - Optional< QString > email; + Optional email; /** The IdentityID of the share recipient. If present, only the user who has claimed that identity may access this share. */ - Optional< IdentityID > recipientIdentityId; + Optional recipientIdentityId; /** DEPRECATED */ - Optional< bool > notebookModifiable; + Optional notebookModifiable; /** The date that the owner first created the share with the specific email address. */ - Optional< Timestamp > serviceCreated; + Optional serviceCreated; /** The date the shared notebook was last updated on the service. This will be updated when authenticateToSharedNotebook is called the first @@ -3313,7 +3314,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { as part of a shareNotebook(...) call, as well as on any calls to updateSharedNotebook(...). */ - Optional< Timestamp > serviceUpdated; + Optional serviceUpdated; /** An immutable, opaque string that acts as a globally unique identifier for this shared notebook record. You can use this field to @@ -3321,25 +3322,25 @@ struct QEVERCLOUD_EXPORT SharedNotebook { create new LinkedNotebook records. This field replaces the deprecated shareKey field. */ - Optional< QString > globalId; + Optional globalId; /** 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. */ - Optional< QString > username; + Optional username; /** The privilege level granted to the notebook, activity stream, and invitations. See the corresponding enumeration for details. */ - Optional< SharedNotebookPrivilegeLevel > privilege; + Optional privilege; /** 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. */ - Optional< SharedNotebookRecipientSettings > recipientSettings; + Optional recipientSettings; /** 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 @@ -3348,7 +3349,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { field is currently unset for a SharedNotebook created by joining a notebook that has been published to the business. */ - Optional< UserID > sharerUserId; + Optional sharerUserId; /** 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 @@ -3356,7 +3357,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { created SharedNotebook being assigned to a user. This value is always set if serviceAssigned is set. */ - Optional< QString > recipientUsername; + Optional recipientUsername; /** 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 @@ -3365,13 +3366,13 @@ struct QEVERCLOUD_EXPORT SharedNotebook { prefer this field over recipientUsername unless they need to use usernames directly. */ - Optional< UserID > recipientUserId; + Optional recipientUserId; /** 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. */ - Optional< Timestamp > serviceAssigned; + Optional serviceAssigned; bool operator==(const SharedNotebook & other) const { @@ -3406,7 +3407,7 @@ struct QEVERCLOUD_EXPORT SharedNotebook { */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions { /** NOT DOCUMENTED */ - Optional< CanMoveToContainerStatus > canMoveToContainer; + Optional canMoveToContainer; bool operator==(const CanMoveToContainerRestrictions & other) const { @@ -3452,131 +3453,131 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions { The client is not able to read notes from the service and the notebook is write-only. */ - Optional< bool > noReadNotes; + Optional noReadNotes; /** The client may not create new notes in the notebook. */ - Optional< bool > noCreateNotes; + Optional noCreateNotes; /** The client may not update notes currently in the notebook. */ - Optional< bool > noUpdateNotes; + Optional noUpdateNotes; /** The client may not expunge notes currently in the notebook. */ - Optional< bool > noExpungeNotes; + Optional noExpungeNotes; /** The client may not share notes in the notebook via the shareNote or createOrUpdateSharedNotes methods. */ - Optional< bool > noShareNotes; + Optional noShareNotes; /** 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. */ - Optional< bool > noEmailNotes; + Optional noEmailNotes; /** The client may not send messages to the share recipients of the notebook. */ - Optional< bool > noSendMessageToRecipients; + Optional noSendMessageToRecipients; /** The client may not update the Notebook object itself, for example, via the updateNotebook method. */ - Optional< bool > noUpdateNotebook; + Optional noUpdateNotebook; /** The client may not expunge the Notebook object itself, for example, via the expungeNotebook method. */ - Optional< bool > noExpungeNotebook; + Optional noExpungeNotebook; /** The client may not set this notebook to be the default notebook. The caller should leave Notebook.defaultNotebook unset. */ - Optional< bool > noSetDefaultNotebook; + Optional noSetDefaultNotebook; /** If the client is able to update the Notebook, the Notebook.stack value may not be set. */ - Optional< bool > noSetNotebookStack; + Optional noSetNotebookStack; /** The client may not publish the notebook to the public. For example, business notebooks may not be shared publicly. */ - Optional< bool > noPublishToPublic; + Optional noPublishToPublic; /** The client may not publish the notebook to the business library. */ - Optional< bool > noPublishToBusinessLibrary; + Optional noPublishToBusinessLibrary; /** The client may not complete an operation that results in a new tag being created in the owner's account. */ - Optional< bool > noCreateTags; + Optional noCreateTags; /** The client may not update tags in the owner's account. */ - Optional< bool > noUpdateTags; + Optional noUpdateTags; /** The client may not expunge tags in the owner's account. */ - Optional< bool > noExpungeTags; + Optional noExpungeTags; /** 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. */ - Optional< bool > noSetParentTag; + Optional noSetParentTag; /** The client is unable to create shared notebooks for the notebook. */ - Optional< bool > noCreateSharedNotebooks; + Optional noCreateSharedNotebooks; /** 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. */ - Optional< SharedNotebookInstanceRestrictions > updateWhichSharedNotebookRestrictions; + Optional updateWhichSharedNotebookRestrictions; /** 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. */ - Optional< SharedNotebookInstanceRestrictions > expungeWhichSharedNotebookRestrictions; + Optional expungeWhichSharedNotebookRestrictions; /** The client may not share notes in the notebook via the shareNoteWithBusiness method. */ - Optional< bool > noShareNotesWithBusiness; + Optional noShareNotesWithBusiness; /** The client may not rename this notebook. */ - Optional< bool > noRenameNotebook; + Optional noRenameNotebook; /** clients may not change the NotebookRecipientSettings.inMyList settings for this notebook. */ - Optional< bool > noSetInMyList; + Optional noSetInMyList; /** NOT DOCUMENTED */ - Optional< bool > noChangeContact; + Optional noChangeContact; /** Specifies if the client can move this notebook to a container and if not, the reason why. */ - Optional< CanMoveToContainerRestrictions > canMoveToContainerRestrictions; + Optional canMoveToContainerRestrictions; /** NOT DOCUMENTED */ - Optional< bool > noSetReminderNotifyEmail; + Optional noSetReminderNotifyEmail; /** NOT DOCUMENTED */ - Optional< bool > noSetReminderNotifyInApp; + Optional noSetReminderNotifyInApp; /** NOT DOCUMENTED */ - Optional< bool > noSetRecipientSettingsStack; + Optional noSetRecipientSettingsStack; /** If set, the client cannot move a Note into or out of the Notebook. */ - Optional< bool > noCanMoveNote; + Optional noCanMoveNote; bool operator==(const NotebookRestrictions & other) const { @@ -3630,7 +3631,7 @@ struct QEVERCLOUD_EXPORT Notebook {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** A sequence of characters representing the name of the notebook. May be changed by clients, but the account may not contain two @@ -3641,14 +3642,14 @@ struct QEVERCLOUD_EXPORT Notebook {
    Regex: EDAM_NOTEBOOK_NAME_REGEX */ - Optional< QString > name; + Optional name; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** If true, this notebook should be used for new notes whenever the user has not (or cannot) specify a desired target notebook. @@ -3661,21 +3662,21 @@ struct QEVERCLOUD_EXPORT Notebook { 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. */ - Optional< bool > defaultNotebook; + Optional defaultNotebook; /** 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. */ - Optional< Timestamp > serviceCreated; + Optional serviceCreated; /** 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. */ - Optional< Timestamp > serviceUpdated; + Optional serviceUpdated; /** 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 @@ -3685,7 +3686,7 @@ struct QEVERCLOUD_EXPORT Notebook { Note that this structure is never populated for business notebooks, see the businessNotebook field. */ - Optional< Publishing > publishing; + Optional publishing; /** If this is set to true, then the Notebook will be accessible either to the public, or for business users to their business, @@ -3694,7 +3695,7 @@ struct QEVERCLOUD_EXPORT Notebook { Clients that do not wish to change the publishing behavior of a Notebook should not set this value when calling NoteStore.updateNotebook(). */ - Optional< bool > published; + Optional published; /** 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 @@ -3702,11 +3703,11 @@ struct QEVERCLOUD_EXPORT Notebook { Notebooks with no stack set are "top level" and not contained within a stack. */ - Optional< QString > stack; + Optional stack; /** DEPRECATED - replaced by sharedNotebooks. */ - Optional< QList< qint64 > > sharedNotebookIds; + Optional> sharedNotebookIds; /** The list of recipients to whom this notebook has been shared (one SharedNotebook object per recipient email address). This field will @@ -3716,14 +3717,14 @@ struct QEVERCLOUD_EXPORT Notebook { This field is read-only. Clients may not make changes to shared notebooks via this field. */ - Optional< QList< SharedNotebook > > sharedNotebooks; + Optional> sharedNotebooks; /** 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. */ - Optional< BusinessNotebook > businessNotebook; + Optional businessNotebook; /** Intended for use with Business accounts, this field identifies the user who has been designated as the "contact". For notebooks created in business @@ -3733,15 +3734,15 @@ struct QEVERCLOUD_EXPORT Notebook { field unset, indicating that no change to the value is being requested and that the existing value, if any, should be preserved. */ - Optional< User > contact; + Optional contact; /** NOT DOCUMENTED */ - Optional< NotebookRestrictions > restrictions; + Optional restrictions; /** 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. */ - Optional< NotebookRecipientSettings > recipientSettings; + Optional recipientSettings; bool operator==(const Notebook & other) const { @@ -3779,18 +3780,18 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { /** The display name of the shared notebook. The link owner can change this. */ - Optional< QString > shareName; + Optional shareName; /** The username of the user who owns the shared or public notebook. */ - Optional< QString > username; + Optional username; /** The shard ID of the notebook if the notebook is not public.
    uri The identifier of the public notebook. */ - Optional< QString > shardId; + Optional shardId; /** 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 @@ -3798,9 +3799,9 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { Notebook.GUID value when creating new LinkedNotebooks. This field replaces the deprecated "shareKey" field. */ - Optional< QString > sharedNotebookGlobalId; + Optional sharedNotebookGlobalId; /** NOT DOCUMENTED */ - Optional< QString > uri; + Optional uri; /** 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 @@ -3810,21 +3811,21 @@ struct QEVERCLOUD_EXPORT LinkedNotebook {
    Regex: EDAM_GUID_REGEX */ - Optional< Guid > guid; + Optional guid; /** 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. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** 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. */ - Optional< QString > noteStoreUrl; + Optional noteStoreUrl; /** 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 @@ -3834,7 +3835,7 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { end of this string to construct the full URL, as documented on our developer web site. */ - Optional< QString > webApiUrlPrefix; + Optional webApiUrlPrefix; /** 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 @@ -3843,12 +3844,12 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { stack. The link owner can change this and this field is for the benefit of the link owner. */ - Optional< QString > stack; + Optional stack; /** If set, this will be the unique identifier for the business that owns the notebook to which the linked notebook refers. */ - Optional< qint32 > businessId; + Optional businessId; bool operator==(const LinkedNotebook & other) const { @@ -3882,25 +3883,25 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor { /** The unique identifier of the notebook. */ - Optional< Guid > guid; + Optional guid; /** A sequence of characters representing the name of the notebook. */ - Optional< QString > notebookDisplayName; + Optional notebookDisplayName; /** The User.name value of the notebook's "contact". */ - Optional< QString > contactName; + Optional contactName; /** Whether a SharedNotebook record exists between the calling user and this notebook. */ - Optional< bool > hasSharedNotebook; + Optional hasSharedNotebook; /** The number of users who have joined this notebook. */ - Optional< qint32 > joinedUserCount; + Optional joinedUserCount; bool operator==(const NotebookDescriptor & other) const { @@ -3927,44 +3928,44 @@ struct QEVERCLOUD_EXPORT UserProfile { /** The numeric identifier that uniquely identifies a user. */ - Optional< UserID > id; + Optional id; /** The full name of the user. */ - Optional< QString > name; + Optional name; /** The user's business email address. If the user has not registered their business email address, this field will be empty. */ - Optional< QString > email; + Optional email; /** The user's Evernote username. */ - Optional< QString > username; + Optional username; /** The user's business specific attributes. */ - Optional< BusinessUserAttributes > attributes; + Optional attributes; /** The time when the user joined the business */ - Optional< Timestamp > joined; + Optional joined; /** The time when the user's profile photo was most recently updated */ - Optional< Timestamp > photoLastUpdated; + Optional photoLastUpdated; /** A URL identifying a copy of the user's current profile photo */ - Optional< QString > photoUrl; + Optional photoUrl; /** The BusinessUserRole for the user */ - Optional< BusinessUserRole > role; + Optional role; /** The BusinessUserStatus for the user */ - Optional< BusinessUserStatus > status; + Optional status; bool operator==(const UserProfile & other) const { @@ -3998,23 +3999,23 @@ struct QEVERCLOUD_EXPORT RelatedContentImage { /** The external URL of the image */ - Optional< QString > url; + Optional url; /** The width of the image, in pixels. */ - Optional< qint32 > width; + Optional width; /** The height of the image, in pixels. */ - Optional< qint32 > height; + Optional height; /** the pixel ratio (usually either 1.0, 1.5 or 2.0) */ - Optional< double > pixelRatio; + Optional pixelRatio; /** the size of the image file, in bytes */ - Optional< qint32 > fileSize; + Optional fileSize; bool operator==(const RelatedContentImage & other) const { @@ -4042,74 +4043,74 @@ struct QEVERCLOUD_EXPORT RelatedContent { /** An identifier that uniquely identifies the content. */ - Optional< QString > contentId; + Optional contentId; /** The main title to show. */ - Optional< QString > title; + Optional title; /** The URL the client can use to retrieve the content. */ - Optional< QString > url; + Optional url; /** An identifier that uniquely identifies the source. */ - Optional< QString > sourceId; + Optional sourceId; /** A URL the client can access to know more about the source. */ - Optional< QString > sourceUrl; + Optional sourceUrl; /** The favicon URL of the source which the content belongs to. */ - Optional< QString > sourceFaviconUrl; + Optional sourceFaviconUrl; /** A human-readable name of the source that provided this content. */ - Optional< QString > sourceName; + Optional sourceName; /** A timestamp telling the user about the recency of the content. */ - Optional< Timestamp > date; + Optional date; /** A teaser text to show to the user; usually the first few sentences of the content, excluding the title. */ - Optional< QString > teaser; + Optional teaser; /** A list of thumbnails the client can show in the snippet. */ - Optional< QList< RelatedContentImage > > thumbnails; + Optional> thumbnails; /** The type of this related content. */ - Optional< RelatedContentType > contentType; + Optional contentType; /** An indication of how this content can be accessed. This type influences the semantics of the url parameter. */ - Optional< RelatedContentAccess > accessType; + Optional accessType; /** 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. */ - Optional< QString > visibleUrl; + Optional visibleUrl; /** 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. */ - Optional< QString > clipUrl; + Optional clipUrl; /** If set, the client may use this Contact for messaging purposes. This will typically only be set for user profiles. */ - Optional< Contact > contact; + Optional contact; /** For News articles only. A list of names of the article authors, if available. */ - Optional< QStringList > authors; + Optional authors; bool operator==(const RelatedContent & other) const { @@ -4147,38 +4148,38 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { /** The ID of the business to which the invitation grants access. */ - Optional< qint32 > businessId; + Optional businessId; /** The email address that was invited to join the business. */ - Optional< QString > email; + Optional email; /** The role to grant the user after the invitation is accepted. */ - Optional< BusinessUserRole > role; + Optional role; /** The status of the invitation. */ - Optional< BusinessInvitationStatus > status; + Optional status; /** 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. */ - Optional< UserID > requesterId; + Optional requesterId; /** If this invitation was created implicitly via a WorkChat, this field will be true. */ - Optional< bool > fromWorkChat; + Optional fromWorkChat; /** The timestamp at which this invitation was created. */ - Optional< Timestamp > created; + Optional created; /** The timestamp at which the most recent reminder was sent. */ - Optional< Timestamp > mostRecentReminder; + Optional mostRecentReminder; bool operator==(const BusinessInvitation & other) const { @@ -4231,11 +4232,11 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { */ struct QEVERCLOUD_EXPORT UserIdentity { /** NOT DOCUMENTED */ - Optional< UserIdentityType > type; + Optional type; /** NOT DOCUMENTED */ - Optional< QString > stringIdentifier; + Optional stringIdentifier; /** NOT DOCUMENTED */ - Optional< qint64 > longIdentifier; + Optional longIdentifier; bool operator==(const UserIdentity & other) const { @@ -4264,16 +4265,16 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { /** The service level of the account. */ - Optional< ServiceLevel > serviceLevel; + Optional serviceLevel; /** NOT DOCUMENTED */ - Optional< QString > username; + Optional username; /** 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. */ - Optional< QString > noteStoreUrl; + Optional noteStoreUrl; /** 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 @@ -4283,7 +4284,7 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { end of this string to construct the full URL, as documented on our developer web site. */ - Optional< QString > webApiUrlPrefix; + Optional webApiUrlPrefix; bool operator==(const PublicUserInfo & other) const { @@ -4311,7 +4312,7 @@ struct QEVERCLOUD_EXPORT UserUrls { 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. */ - Optional< QString > noteStoreUrl; + Optional noteStoreUrl; /** 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 @@ -4321,33 +4322,33 @@ struct QEVERCLOUD_EXPORT UserUrls { end of this string to construct the full URL, as documented on our developer web site. */ - Optional< QString > webApiUrlPrefix; + Optional webApiUrlPrefix; /** 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. */ - Optional< QString > userStoreUrl; + Optional userStoreUrl; /** 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. */ - Optional< QString > utilityUrl; + Optional utilityUrl; /** 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. */ - Optional< QString > messageStoreUrl; + Optional messageStoreUrl; /** 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. */ - Optional< QString > userWebSocketUrl; + Optional userWebSocketUrl; bool operator==(const UserUrls & other) const { @@ -4394,21 +4395,21 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { authenticated if this was a full authentication. May be absent if this particular authentication did not require user information. */ - Optional< User > user; + Optional user; /** 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. */ - Optional< PublicUserInfo > publicUserInfo; + Optional publicUserInfo; /** DEPRECATED - Client applications should use urls.noteStoreUrl. */ - Optional< QString > noteStoreUrl; + Optional noteStoreUrl; /** DEPRECATED - Client applications should use urls.webApiUrlPrefix. */ - Optional< QString > webApiUrlPrefix; + Optional webApiUrlPrefix; /** 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 @@ -4416,7 +4417,7 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { a short-lived authentication token that may only be used to make a subsequent call to completeTwoFactorAuthentication. */ - Optional< bool > secondFactorRequired; + Optional secondFactorRequired; /** When secondFactorRequired is set to true, this field may contain a string describing the second factor delivery method that the user has configured. @@ -4424,12 +4425,12 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { "(xxx) xxx-x095". This string can be displayed to the user to remind them how to obtain the required second factor. */ - Optional< QString > secondFactorDeliveryHint; + Optional secondFactorDeliveryHint; /** This structure will contain all of the URLs that clients need to make requests to the Evernote service on behalf of the authenticated User. */ - Optional< UserUrls > urls; + Optional urls; bool operator==(const AuthenticationResult & other) const { @@ -4486,40 +4487,40 @@ struct QEVERCLOUD_EXPORT BootstrapSettings { /** Whether the client application should enable sharing of notes on Facebook. */ - Optional< bool > enableFacebookSharing; + Optional enableFacebookSharing; /** Whether the client application should enable gift subscriptions. */ - Optional< bool > enableGiftSubscriptions; + Optional enableGiftSubscriptions; /** Whether the client application should enable in-client creation of support tickets. */ - Optional< bool > enableSupportTickets; + Optional enableSupportTickets; /** Whether the client application should enable shared notebooks. */ - Optional< bool > enableSharedNotebooks; + Optional enableSharedNotebooks; /** Whether the client application should enable single note sharing. */ - Optional< bool > enableSingleNoteSharing; + Optional enableSingleNoteSharing; /** Whether the client application should enable sponsored accounts. */ - Optional< bool > enableSponsoredAccounts; + Optional enableSponsoredAccounts; /** Whether the client application should enable sharing of notes on Twitter. */ - Optional< bool > enableTwitterSharing; + Optional enableTwitterSharing; /** NOT DOCUMENTED */ - Optional< bool > enableLinkedInSharing; + Optional enableLinkedInSharing; /** NOT DOCUMENTED */ - Optional< bool > enablePublicNotebooks; + Optional enablePublicNotebooks; /** Whether the client application should enable authentication with Google, for example to allow integration with a user's Gmail contacts. */ - Optional< bool > enableGoogle; + Optional enableGoogle; bool operator==(const BootstrapSettings & other) const { @@ -4583,7 +4584,7 @@ struct QEVERCLOUD_EXPORT BootstrapInfo { List of one or more bootstrap profiles, in descending preference order. */ - QList< BootstrapProfile > profiles; + QList profiles; bool operator==(const BootstrapInfo & other) const { @@ -4620,7 +4621,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException { public: EDAMErrorCode errorCode; - Optional< QString > parameter; + Optional parameter; EDAMUserException(); virtual ~EDAMUserException() throw() Q_DECL_OVERRIDE; @@ -4661,8 +4662,8 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException { public: EDAMErrorCode errorCode; - Optional< QString > message; - Optional< qint32 > rateLimitDuration; + Optional message; + Optional rateLimitDuration; EDAMSystemException(); virtual ~EDAMSystemException() throw() Q_DECL_OVERRIDE; @@ -4702,8 +4703,8 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException { public: - Optional< QString > identifier; - Optional< QString > key; + Optional identifier; + Optional key; EDAMNotFoundException(); virtual ~EDAMNotFoundException() throw() Q_DECL_OVERRIDE; @@ -4751,9 +4752,9 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException { public: - QList< Contact > contacts; - Optional< QString > parameter; - Optional< QList< EDAMInvalidContactReason > > reasons; + QList contacts; + Optional parameter; + Optional> reasons; EDAMInvalidContactsException(); virtual ~EDAMInvalidContactsException() throw() Q_DECL_OVERRIDE; @@ -4798,7 +4799,7 @@ struct QEVERCLOUD_EXPORT SyncChunk { in this sync chunk. If there are no objects in the chunk, this will not be set. */ - Optional< qint32 > chunkHighUSN; + Optional chunkHighUSN; /** The total number of updates that have been performed in the service for this account. This is equal to the highest USN within the @@ -4814,61 +4815,61 @@ struct QEVERCLOUD_EXPORT SyncChunk { of tags and resources, but the note content, resource content, resource recognition data and resource alternate data will not be supplied. */ - Optional< QList< Note > > notes; + Optional> notes; /** If present, this is a list of non-expunged notebooks that have a USN in this chunk. */ - Optional< QList< Notebook > > notebooks; + Optional> notebooks; /** If present, this is a list of the non-expunged tags that have a USN in this chunk. */ - Optional< QList< Tag > > tags; + Optional> tags; /** If present, this is a list of non-expunged searches that have a USN in this chunk. */ - Optional< QList< SavedSearch > > searches; + Optional> searches; /** 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. */ - Optional< QList< Resource > > resources; + Optional> resources; /** If present, the GUIDs of all of the notes that were permanently expunged in this chunk. */ - Optional< QList< Guid > > expungedNotes; + Optional> expungedNotes; /** 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. */ - Optional< QList< Guid > > expungedNotebooks; + Optional> expungedNotebooks; /** If present, the GUIDs of all of the tags that were permanently expunged in this chunk. */ - Optional< QList< Guid > > expungedTags; + Optional> expungedTags; /** If present, the GUIDs of all of the saved searches that were permanently expunged in this chunk. */ - Optional< QList< Guid > > expungedSearches; + Optional> expungedSearches; /** If present, this is a list of non-expunged LinkedNotebooks that have a USN in this chunk. */ - Optional< QList< LinkedNotebook > > linkedNotebooks; + Optional> linkedNotebooks; /** If present, the GUIDs of all of the LinkedNotebooks that were permanently expunged in this chunk. */ - Optional< QList< Guid > > expungedLinkedNotebooks; + Optional> expungedLinkedNotebooks; bool operator==(const SyncChunk & other) const { @@ -4917,20 +4918,20 @@ struct QEVERCLOUD_EXPORT NoteList { metadata (attributes, resources, etc.), but will not include the ENML content of the note or the binary contents of any resources. */ - QList< Note > notes; + QList notes; /** 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. */ - Optional< QStringList > stoppedWords; + Optional stoppedWords; /** 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. */ - Optional< QStringList > searchedWords; + Optional searchedWords; /** Indicates the total number of transactions that have been committed within the account. This reflects (for example) the @@ -4939,16 +4940,16 @@ struct QEVERCLOUD_EXPORT NoteList { This number is the "high water mark" for Update Sequence Numbers (USN) within the account. */ - Optional< qint32 > updateCount; + Optional updateCount; /** Specifies the correlating information about the current search session, in byte array. */ - Optional< QByteArray > searchContextBytes; + Optional searchContextBytes; /** Depends on the value of context in NoteFilter, this field may contain debug information if the service decides to do so. */ - Optional< QString > debugInfo; + Optional debugInfo; bool operator==(const NoteList & other) const { @@ -4984,35 +4985,35 @@ struct QEVERCLOUD_EXPORT NoteMetadata { /** NOT DOCUMENTED */ Guid guid; /** NOT DOCUMENTED */ - Optional< QString > title; + Optional title; /** NOT DOCUMENTED */ - Optional< qint32 > contentLength; + Optional contentLength; /** NOT DOCUMENTED */ - Optional< Timestamp > created; + Optional created; /** NOT DOCUMENTED */ - Optional< Timestamp > updated; + Optional updated; /** NOT DOCUMENTED */ - Optional< Timestamp > deleted; + Optional deleted; /** NOT DOCUMENTED */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** NOT DOCUMENTED */ - Optional< QString > notebookGuid; + Optional notebookGuid; /** NOT DOCUMENTED */ - Optional< QList< Guid > > tagGuids; + Optional> tagGuids; /** NOT DOCUMENTED */ - Optional< NoteAttributes > attributes; + Optional attributes; /** 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. */ - Optional< QString > largestResourceMime; + Optional largestResourceMime; /** 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. */ - Optional< qint32 > largestResourceSize; + Optional largestResourceSize; bool operator==(const NoteMetadata & other) const { @@ -5063,20 +5064,20 @@ struct QEVERCLOUD_EXPORT NotesMetadataList { performed. Only the 'guid' field will be guaranteed to be set in each Note. */ - QList< NoteMetadata > notes; + QList notes; /** 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. */ - Optional< QStringList > stoppedWords; + Optional stoppedWords; /** 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. */ - Optional< QStringList > searchedWords; + Optional searchedWords; /** Indicates the total number of transactions that have been committed within the account. This reflects (for example) the @@ -5085,16 +5086,16 @@ struct QEVERCLOUD_EXPORT NotesMetadataList { This number is the "high water mark" for Update Sequence Numbers (USN) within the account. */ - Optional< qint32 > updateCount; + Optional updateCount; /** Specifies the correlating information about the current search session, in byte array. */ - Optional< QByteArray > searchContextBytes; + Optional searchContextBytes; /** Depends on the value of context in NoteFilter, this field may contain debug information if the service decides to do so. */ - Optional< QString > debugInfo; + Optional debugInfo; bool operator==(const NotesMetadataList & other) const { @@ -5127,37 +5128,37 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters { should be retrieved from the service and sent as email. If not set, the 'note' field must be provided instead. */ - Optional< QString > guid; + Optional guid; /** 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. */ - Optional< Note > note; + Optional note; /** 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. */ - Optional< QStringList > toAddresses; + Optional toAddresses; /** 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. */ - Optional< QStringList > ccAddresses; + Optional ccAddresses; /** 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. */ - Optional< QString > subject; + Optional subject; /** If provided, this is additional personal text that should be included into the email as a message from the owner to the recipient(s). */ - Optional< QString > message; + Optional message; bool operator==(const NoteEmailParameters & other) const { @@ -5190,17 +5191,17 @@ struct QEVERCLOUD_EXPORT RelatedResult { If notes have been requested to be included, this will be the list of notes. */ - Optional< QList< Note > > notes; + Optional> notes; /** If notebooks have been requested to be included, this will be the list of notebooks. */ - Optional< QList< Notebook > > notebooks; + Optional> notebooks; /** If tags have been requested to be included, this will be the list of tags. */ - Optional< QList< Tag > > tags; + Optional> tags; /** If includeContainingNotebooks is set to true in the RelatedResultSpec, return the list of notebooks to @@ -5208,19 +5209,19 @@ struct QEVERCLOUD_EXPORT RelatedResult { list will occur once per notebook GUID and are represented as NotebookDescriptor objects. */ - Optional< QList< NotebookDescriptor > > containingNotebooks; + Optional> containingNotebooks; /** NOT DOCUMENTED */ - Optional< QString > debugInfo; + Optional debugInfo; /** 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. */ - Optional< QList< UserProfile > > experts; + Optional> experts; /** If related content has been requested to be included, this will be the list of related content snippets. */ - Optional< QList< RelatedContent > > relatedContent; + Optional> relatedContent; /** If set and non-empty, this cache key may be used in subsequent "NoteStore.findRelated" calls (via "RelatedQuery") to re-use previous @@ -5254,7 +5255,7 @@ struct QEVERCLOUD_EXPORT RelatedResult { "RelatedResult.relatedContent". List fields that are set, but empty indicate that no results could be found; the cache should be updated correspondingly. */ - Optional< QString > cacheKey; + Optional cacheKey; /** 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. @@ -5263,7 +5264,7 @@ struct QEVERCLOUD_EXPORT RelatedResult { but it should supply the stored cacheKey to the service when checking for an update. */ - Optional< qint32 > cacheExpires; + Optional cacheExpires; bool operator==(const RelatedResult & other) const { @@ -5300,11 +5301,11 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult { You can check for updates to these large objects by checking the Data.bodyHash values and downloading accordingly. */ - Optional< Note > note; + Optional note; /** Whether or not the note was updated by the operation. */ - Optional< bool > updated; + Optional updated; bool operator==(const UpdateNoteIfUsnMatchesResult & other) const { @@ -5330,7 +5331,7 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { The string that clients should show to users to represent this invitation. */ - Optional< QString > displayName; + Optional displayName; /** Identifies the recipient of the invitation. The user identity type can be either EMAIL, EVERNOTE or IDENTITYID. If the @@ -5339,7 +5340,7 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { EVERNOTE or IDENTITYID, depending on whether we can map the identity to an Evernote user at the time of creation. */ - Optional< UserIdentity > recipientUserIdentity; + Optional recipientUserIdentity; /** 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. @@ -5347,13 +5348,13 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { Evernote User ID, and so we won't know until the invitation is redeemed whether or not the recipient already has privilege. */ - Optional< ShareRelationshipPrivilegeLevel > privilege; + Optional privilege; /** 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. */ - Optional< UserID > sharerUserId; + Optional sharerUserId; bool operator==(const InvitationShareRelationship & other) const { @@ -5383,13 +5384,13 @@ struct QEVERCLOUD_EXPORT ShareRelationships { A list of open invitations that can be redeemed into memberships to the notebook. */ - Optional< QList< InvitationShareRelationship > > invitations; + Optional> invitations; /** A list of memberships of the notebook. A member is identified by their Evernote UserID and has rights to access the notebook. */ - Optional< QList< MemberShareRelationship > > memberships; + Optional> memberships; /** The restrictions on what privileges may be granted to invitees to this notebook. These restrictions may be specific to the calling @@ -5398,7 +5399,7 @@ struct QEVERCLOUD_EXPORT ShareRelationships { recipient of the invitation has been identified by the service, such as by a business auto-join, the actual assigned privilege may change. */ - Optional< ShareRelationshipRestrictions > invitationRestrictions; + Optional invitationRestrictions; bool operator==(const ShareRelationships & other) const { @@ -5424,12 +5425,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { /** The GUID of the notebook whose shares are being managed. */ - Optional< QString > notebookGuid; + Optional notebookGuid; /** If the service sends a message to invitees, this parameter will be used to form the actual message that is sent. */ - Optional< QString > inviteMessage; + Optional inviteMessage; /** The list of existing memberships to update. This field is not intended to be the full set of memberships for the notebook and @@ -5442,7 +5443,7 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { joined by the service, so the client is creating an invitation, not a membership). */ - Optional< QList< MemberShareRelationship > > membershipsToUpdate; + Optional> membershipsToUpdate; /** The list of invitations to update, as matched by the identity field of the InvitationShareRelationship instances, or to create if @@ -5456,7 +5457,7 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { belongs. Note that to discover the user IDs for business members, the sharer must also be part of the business. */ - Optional< QList< InvitationShareRelationship > > invitationsToCreateOrUpdate; + Optional> invitationsToCreateOrUpdate; /** The list of share relationships to expunge from the service. If the user identity is for an Evernote UserID, then matching invitations or @@ -5465,7 +5466,7 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { match the identity (by identity ID or user ID or e-mail for legacy invitations) will be removed. */ - Optional< QList< UserIdentity > > unshares; + Optional> unshares; bool operator==(const ManageNotebookSharesParameters & other) const { @@ -5500,19 +5501,19 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError { The identity of the share relationship whose update encountered an error. */ - Optional< UserIdentity > userIdentity; + Optional userIdentity; /** 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. */ - Optional< EDAMUserException > userException; + Optional userException; /** 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. */ - Optional< EDAMNotFoundException > notFoundException; + Optional notFoundException; bool operator==(const ManageNotebookSharesError & other) const { @@ -5539,7 +5540,7 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult { might still have occurred, and in that case, this field will contain the list of those errors the occurred. */ - Optional< QList< ManageNotebookSharesError > > errors; + Optional> errors; bool operator==(const ManageNotebookSharesResult & other) const { @@ -5562,7 +5563,7 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { /** The GUID of the note. */ - Optional< Guid > noteGuid; + Optional noteGuid; /** 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 @@ -5570,18 +5571,18 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { identities. The sharer must be a participant of the thread. Either this field or recipientContacts must be set. */ - Optional< MessageThreadID > recipientThreadId; + Optional recipientThreadId; /** 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. */ - Optional< QList< Contact > > recipientContacts; + Optional> recipientContacts; /** The privilege level to be granted. */ - Optional< SharedNotePrivilegeLevel > privilege; + Optional privilege; bool operator==(const SharedNoteTemplate & other) const { @@ -5607,7 +5608,7 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { /** The GUID of the notebook. */ - Optional< Guid > notebookGuid; + Optional notebookGuid; /** 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 @@ -5615,18 +5616,18 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { identities. The sharer must be a participant of the thread. Either this field or recipientContacts must be set. */ - Optional< MessageThreadID > recipientThreadId; + Optional recipientThreadId; /** 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. */ - Optional< QList< Contact > > recipientContacts; + Optional> recipientContacts; /** The privilege level to be granted. */ - Optional< SharedNotebookPrivilegeLevel > privilege; + Optional privilege; bool operator==(const NotebookShareTemplate & other) const { @@ -5652,14 +5653,14 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult { /** The USN of the notebook after the call. */ - Optional< qint32 > updateSequenceNum; + Optional updateSequenceNum; /** 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. */ - Optional< QList< SharedNotebook > > matchingShares; + Optional> matchingShares; bool operator==(const CreateOrUpdateNotebookSharesResult & other) const { @@ -5691,17 +5692,17 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError { The identity ID of an outstanding invitation that was not updated due to the error. */ - Optional< IdentityID > identityID; + Optional identityID; /** The user ID of an existing membership that was not updated due to the error. */ - Optional< UserID > userID; + Optional userID; /** If the error is represented as an EDAMUserException that would have otherwise been thrown without best-effort execution. */ - Optional< EDAMUserException > userException; + Optional userException; /** If the error is represented as an EDAMNotFoundException that would have otherwise been thrown without best-effort execution. @@ -5709,7 +5710,7 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError { or "User.id", indicating that no existing share could be found for the specified recipient. */ - Optional< EDAMNotFoundException > notFoundException; + Optional notFoundException; bool operator==(const ManageNoteSharesError & other) const { @@ -5737,7 +5738,7 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { might still have occurred. In that case, this field will contain the list of errors. */ - Optional< QList< ManageNoteSharesError > > errors; + Optional> errors; bool operator==(const ManageNoteSharesResult & other) const { diff --git a/QEverCloud/src/generated/Constants.cpp b/QEverCloud/src/generated/Constants.cpp index 08003088..af04b980 100644 --- a/QEverCloud/src/generated/Constants.cpp +++ b/QEverCloud/src/generated/Constants.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -120,13 +121,46 @@ const QString EDAM_MIME_TYPE_PDF = QStringLiteral("application/pdf"); const QString EDAM_MIME_TYPE_DEFAULT = QStringLiteral("application/octet-stream"); // Limits.thrift -const QSet< QString > EDAM_MIME_TYPES = QSet< QString >() << 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; -// Limits.thrift - -const QSet< QString > EDAM_INDEXABLE_RESOURCE_MIME_TYPES = QSet< QString >() << QStringLiteral("application/msword") << QStringLiteral("application/mspowerpoint") << QStringLiteral("application/excel") << QStringLiteral("application/vnd.ms-word") << QStringLiteral("application/vnd.ms-powerpoint") << QStringLiteral("application/vnd.ms-excel") << QStringLiteral("application/vnd.openxmlformats-officedocument.wordprocessingml.document") << QStringLiteral("application/vnd.openxmlformats-officedocument.presentationml.presentation") << QStringLiteral("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") << QStringLiteral("application/vnd.apple.pages") << QStringLiteral("application/vnd.apple.numbers") << QStringLiteral("application/vnd.apple.keynote") << QStringLiteral("application/x-iwork-pages-sffpages") << QStringLiteral("application/x-iwork-numbers-sffnumbers") << QStringLiteral("application/x-iwork-keynote-sffkey"); -// Limits.thrift - -const QSet< QString > EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES = QSet< QString >() << QStringLiteral("application/x-sh") << QStringLiteral("application/x-bsh") << QStringLiteral("application/sql") << QStringLiteral("application/x-sql"); +const QSet EDAM_MIME_TYPES = QSet() + << 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 +; +// Limits.thrift + +const QSet EDAM_INDEXABLE_RESOURCE_MIME_TYPES = QSet() + << QStringLiteral("application/msword") + << QStringLiteral("application/mspowerpoint") + << QStringLiteral("application/excel") + << QStringLiteral("application/vnd.ms-word") + << QStringLiteral("application/vnd.ms-powerpoint") + << QStringLiteral("application/vnd.ms-excel") + << QStringLiteral("application/vnd.openxmlformats-officedocument.wordprocessingml.document") + << QStringLiteral("application/vnd.openxmlformats-officedocument.presentationml.presentation") + << QStringLiteral("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") + << QStringLiteral("application/vnd.apple.pages") + << QStringLiteral("application/vnd.apple.numbers") + << QStringLiteral("application/vnd.apple.keynote") + << QStringLiteral("application/x-iwork-pages-sffpages") + << QStringLiteral("application/x-iwork-numbers-sffnumbers") + << QStringLiteral("application/x-iwork-keynote-sffkey") +; +// Limits.thrift + +const QSet EDAM_INDEXABLE_PLAINTEXT_MIME_TYPES = QSet() + << QStringLiteral("application/x-sh") + << QStringLiteral("application/x-bsh") + << QStringLiteral("application/sql") + << QStringLiteral("application/x-sql") +; // Limits.thrift const qint32 EDAM_SEARCH_QUERY_LEN_MIN = 0; @@ -243,7 +277,10 @@ const qint32 EDAM_PUBLISHING_URI_LEN_MAX = 255; const QString EDAM_PUBLISHING_URI_REGEX = QStringLiteral("^[a-zA-Z0-9.~_+-]{1,255}$"); // Limits.thrift -const QSet< QString > EDAM_PUBLISHING_URI_PROHIBITED = QSet< QString >() << QStringLiteral(".") << QStringLiteral(".."); +const QSet EDAM_PUBLISHING_URI_PROHIBITED = QSet() + << QStringLiteral(".") + << QStringLiteral("..") +; // Limits.thrift const qint32 EDAM_PUBLISHING_DESCRIPTION_LEN_MIN = 1; diff --git a/QEverCloud/src/generated/EDAMErrorCode.cpp b/QEverCloud/src/generated/EDAMErrorCode.cpp index 13aae848..5ffca081 100644 --- a/QEverCloud/src/generated/EDAMErrorCode.cpp +++ b/QEverCloud/src/generated/EDAMErrorCode.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 429a1cb7..9a6e4d87 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -18,13 +19,19 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -QByteArray NoteStore_getSyncState_prepareParams(QString authenticationToken) +QByteArray NoteStore_getSyncState_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getSyncState"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getSyncState_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getSyncState"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getSyncState_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -43,19 +50,19 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSyncState")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -63,9 +70,9 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; readSyncState(r, v); @@ -102,7 +109,9 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getSyncState: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getSyncState: missing result")); } return result; } @@ -112,41 +121,63 @@ QVariant NoteStore_getSyncState_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSyncState_readReply(reply)); } -SyncState NoteStore::getSyncState(QString authenticationToken) +SyncState NoteStore::getSyncState( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSyncState_prepareParams(authenticationToken); + QByteArray params = NoteStore_getSyncState_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSyncState_readReply(reply); } -AsyncResult* NoteStore::getSyncStateAsync(QString authenticationToken) +AsyncResult* NoteStore::getSyncStateAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSyncState_prepareParams(authenticationToken); + QByteArray params = NoteStore_getSyncState_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_getSyncState_readReplyAsync); } -QByteArray NoteStore_getFilteredSyncChunk_prepareParams(QString authenticationToken, qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter& filter) +QByteArray NoteStore_getFilteredSyncChunk_prepareParams( + QString authenticationToken, + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter& filter) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getFilteredSyncChunk"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getFilteredSyncChunk_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getFilteredSyncChunk"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getFilteredSyncChunk_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("afterUSN"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("afterUSN"), + ThriftFieldType::T_I32, + 2); w.writeI32(afterUSN); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("maxEntries"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("maxEntries"), + ThriftFieldType::T_I32, + 3); w.writeI32(maxEntries); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 4); + w.writeFieldBegin( + QStringLiteral("filter"), + ThriftFieldType::T_STRUCT, + 4); writeSyncChunkFilter(w, filter); w.writeFieldEnd(); w.writeFieldStop(); @@ -165,19 +196,19 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getFilteredSyncChunk")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -185,9 +216,9 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; readSyncChunk(r, v); @@ -224,7 +255,9 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getFilteredSyncChunk: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getFilteredSyncChunk: missing result")); } return result; } @@ -234,35 +267,61 @@ QVariant NoteStore_getFilteredSyncChunk_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getFilteredSyncChunk_readReply(reply)); } -SyncChunk NoteStore::getFilteredSyncChunk(qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter& filter, QString authenticationToken) +SyncChunk NoteStore::getFilteredSyncChunk( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter& filter, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams(authenticationToken, afterUSN, maxEntries, filter); + QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( + authenticationToken, + afterUSN, + maxEntries, + filter); QByteArray reply = askEvernote(m_url, params); return NoteStore_getFilteredSyncChunk_readReply(reply); } -AsyncResult* NoteStore::getFilteredSyncChunkAsync(qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter& filter, QString authenticationToken) +AsyncResult* NoteStore::getFilteredSyncChunkAsync( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter& filter, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams(authenticationToken, afterUSN, maxEntries, filter); + QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( + authenticationToken, + afterUSN, + maxEntries, + filter); return new AsyncResult(m_url, params, NoteStore_getFilteredSyncChunk_readReplyAsync); } -QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams(QString authenticationToken, const LinkedNotebook& linkedNotebook) +QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( + QString authenticationToken, + const LinkedNotebook& linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getLinkedNotebookSyncState"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getLinkedNotebookSyncState_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncState"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getLinkedNotebookSyncState_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("linkedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeLinkedNotebook(w, linkedNotebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -281,19 +340,19 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getLinkedNotebookSyncState")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -301,9 +360,9 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; readSyncState(r, v); @@ -350,7 +409,9 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getLinkedNotebookSyncState: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getLinkedNotebookSyncState: missing result")); } return result; } @@ -360,44 +421,74 @@ QVariant NoteStore_getLinkedNotebookSyncState_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getLinkedNotebookSyncState_readReply(reply)); } -SyncState NoteStore::getLinkedNotebookSyncState(const LinkedNotebook& linkedNotebook, QString authenticationToken) +SyncState NoteStore::getLinkedNotebookSyncState( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( + authenticationToken, + linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_getLinkedNotebookSyncState_readReply(reply); } -AsyncResult* NoteStore::getLinkedNotebookSyncStateAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken) +AsyncResult* NoteStore::getLinkedNotebookSyncStateAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( + authenticationToken, + linkedNotebook); return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncState_readReplyAsync); } -QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams(QString authenticationToken, const LinkedNotebook& linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly) +QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( + QString authenticationToken, + const LinkedNotebook& linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getLinkedNotebookSyncChunk"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getLinkedNotebookSyncChunk_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncChunk"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getLinkedNotebookSyncChunk_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("linkedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeLinkedNotebook(w, linkedNotebook); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("afterUSN"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("afterUSN"), + ThriftFieldType::T_I32, + 3); w.writeI32(afterUSN); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("maxEntries"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("maxEntries"), + ThriftFieldType::T_I32, + 4); w.writeI32(maxEntries); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("fullSyncOnly"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("fullSyncOnly"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(fullSyncOnly); w.writeFieldEnd(); w.writeFieldStop(); @@ -416,19 +507,19 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getLinkedNotebookSyncChunk")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -436,9 +527,9 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; readSyncChunk(r, v); @@ -485,7 +576,9 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getLinkedNotebookSyncChunk: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getLinkedNotebookSyncChunk: missing result")); } return result; } @@ -495,32 +588,58 @@ QVariant NoteStore_getLinkedNotebookSyncChunk_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getLinkedNotebookSyncChunk_readReply(reply)); } -SyncChunk NoteStore::getLinkedNotebookSyncChunk(const LinkedNotebook& linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, QString authenticationToken) +SyncChunk NoteStore::getLinkedNotebookSyncChunk( + const LinkedNotebook& linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams(authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly); + QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( + authenticationToken, + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly); QByteArray reply = askEvernote(m_url, params); return NoteStore_getLinkedNotebookSyncChunk_readReply(reply); } -AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync(const LinkedNotebook& linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, QString authenticationToken) +AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync( + const LinkedNotebook& linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams(authenticationToken, linkedNotebook, afterUSN, maxEntries, fullSyncOnly); + QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( + authenticationToken, + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly); return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncChunk_readReplyAsync); } -QByteArray NoteStore_listNotebooks_prepareParams(QString authenticationToken) +QByteArray NoteStore_listNotebooks_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listNotebooks_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listNotebooks"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listNotebooks_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -529,29 +648,29 @@ QByteArray NoteStore_listNotebooks_prepareParams(QString authenticationToken) return w.buffer(); } -QList< Notebook > NoteStore_listNotebooks_readReply(QByteArray reply) +QList NoteStore_listNotebooks_readReply(QByteArray reply) { bool resultIsSet = false; - QList< Notebook > result = QList< Notebook >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -559,11 +678,11 @@ QList< Notebook > NoteStore_listNotebooks_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< Notebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -608,7 +727,9 @@ QList< Notebook > NoteStore_listNotebooks_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listNotebooks: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listNotebooks: missing result")); } return result; } @@ -618,32 +739,42 @@ QVariant NoteStore_listNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listNotebooks_readReply(reply)); } -QList< Notebook > NoteStore::listNotebooks(QString authenticationToken) +QList NoteStore::listNotebooks( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listNotebooks_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listNotebooks_readReply(reply); } -AsyncResult* NoteStore::listNotebooksAsync(QString authenticationToken) +AsyncResult* NoteStore::listNotebooksAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listNotebooks_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listNotebooks_readReplyAsync); } -QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams(QString authenticationToken) +QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listAccessibleBusinessNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listAccessibleBusinessNotebooks_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listAccessibleBusinessNotebooks"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listAccessibleBusinessNotebooks_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -652,29 +783,29 @@ QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams(QString authe return w.buffer(); } -QList< Notebook > NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray reply) +QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray reply) { bool resultIsSet = false; - QList< Notebook > result = QList< Notebook >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listAccessibleBusinessNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -682,11 +813,11 @@ QList< Notebook > NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< Notebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -731,7 +862,9 @@ QList< Notebook > NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listAccessibleBusinessNotebooks: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listAccessibleBusinessNotebooks: missing result")); } return result; } @@ -741,35 +874,49 @@ QVariant NoteStore_listAccessibleBusinessNotebooks_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_listAccessibleBusinessNotebooks_readReply(reply)); } -QList< Notebook > NoteStore::listAccessibleBusinessNotebooks(QString authenticationToken) +QList NoteStore::listAccessibleBusinessNotebooks( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listAccessibleBusinessNotebooks_readReply(reply); } -AsyncResult* NoteStore::listAccessibleBusinessNotebooksAsync(QString authenticationToken) +AsyncResult* NoteStore::listAccessibleBusinessNotebooksAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listAccessibleBusinessNotebooks_readReplyAsync); } -QByteArray NoteStore_getNotebook_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getNotebook_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -788,19 +935,19 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -808,9 +955,9 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); @@ -857,7 +1004,9 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNotebook: missing result")); } return result; } @@ -867,32 +1016,46 @@ QVariant NoteStore_getNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNotebook_readReply(reply)); } -Notebook NoteStore::getNotebook(Guid guid, QString authenticationToken) +Notebook NoteStore::getNotebook( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNotebook_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNotebook_readReply(reply); } -AsyncResult* NoteStore::getNotebookAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getNotebookAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNotebook_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getNotebook_readReplyAsync); } -QByteArray NoteStore_getDefaultNotebook_prepareParams(QString authenticationToken) +QByteArray NoteStore_getDefaultNotebook_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getDefaultNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getDefaultNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getDefaultNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getDefaultNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -911,19 +1074,19 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getDefaultNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -931,9 +1094,9 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); @@ -970,7 +1133,9 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getDefaultNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getDefaultNotebook: missing result")); } return result; } @@ -980,35 +1145,49 @@ QVariant NoteStore_getDefaultNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getDefaultNotebook_readReply(reply)); } -Notebook NoteStore::getDefaultNotebook(QString authenticationToken) +Notebook NoteStore::getDefaultNotebook( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getDefaultNotebook_prepareParams(authenticationToken); + QByteArray params = NoteStore_getDefaultNotebook_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_getDefaultNotebook_readReply(reply); } -AsyncResult* NoteStore::getDefaultNotebookAsync(QString authenticationToken) +AsyncResult* NoteStore::getDefaultNotebookAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getDefaultNotebook_prepareParams(authenticationToken); + QByteArray params = NoteStore_getDefaultNotebook_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_getDefaultNotebook_readReplyAsync); } -QByteArray NoteStore_createNotebook_prepareParams(QString authenticationToken, const Notebook& notebook) +QByteArray NoteStore_createNotebook_prepareParams( + QString authenticationToken, + const Notebook& notebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("notebook"), + ThriftFieldType::T_STRUCT, + 2); writeNotebook(w, notebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -1027,19 +1206,19 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1047,9 +1226,9 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); @@ -1096,7 +1275,9 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createNotebook: missing result")); } return result; } @@ -1106,35 +1287,53 @@ QVariant NoteStore_createNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createNotebook_readReply(reply)); } -Notebook NoteStore::createNotebook(const Notebook& notebook, QString authenticationToken) +Notebook NoteStore::createNotebook( + const Notebook& notebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createNotebook_prepareParams(authenticationToken, notebook); + QByteArray params = NoteStore_createNotebook_prepareParams( + authenticationToken, + notebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_createNotebook_readReply(reply); } -AsyncResult* NoteStore::createNotebookAsync(const Notebook& notebook, QString authenticationToken) +AsyncResult* NoteStore::createNotebookAsync( + const Notebook& notebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createNotebook_prepareParams(authenticationToken, notebook); + QByteArray params = NoteStore_createNotebook_prepareParams( + authenticationToken, + notebook); return new AsyncResult(m_url, params, NoteStore_createNotebook_readReplyAsync); } -QByteArray NoteStore_updateNotebook_prepareParams(QString authenticationToken, const Notebook& notebook) +QByteArray NoteStore_updateNotebook_prepareParams( + QString authenticationToken, + const Notebook& notebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("notebook"), + ThriftFieldType::T_STRUCT, + 2); writeNotebook(w, notebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -1153,19 +1352,19 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1173,9 +1372,9 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -1222,7 +1421,9 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateNotebook: missing result")); } return result; } @@ -1232,35 +1433,53 @@ QVariant NoteStore_updateNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNotebook_readReply(reply)); } -qint32 NoteStore::updateNotebook(const Notebook& notebook, QString authenticationToken) +qint32 NoteStore::updateNotebook( + const Notebook& notebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNotebook_prepareParams(authenticationToken, notebook); + QByteArray params = NoteStore_updateNotebook_prepareParams( + authenticationToken, + notebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNotebook_readReply(reply); } -AsyncResult* NoteStore::updateNotebookAsync(const Notebook& notebook, QString authenticationToken) +AsyncResult* NoteStore::updateNotebookAsync( + const Notebook& notebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNotebook_prepareParams(authenticationToken, notebook); + QByteArray params = NoteStore_updateNotebook_prepareParams( + authenticationToken, + notebook); return new AsyncResult(m_url, params, NoteStore_updateNotebook_readReplyAsync); } -QByteArray NoteStore_expungeNotebook_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_expungeNotebook_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("expungeNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_expungeNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("expungeNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_expungeNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -1279,19 +1498,19 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1299,9 +1518,9 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -1348,7 +1567,9 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("expungeNotebook: missing result")); } return result; } @@ -1358,32 +1579,46 @@ QVariant NoteStore_expungeNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeNotebook_readReply(reply)); } -qint32 NoteStore::expungeNotebook(Guid guid, QString authenticationToken) +qint32 NoteStore::expungeNotebook( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeNotebook_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeNotebook_readReply(reply); } -AsyncResult* NoteStore::expungeNotebookAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::expungeNotebookAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeNotebook_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_expungeNotebook_readReplyAsync); } -QByteArray NoteStore_listTags_prepareParams(QString authenticationToken) +QByteArray NoteStore_listTags_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listTags"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listTags_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listTags"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listTags_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -1392,29 +1627,29 @@ QByteArray NoteStore_listTags_prepareParams(QString authenticationToken) return w.buffer(); } -QList< Tag > NoteStore_listTags_readReply(QByteArray reply) +QList NoteStore_listTags_readReply(QByteArray reply) { bool resultIsSet = false; - QList< Tag > result = QList< Tag >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listTags")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1422,11 +1657,11 @@ QList< Tag > NoteStore_listTags_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< Tag > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1471,7 +1706,9 @@ QList< Tag > NoteStore_listTags_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listTags: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listTags: missing result")); } return result; } @@ -1481,35 +1718,49 @@ QVariant NoteStore_listTags_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listTags_readReply(reply)); } -QList< Tag > NoteStore::listTags(QString authenticationToken) +QList NoteStore::listTags( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listTags_prepareParams(authenticationToken); + QByteArray params = NoteStore_listTags_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listTags_readReply(reply); } -AsyncResult* NoteStore::listTagsAsync(QString authenticationToken) +AsyncResult* NoteStore::listTagsAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listTags_prepareParams(authenticationToken); + QByteArray params = NoteStore_listTags_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listTags_readReplyAsync); } -QByteArray NoteStore_listTagsByNotebook_prepareParams(QString authenticationToken, Guid notebookGuid) +QByteArray NoteStore_listTagsByNotebook_prepareParams( + QString authenticationToken, + Guid notebookGuid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listTagsByNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listTagsByNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listTagsByNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listTagsByNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(notebookGuid); w.writeFieldEnd(); w.writeFieldStop(); @@ -1518,29 +1769,29 @@ QByteArray NoteStore_listTagsByNotebook_prepareParams(QString authenticationToke return w.buffer(); } -QList< Tag > NoteStore_listTagsByNotebook_readReply(QByteArray reply) +QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) { bool resultIsSet = false; - QList< Tag > result = QList< Tag >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listTagsByNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1548,11 +1799,11 @@ QList< Tag > NoteStore_listTagsByNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< Tag > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1607,7 +1858,9 @@ QList< Tag > NoteStore_listTagsByNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listTagsByNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listTagsByNotebook: missing result")); } return result; } @@ -1617,35 +1870,53 @@ QVariant NoteStore_listTagsByNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listTagsByNotebook_readReply(reply)); } -QList< Tag > NoteStore::listTagsByNotebook(Guid notebookGuid, QString authenticationToken) +QList NoteStore::listTagsByNotebook( + Guid notebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listTagsByNotebook_prepareParams(authenticationToken, notebookGuid); + QByteArray params = NoteStore_listTagsByNotebook_prepareParams( + authenticationToken, + notebookGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_listTagsByNotebook_readReply(reply); } -AsyncResult* NoteStore::listTagsByNotebookAsync(Guid notebookGuid, QString authenticationToken) +AsyncResult* NoteStore::listTagsByNotebookAsync( + Guid notebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listTagsByNotebook_prepareParams(authenticationToken, notebookGuid); + QByteArray params = NoteStore_listTagsByNotebook_prepareParams( + authenticationToken, + notebookGuid); return new AsyncResult(m_url, params, NoteStore_listTagsByNotebook_readReplyAsync); } -QByteArray NoteStore_getTag_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getTag_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getTag_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getTag"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getTag_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -1664,19 +1935,19 @@ Tag NoteStore_getTag_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1684,9 +1955,9 @@ Tag NoteStore_getTag_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; readTag(r, v); @@ -1733,7 +2004,9 @@ Tag NoteStore_getTag_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getTag: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getTag: missing result")); } return result; } @@ -1743,35 +2016,53 @@ QVariant NoteStore_getTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getTag_readReply(reply)); } -Tag NoteStore::getTag(Guid guid, QString authenticationToken) +Tag NoteStore::getTag( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getTag_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getTag_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getTag_readReply(reply); } -AsyncResult* NoteStore::getTagAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getTagAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getTag_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getTag_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getTag_readReplyAsync); } -QByteArray NoteStore_createTag_prepareParams(QString authenticationToken, const Tag& tag) +QByteArray NoteStore_createTag_prepareParams( + QString authenticationToken, + const Tag& tag) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createTag_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createTag"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createTag_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("tag"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("tag"), + ThriftFieldType::T_STRUCT, + 2); writeTag(w, tag); w.writeFieldEnd(); w.writeFieldStop(); @@ -1790,19 +2081,19 @@ Tag NoteStore_createTag_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1810,9 +2101,9 @@ Tag NoteStore_createTag_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; readTag(r, v); @@ -1859,7 +2150,9 @@ Tag NoteStore_createTag_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createTag: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createTag: missing result")); } return result; } @@ -1869,35 +2162,53 @@ QVariant NoteStore_createTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createTag_readReply(reply)); } -Tag NoteStore::createTag(const Tag& tag, QString authenticationToken) +Tag NoteStore::createTag( + const Tag& tag, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createTag_prepareParams(authenticationToken, tag); + QByteArray params = NoteStore_createTag_prepareParams( + authenticationToken, + tag); QByteArray reply = askEvernote(m_url, params); return NoteStore_createTag_readReply(reply); } -AsyncResult* NoteStore::createTagAsync(const Tag& tag, QString authenticationToken) +AsyncResult* NoteStore::createTagAsync( + const Tag& tag, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createTag_prepareParams(authenticationToken, tag); + QByteArray params = NoteStore_createTag_prepareParams( + authenticationToken, + tag); return new AsyncResult(m_url, params, NoteStore_createTag_readReplyAsync); } -QByteArray NoteStore_updateTag_prepareParams(QString authenticationToken, const Tag& tag) +QByteArray NoteStore_updateTag_prepareParams( + QString authenticationToken, + const Tag& tag) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateTag_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateTag"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateTag_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("tag"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("tag"), + ThriftFieldType::T_STRUCT, + 2); writeTag(w, tag); w.writeFieldEnd(); w.writeFieldStop(); @@ -1916,19 +2227,19 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -1936,9 +2247,9 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -1985,7 +2296,9 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateTag: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateTag: missing result")); } return result; } @@ -1995,35 +2308,53 @@ QVariant NoteStore_updateTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateTag_readReply(reply)); } -qint32 NoteStore::updateTag(const Tag& tag, QString authenticationToken) +qint32 NoteStore::updateTag( + const Tag& tag, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateTag_prepareParams(authenticationToken, tag); + QByteArray params = NoteStore_updateTag_prepareParams( + authenticationToken, + tag); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateTag_readReply(reply); } -AsyncResult* NoteStore::updateTagAsync(const Tag& tag, QString authenticationToken) +AsyncResult* NoteStore::updateTagAsync( + const Tag& tag, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateTag_prepareParams(authenticationToken, tag); + QByteArray params = NoteStore_updateTag_prepareParams( + authenticationToken, + tag); return new AsyncResult(m_url, params, NoteStore_updateTag_readReplyAsync); } -QByteArray NoteStore_untagAll_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_untagAll_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("untagAll"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_untagAll_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("untagAll"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_untagAll_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -2040,19 +2371,19 @@ void NoteStore_untagAll_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("untagAll")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2060,7 +2391,7 @@ void NoteStore_untagAll_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -2106,35 +2437,53 @@ QVariant NoteStore_untagAll_readReplyAsync(QByteArray reply) return QVariant(); } -void NoteStore::untagAll(Guid guid, QString authenticationToken) +void NoteStore::untagAll( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_untagAll_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_untagAll_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); NoteStore_untagAll_readReply(reply); } -AsyncResult* NoteStore::untagAllAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::untagAllAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_untagAll_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_untagAll_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_untagAll_readReplyAsync); } -QByteArray NoteStore_expungeTag_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_expungeTag_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("expungeTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_expungeTag_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("expungeTag"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_expungeTag_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -2153,19 +2502,19 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2173,9 +2522,9 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -2222,7 +2571,9 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeTag: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("expungeTag: missing result")); } return result; } @@ -2232,32 +2583,46 @@ QVariant NoteStore_expungeTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeTag_readReply(reply)); } -qint32 NoteStore::expungeTag(Guid guid, QString authenticationToken) +qint32 NoteStore::expungeTag( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeTag_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeTag_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeTag_readReply(reply); } -AsyncResult* NoteStore::expungeTagAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::expungeTagAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeTag_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeTag_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_expungeTag_readReplyAsync); } -QByteArray NoteStore_listSearches_prepareParams(QString authenticationToken) +QByteArray NoteStore_listSearches_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listSearches"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listSearches_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listSearches"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listSearches_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -2266,29 +2631,29 @@ QByteArray NoteStore_listSearches_prepareParams(QString authenticationToken) return w.buffer(); } -QList< SavedSearch > NoteStore_listSearches_readReply(QByteArray reply) +QList NoteStore_listSearches_readReply(QByteArray reply) { bool resultIsSet = false; - QList< SavedSearch > result = QList< SavedSearch >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listSearches")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2296,11 +2661,11 @@ QList< SavedSearch > NoteStore_listSearches_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< SavedSearch > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2345,7 +2710,9 @@ QList< SavedSearch > NoteStore_listSearches_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listSearches: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listSearches: missing result")); } return result; } @@ -2355,35 +2722,49 @@ QVariant NoteStore_listSearches_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listSearches_readReply(reply)); } -QList< SavedSearch > NoteStore::listSearches(QString authenticationToken) +QList NoteStore::listSearches( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listSearches_prepareParams(authenticationToken); + QByteArray params = NoteStore_listSearches_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listSearches_readReply(reply); } -AsyncResult* NoteStore::listSearchesAsync(QString authenticationToken) +AsyncResult* NoteStore::listSearchesAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listSearches_prepareParams(authenticationToken); + QByteArray params = NoteStore_listSearches_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listSearches_readReplyAsync); } -QByteArray NoteStore_getSearch_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getSearch_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getSearch_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getSearch"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getSearch_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -2402,19 +2783,19 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2422,9 +2803,9 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; readSavedSearch(r, v); @@ -2471,7 +2852,9 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getSearch: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getSearch: missing result")); } return result; } @@ -2481,35 +2864,53 @@ QVariant NoteStore_getSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSearch_readReply(reply)); } -SavedSearch NoteStore::getSearch(Guid guid, QString authenticationToken) +SavedSearch NoteStore::getSearch( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSearch_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getSearch_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSearch_readReply(reply); } -AsyncResult* NoteStore::getSearchAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getSearchAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSearch_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getSearch_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getSearch_readReplyAsync); } -QByteArray NoteStore_createSearch_prepareParams(QString authenticationToken, const SavedSearch& search) +QByteArray NoteStore_createSearch_prepareParams( + QString authenticationToken, + const SavedSearch& search) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createSearch_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createSearch"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createSearch_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("search"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("search"), + ThriftFieldType::T_STRUCT, + 2); writeSavedSearch(w, search); w.writeFieldEnd(); w.writeFieldStop(); @@ -2528,19 +2929,19 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2548,9 +2949,9 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; readSavedSearch(r, v); @@ -2587,7 +2988,9 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createSearch: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createSearch: missing result")); } return result; } @@ -2597,35 +3000,53 @@ QVariant NoteStore_createSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createSearch_readReply(reply)); } -SavedSearch NoteStore::createSearch(const SavedSearch& search, QString authenticationToken) +SavedSearch NoteStore::createSearch( + const SavedSearch& search, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createSearch_prepareParams(authenticationToken, search); + QByteArray params = NoteStore_createSearch_prepareParams( + authenticationToken, + search); QByteArray reply = askEvernote(m_url, params); return NoteStore_createSearch_readReply(reply); } -AsyncResult* NoteStore::createSearchAsync(const SavedSearch& search, QString authenticationToken) +AsyncResult* NoteStore::createSearchAsync( + const SavedSearch& search, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createSearch_prepareParams(authenticationToken, search); + QByteArray params = NoteStore_createSearch_prepareParams( + authenticationToken, + search); return new AsyncResult(m_url, params, NoteStore_createSearch_readReplyAsync); } -QByteArray NoteStore_updateSearch_prepareParams(QString authenticationToken, const SavedSearch& search) +QByteArray NoteStore_updateSearch_prepareParams( + QString authenticationToken, + const SavedSearch& search) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateSearch_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateSearch"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateSearch_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("search"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("search"), + ThriftFieldType::T_STRUCT, + 2); writeSavedSearch(w, search); w.writeFieldEnd(); w.writeFieldStop(); @@ -2644,19 +3065,19 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2664,9 +3085,9 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -2713,7 +3134,9 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateSearch: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateSearch: missing result")); } return result; } @@ -2723,35 +3146,53 @@ QVariant NoteStore_updateSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateSearch_readReply(reply)); } -qint32 NoteStore::updateSearch(const SavedSearch& search, QString authenticationToken) +qint32 NoteStore::updateSearch( + const SavedSearch& search, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateSearch_prepareParams(authenticationToken, search); + QByteArray params = NoteStore_updateSearch_prepareParams( + authenticationToken, + search); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateSearch_readReply(reply); } -AsyncResult* NoteStore::updateSearchAsync(const SavedSearch& search, QString authenticationToken) +AsyncResult* NoteStore::updateSearchAsync( + const SavedSearch& search, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateSearch_prepareParams(authenticationToken, search); + QByteArray params = NoteStore_updateSearch_prepareParams( + authenticationToken, + search); return new AsyncResult(m_url, params, NoteStore_updateSearch_readReplyAsync); } -QByteArray NoteStore_expungeSearch_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_expungeSearch_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("expungeSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_expungeSearch_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("expungeSearch"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_expungeSearch_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -2770,19 +3211,19 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2790,9 +3231,9 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -2839,7 +3280,9 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeSearch: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("expungeSearch: missing result")); } return result; } @@ -2849,38 +3292,60 @@ QVariant NoteStore_expungeSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeSearch_readReply(reply)); } -qint32 NoteStore::expungeSearch(Guid guid, QString authenticationToken) +qint32 NoteStore::expungeSearch( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeSearch_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeSearch_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeSearch_readReply(reply); } -AsyncResult* NoteStore::expungeSearchAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::expungeSearchAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeSearch_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeSearch_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_expungeSearch_readReplyAsync); } -QByteArray NoteStore_findNoteOffset_prepareParams(QString authenticationToken, const NoteFilter& filter, Guid guid) +QByteArray NoteStore_findNoteOffset_prepareParams( + QString authenticationToken, + const NoteFilter& filter, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("findNoteOffset"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_findNoteOffset_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("findNoteOffset"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_findNoteOffset_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("filter"), + ThriftFieldType::T_STRUCT, + 2); writeNoteFilter(w, filter); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 3); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -2899,19 +3364,19 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNoteOffset")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -2919,9 +3384,9 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -2968,7 +3433,9 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("findNoteOffset: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("findNoteOffset: missing result")); } return result; } @@ -2978,44 +3445,78 @@ QVariant NoteStore_findNoteOffset_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNoteOffset_readReply(reply)); } -qint32 NoteStore::findNoteOffset(const NoteFilter& filter, Guid guid, QString authenticationToken) +qint32 NoteStore::findNoteOffset( + const NoteFilter& filter, + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNoteOffset_prepareParams(authenticationToken, filter, guid); + QByteArray params = NoteStore_findNoteOffset_prepareParams( + authenticationToken, + filter, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_findNoteOffset_readReply(reply); } -AsyncResult* NoteStore::findNoteOffsetAsync(const NoteFilter& filter, Guid guid, QString authenticationToken) +AsyncResult* NoteStore::findNoteOffsetAsync( + const NoteFilter& filter, + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNoteOffset_prepareParams(authenticationToken, filter, guid); + QByteArray params = NoteStore_findNoteOffset_prepareParams( + authenticationToken, + filter, + guid); return new AsyncResult(m_url, params, NoteStore_findNoteOffset_readReplyAsync); } -QByteArray NoteStore_findNotesMetadata_prepareParams(QString authenticationToken, const NoteFilter& filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec& resultSpec) +QByteArray NoteStore_findNotesMetadata_prepareParams( + QString authenticationToken, + const NoteFilter& filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec& resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("findNotesMetadata"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_findNotesMetadata_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("findNotesMetadata"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_findNotesMetadata_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("filter"), + ThriftFieldType::T_STRUCT, + 2); writeNoteFilter(w, filter); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("offset"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("offset"), + ThriftFieldType::T_I32, + 3); w.writeI32(offset); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("maxNotes"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("maxNotes"), + ThriftFieldType::T_I32, + 4); w.writeI32(maxNotes); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 5); + w.writeFieldBegin( + QStringLiteral("resultSpec"), + ThriftFieldType::T_STRUCT, + 5); writeNotesMetadataResultSpec(w, resultSpec); w.writeFieldEnd(); w.writeFieldStop(); @@ -3034,19 +3535,19 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNotesMetadata")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3054,9 +3555,9 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NotesMetadataList v; readNotesMetadataList(r, v); @@ -3103,7 +3604,9 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("findNotesMetadata: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("findNotesMetadata: missing result")); } return result; } @@ -3113,38 +3616,72 @@ QVariant NoteStore_findNotesMetadata_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNotesMetadata_readReply(reply)); } -NotesMetadataList NoteStore::findNotesMetadata(const NoteFilter& filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec& resultSpec, QString authenticationToken) +NotesMetadataList NoteStore::findNotesMetadata( + const NoteFilter& filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNotesMetadata_prepareParams(authenticationToken, filter, offset, maxNotes, resultSpec); + QByteArray params = NoteStore_findNotesMetadata_prepareParams( + authenticationToken, + filter, + offset, + maxNotes, + resultSpec); QByteArray reply = askEvernote(m_url, params); return NoteStore_findNotesMetadata_readReply(reply); } -AsyncResult* NoteStore::findNotesMetadataAsync(const NoteFilter& filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec& resultSpec, QString authenticationToken) +AsyncResult* NoteStore::findNotesMetadataAsync( + const NoteFilter& filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNotesMetadata_prepareParams(authenticationToken, filter, offset, maxNotes, resultSpec); + QByteArray params = NoteStore_findNotesMetadata_prepareParams( + authenticationToken, + filter, + offset, + maxNotes, + resultSpec); return new AsyncResult(m_url, params, NoteStore_findNotesMetadata_readReplyAsync); } -QByteArray NoteStore_findNoteCounts_prepareParams(QString authenticationToken, const NoteFilter& filter, bool withTrash) +QByteArray NoteStore_findNoteCounts_prepareParams( + QString authenticationToken, + const NoteFilter& filter, + bool withTrash) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("findNoteCounts"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_findNoteCounts_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("findNoteCounts"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_findNoteCounts_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("filter"), + ThriftFieldType::T_STRUCT, + 2); writeNoteFilter(w, filter); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withTrash"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("withTrash"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(withTrash); w.writeFieldEnd(); w.writeFieldStop(); @@ -3163,19 +3700,19 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNoteCounts")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3183,9 +3720,9 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NoteCollectionCounts v; readNoteCollectionCounts(r, v); @@ -3232,7 +3769,9 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("findNoteCounts: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("findNoteCounts: missing result")); } return result; } @@ -3242,38 +3781,64 @@ QVariant NoteStore_findNoteCounts_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNoteCounts_readReply(reply)); } -NoteCollectionCounts NoteStore::findNoteCounts(const NoteFilter& filter, bool withTrash, QString authenticationToken) +NoteCollectionCounts NoteStore::findNoteCounts( + const NoteFilter& filter, + bool withTrash, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNoteCounts_prepareParams(authenticationToken, filter, withTrash); + QByteArray params = NoteStore_findNoteCounts_prepareParams( + authenticationToken, + filter, + withTrash); QByteArray reply = askEvernote(m_url, params); return NoteStore_findNoteCounts_readReply(reply); } -AsyncResult* NoteStore::findNoteCountsAsync(const NoteFilter& filter, bool withTrash, QString authenticationToken) +AsyncResult* NoteStore::findNoteCountsAsync( + const NoteFilter& filter, + bool withTrash, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findNoteCounts_prepareParams(authenticationToken, filter, withTrash); + QByteArray params = NoteStore_findNoteCounts_prepareParams( + authenticationToken, + filter, + withTrash); return new AsyncResult(m_url, params, NoteStore_findNoteCounts_readReplyAsync); } -QByteArray NoteStore_getNoteWithResultSpec_prepareParams(QString authenticationToken, Guid guid, const NoteResultSpec& resultSpec) +QByteArray NoteStore_getNoteWithResultSpec_prepareParams( + QString authenticationToken, + Guid guid, + const NoteResultSpec& resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteWithResultSpec"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteWithResultSpec_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteWithResultSpec"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteWithResultSpec_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("resultSpec"), + ThriftFieldType::T_STRUCT, + 3); writeNoteResultSpec(w, resultSpec); w.writeFieldEnd(); w.writeFieldStop(); @@ -3292,19 +3857,19 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteWithResultSpec")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3312,9 +3877,9 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -3361,7 +3926,9 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteWithResultSpec: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteWithResultSpec: missing result")); } return result; } @@ -3371,47 +3938,85 @@ QVariant NoteStore_getNoteWithResultSpec_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteWithResultSpec_readReply(reply)); } -Note NoteStore::getNoteWithResultSpec(Guid guid, const NoteResultSpec& resultSpec, QString authenticationToken) +Note NoteStore::getNoteWithResultSpec( + Guid guid, + const NoteResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams(authenticationToken, guid, resultSpec); + QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( + authenticationToken, + guid, + resultSpec); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteWithResultSpec_readReply(reply); } -AsyncResult* NoteStore::getNoteWithResultSpecAsync(Guid guid, const NoteResultSpec& resultSpec, QString authenticationToken) +AsyncResult* NoteStore::getNoteWithResultSpecAsync( + Guid guid, + const NoteResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams(authenticationToken, guid, resultSpec); + QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( + authenticationToken, + guid, + resultSpec); return new AsyncResult(m_url, params, NoteStore_getNoteWithResultSpec_readReplyAsync); } -QByteArray NoteStore_getNote_prepareParams(QString authenticationToken, Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData) +QByteArray NoteStore_getNote_prepareParams( + QString authenticationToken, + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withContent"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("withContent"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(withContent); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesData"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("withResourcesData"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(withResourcesData); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesRecognition"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("withResourcesRecognition"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(withResourcesRecognition); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesAlternateData"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("withResourcesAlternateData"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(withResourcesAlternateData); w.writeFieldEnd(); w.writeFieldStop(); @@ -3430,19 +4035,19 @@ Note NoteStore_getNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3450,9 +4055,9 @@ Note NoteStore_getNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -3499,7 +4104,9 @@ Note NoteStore_getNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNote: missing result")); } return result; } @@ -3509,35 +4116,69 @@ QVariant NoteStore_getNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNote_readReply(reply)); } -Note NoteStore::getNote(Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken) +Note NoteStore::getNote( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNote_prepareParams(authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData); + QByteArray params = NoteStore_getNote_prepareParams( + authenticationToken, + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNote_readReply(reply); } -AsyncResult* NoteStore::getNoteAsync(Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken) +AsyncResult* NoteStore::getNoteAsync( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNote_prepareParams(authenticationToken, guid, withContent, withResourcesData, withResourcesRecognition, withResourcesAlternateData); + QByteArray params = NoteStore_getNote_prepareParams( + authenticationToken, + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData); return new AsyncResult(m_url, params, NoteStore_getNote_readReplyAsync); } -QByteArray NoteStore_getNoteApplicationData_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getNoteApplicationData_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteApplicationData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteApplicationData_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteApplicationData"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteApplicationData_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -3556,19 +4197,19 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteApplicationData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3576,9 +4217,9 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; readLazyMap(r, v); @@ -3625,7 +4266,9 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteApplicationData: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteApplicationData: missing result")); } return result; } @@ -3635,38 +4278,60 @@ QVariant NoteStore_getNoteApplicationData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteApplicationData_readReply(reply)); } -LazyMap NoteStore::getNoteApplicationData(Guid guid, QString authenticationToken) +LazyMap NoteStore::getNoteApplicationData( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteApplicationData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteApplicationData_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteApplicationData_readReply(reply); } -AsyncResult* NoteStore::getNoteApplicationDataAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getNoteApplicationDataAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteApplicationData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteApplicationData_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getNoteApplicationData_readReplyAsync); } -QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key) +QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); w.writeFieldStop(); @@ -3685,19 +4350,19 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3705,9 +4370,9 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -3754,7 +4419,9 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteApplicationDataEntry: missing result")); } return result; } @@ -3764,41 +4431,71 @@ QVariant NoteStore_getNoteApplicationDataEntry_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteApplicationDataEntry_readReply(reply)); } -QString NoteStore::getNoteApplicationDataEntry(Guid guid, QString key, QString authenticationToken) +QString NoteStore::getNoteApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::getNoteApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken) +AsyncResult* NoteStore::getNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); return new AsyncResult(m_url, params, NoteStore_getNoteApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key, QString value) +QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key, + QString value) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("setNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_setNoteApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("setNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_setNoteApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("value"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("value"), + ThriftFieldType::T_STRING, + 4); w.writeString(value); w.writeFieldEnd(); w.writeFieldStop(); @@ -3817,19 +4514,19 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3837,9 +4534,9 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -3886,7 +4583,9 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("setNoteApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("setNoteApplicationDataEntry: missing result")); } return result; } @@ -3896,38 +4595,68 @@ QVariant NoteStore_setNoteApplicationDataEntry_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_setNoteApplicationDataEntry_readReply(reply)); } -qint32 NoteStore::setNoteApplicationDataEntry(Guid guid, QString key, QString value, QString authenticationToken) +qint32 NoteStore::setNoteApplicationDataEntry( + Guid guid, + QString key, + QString value, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key, value); + QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key, + value); QByteArray reply = askEvernote(m_url, params); return NoteStore_setNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::setNoteApplicationDataEntryAsync(Guid guid, QString key, QString value, QString authenticationToken) +AsyncResult* NoteStore::setNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key, value); + QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key, + value); return new AsyncResult(m_url, params, NoteStore_setNoteApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key) +QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("unsetNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_unsetNoteApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("unsetNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_unsetNoteApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); w.writeFieldStop(); @@ -3946,19 +4675,19 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("unsetNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -3966,9 +4695,9 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -4015,7 +4744,9 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("unsetNoteApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("unsetNoteApplicationDataEntry: missing result")); } return result; } @@ -4025,35 +4756,57 @@ QVariant NoteStore_unsetNoteApplicationDataEntry_readReplyAsync(QByteArray reply return QVariant::fromValue(NoteStore_unsetNoteApplicationDataEntry_readReply(reply)); } -qint32 NoteStore::unsetNoteApplicationDataEntry(Guid guid, QString key, QString authenticationToken) +qint32 NoteStore::unsetNoteApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); QByteArray reply = askEvernote(m_url, params); return NoteStore_unsetNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::unsetNoteApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken) +AsyncResult* NoteStore::unsetNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); return new AsyncResult(m_url, params, NoteStore_unsetNoteApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_getNoteContent_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getNoteContent_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteContent"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteContent_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteContent"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteContent_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -4072,19 +4825,19 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteContent")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4092,9 +4845,9 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -4141,7 +4894,9 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteContent: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteContent: missing result")); } return result; } @@ -4151,41 +4906,67 @@ QVariant NoteStore_getNoteContent_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteContent_readReply(reply)); } -QString NoteStore::getNoteContent(Guid guid, QString authenticationToken) +QString NoteStore::getNoteContent( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteContent_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteContent_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteContent_readReply(reply); } -AsyncResult* NoteStore::getNoteContentAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getNoteContentAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteContent_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteContent_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getNoteContent_readReplyAsync); } -QByteArray NoteStore_getNoteSearchText_prepareParams(QString authenticationToken, Guid guid, bool noteOnly, bool tokenizeForIndexing) +QByteArray NoteStore_getNoteSearchText_prepareParams( + QString authenticationToken, + Guid guid, + bool noteOnly, + bool tokenizeForIndexing) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteSearchText"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteSearchText_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteSearchText"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteSearchText_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteOnly"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("noteOnly"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(noteOnly); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("tokenizeForIndexing"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("tokenizeForIndexing"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(tokenizeForIndexing); w.writeFieldEnd(); w.writeFieldStop(); @@ -4204,19 +4985,19 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteSearchText")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4224,9 +5005,9 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -4273,7 +5054,9 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteSearchText: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteSearchText: missing result")); } return result; } @@ -4283,35 +5066,61 @@ QVariant NoteStore_getNoteSearchText_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteSearchText_readReply(reply)); } -QString NoteStore::getNoteSearchText(Guid guid, bool noteOnly, bool tokenizeForIndexing, QString authenticationToken) +QString NoteStore::getNoteSearchText( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteSearchText_prepareParams(authenticationToken, guid, noteOnly, tokenizeForIndexing); + QByteArray params = NoteStore_getNoteSearchText_prepareParams( + authenticationToken, + guid, + noteOnly, + tokenizeForIndexing); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteSearchText_readReply(reply); } -AsyncResult* NoteStore::getNoteSearchTextAsync(Guid guid, bool noteOnly, bool tokenizeForIndexing, QString authenticationToken) +AsyncResult* NoteStore::getNoteSearchTextAsync( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteSearchText_prepareParams(authenticationToken, guid, noteOnly, tokenizeForIndexing); + QByteArray params = NoteStore_getNoteSearchText_prepareParams( + authenticationToken, + guid, + noteOnly, + tokenizeForIndexing); return new AsyncResult(m_url, params, NoteStore_getNoteSearchText_readReplyAsync); } -QByteArray NoteStore_getResourceSearchText_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceSearchText_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceSearchText"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceSearchText_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceSearchText"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceSearchText_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -4330,19 +5139,19 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceSearchText")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4350,9 +5159,9 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -4399,7 +5208,9 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceSearchText: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceSearchText: missing result")); } return result; } @@ -4409,35 +5220,53 @@ QVariant NoteStore_getResourceSearchText_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceSearchText_readReply(reply)); } -QString NoteStore::getResourceSearchText(Guid guid, QString authenticationToken) +QString NoteStore::getResourceSearchText( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceSearchText_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceSearchText_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceSearchText_readReply(reply); } -AsyncResult* NoteStore::getResourceSearchTextAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceSearchTextAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceSearchText_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceSearchText_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceSearchText_readReplyAsync); } -QByteArray NoteStore_getNoteTagNames_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getNoteTagNames_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteTagNames"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteTagNames_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteTagNames"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteTagNames_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -4456,19 +5285,19 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteTagNames")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4476,9 +5305,9 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QStringList v; qint32 size; @@ -4535,7 +5364,9 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteTagNames: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteTagNames: missing result")); } return result; } @@ -4545,35 +5376,53 @@ QVariant NoteStore_getNoteTagNames_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteTagNames_readReply(reply)); } -QStringList NoteStore::getNoteTagNames(Guid guid, QString authenticationToken) +QStringList NoteStore::getNoteTagNames( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteTagNames_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteTagNames_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteTagNames_readReply(reply); } -AsyncResult* NoteStore::getNoteTagNamesAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getNoteTagNamesAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteTagNames_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getNoteTagNames_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getNoteTagNames_readReplyAsync); } -QByteArray NoteStore_createNote_prepareParams(QString authenticationToken, const Note& note) +QByteArray NoteStore_createNote_prepareParams( + QString authenticationToken, + const Note& note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 2); writeNote(w, note); w.writeFieldEnd(); w.writeFieldStop(); @@ -4592,19 +5441,19 @@ Note NoteStore_createNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4612,9 +5461,9 @@ Note NoteStore_createNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -4661,7 +5510,9 @@ Note NoteStore_createNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createNote: missing result")); } return result; } @@ -4671,35 +5522,53 @@ QVariant NoteStore_createNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createNote_readReply(reply)); } -Note NoteStore::createNote(const Note& note, QString authenticationToken) +Note NoteStore::createNote( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createNote_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_createNote_prepareParams( + authenticationToken, + note); QByteArray reply = askEvernote(m_url, params); return NoteStore_createNote_readReply(reply); } -AsyncResult* NoteStore::createNoteAsync(const Note& note, QString authenticationToken) +AsyncResult* NoteStore::createNoteAsync( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createNote_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_createNote_prepareParams( + authenticationToken, + note); return new AsyncResult(m_url, params, NoteStore_createNote_readReplyAsync); } -QByteArray NoteStore_updateNote_prepareParams(QString authenticationToken, const Note& note) +QByteArray NoteStore_updateNote_prepareParams( + QString authenticationToken, + const Note& note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 2); writeNote(w, note); w.writeFieldEnd(); w.writeFieldStop(); @@ -4718,19 +5587,19 @@ Note NoteStore_updateNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4738,9 +5607,9 @@ Note NoteStore_updateNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -4787,7 +5656,9 @@ Note NoteStore_updateNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateNote: missing result")); } return result; } @@ -4797,35 +5668,53 @@ QVariant NoteStore_updateNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNote_readReply(reply)); } -Note NoteStore::updateNote(const Note& note, QString authenticationToken) +Note NoteStore::updateNote( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNote_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_updateNote_prepareParams( + authenticationToken, + note); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNote_readReply(reply); } -AsyncResult* NoteStore::updateNoteAsync(const Note& note, QString authenticationToken) +AsyncResult* NoteStore::updateNoteAsync( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNote_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_updateNote_prepareParams( + authenticationToken, + note); return new AsyncResult(m_url, params, NoteStore_updateNote_readReplyAsync); } -QByteArray NoteStore_deleteNote_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_deleteNote_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("deleteNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_deleteNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("deleteNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_deleteNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -4844,19 +5733,19 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("deleteNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4864,9 +5753,9 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -4913,7 +5802,9 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("deleteNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("deleteNote: missing result")); } return result; } @@ -4923,35 +5814,53 @@ QVariant NoteStore_deleteNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_deleteNote_readReply(reply)); } -qint32 NoteStore::deleteNote(Guid guid, QString authenticationToken) +qint32 NoteStore::deleteNote( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_deleteNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_deleteNote_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_deleteNote_readReply(reply); } -AsyncResult* NoteStore::deleteNoteAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::deleteNoteAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_deleteNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_deleteNote_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_deleteNote_readReplyAsync); } -QByteArray NoteStore_expungeNote_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_expungeNote_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("expungeNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_expungeNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("expungeNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_expungeNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -4970,19 +5879,19 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -4990,9 +5899,9 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -5039,7 +5948,9 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("expungeNote: missing result")); } return result; } @@ -5049,38 +5960,60 @@ QVariant NoteStore_expungeNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeNote_readReply(reply)); } -qint32 NoteStore::expungeNote(Guid guid, QString authenticationToken) +qint32 NoteStore::expungeNote( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeNote_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeNote_readReply(reply); } -AsyncResult* NoteStore::expungeNoteAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::expungeNoteAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeNote_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_expungeNote_readReplyAsync); } -QByteArray NoteStore_copyNote_prepareParams(QString authenticationToken, Guid noteGuid, Guid toNotebookGuid) +QByteArray NoteStore_copyNote_prepareParams( + QString authenticationToken, + Guid noteGuid, + Guid toNotebookGuid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("copyNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_copyNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("copyNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_copyNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(noteGuid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("toNotebookGuid"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("toNotebookGuid"), + ThriftFieldType::T_STRING, + 3); w.writeString(toNotebookGuid); w.writeFieldEnd(); w.writeFieldStop(); @@ -5099,19 +6032,19 @@ Note NoteStore_copyNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("copyNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5119,9 +6052,9 @@ Note NoteStore_copyNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -5168,7 +6101,9 @@ Note NoteStore_copyNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("copyNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("copyNote: missing result")); } return result; } @@ -5178,35 +6113,57 @@ QVariant NoteStore_copyNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_copyNote_readReply(reply)); } -Note NoteStore::copyNote(Guid noteGuid, Guid toNotebookGuid, QString authenticationToken) +Note NoteStore::copyNote( + Guid noteGuid, + Guid toNotebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_copyNote_prepareParams(authenticationToken, noteGuid, toNotebookGuid); + QByteArray params = NoteStore_copyNote_prepareParams( + authenticationToken, + noteGuid, + toNotebookGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_copyNote_readReply(reply); } -AsyncResult* NoteStore::copyNoteAsync(Guid noteGuid, Guid toNotebookGuid, QString authenticationToken) +AsyncResult* NoteStore::copyNoteAsync( + Guid noteGuid, + Guid toNotebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_copyNote_prepareParams(authenticationToken, noteGuid, toNotebookGuid); + QByteArray params = NoteStore_copyNote_prepareParams( + authenticationToken, + noteGuid, + toNotebookGuid); return new AsyncResult(m_url, params, NoteStore_copyNote_readReplyAsync); } -QByteArray NoteStore_listNoteVersions_prepareParams(QString authenticationToken, Guid noteGuid) +QByteArray NoteStore_listNoteVersions_prepareParams( + QString authenticationToken, + Guid noteGuid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listNoteVersions"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listNoteVersions_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listNoteVersions"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listNoteVersions_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(noteGuid); w.writeFieldEnd(); w.writeFieldStop(); @@ -5215,29 +6172,29 @@ QByteArray NoteStore_listNoteVersions_prepareParams(QString authenticationToken, return w.buffer(); } -QList< NoteVersionId > NoteStore_listNoteVersions_readReply(QByteArray reply) +QList NoteStore_listNoteVersions_readReply(QByteArray reply) { bool resultIsSet = false; - QList< NoteVersionId > result = QList< NoteVersionId >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listNoteVersions")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5245,11 +6202,11 @@ QList< NoteVersionId > NoteStore_listNoteVersions_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< NoteVersionId > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -5304,7 +6261,9 @@ QList< NoteVersionId > NoteStore_listNoteVersions_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listNoteVersions: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listNoteVersions: missing result")); } return result; } @@ -5314,47 +6273,81 @@ QVariant NoteStore_listNoteVersions_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listNoteVersions_readReply(reply)); } -QList< NoteVersionId > NoteStore::listNoteVersions(Guid noteGuid, QString authenticationToken) +QList NoteStore::listNoteVersions( + Guid noteGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listNoteVersions_prepareParams(authenticationToken, noteGuid); + QByteArray params = NoteStore_listNoteVersions_prepareParams( + authenticationToken, + noteGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_listNoteVersions_readReply(reply); } -AsyncResult* NoteStore::listNoteVersionsAsync(Guid noteGuid, QString authenticationToken) +AsyncResult* NoteStore::listNoteVersionsAsync( + Guid noteGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listNoteVersions_prepareParams(authenticationToken, noteGuid); + QByteArray params = NoteStore_listNoteVersions_prepareParams( + authenticationToken, + noteGuid); return new AsyncResult(m_url, params, NoteStore_listNoteVersions_readReplyAsync); } -QByteArray NoteStore_getNoteVersion_prepareParams(QString authenticationToken, Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData) +QByteArray NoteStore_getNoteVersion_prepareParams( + QString authenticationToken, + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNoteVersion"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNoteVersion_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNoteVersion"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNoteVersion_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(noteGuid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 3); w.writeI32(updateSequenceNum); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesData"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("withResourcesData"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(withResourcesData); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesRecognition"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("withResourcesRecognition"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(withResourcesRecognition); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withResourcesAlternateData"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("withResourcesAlternateData"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(withResourcesAlternateData); w.writeFieldEnd(); w.writeFieldStop(); @@ -5373,19 +6366,19 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteVersion")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5393,9 +6386,9 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); @@ -5442,7 +6435,9 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteVersion: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNoteVersion: missing result")); } return result; } @@ -5452,47 +6447,97 @@ QVariant NoteStore_getNoteVersion_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteVersion_readReply(reply)); } -Note NoteStore::getNoteVersion(Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken) +Note NoteStore::getNoteVersion( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteVersion_prepareParams(authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData); + QByteArray params = NoteStore_getNoteVersion_prepareParams( + authenticationToken, + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteVersion_readReply(reply); } -AsyncResult* NoteStore::getNoteVersionAsync(Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, QString authenticationToken) +AsyncResult* NoteStore::getNoteVersionAsync( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNoteVersion_prepareParams(authenticationToken, noteGuid, updateSequenceNum, withResourcesData, withResourcesRecognition, withResourcesAlternateData); + QByteArray params = NoteStore_getNoteVersion_prepareParams( + authenticationToken, + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData); return new AsyncResult(m_url, params, NoteStore_getNoteVersion_readReplyAsync); } -QByteArray NoteStore_getResource_prepareParams(QString authenticationToken, Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData) +QByteArray NoteStore_getResource_prepareParams( + QString authenticationToken, + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResource"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResource_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResource"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResource_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withData"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("withData"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(withData); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withRecognition"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("withRecognition"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(withRecognition); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withAttributes"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("withAttributes"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(withAttributes); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withAlternateData"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("withAlternateData"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(withAlternateData); w.writeFieldEnd(); w.writeFieldStop(); @@ -5511,19 +6556,19 @@ Resource NoteStore_getResource_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResource")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5531,9 +6576,9 @@ Resource NoteStore_getResource_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; readResource(r, v); @@ -5580,7 +6625,9 @@ Resource NoteStore_getResource_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResource: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResource: missing result")); } return result; } @@ -5590,35 +6637,69 @@ QVariant NoteStore_getResource_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResource_readReply(reply)); } -Resource NoteStore::getResource(Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, QString authenticationToken) +Resource NoteStore::getResource( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResource_prepareParams(authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData); + QByteArray params = NoteStore_getResource_prepareParams( + authenticationToken, + guid, + withData, + withRecognition, + withAttributes, + withAlternateData); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResource_readReply(reply); } -AsyncResult* NoteStore::getResourceAsync(Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, QString authenticationToken) +AsyncResult* NoteStore::getResourceAsync( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResource_prepareParams(authenticationToken, guid, withData, withRecognition, withAttributes, withAlternateData); + QByteArray params = NoteStore_getResource_prepareParams( + authenticationToken, + guid, + withData, + withRecognition, + withAttributes, + withAlternateData); return new AsyncResult(m_url, params, NoteStore_getResource_readReplyAsync); } -QByteArray NoteStore_getResourceApplicationData_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceApplicationData_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceApplicationData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceApplicationData_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceApplicationData"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceApplicationData_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -5637,19 +6718,19 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceApplicationData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5657,9 +6738,9 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; readLazyMap(r, v); @@ -5706,7 +6787,9 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceApplicationData: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceApplicationData: missing result")); } return result; } @@ -5716,38 +6799,60 @@ QVariant NoteStore_getResourceApplicationData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceApplicationData_readReply(reply)); } -LazyMap NoteStore::getResourceApplicationData(Guid guid, QString authenticationToken) +LazyMap NoteStore::getResourceApplicationData( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceApplicationData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceApplicationData_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceApplicationData_readReply(reply); } -AsyncResult* NoteStore::getResourceApplicationDataAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceApplicationDataAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceApplicationData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceApplicationData_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceApplicationData_readReplyAsync); } -QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key) +QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); w.writeFieldStop(); @@ -5766,19 +6871,19 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5786,9 +6891,9 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -5835,7 +6940,9 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceApplicationDataEntry: missing result")); } return result; } @@ -5845,41 +6952,71 @@ QVariant NoteStore_getResourceApplicationDataEntry_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_getResourceApplicationDataEntry_readReply(reply)); } -QString NoteStore::getResourceApplicationDataEntry(Guid guid, QString key, QString authenticationToken) +QString NoteStore::getResourceApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::getResourceApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken) +AsyncResult* NoteStore::getResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); return new AsyncResult(m_url, params, NoteStore_getResourceApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key, QString value) +QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key, + QString value) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("setResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_setResourceApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("setResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_setResourceApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("value"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("value"), + ThriftFieldType::T_STRING, + 4); w.writeString(value); w.writeFieldEnd(); w.writeFieldStop(); @@ -5898,19 +7035,19 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -5918,9 +7055,9 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -5967,7 +7104,9 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("setResourceApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("setResourceApplicationDataEntry: missing result")); } return result; } @@ -5977,38 +7116,68 @@ QVariant NoteStore_setResourceApplicationDataEntry_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_setResourceApplicationDataEntry_readReply(reply)); } -qint32 NoteStore::setResourceApplicationDataEntry(Guid guid, QString key, QString value, QString authenticationToken) +qint32 NoteStore::setResourceApplicationDataEntry( + Guid guid, + QString key, + QString value, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key, value); + QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key, + value); QByteArray reply = askEvernote(m_url, params); return NoteStore_setResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::setResourceApplicationDataEntryAsync(Guid guid, QString key, QString value, QString authenticationToken) +AsyncResult* NoteStore::setResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key, value); + QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key, + value); return new AsyncResult(m_url, params, NoteStore_setResourceApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams(QString authenticationToken, Guid guid, QString key) +QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( + QString authenticationToken, + Guid guid, + QString key) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("unsetResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_unsetResourceApplicationDataEntry_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("unsetResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_unsetResourceApplicationDataEntry_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 3); w.writeString(key); w.writeFieldEnd(); w.writeFieldStop(); @@ -6027,19 +7196,19 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("unsetResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6047,9 +7216,9 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -6096,7 +7265,9 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("unsetResourceApplicationDataEntry: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("unsetResourceApplicationDataEntry: missing result")); } return result; } @@ -6106,35 +7277,57 @@ QVariant NoteStore_unsetResourceApplicationDataEntry_readReplyAsync(QByteArray r return QVariant::fromValue(NoteStore_unsetResourceApplicationDataEntry_readReply(reply)); } -qint32 NoteStore::unsetResourceApplicationDataEntry(Guid guid, QString key, QString authenticationToken) +qint32 NoteStore::unsetResourceApplicationDataEntry( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); QByteArray reply = askEvernote(m_url, params); return NoteStore_unsetResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::unsetResourceApplicationDataEntryAsync(Guid guid, QString key, QString authenticationToken) +AsyncResult* NoteStore::unsetResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams(authenticationToken, guid, key); + QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( + authenticationToken, + guid, + key); return new AsyncResult(m_url, params, NoteStore_unsetResourceApplicationDataEntry_readReplyAsync); } -QByteArray NoteStore_updateResource_prepareParams(QString authenticationToken, const Resource& resource) +QByteArray NoteStore_updateResource_prepareParams( + QString authenticationToken, + const Resource& resource) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateResource"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateResource_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateResource"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateResource_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("resource"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("resource"), + ThriftFieldType::T_STRUCT, + 2); writeResource(w, resource); w.writeFieldEnd(); w.writeFieldStop(); @@ -6153,19 +7346,19 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateResource")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6173,9 +7366,9 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -6222,7 +7415,9 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateResource: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateResource: missing result")); } return result; } @@ -6232,35 +7427,53 @@ QVariant NoteStore_updateResource_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateResource_readReply(reply)); } -qint32 NoteStore::updateResource(const Resource& resource, QString authenticationToken) +qint32 NoteStore::updateResource( + const Resource& resource, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateResource_prepareParams(authenticationToken, resource); + QByteArray params = NoteStore_updateResource_prepareParams( + authenticationToken, + resource); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateResource_readReply(reply); } -AsyncResult* NoteStore::updateResourceAsync(const Resource& resource, QString authenticationToken) +AsyncResult* NoteStore::updateResourceAsync( + const Resource& resource, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateResource_prepareParams(authenticationToken, resource); + QByteArray params = NoteStore_updateResource_prepareParams( + authenticationToken, + resource); return new AsyncResult(m_url, params, NoteStore_updateResource_readReplyAsync); } -QByteArray NoteStore_getResourceData_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceData_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceData_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceData"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceData_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -6279,19 +7492,19 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6299,9 +7512,9 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); @@ -6348,7 +7561,9 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceData: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceData: missing result")); } return result; } @@ -6358,47 +7573,81 @@ QVariant NoteStore_getResourceData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceData_readReply(reply)); } -QByteArray NoteStore::getResourceData(Guid guid, QString authenticationToken) +QByteArray NoteStore::getResourceData( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceData_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceData_readReply(reply); } -AsyncResult* NoteStore::getResourceDataAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceDataAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceData_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceData_readReplyAsync); } -QByteArray NoteStore_getResourceByHash_prepareParams(QString authenticationToken, Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData) +QByteArray NoteStore_getResourceByHash_prepareParams( + QString authenticationToken, + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceByHash"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceByHash_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceByHash"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceByHash_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(noteGuid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("contentHash"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("contentHash"), + ThriftFieldType::T_STRING, + 3); w.writeBinary(contentHash); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withData"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("withData"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(withData); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withRecognition"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("withRecognition"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(withRecognition); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("withAlternateData"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("withAlternateData"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(withAlternateData); w.writeFieldEnd(); w.writeFieldStop(); @@ -6417,19 +7666,19 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceByHash")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6437,9 +7686,9 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; readResource(r, v); @@ -6486,7 +7735,9 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceByHash: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceByHash: missing result")); } return result; } @@ -6496,35 +7747,69 @@ QVariant NoteStore_getResourceByHash_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceByHash_readReply(reply)); } -Resource NoteStore::getResourceByHash(Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, QString authenticationToken) +Resource NoteStore::getResourceByHash( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceByHash_prepareParams(authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData); + QByteArray params = NoteStore_getResourceByHash_prepareParams( + authenticationToken, + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceByHash_readReply(reply); } -AsyncResult* NoteStore::getResourceByHashAsync(Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, QString authenticationToken) +AsyncResult* NoteStore::getResourceByHashAsync( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceByHash_prepareParams(authenticationToken, noteGuid, contentHash, withData, withRecognition, withAlternateData); + QByteArray params = NoteStore_getResourceByHash_prepareParams( + authenticationToken, + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData); return new AsyncResult(m_url, params, NoteStore_getResourceByHash_readReplyAsync); } -QByteArray NoteStore_getResourceRecognition_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceRecognition_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceRecognition"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceRecognition_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceRecognition"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceRecognition_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -6543,19 +7828,19 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceRecognition")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6563,9 +7848,9 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); @@ -6612,7 +7897,9 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceRecognition: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceRecognition: missing result")); } return result; } @@ -6622,35 +7909,53 @@ QVariant NoteStore_getResourceRecognition_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceRecognition_readReply(reply)); } -QByteArray NoteStore::getResourceRecognition(Guid guid, QString authenticationToken) +QByteArray NoteStore::getResourceRecognition( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceRecognition_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceRecognition_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceRecognition_readReply(reply); } -AsyncResult* NoteStore::getResourceRecognitionAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceRecognitionAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceRecognition_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceRecognition_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceRecognition_readReplyAsync); } -QByteArray NoteStore_getResourceAlternateData_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceAlternateData_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceAlternateData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceAlternateData_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceAlternateData"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceAlternateData_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -6669,19 +7974,19 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceAlternateData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6689,9 +7994,9 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); @@ -6738,7 +8043,9 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceAlternateData: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceAlternateData: missing result")); } return result; } @@ -6748,35 +8055,53 @@ QVariant NoteStore_getResourceAlternateData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceAlternateData_readReply(reply)); } -QByteArray NoteStore::getResourceAlternateData(Guid guid, QString authenticationToken) +QByteArray NoteStore::getResourceAlternateData( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceAlternateData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceAlternateData_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceAlternateData_readReply(reply); } -AsyncResult* NoteStore::getResourceAlternateDataAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceAlternateDataAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceAlternateData_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceAlternateData_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceAlternateData_readReplyAsync); } -QByteArray NoteStore_getResourceAttributes_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_getResourceAttributes_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getResourceAttributes"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getResourceAttributes_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getResourceAttributes"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getResourceAttributes_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -6795,19 +8120,19 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceAttributes")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6815,9 +8140,9 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ResourceAttributes v; readResourceAttributes(r, v); @@ -6864,7 +8189,9 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceAttributes: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getResourceAttributes: missing result")); } return result; } @@ -6874,35 +8201,53 @@ QVariant NoteStore_getResourceAttributes_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceAttributes_readReply(reply)); } -ResourceAttributes NoteStore::getResourceAttributes(Guid guid, QString authenticationToken) +ResourceAttributes NoteStore::getResourceAttributes( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceAttributes_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceAttributes_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceAttributes_readReply(reply); } -AsyncResult* NoteStore::getResourceAttributesAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::getResourceAttributesAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getResourceAttributes_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_getResourceAttributes_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_getResourceAttributes_readReplyAsync); } -QByteArray NoteStore_getPublicNotebook_prepareParams(UserID userId, QString publicUri) +QByteArray NoteStore_getPublicNotebook_prepareParams( + UserID userId, + QString publicUri) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getPublicNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getPublicNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 1); + w.writeMessageBegin( + QStringLiteral("getPublicNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getPublicNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("userId"), + ThriftFieldType::T_I32, + 1); w.writeI32(userId); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("publicUri"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("publicUri"), + ThriftFieldType::T_STRING, + 2); w.writeString(publicUri); w.writeFieldEnd(); w.writeFieldStop(); @@ -6921,19 +8266,19 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getPublicNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -6941,9 +8286,9 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); @@ -6980,7 +8325,9 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getPublicNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getPublicNotebook: missing result")); } return result; } @@ -6990,32 +8337,54 @@ QVariant NoteStore_getPublicNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getPublicNotebook_readReply(reply)); } -Notebook NoteStore::getPublicNotebook(UserID userId, QString publicUri) +Notebook NoteStore::getPublicNotebook( + UserID userId, + QString publicUri) { - QByteArray params = NoteStore_getPublicNotebook_prepareParams(userId, publicUri); + QByteArray params = NoteStore_getPublicNotebook_prepareParams( + userId, + publicUri); QByteArray reply = askEvernote(m_url, params); return NoteStore_getPublicNotebook_readReply(reply); } -AsyncResult* NoteStore::getPublicNotebookAsync(UserID userId, QString publicUri) +AsyncResult* NoteStore::getPublicNotebookAsync( + UserID userId, + QString publicUri) { - QByteArray params = NoteStore_getPublicNotebook_prepareParams(userId, publicUri); + QByteArray params = NoteStore_getPublicNotebook_prepareParams( + userId, + publicUri); return new AsyncResult(m_url, params, NoteStore_getPublicNotebook_readReplyAsync); } -QByteArray NoteStore_shareNotebook_prepareParams(QString authenticationToken, const SharedNotebook& sharedNotebook, QString message) +QByteArray NoteStore_shareNotebook_prepareParams( + QString authenticationToken, + const SharedNotebook& sharedNotebook, + QString message) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("shareNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_shareNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("shareNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_shareNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("sharedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("sharedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeSharedNotebook(w, sharedNotebook); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("message"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("message"), + ThriftFieldType::T_STRING, + 3); w.writeString(message); w.writeFieldEnd(); w.writeFieldStop(); @@ -7034,19 +8403,19 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("shareNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7054,9 +8423,9 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; readSharedNotebook(r, v); @@ -7103,7 +8472,9 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("shareNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("shareNotebook: missing result")); } return result; } @@ -7113,35 +8484,57 @@ QVariant NoteStore_shareNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_shareNotebook_readReply(reply)); } -SharedNotebook NoteStore::shareNotebook(const SharedNotebook& sharedNotebook, QString message, QString authenticationToken) +SharedNotebook NoteStore::shareNotebook( + const SharedNotebook& sharedNotebook, + QString message, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_shareNotebook_prepareParams(authenticationToken, sharedNotebook, message); + QByteArray params = NoteStore_shareNotebook_prepareParams( + authenticationToken, + sharedNotebook, + message); QByteArray reply = askEvernote(m_url, params); return NoteStore_shareNotebook_readReply(reply); } -AsyncResult* NoteStore::shareNotebookAsync(const SharedNotebook& sharedNotebook, QString message, QString authenticationToken) +AsyncResult* NoteStore::shareNotebookAsync( + const SharedNotebook& sharedNotebook, + QString message, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_shareNotebook_prepareParams(authenticationToken, sharedNotebook, message); + QByteArray params = NoteStore_shareNotebook_prepareParams( + authenticationToken, + sharedNotebook, + message); return new AsyncResult(m_url, params, NoteStore_shareNotebook_readReplyAsync); } -QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams(QString authenticationToken, const NotebookShareTemplate& shareTemplate) +QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( + QString authenticationToken, + const NotebookShareTemplate& shareTemplate) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createOrUpdateNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createOrUpdateNotebookShares_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createOrUpdateNotebookShares"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createOrUpdateNotebookShares_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("shareTemplate"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("shareTemplate"), + ThriftFieldType::T_STRUCT, + 2); writeNotebookShareTemplate(w, shareTemplate); w.writeFieldEnd(); w.writeFieldStop(); @@ -7160,19 +8553,19 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createOrUpdateNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7180,9 +8573,9 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; CreateOrUpdateNotebookSharesResult v; readCreateOrUpdateNotebookSharesResult(r, v); @@ -7239,7 +8632,9 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createOrUpdateNotebookShares: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createOrUpdateNotebookShares: missing result")); } return result; } @@ -7249,35 +8644,53 @@ QVariant NoteStore_createOrUpdateNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createOrUpdateNotebookShares_readReply(reply)); } -CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares(const NotebookShareTemplate& shareTemplate, QString authenticationToken) +CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( + const NotebookShareTemplate& shareTemplate, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams(authenticationToken, shareTemplate); + QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( + authenticationToken, + shareTemplate); QByteArray reply = askEvernote(m_url, params); return NoteStore_createOrUpdateNotebookShares_readReply(reply); } -AsyncResult* NoteStore::createOrUpdateNotebookSharesAsync(const NotebookShareTemplate& shareTemplate, QString authenticationToken) +AsyncResult* NoteStore::createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate& shareTemplate, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams(authenticationToken, shareTemplate); + QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( + authenticationToken, + shareTemplate); return new AsyncResult(m_url, params, NoteStore_createOrUpdateNotebookShares_readReplyAsync); } -QByteArray NoteStore_updateSharedNotebook_prepareParams(QString authenticationToken, const SharedNotebook& sharedNotebook) +QByteArray NoteStore_updateSharedNotebook_prepareParams( + QString authenticationToken, + const SharedNotebook& sharedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateSharedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateSharedNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateSharedNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateSharedNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("sharedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("sharedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeSharedNotebook(w, sharedNotebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -7296,19 +8709,19 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateSharedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7316,9 +8729,9 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -7365,7 +8778,9 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateSharedNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateSharedNotebook: missing result")); } return result; } @@ -7375,38 +8790,60 @@ QVariant NoteStore_updateSharedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateSharedNotebook_readReply(reply)); } -qint32 NoteStore::updateSharedNotebook(const SharedNotebook& sharedNotebook, QString authenticationToken) +qint32 NoteStore::updateSharedNotebook( + const SharedNotebook& sharedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateSharedNotebook_prepareParams(authenticationToken, sharedNotebook); + QByteArray params = NoteStore_updateSharedNotebook_prepareParams( + authenticationToken, + sharedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateSharedNotebook_readReply(reply); } -AsyncResult* NoteStore::updateSharedNotebookAsync(const SharedNotebook& sharedNotebook, QString authenticationToken) +AsyncResult* NoteStore::updateSharedNotebookAsync( + const SharedNotebook& sharedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateSharedNotebook_prepareParams(authenticationToken, sharedNotebook); + QByteArray params = NoteStore_updateSharedNotebook_prepareParams( + authenticationToken, + sharedNotebook); return new AsyncResult(m_url, params, NoteStore_updateSharedNotebook_readReplyAsync); } -QByteArray NoteStore_setNotebookRecipientSettings_prepareParams(QString authenticationToken, QString notebookGuid, const NotebookRecipientSettings& recipientSettings) +QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( + QString authenticationToken, + QString notebookGuid, + const NotebookRecipientSettings& recipientSettings) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("setNotebookRecipientSettings"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_setNotebookRecipientSettings_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("setNotebookRecipientSettings"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_setNotebookRecipientSettings_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(notebookGuid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("recipientSettings"), + ThriftFieldType::T_STRUCT, + 3); writeNotebookRecipientSettings(w, recipientSettings); w.writeFieldEnd(); w.writeFieldStop(); @@ -7425,19 +8862,19 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setNotebookRecipientSettings")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7445,9 +8882,9 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); @@ -7494,7 +8931,9 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("setNotebookRecipientSettings: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("setNotebookRecipientSettings: missing result")); } return result; } @@ -7504,32 +8943,50 @@ QVariant NoteStore_setNotebookRecipientSettings_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_setNotebookRecipientSettings_readReply(reply)); } -Notebook NoteStore::setNotebookRecipientSettings(QString notebookGuid, const NotebookRecipientSettings& recipientSettings, QString authenticationToken) +Notebook NoteStore::setNotebookRecipientSettings( + QString notebookGuid, + const NotebookRecipientSettings& recipientSettings, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams(authenticationToken, notebookGuid, recipientSettings); + QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( + authenticationToken, + notebookGuid, + recipientSettings); QByteArray reply = askEvernote(m_url, params); return NoteStore_setNotebookRecipientSettings_readReply(reply); } -AsyncResult* NoteStore::setNotebookRecipientSettingsAsync(QString notebookGuid, const NotebookRecipientSettings& recipientSettings, QString authenticationToken) +AsyncResult* NoteStore::setNotebookRecipientSettingsAsync( + QString notebookGuid, + const NotebookRecipientSettings& recipientSettings, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams(authenticationToken, notebookGuid, recipientSettings); + QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( + authenticationToken, + notebookGuid, + recipientSettings); return new AsyncResult(m_url, params, NoteStore_setNotebookRecipientSettings_readReplyAsync); } -QByteArray NoteStore_listSharedNotebooks_prepareParams(QString authenticationToken) +QByteArray NoteStore_listSharedNotebooks_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listSharedNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listSharedNotebooks_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listSharedNotebooks"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listSharedNotebooks_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -7538,29 +8995,29 @@ QByteArray NoteStore_listSharedNotebooks_prepareParams(QString authenticationTok return w.buffer(); } -QList< SharedNotebook > NoteStore_listSharedNotebooks_readReply(QByteArray reply) +QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) { bool resultIsSet = false; - QList< SharedNotebook > result = QList< SharedNotebook >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listSharedNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7568,11 +9025,11 @@ QList< SharedNotebook > NoteStore_listSharedNotebooks_readReply(QByteArray reply r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< SharedNotebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -7627,7 +9084,9 @@ QList< SharedNotebook > NoteStore_listSharedNotebooks_readReply(QByteArray reply r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listSharedNotebooks: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listSharedNotebooks: missing result")); } return result; } @@ -7637,35 +9096,49 @@ QVariant NoteStore_listSharedNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listSharedNotebooks_readReply(reply)); } -QList< SharedNotebook > NoteStore::listSharedNotebooks(QString authenticationToken) +QList NoteStore::listSharedNotebooks( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listSharedNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listSharedNotebooks_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listSharedNotebooks_readReply(reply); } -AsyncResult* NoteStore::listSharedNotebooksAsync(QString authenticationToken) +AsyncResult* NoteStore::listSharedNotebooksAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listSharedNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listSharedNotebooks_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listSharedNotebooks_readReplyAsync); } -QByteArray NoteStore_createLinkedNotebook_prepareParams(QString authenticationToken, const LinkedNotebook& linkedNotebook) +QByteArray NoteStore_createLinkedNotebook_prepareParams( + QString authenticationToken, + const LinkedNotebook& linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("createLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_createLinkedNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("createLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_createLinkedNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("linkedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeLinkedNotebook(w, linkedNotebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -7684,19 +9157,19 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7704,9 +9177,9 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LinkedNotebook v; readLinkedNotebook(r, v); @@ -7753,7 +9226,9 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("createLinkedNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("createLinkedNotebook: missing result")); } return result; } @@ -7763,35 +9238,53 @@ QVariant NoteStore_createLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createLinkedNotebook_readReply(reply)); } -LinkedNotebook NoteStore::createLinkedNotebook(const LinkedNotebook& linkedNotebook, QString authenticationToken) +LinkedNotebook NoteStore::createLinkedNotebook( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createLinkedNotebook_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_createLinkedNotebook_prepareParams( + authenticationToken, + linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_createLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::createLinkedNotebookAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken) +AsyncResult* NoteStore::createLinkedNotebookAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_createLinkedNotebook_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_createLinkedNotebook_prepareParams( + authenticationToken, + linkedNotebook); return new AsyncResult(m_url, params, NoteStore_createLinkedNotebook_readReplyAsync); } -QByteArray NoteStore_updateLinkedNotebook_prepareParams(QString authenticationToken, const LinkedNotebook& linkedNotebook) +QByteArray NoteStore_updateLinkedNotebook_prepareParams( + QString authenticationToken, + const LinkedNotebook& linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateLinkedNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateLinkedNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("linkedNotebook"), + ThriftFieldType::T_STRUCT, + 2); writeLinkedNotebook(w, linkedNotebook); w.writeFieldEnd(); w.writeFieldStop(); @@ -7810,19 +9303,19 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7830,9 +9323,9 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -7879,7 +9372,9 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateLinkedNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateLinkedNotebook: missing result")); } return result; } @@ -7889,32 +9384,46 @@ QVariant NoteStore_updateLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateLinkedNotebook_readReply(reply)); } -qint32 NoteStore::updateLinkedNotebook(const LinkedNotebook& linkedNotebook, QString authenticationToken) +qint32 NoteStore::updateLinkedNotebook( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateLinkedNotebook_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( + authenticationToken, + linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::updateLinkedNotebookAsync(const LinkedNotebook& linkedNotebook, QString authenticationToken) +AsyncResult* NoteStore::updateLinkedNotebookAsync( + const LinkedNotebook& linkedNotebook, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateLinkedNotebook_prepareParams(authenticationToken, linkedNotebook); + QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( + authenticationToken, + linkedNotebook); return new AsyncResult(m_url, params, NoteStore_updateLinkedNotebook_readReplyAsync); } -QByteArray NoteStore_listLinkedNotebooks_prepareParams(QString authenticationToken) +QByteArray NoteStore_listLinkedNotebooks_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listLinkedNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_listLinkedNotebooks_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listLinkedNotebooks"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_listLinkedNotebooks_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -7923,29 +9432,29 @@ QByteArray NoteStore_listLinkedNotebooks_prepareParams(QString authenticationTok return w.buffer(); } -QList< LinkedNotebook > NoteStore_listLinkedNotebooks_readReply(QByteArray reply) +QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) { bool resultIsSet = false; - QList< LinkedNotebook > result = QList< LinkedNotebook >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listLinkedNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -7953,11 +9462,11 @@ QList< LinkedNotebook > NoteStore_listLinkedNotebooks_readReply(QByteArray reply r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< LinkedNotebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -8012,7 +9521,9 @@ QList< LinkedNotebook > NoteStore_listLinkedNotebooks_readReply(QByteArray reply r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listLinkedNotebooks: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listLinkedNotebooks: missing result")); } return result; } @@ -8022,35 +9533,49 @@ QVariant NoteStore_listLinkedNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listLinkedNotebooks_readReply(reply)); } -QList< LinkedNotebook > NoteStore::listLinkedNotebooks(QString authenticationToken) +QList NoteStore::listLinkedNotebooks( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listLinkedNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_listLinkedNotebooks_readReply(reply); } -AsyncResult* NoteStore::listLinkedNotebooksAsync(QString authenticationToken) +AsyncResult* NoteStore::listLinkedNotebooksAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_listLinkedNotebooks_prepareParams(authenticationToken); + QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_listLinkedNotebooks_readReplyAsync); } -QByteArray NoteStore_expungeLinkedNotebook_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_expungeLinkedNotebook_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("expungeLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_expungeLinkedNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("expungeLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_expungeLinkedNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -8069,19 +9594,19 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8089,9 +9614,9 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_I32) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); @@ -8138,7 +9663,9 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeLinkedNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("expungeLinkedNotebook: missing result")); } return result; } @@ -8148,35 +9675,53 @@ QVariant NoteStore_expungeLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeLinkedNotebook_readReply(reply)); } -qint32 NoteStore::expungeLinkedNotebook(Guid guid, QString authenticationToken) +qint32 NoteStore::expungeLinkedNotebook( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::expungeLinkedNotebookAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::expungeLinkedNotebookAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_expungeLinkedNotebook_readReplyAsync); } -QByteArray NoteStore_authenticateToSharedNotebook_prepareParams(QString shareKeyOrGlobalId, QString authenticationToken) +QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( + QString shareKeyOrGlobalId, + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("authenticateToSharedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_authenticateToSharedNotebook_pargs")); - w.writeFieldBegin(QStringLiteral("shareKeyOrGlobalId"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("authenticateToSharedNotebook"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_authenticateToSharedNotebook_pargs")); + w.writeFieldBegin( + QStringLiteral("shareKeyOrGlobalId"), + ThriftFieldType::T_STRING, + 1); w.writeString(shareKeyOrGlobalId); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 2); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -8195,19 +9740,19 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToSharedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8215,9 +9760,9 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); @@ -8264,7 +9809,9 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToSharedNotebook: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("authenticateToSharedNotebook: missing result")); } return result; } @@ -8274,32 +9821,46 @@ QVariant NoteStore_authenticateToSharedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_authenticateToSharedNotebook_readReply(reply)); } -AuthenticationResult NoteStore::authenticateToSharedNotebook(QString shareKeyOrGlobalId, QString authenticationToken) +AuthenticationResult NoteStore::authenticateToSharedNotebook( + QString shareKeyOrGlobalId, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams(shareKeyOrGlobalId, authenticationToken); + QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( + shareKeyOrGlobalId, + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_authenticateToSharedNotebook_readReply(reply); } -AsyncResult* NoteStore::authenticateToSharedNotebookAsync(QString shareKeyOrGlobalId, QString authenticationToken) +AsyncResult* NoteStore::authenticateToSharedNotebookAsync( + QString shareKeyOrGlobalId, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams(shareKeyOrGlobalId, authenticationToken); + QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( + shareKeyOrGlobalId, + authenticationToken); return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNotebook_readReplyAsync); } -QByteArray NoteStore_getSharedNotebookByAuth_prepareParams(QString authenticationToken) +QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getSharedNotebookByAuth"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getSharedNotebookByAuth_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getSharedNotebookByAuth"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getSharedNotebookByAuth_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -8318,19 +9879,19 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSharedNotebookByAuth")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8338,9 +9899,9 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; readSharedNotebook(r, v); @@ -8387,7 +9948,9 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getSharedNotebookByAuth: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getSharedNotebookByAuth: missing result")); } return result; } @@ -8397,35 +9960,49 @@ QVariant NoteStore_getSharedNotebookByAuth_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSharedNotebookByAuth_readReply(reply)); } -SharedNotebook NoteStore::getSharedNotebookByAuth(QString authenticationToken) +SharedNotebook NoteStore::getSharedNotebookByAuth( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams(authenticationToken); + QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSharedNotebookByAuth_readReply(reply); } -AsyncResult* NoteStore::getSharedNotebookByAuthAsync(QString authenticationToken) +AsyncResult* NoteStore::getSharedNotebookByAuthAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams(authenticationToken); + QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, NoteStore_getSharedNotebookByAuth_readReplyAsync); } -QByteArray NoteStore_emailNote_prepareParams(QString authenticationToken, const NoteEmailParameters& parameters) +QByteArray NoteStore_emailNote_prepareParams( + QString authenticationToken, + const NoteEmailParameters& parameters) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("emailNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_emailNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("emailNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_emailNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("parameters"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("parameters"), + ThriftFieldType::T_STRUCT, + 2); writeNoteEmailParameters(w, parameters); w.writeFieldEnd(); w.writeFieldStop(); @@ -8442,19 +10019,19 @@ void NoteStore_emailNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("emailNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8462,7 +10039,7 @@ void NoteStore_emailNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -8508,35 +10085,53 @@ QVariant NoteStore_emailNote_readReplyAsync(QByteArray reply) return QVariant(); } -void NoteStore::emailNote(const NoteEmailParameters& parameters, QString authenticationToken) +void NoteStore::emailNote( + const NoteEmailParameters& parameters, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_emailNote_prepareParams(authenticationToken, parameters); + QByteArray params = NoteStore_emailNote_prepareParams( + authenticationToken, + parameters); QByteArray reply = askEvernote(m_url, params); NoteStore_emailNote_readReply(reply); } -AsyncResult* NoteStore::emailNoteAsync(const NoteEmailParameters& parameters, QString authenticationToken) +AsyncResult* NoteStore::emailNoteAsync( + const NoteEmailParameters& parameters, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_emailNote_prepareParams(authenticationToken, parameters); + QByteArray params = NoteStore_emailNote_prepareParams( + authenticationToken, + parameters); return new AsyncResult(m_url, params, NoteStore_emailNote_readReplyAsync); } -QByteArray NoteStore_shareNote_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_shareNote_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("shareNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_shareNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("shareNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_shareNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -8555,19 +10150,19 @@ QString NoteStore_shareNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("shareNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8575,9 +10170,9 @@ QString NoteStore_shareNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRING) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); @@ -8624,7 +10219,9 @@ QString NoteStore_shareNote_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("shareNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("shareNote: missing result")); } return result; } @@ -8634,35 +10231,53 @@ QVariant NoteStore_shareNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_shareNote_readReply(reply)); } -QString NoteStore::shareNote(Guid guid, QString authenticationToken) +QString NoteStore::shareNote( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_shareNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_shareNote_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_shareNote_readReply(reply); } -AsyncResult* NoteStore::shareNoteAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::shareNoteAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_shareNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_shareNote_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_shareNote_readReplyAsync); } -QByteArray NoteStore_stopSharingNote_prepareParams(QString authenticationToken, Guid guid) +QByteArray NoteStore_stopSharingNote_prepareParams( + QString authenticationToken, + Guid guid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("stopSharingNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_stopSharingNote_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("stopSharingNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_stopSharingNote_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 2); w.writeString(guid); w.writeFieldEnd(); w.writeFieldStop(); @@ -8679,19 +10294,19 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("stopSharingNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8699,7 +10314,7 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -8745,38 +10360,60 @@ QVariant NoteStore_stopSharingNote_readReplyAsync(QByteArray reply) return QVariant(); } -void NoteStore::stopSharingNote(Guid guid, QString authenticationToken) +void NoteStore::stopSharingNote( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_stopSharingNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_stopSharingNote_prepareParams( + authenticationToken, + guid); QByteArray reply = askEvernote(m_url, params); NoteStore_stopSharingNote_readReply(reply); } -AsyncResult* NoteStore::stopSharingNoteAsync(Guid guid, QString authenticationToken) +AsyncResult* NoteStore::stopSharingNoteAsync( + Guid guid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_stopSharingNote_prepareParams(authenticationToken, guid); + QByteArray params = NoteStore_stopSharingNote_prepareParams( + authenticationToken, + guid); return new AsyncResult(m_url, params, NoteStore_stopSharingNote_readReplyAsync); } -QByteArray NoteStore_authenticateToSharedNote_prepareParams(QString guid, QString noteKey, QString authenticationToken) +QByteArray NoteStore_authenticateToSharedNote_prepareParams( + QString guid, + QString noteKey, + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("authenticateToSharedNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_authenticateToSharedNote_pargs")); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_authenticateToSharedNote_pargs")); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(guid); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("noteKey"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteKey"), + ThriftFieldType::T_STRING, + 2); w.writeString(noteKey); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 3); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -8795,19 +10432,19 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToSharedNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8815,9 +10452,9 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); @@ -8864,7 +10501,9 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToSharedNote: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("authenticateToSharedNote: missing result")); } return result; } @@ -8874,38 +10513,64 @@ QVariant NoteStore_authenticateToSharedNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_authenticateToSharedNote_readReply(reply)); } -AuthenticationResult NoteStore::authenticateToSharedNote(QString guid, QString noteKey, QString authenticationToken) +AuthenticationResult NoteStore::authenticateToSharedNote( + QString guid, + QString noteKey, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_authenticateToSharedNote_prepareParams(guid, noteKey, authenticationToken); + QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( + guid, + noteKey, + authenticationToken); QByteArray reply = askEvernote(m_url, params); return NoteStore_authenticateToSharedNote_readReply(reply); } -AsyncResult* NoteStore::authenticateToSharedNoteAsync(QString guid, QString noteKey, QString authenticationToken) +AsyncResult* NoteStore::authenticateToSharedNoteAsync( + QString guid, + QString noteKey, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_authenticateToSharedNote_prepareParams(guid, noteKey, authenticationToken); + QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( + guid, + noteKey, + authenticationToken); return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNote_readReplyAsync); } -QByteArray NoteStore_findRelated_prepareParams(QString authenticationToken, const RelatedQuery& query, const RelatedResultSpec& resultSpec) +QByteArray NoteStore_findRelated_prepareParams( + QString authenticationToken, + const RelatedQuery& query, + const RelatedResultSpec& resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("findRelated"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_findRelated_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("findRelated"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_findRelated_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("query"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("query"), + ThriftFieldType::T_STRUCT, + 2); writeRelatedQuery(w, query); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("resultSpec"), + ThriftFieldType::T_STRUCT, + 3); writeRelatedResultSpec(w, resultSpec); w.writeFieldEnd(); w.writeFieldStop(); @@ -8924,19 +10589,19 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findRelated")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -8944,9 +10609,9 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; RelatedResult v; readRelatedResult(r, v); @@ -8993,7 +10658,9 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("findRelated: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("findRelated: missing result")); } return result; } @@ -9003,35 +10670,57 @@ QVariant NoteStore_findRelated_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findRelated_readReply(reply)); } -RelatedResult NoteStore::findRelated(const RelatedQuery& query, const RelatedResultSpec& resultSpec, QString authenticationToken) +RelatedResult NoteStore::findRelated( + const RelatedQuery& query, + const RelatedResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findRelated_prepareParams(authenticationToken, query, resultSpec); + QByteArray params = NoteStore_findRelated_prepareParams( + authenticationToken, + query, + resultSpec); QByteArray reply = askEvernote(m_url, params); return NoteStore_findRelated_readReply(reply); } -AsyncResult* NoteStore::findRelatedAsync(const RelatedQuery& query, const RelatedResultSpec& resultSpec, QString authenticationToken) +AsyncResult* NoteStore::findRelatedAsync( + const RelatedQuery& query, + const RelatedResultSpec& resultSpec, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_findRelated_prepareParams(authenticationToken, query, resultSpec); + QByteArray params = NoteStore_findRelated_prepareParams( + authenticationToken, + query, + resultSpec); return new AsyncResult(m_url, params, NoteStore_findRelated_readReplyAsync); } -QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams(QString authenticationToken, const Note& note) +QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( + QString authenticationToken, + const Note& note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateNoteIfUsnMatches"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_updateNoteIfUsnMatches_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateNoteIfUsnMatches"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_updateNoteIfUsnMatches_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 2); writeNote(w, note); w.writeFieldEnd(); w.writeFieldStop(); @@ -9050,19 +10739,19 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNoteIfUsnMatches")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9070,9 +10759,9 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UpdateNoteIfUsnMatchesResult v; readUpdateNoteIfUsnMatchesResult(r, v); @@ -9119,7 +10808,9 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNoteIfUsnMatches: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("updateNoteIfUsnMatches: missing result")); } return result; } @@ -9129,35 +10820,53 @@ QVariant NoteStore_updateNoteIfUsnMatches_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNoteIfUsnMatches_readReply(reply)); } -UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches(const Note& note, QString authenticationToken) +UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( + authenticationToken, + note); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNoteIfUsnMatches_readReply(reply); } -AsyncResult* NoteStore::updateNoteIfUsnMatchesAsync(const Note& note, QString authenticationToken) +AsyncResult* NoteStore::updateNoteIfUsnMatchesAsync( + const Note& note, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams(authenticationToken, note); + QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( + authenticationToken, + note); return new AsyncResult(m_url, params, NoteStore_updateNoteIfUsnMatches_readReplyAsync); } -QByteArray NoteStore_manageNotebookShares_prepareParams(QString authenticationToken, const ManageNotebookSharesParameters& parameters) +QByteArray NoteStore_manageNotebookShares_prepareParams( + QString authenticationToken, + const ManageNotebookSharesParameters& parameters) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("manageNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_manageNotebookShares_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("manageNotebookShares"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_manageNotebookShares_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("parameters"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("parameters"), + ThriftFieldType::T_STRUCT, + 2); writeManageNotebookSharesParameters(w, parameters); w.writeFieldEnd(); w.writeFieldStop(); @@ -9176,19 +10885,19 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("manageNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9196,9 +10905,9 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ManageNotebookSharesResult v; readManageNotebookSharesResult(r, v); @@ -9245,7 +10954,9 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("manageNotebookShares: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("manageNotebookShares: missing result")); } return result; } @@ -9255,35 +10966,53 @@ QVariant NoteStore_manageNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_manageNotebookShares_readReply(reply)); } -ManageNotebookSharesResult NoteStore::manageNotebookShares(const ManageNotebookSharesParameters& parameters, QString authenticationToken) +ManageNotebookSharesResult NoteStore::manageNotebookShares( + const ManageNotebookSharesParameters& parameters, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_manageNotebookShares_prepareParams(authenticationToken, parameters); + QByteArray params = NoteStore_manageNotebookShares_prepareParams( + authenticationToken, + parameters); QByteArray reply = askEvernote(m_url, params); return NoteStore_manageNotebookShares_readReply(reply); } -AsyncResult* NoteStore::manageNotebookSharesAsync(const ManageNotebookSharesParameters& parameters, QString authenticationToken) +AsyncResult* NoteStore::manageNotebookSharesAsync( + const ManageNotebookSharesParameters& parameters, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_manageNotebookShares_prepareParams(authenticationToken, parameters); + QByteArray params = NoteStore_manageNotebookShares_prepareParams( + authenticationToken, + parameters); return new AsyncResult(m_url, params, NoteStore_manageNotebookShares_readReplyAsync); } -QByteArray NoteStore_getNotebookShares_prepareParams(QString authenticationToken, QString notebookGuid) +QByteArray NoteStore_getNotebookShares_prepareParams( + QString authenticationToken, + QString notebookGuid) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("NoteStore_getNotebookShares_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getNotebookShares"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("NoteStore_getNotebookShares_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(notebookGuid); w.writeFieldEnd(); w.writeFieldStop(); @@ -9302,19 +11031,19 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9322,9 +11051,9 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ShareRelationships v; readShareRelationships(r, v); @@ -9371,7 +11100,9 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getNotebookShares: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getNotebookShares: missing result")); } return result; } @@ -9381,38 +11112,60 @@ QVariant NoteStore_getNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNotebookShares_readReply(reply)); } -ShareRelationships NoteStore::getNotebookShares(QString notebookGuid, QString authenticationToken) +ShareRelationships NoteStore::getNotebookShares( + QString notebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNotebookShares_prepareParams(authenticationToken, notebookGuid); + QByteArray params = NoteStore_getNotebookShares_prepareParams( + authenticationToken, + notebookGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNotebookShares_readReply(reply); } -AsyncResult* NoteStore::getNotebookSharesAsync(QString notebookGuid, QString authenticationToken) +AsyncResult* NoteStore::getNotebookSharesAsync( + QString notebookGuid, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = NoteStore_getNotebookShares_prepareParams(authenticationToken, notebookGuid); + QByteArray params = NoteStore_getNotebookShares_prepareParams( + authenticationToken, + notebookGuid); return new AsyncResult(m_url, params, NoteStore_getNotebookShares_readReplyAsync); } -QByteArray UserStore_checkVersion_prepareParams(QString clientName, qint16 edamVersionMajor, qint16 edamVersionMinor) +QByteArray UserStore_checkVersion_prepareParams( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("checkVersion"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_checkVersion_pargs")); - w.writeFieldBegin(QStringLiteral("clientName"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("checkVersion"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_checkVersion_pargs")); + w.writeFieldBegin( + QStringLiteral("clientName"), + ThriftFieldType::T_STRING, + 1); w.writeString(clientName); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("edamVersionMajor"), ThriftFieldType::T_I16, 2); + w.writeFieldBegin( + QStringLiteral("edamVersionMajor"), + ThriftFieldType::T_I16, + 2); w.writeI16(edamVersionMajor); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("edamVersionMinor"), ThriftFieldType::T_I16, 3); + w.writeFieldBegin( + QStringLiteral("edamVersionMinor"), + ThriftFieldType::T_I16, + 3); w.writeI16(edamVersionMinor); w.writeFieldEnd(); w.writeFieldStop(); @@ -9431,19 +11184,19 @@ bool UserStore_checkVersion_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("checkVersion")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9451,9 +11204,9 @@ bool UserStore_checkVersion_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_BOOL) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_BOOL) { resultIsSet = true; bool v; r.readBool(v); @@ -9470,7 +11223,9 @@ bool UserStore_checkVersion_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("checkVersion: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("checkVersion: missing result")); } return result; } @@ -9480,26 +11235,44 @@ QVariant UserStore_checkVersion_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_checkVersion_readReply(reply)); } -bool UserStore::checkVersion(QString clientName, qint16 edamVersionMajor, qint16 edamVersionMinor) +bool UserStore::checkVersion( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor) { - QByteArray params = UserStore_checkVersion_prepareParams(clientName, edamVersionMajor, edamVersionMinor); + QByteArray params = UserStore_checkVersion_prepareParams( + clientName, + edamVersionMajor, + edamVersionMinor); QByteArray reply = askEvernote(m_url, params); return UserStore_checkVersion_readReply(reply); } -AsyncResult* UserStore::checkVersionAsync(QString clientName, qint16 edamVersionMajor, qint16 edamVersionMinor) +AsyncResult* UserStore::checkVersionAsync( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor) { - QByteArray params = UserStore_checkVersion_prepareParams(clientName, edamVersionMajor, edamVersionMinor); + QByteArray params = UserStore_checkVersion_prepareParams( + clientName, + edamVersionMajor, + edamVersionMinor); return new AsyncResult(m_url, params, UserStore_checkVersion_readReplyAsync); } -QByteArray UserStore_getBootstrapInfo_prepareParams(QString locale) +QByteArray UserStore_getBootstrapInfo_prepareParams( + QString locale) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getBootstrapInfo"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_getBootstrapInfo_pargs")); - w.writeFieldBegin(QStringLiteral("locale"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getBootstrapInfo"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_getBootstrapInfo_pargs")); + w.writeFieldBegin( + QStringLiteral("locale"), + ThriftFieldType::T_STRING, + 1); w.writeString(locale); w.writeFieldEnd(); w.writeFieldStop(); @@ -9518,19 +11291,19 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getBootstrapInfo")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9538,9 +11311,9 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; BootstrapInfo v; readBootstrapInfo(r, v); @@ -9557,7 +11330,9 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getBootstrapInfo: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getBootstrapInfo: missing result")); } return result; } @@ -9567,44 +11342,78 @@ QVariant UserStore_getBootstrapInfo_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getBootstrapInfo_readReply(reply)); } -BootstrapInfo UserStore::getBootstrapInfo(QString locale) +BootstrapInfo UserStore::getBootstrapInfo( + QString locale) { - QByteArray params = UserStore_getBootstrapInfo_prepareParams(locale); + QByteArray params = UserStore_getBootstrapInfo_prepareParams( + locale); QByteArray reply = askEvernote(m_url, params); return UserStore_getBootstrapInfo_readReply(reply); } -AsyncResult* UserStore::getBootstrapInfoAsync(QString locale) +AsyncResult* UserStore::getBootstrapInfoAsync( + QString locale) { - QByteArray params = UserStore_getBootstrapInfo_prepareParams(locale); + QByteArray params = UserStore_getBootstrapInfo_prepareParams( + locale); return new AsyncResult(m_url, params, UserStore_getBootstrapInfo_readReplyAsync); } -QByteArray UserStore_authenticateLongSession_prepareParams(QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor) +QByteArray UserStore_authenticateLongSession_prepareParams( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("authenticateLongSession"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_authenticateLongSession_pargs")); - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("authenticateLongSession"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_authenticateLongSession_pargs")); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 1); w.writeString(username); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("password"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("password"), + ThriftFieldType::T_STRING, + 2); w.writeString(password); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("consumerKey"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("consumerKey"), + ThriftFieldType::T_STRING, + 3); w.writeString(consumerKey); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("consumerSecret"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("consumerSecret"), + ThriftFieldType::T_STRING, + 4); w.writeString(consumerSecret); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("deviceIdentifier"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("deviceIdentifier"), + ThriftFieldType::T_STRING, + 5); w.writeString(deviceIdentifier); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("deviceDescription"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("deviceDescription"), + ThriftFieldType::T_STRING, + 6); w.writeString(deviceDescription); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("supportsTwoFactor"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("supportsTwoFactor"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(supportsTwoFactor); w.writeFieldEnd(); w.writeFieldStop(); @@ -9623,19 +11432,19 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateLongSession")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9643,9 +11452,9 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); @@ -9682,7 +11491,9 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateLongSession: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("authenticateLongSession: missing result")); } return result; } @@ -9692,35 +11503,81 @@ QVariant UserStore_authenticateLongSession_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_authenticateLongSession_readReply(reply)); } -AuthenticationResult UserStore::authenticateLongSession(QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor) -{ - QByteArray params = UserStore_authenticateLongSession_prepareParams(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor); +AuthenticationResult UserStore::authenticateLongSession( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor) +{ + QByteArray params = UserStore_authenticateLongSession_prepareParams( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor); QByteArray reply = askEvernote(m_url, params); return UserStore_authenticateLongSession_readReply(reply); } -AsyncResult* UserStore::authenticateLongSessionAsync(QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor) -{ - QByteArray params = UserStore_authenticateLongSession_prepareParams(username, password, consumerKey, consumerSecret, deviceIdentifier, deviceDescription, supportsTwoFactor); +AsyncResult* UserStore::authenticateLongSessionAsync( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor) +{ + QByteArray params = UserStore_authenticateLongSession_prepareParams( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor); return new AsyncResult(m_url, params, UserStore_authenticateLongSession_readReplyAsync); } -QByteArray UserStore_completeTwoFactorAuthentication_prepareParams(QString authenticationToken, QString oneTimeCode, QString deviceIdentifier, QString deviceDescription) +QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( + QString authenticationToken, + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("completeTwoFactorAuthentication"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_completeTwoFactorAuthentication_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("completeTwoFactorAuthentication"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_completeTwoFactorAuthentication_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("oneTimeCode"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("oneTimeCode"), + ThriftFieldType::T_STRING, + 2); w.writeString(oneTimeCode); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("deviceIdentifier"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("deviceIdentifier"), + ThriftFieldType::T_STRING, + 3); w.writeString(deviceIdentifier); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("deviceDescription"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("deviceDescription"), + ThriftFieldType::T_STRING, + 4); w.writeString(deviceDescription); w.writeFieldEnd(); w.writeFieldStop(); @@ -9739,19 +11596,19 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("completeTwoFactorAuthentication")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9759,9 +11616,9 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); @@ -9798,7 +11655,9 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("completeTwoFactorAuthentication: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("completeTwoFactorAuthentication: missing result")); } return result; } @@ -9808,32 +11667,54 @@ QVariant UserStore_completeTwoFactorAuthentication_readReplyAsync(QByteArray rep return QVariant::fromValue(UserStore_completeTwoFactorAuthentication_readReply(reply)); } -AuthenticationResult UserStore::completeTwoFactorAuthentication(QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken) +AuthenticationResult UserStore::completeTwoFactorAuthentication( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription); + QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( + authenticationToken, + oneTimeCode, + deviceIdentifier, + deviceDescription); QByteArray reply = askEvernote(m_url, params); return UserStore_completeTwoFactorAuthentication_readReply(reply); } -AsyncResult* UserStore::completeTwoFactorAuthenticationAsync(QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, QString authenticationToken) +AsyncResult* UserStore::completeTwoFactorAuthenticationAsync( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams(authenticationToken, oneTimeCode, deviceIdentifier, deviceDescription); + QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( + authenticationToken, + oneTimeCode, + deviceIdentifier, + deviceDescription); return new AsyncResult(m_url, params, UserStore_completeTwoFactorAuthentication_readReplyAsync); } -QByteArray UserStore_revokeLongSession_prepareParams(QString authenticationToken) +QByteArray UserStore_revokeLongSession_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("revokeLongSession"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_revokeLongSession_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("revokeLongSession"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_revokeLongSession_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -9850,19 +11731,19 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("revokeLongSession")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9870,7 +11751,7 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -9906,32 +11787,42 @@ QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) return QVariant(); } -void UserStore::revokeLongSession(QString authenticationToken) +void UserStore::revokeLongSession( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_revokeLongSession_prepareParams(authenticationToken); + QByteArray params = UserStore_revokeLongSession_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); UserStore_revokeLongSession_readReply(reply); } -AsyncResult* UserStore::revokeLongSessionAsync(QString authenticationToken) +AsyncResult* UserStore::revokeLongSessionAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_revokeLongSession_prepareParams(authenticationToken); + QByteArray params = UserStore_revokeLongSession_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, UserStore_revokeLongSession_readReplyAsync); } -QByteArray UserStore_authenticateToBusiness_prepareParams(QString authenticationToken) +QByteArray UserStore_authenticateToBusiness_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("authenticateToBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_authenticateToBusiness_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_authenticateToBusiness_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -9950,19 +11841,19 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -9970,9 +11861,9 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); @@ -10009,7 +11900,9 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToBusiness: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("authenticateToBusiness: missing result")); } return result; } @@ -10019,32 +11912,42 @@ QVariant UserStore_authenticateToBusiness_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_authenticateToBusiness_readReply(reply)); } -AuthenticationResult UserStore::authenticateToBusiness(QString authenticationToken) +AuthenticationResult UserStore::authenticateToBusiness( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_authenticateToBusiness_prepareParams(authenticationToken); + QByteArray params = UserStore_authenticateToBusiness_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return UserStore_authenticateToBusiness_readReply(reply); } -AsyncResult* UserStore::authenticateToBusinessAsync(QString authenticationToken) +AsyncResult* UserStore::authenticateToBusinessAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_authenticateToBusiness_prepareParams(authenticationToken); + QByteArray params = UserStore_authenticateToBusiness_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, UserStore_authenticateToBusiness_readReplyAsync); } -QByteArray UserStore_getUser_prepareParams(QString authenticationToken) +QByteArray UserStore_getUser_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getUser"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_getUser_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getUser"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_getUser_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -10063,19 +11966,19 @@ User UserStore_getUser_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getUser")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10083,9 +11986,9 @@ User UserStore_getUser_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; User v; readUser(r, v); @@ -10122,7 +12025,9 @@ User UserStore_getUser_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getUser: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getUser: missing result")); } return result; } @@ -10132,32 +12037,42 @@ QVariant UserStore_getUser_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getUser_readReply(reply)); } -User UserStore::getUser(QString authenticationToken) +User UserStore::getUser( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_getUser_prepareParams(authenticationToken); + QByteArray params = UserStore_getUser_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return UserStore_getUser_readReply(reply); } -AsyncResult* UserStore::getUserAsync(QString authenticationToken) +AsyncResult* UserStore::getUserAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_getUser_prepareParams(authenticationToken); + QByteArray params = UserStore_getUser_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, UserStore_getUser_readReplyAsync); } -QByteArray UserStore_getPublicUserInfo_prepareParams(QString username) +QByteArray UserStore_getPublicUserInfo_prepareParams( + QString username) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getPublicUserInfo"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_getPublicUserInfo_pargs")); - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getPublicUserInfo"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_getPublicUserInfo_pargs")); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 1); w.writeString(username); w.writeFieldEnd(); w.writeFieldStop(); @@ -10176,19 +12091,19 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getPublicUserInfo")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10196,9 +12111,9 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; PublicUserInfo v; readPublicUserInfo(r, v); @@ -10245,7 +12160,9 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getPublicUserInfo: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getPublicUserInfo: missing result")); } return result; } @@ -10255,26 +12172,36 @@ QVariant UserStore_getPublicUserInfo_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getPublicUserInfo_readReply(reply)); } -PublicUserInfo UserStore::getPublicUserInfo(QString username) +PublicUserInfo UserStore::getPublicUserInfo( + QString username) { - QByteArray params = UserStore_getPublicUserInfo_prepareParams(username); + QByteArray params = UserStore_getPublicUserInfo_prepareParams( + username); QByteArray reply = askEvernote(m_url, params); return UserStore_getPublicUserInfo_readReply(reply); } -AsyncResult* UserStore::getPublicUserInfoAsync(QString username) +AsyncResult* UserStore::getPublicUserInfoAsync( + QString username) { - QByteArray params = UserStore_getPublicUserInfo_prepareParams(username); + QByteArray params = UserStore_getPublicUserInfo_prepareParams( + username); return new AsyncResult(m_url, params, UserStore_getPublicUserInfo_readReplyAsync); } -QByteArray UserStore_getUserUrls_prepareParams(QString authenticationToken) +QByteArray UserStore_getUserUrls_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getUserUrls"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_getUserUrls_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("getUserUrls"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_getUserUrls_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -10293,19 +12220,19 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getUserUrls")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10313,9 +12240,9 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UserUrls v; readUserUrls(r, v); @@ -10352,7 +12279,9 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getUserUrls: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getUserUrls: missing result")); } return result; } @@ -10362,35 +12291,49 @@ QVariant UserStore_getUserUrls_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getUserUrls_readReply(reply)); } -UserUrls UserStore::getUserUrls(QString authenticationToken) +UserUrls UserStore::getUserUrls( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_getUserUrls_prepareParams(authenticationToken); + QByteArray params = UserStore_getUserUrls_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return UserStore_getUserUrls_readReply(reply); } -AsyncResult* UserStore::getUserUrlsAsync(QString authenticationToken) +AsyncResult* UserStore::getUserUrlsAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_getUserUrls_prepareParams(authenticationToken); + QByteArray params = UserStore_getUserUrls_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, UserStore_getUserUrls_readReplyAsync); } -QByteArray UserStore_inviteToBusiness_prepareParams(QString authenticationToken, QString emailAddress) +QByteArray UserStore_inviteToBusiness_prepareParams( + QString authenticationToken, + QString emailAddress) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("inviteToBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_inviteToBusiness_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("inviteToBusiness"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_inviteToBusiness_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("emailAddress"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("emailAddress"), + ThriftFieldType::T_STRING, + 2); w.writeString(emailAddress); w.writeFieldEnd(); w.writeFieldStop(); @@ -10407,19 +12350,19 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("inviteToBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10427,7 +12370,7 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -10463,35 +12406,53 @@ QVariant UserStore_inviteToBusiness_readReplyAsync(QByteArray reply) return QVariant(); } -void UserStore::inviteToBusiness(QString emailAddress, QString authenticationToken) +void UserStore::inviteToBusiness( + QString emailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_inviteToBusiness_prepareParams(authenticationToken, emailAddress); + QByteArray params = UserStore_inviteToBusiness_prepareParams( + authenticationToken, + emailAddress); QByteArray reply = askEvernote(m_url, params); UserStore_inviteToBusiness_readReply(reply); } -AsyncResult* UserStore::inviteToBusinessAsync(QString emailAddress, QString authenticationToken) +AsyncResult* UserStore::inviteToBusinessAsync( + QString emailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_inviteToBusiness_prepareParams(authenticationToken, emailAddress); + QByteArray params = UserStore_inviteToBusiness_prepareParams( + authenticationToken, + emailAddress); return new AsyncResult(m_url, params, UserStore_inviteToBusiness_readReplyAsync); } -QByteArray UserStore_removeFromBusiness_prepareParams(QString authenticationToken, QString emailAddress) +QByteArray UserStore_removeFromBusiness_prepareParams( + QString authenticationToken, + QString emailAddress) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("removeFromBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_removeFromBusiness_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("removeFromBusiness"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_removeFromBusiness_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("emailAddress"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("emailAddress"), + ThriftFieldType::T_STRING, + 2); w.writeString(emailAddress); w.writeFieldEnd(); w.writeFieldStop(); @@ -10508,19 +12469,19 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("removeFromBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10528,7 +12489,7 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -10574,38 +12535,60 @@ QVariant UserStore_removeFromBusiness_readReplyAsync(QByteArray reply) return QVariant(); } -void UserStore::removeFromBusiness(QString emailAddress, QString authenticationToken) +void UserStore::removeFromBusiness( + QString emailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_removeFromBusiness_prepareParams(authenticationToken, emailAddress); + QByteArray params = UserStore_removeFromBusiness_prepareParams( + authenticationToken, + emailAddress); QByteArray reply = askEvernote(m_url, params); UserStore_removeFromBusiness_readReply(reply); } -AsyncResult* UserStore::removeFromBusinessAsync(QString emailAddress, QString authenticationToken) +AsyncResult* UserStore::removeFromBusinessAsync( + QString emailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_removeFromBusiness_prepareParams(authenticationToken, emailAddress); + QByteArray params = UserStore_removeFromBusiness_prepareParams( + authenticationToken, + emailAddress); return new AsyncResult(m_url, params, UserStore_removeFromBusiness_readReplyAsync); } -QByteArray UserStore_updateBusinessUserIdentifier_prepareParams(QString authenticationToken, QString oldEmailAddress, QString newEmailAddress) +QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( + QString authenticationToken, + QString oldEmailAddress, + QString newEmailAddress) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("updateBusinessUserIdentifier"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_updateBusinessUserIdentifier_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("updateBusinessUserIdentifier"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_updateBusinessUserIdentifier_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("oldEmailAddress"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("oldEmailAddress"), + ThriftFieldType::T_STRING, + 2); w.writeString(oldEmailAddress); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("newEmailAddress"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("newEmailAddress"), + ThriftFieldType::T_STRING, + 3); w.writeString(newEmailAddress); w.writeFieldEnd(); w.writeFieldStop(); @@ -10622,19 +12605,19 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateBusinessUserIdentifier")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10642,7 +12625,7 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; + if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; @@ -10688,32 +12671,50 @@ QVariant UserStore_updateBusinessUserIdentifier_readReplyAsync(QByteArray reply) return QVariant(); } -void UserStore::updateBusinessUserIdentifier(QString oldEmailAddress, QString newEmailAddress, QString authenticationToken) +void UserStore::updateBusinessUserIdentifier( + QString oldEmailAddress, + QString newEmailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams(authenticationToken, oldEmailAddress, newEmailAddress); + QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( + authenticationToken, + oldEmailAddress, + newEmailAddress); QByteArray reply = askEvernote(m_url, params); UserStore_updateBusinessUserIdentifier_readReply(reply); } -AsyncResult* UserStore::updateBusinessUserIdentifierAsync(QString oldEmailAddress, QString newEmailAddress, QString authenticationToken) +AsyncResult* UserStore::updateBusinessUserIdentifierAsync( + QString oldEmailAddress, + QString newEmailAddress, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams(authenticationToken, oldEmailAddress, newEmailAddress); + QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( + authenticationToken, + oldEmailAddress, + newEmailAddress); return new AsyncResult(m_url, params, UserStore_updateBusinessUserIdentifier_readReplyAsync); } -QByteArray UserStore_listBusinessUsers_prepareParams(QString authenticationToken) +QByteArray UserStore_listBusinessUsers_prepareParams( + QString authenticationToken) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listBusinessUsers"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_listBusinessUsers_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listBusinessUsers"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_listBusinessUsers_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); w.writeFieldStop(); @@ -10722,29 +12723,29 @@ QByteArray UserStore_listBusinessUsers_prepareParams(QString authenticationToken return w.buffer(); } -QList< UserProfile > UserStore_listBusinessUsers_readReply(QByteArray reply) +QList UserStore_listBusinessUsers_readReply(QByteArray reply) { bool resultIsSet = false; - QList< UserProfile > result = QList< UserProfile >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listBusinessUsers")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10752,11 +12753,11 @@ QList< UserProfile > UserStore_listBusinessUsers_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< UserProfile > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -10801,7 +12802,9 @@ QList< UserProfile > UserStore_listBusinessUsers_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listBusinessUsers: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listBusinessUsers: missing result")); } return result; } @@ -10811,35 +12814,49 @@ QVariant UserStore_listBusinessUsers_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_listBusinessUsers_readReply(reply)); } -QList< UserProfile > UserStore::listBusinessUsers(QString authenticationToken) +QList UserStore::listBusinessUsers( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_listBusinessUsers_prepareParams(authenticationToken); + QByteArray params = UserStore_listBusinessUsers_prepareParams( + authenticationToken); QByteArray reply = askEvernote(m_url, params); return UserStore_listBusinessUsers_readReply(reply); } -AsyncResult* UserStore::listBusinessUsersAsync(QString authenticationToken) +AsyncResult* UserStore::listBusinessUsersAsync( + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_listBusinessUsers_prepareParams(authenticationToken); + QByteArray params = UserStore_listBusinessUsers_prepareParams( + authenticationToken); return new AsyncResult(m_url, params, UserStore_listBusinessUsers_readReplyAsync); } -QByteArray UserStore_listBusinessInvitations_prepareParams(QString authenticationToken, bool includeRequestedInvitations) +QByteArray UserStore_listBusinessInvitations_prepareParams( + QString authenticationToken, + bool includeRequestedInvitations) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("listBusinessInvitations"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_listBusinessInvitations_pargs")); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + w.writeMessageBegin( + QStringLiteral("listBusinessInvitations"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_listBusinessInvitations_pargs")); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 1); w.writeString(authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("includeRequestedInvitations"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("includeRequestedInvitations"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(includeRequestedInvitations); w.writeFieldEnd(); w.writeFieldStop(); @@ -10848,29 +12865,29 @@ QByteArray UserStore_listBusinessInvitations_prepareParams(QString authenticatio return w.buffer(); } -QList< BusinessInvitation > UserStore_listBusinessInvitations_readReply(QByteArray reply) +QList UserStore_listBusinessInvitations_readReply(QByteArray reply) { bool resultIsSet = false; - QList< BusinessInvitation > result = QList< BusinessInvitation >(); + QList result = QList(); ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listBusinessInvitations")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -10878,11 +12895,11 @@ QList< BusinessInvitation > UserStore_listBusinessInvitations_readReply(QByteArr r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_LIST) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; - QList< BusinessInvitation > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -10927,7 +12944,9 @@ QList< BusinessInvitation > UserStore_listBusinessInvitations_readReply(QByteArr r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("listBusinessInvitations: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("listBusinessInvitations: missing result")); } return result; } @@ -10937,32 +12956,46 @@ QVariant UserStore_listBusinessInvitations_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_listBusinessInvitations_readReply(reply)); } -QList< BusinessInvitation > UserStore::listBusinessInvitations(bool includeRequestedInvitations, QString authenticationToken) +QList UserStore::listBusinessInvitations( + bool includeRequestedInvitations, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_listBusinessInvitations_prepareParams(authenticationToken, includeRequestedInvitations); + QByteArray params = UserStore_listBusinessInvitations_prepareParams( + authenticationToken, + includeRequestedInvitations); QByteArray reply = askEvernote(m_url, params); return UserStore_listBusinessInvitations_readReply(reply); } -AsyncResult* UserStore::listBusinessInvitationsAsync(bool includeRequestedInvitations, QString authenticationToken) +AsyncResult* UserStore::listBusinessInvitationsAsync( + bool includeRequestedInvitations, + QString authenticationToken) { if (authenticationToken.isEmpty()) { authenticationToken = m_authenticationToken; } - QByteArray params = UserStore_listBusinessInvitations_prepareParams(authenticationToken, includeRequestedInvitations); + QByteArray params = UserStore_listBusinessInvitations_prepareParams( + authenticationToken, + includeRequestedInvitations); return new AsyncResult(m_url, params, UserStore_listBusinessInvitations_readReplyAsync); } -QByteArray UserStore_getAccountLimits_prepareParams(ServiceLevel serviceLevel) +QByteArray UserStore_getAccountLimits_prepareParams( + ServiceLevel serviceLevel) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; - w.writeMessageBegin(QStringLiteral("getAccountLimits"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin(QStringLiteral("UserStore_getAccountLimits_pargs")); - w.writeFieldBegin(QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 1); + w.writeMessageBegin( + QStringLiteral("getAccountLimits"), ThriftMessageType::T_CALL, cseqid); + w.writeStructBegin( + QStringLiteral("UserStore_getAccountLimits_pargs")); + w.writeFieldBegin( + QStringLiteral("serviceLevel"), + ThriftFieldType::T_I32, + 1); w.writeI32(static_cast(serviceLevel)); w.writeFieldEnd(); w.writeFieldStop(); @@ -10981,19 +13014,19 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) ThriftMessageType::type mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); - throw e; + ThriftException e = readThriftException(r); + r.readMessageEnd(); + throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getAccountLimits")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); - throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); + r.skip(ThriftFieldType::T_STRUCT); + r.readMessageEnd(); + throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType::type fieldType; @@ -11001,9 +13034,9 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) r.readStructBegin(fname); while(true) { r.readFieldBegin(fname, fieldType, fieldId); - if(fieldType == ThriftFieldType::T_STOP) break; - if(fieldId == 0) { - if(fieldType == ThriftFieldType::T_STRUCT) { + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AccountLimits v; readAccountLimits(r, v); @@ -11030,7 +13063,9 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) r.readStructEnd(); r.readMessageEnd(); if (!resultIsSet) { - throw ThriftException(ThriftException::Type::MISSING_RESULT, QStringLiteral("getAccountLimits: missing result")); + throw ThriftException( + ThriftException::Type::MISSING_RESULT, + QStringLiteral("getAccountLimits: missing result")); } return result; } @@ -11040,16 +13075,20 @@ QVariant UserStore_getAccountLimits_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getAccountLimits_readReply(reply)); } -AccountLimits UserStore::getAccountLimits(ServiceLevel serviceLevel) +AccountLimits UserStore::getAccountLimits( + ServiceLevel serviceLevel) { - QByteArray params = UserStore_getAccountLimits_prepareParams(serviceLevel); + QByteArray params = UserStore_getAccountLimits_prepareParams( + serviceLevel); QByteArray reply = askEvernote(m_url, params); return UserStore_getAccountLimits_readReply(reply); } -AsyncResult* UserStore::getAccountLimitsAsync(ServiceLevel serviceLevel) +AsyncResult* UserStore::getAccountLimitsAsync( + ServiceLevel serviceLevel) { - QByteArray params = UserStore_getAccountLimits_prepareParams(serviceLevel); + QByteArray params = UserStore_getAccountLimits_prepareParams( + serviceLevel); return new AsyncResult(m_url, params, UserStore_getAccountLimits_readReplyAsync); } diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index a2ab29b9..621cad96 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API @@ -313,27 +314,45 @@ void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e void writeSyncState(ThriftBinaryBufferWriter & w, const SyncState & s) { w.writeStructBegin(QStringLiteral("SyncState")); - w.writeFieldBegin(QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("currentTime"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.currentTime); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("fullSyncBefore"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("fullSyncBefore"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.fullSyncBefore); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("updateCount"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.updateCount); w.writeFieldEnd(); if (s.uploaded.isSet()) { - w.writeFieldBegin(QStringLiteral("uploaded"), ThriftFieldType::T_I64, 4); + w.writeFieldBegin( + QStringLiteral("uploaded"), + ThriftFieldType::T_I64, + 4); w.writeI64(s.uploaded.ref()); w.writeFieldEnd(); } if (s.userLastUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("userLastUpdated"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("userLastUpdated"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.userLastUpdated.ref()); w.writeFieldEnd(); } if (s.userMaxMessageEventId.isSet()) { - w.writeFieldBegin(QStringLiteral("userMaxMessageEventId"), ThriftFieldType::T_I64, 6); + w.writeFieldBegin( + QStringLiteral("userMaxMessageEventId"), + ThriftFieldType::T_I64, + 6); w.writeI64(s.userMaxMessageEventId.ref()); w.writeFieldEnd(); } @@ -423,19 +442,31 @@ void readSyncState(ThriftBinaryBufferReader & r, SyncState & s) { void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeStructBegin(QStringLiteral("SyncChunk")); - w.writeFieldBegin(QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("currentTime"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.currentTime); w.writeFieldEnd(); if (s.chunkHighUSN.isSet()) { - w.writeFieldBegin(QStringLiteral("chunkHighUSN"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("chunkHighUSN"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.chunkHighUSN.ref()); w.writeFieldEnd(); } - w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("updateCount"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.updateCount); w.writeFieldEnd(); if (s.notes.isSet()) { - w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("notes"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); for(const auto & value: qAsConst(s.notes.ref())) { writeNote(w, value); @@ -444,7 +475,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.notebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("notebooks"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); for(const auto & value: qAsConst(s.notebooks.ref())) { writeNotebook(w, value); @@ -453,7 +487,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.tags.isSet()) { - w.writeFieldBegin(QStringLiteral("tags"), ThriftFieldType::T_LIST, 6); + w.writeFieldBegin( + QStringLiteral("tags"), + ThriftFieldType::T_LIST, + 6); w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); for(const auto & value: qAsConst(s.tags.ref())) { writeTag(w, value); @@ -462,7 +499,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.searches.isSet()) { - w.writeFieldBegin(QStringLiteral("searches"), ThriftFieldType::T_LIST, 7); + w.writeFieldBegin( + QStringLiteral("searches"), + ThriftFieldType::T_LIST, + 7); w.writeListBegin(ThriftFieldType::T_STRUCT, s.searches.ref().length()); for(const auto & value: qAsConst(s.searches.ref())) { writeSavedSearch(w, value); @@ -471,7 +511,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.resources.isSet()) { - w.writeFieldBegin(QStringLiteral("resources"), ThriftFieldType::T_LIST, 8); + w.writeFieldBegin( + QStringLiteral("resources"), + ThriftFieldType::T_LIST, + 8); w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); for(const auto & value: qAsConst(s.resources.ref())) { writeResource(w, value); @@ -480,7 +523,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.expungedNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("expungedNotes"), ThriftFieldType::T_LIST, 9); + w.writeFieldBegin( + QStringLiteral("expungedNotes"), + ThriftFieldType::T_LIST, + 9); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotes.ref().length()); for(const auto & value: qAsConst(s.expungedNotes.ref())) { w.writeString(value); @@ -489,7 +535,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.expungedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("expungedNotebooks"), ThriftFieldType::T_LIST, 10); + w.writeFieldBegin( + QStringLiteral("expungedNotebooks"), + ThriftFieldType::T_LIST, + 10); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotebooks.ref().length()); for(const auto & value: qAsConst(s.expungedNotebooks.ref())) { w.writeString(value); @@ -498,7 +547,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.expungedTags.isSet()) { - w.writeFieldBegin(QStringLiteral("expungedTags"), ThriftFieldType::T_LIST, 11); + w.writeFieldBegin( + QStringLiteral("expungedTags"), + ThriftFieldType::T_LIST, + 11); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedTags.ref().length()); for(const auto & value: qAsConst(s.expungedTags.ref())) { w.writeString(value); @@ -507,7 +559,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.expungedSearches.isSet()) { - w.writeFieldBegin(QStringLiteral("expungedSearches"), ThriftFieldType::T_LIST, 12); + w.writeFieldBegin( + QStringLiteral("expungedSearches"), + ThriftFieldType::T_LIST, + 12); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedSearches.ref().length()); for(const auto & value: qAsConst(s.expungedSearches.ref())) { w.writeString(value); @@ -516,7 +571,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.linkedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("linkedNotebooks"), ThriftFieldType::T_LIST, 13); + w.writeFieldBegin( + QStringLiteral("linkedNotebooks"), + ThriftFieldType::T_LIST, + 13); w.writeListBegin(ThriftFieldType::T_STRUCT, s.linkedNotebooks.ref().length()); for(const auto & value: qAsConst(s.linkedNotebooks.ref())) { writeLinkedNotebook(w, value); @@ -525,7 +583,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeFieldEnd(); } if (s.expungedLinkedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("expungedLinkedNotebooks"), ThriftFieldType::T_LIST, 14); + w.writeFieldBegin( + QStringLiteral("expungedLinkedNotebooks"), + ThriftFieldType::T_LIST, + 14); w.writeListBegin(ThriftFieldType::T_STRING, s.expungedLinkedNotebooks.ref().length()); for(const auto & value: qAsConst(s.expungedLinkedNotebooks.ref())) { w.writeString(value); @@ -579,7 +640,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Note > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -598,7 +659,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Notebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -617,7 +678,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Tag > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -636,7 +697,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_LIST) { - QList< SavedSearch > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -655,7 +716,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Resource > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -674,7 +735,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -693,7 +754,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -712,7 +773,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -731,7 +792,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -750,7 +811,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { - QList< LinkedNotebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -769,7 +830,7 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -799,82 +860,130 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & s) { w.writeStructBegin(QStringLiteral("SyncChunkFilter")); if (s.includeNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNotes"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("includeNotes"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.includeNotes.ref()); w.writeFieldEnd(); } if (s.includeNoteResources.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNoteResources"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("includeNoteResources"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.includeNoteResources.ref()); w.writeFieldEnd(); } if (s.includeNoteAttributes.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNoteAttributes"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("includeNoteAttributes"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.includeNoteAttributes.ref()); w.writeFieldEnd(); } if (s.includeNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNotebooks"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("includeNotebooks"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.includeNotebooks.ref()); w.writeFieldEnd(); } if (s.includeTags.isSet()) { - w.writeFieldBegin(QStringLiteral("includeTags"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("includeTags"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.includeTags.ref()); w.writeFieldEnd(); } if (s.includeSearches.isSet()) { - w.writeFieldBegin(QStringLiteral("includeSearches"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("includeSearches"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.includeSearches.ref()); w.writeFieldEnd(); } if (s.includeResources.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResources"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("includeResources"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.includeResources.ref()); w.writeFieldEnd(); } if (s.includeLinkedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includeLinkedNotebooks"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("includeLinkedNotebooks"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.includeLinkedNotebooks.ref()); w.writeFieldEnd(); } if (s.includeExpunged.isSet()) { - w.writeFieldBegin(QStringLiteral("includeExpunged"), ThriftFieldType::T_BOOL, 9); + w.writeFieldBegin( + QStringLiteral("includeExpunged"), + ThriftFieldType::T_BOOL, + 9); w.writeBool(s.includeExpunged.ref()); w.writeFieldEnd(); } if (s.includeNoteApplicationDataFullMap.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNoteApplicationDataFullMap"), ThriftFieldType::T_BOOL, 10); + w.writeFieldBegin( + QStringLiteral("includeNoteApplicationDataFullMap"), + ThriftFieldType::T_BOOL, + 10); w.writeBool(s.includeNoteApplicationDataFullMap.ref()); w.writeFieldEnd(); } if (s.includeResourceApplicationDataFullMap.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 12); + w.writeFieldBegin( + QStringLiteral("includeResourceApplicationDataFullMap"), + ThriftFieldType::T_BOOL, + 12); w.writeBool(s.includeResourceApplicationDataFullMap.ref()); w.writeFieldEnd(); } if (s.includeNoteResourceApplicationDataFullMap.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNoteResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 13); + w.writeFieldBegin( + QStringLiteral("includeNoteResourceApplicationDataFullMap"), + ThriftFieldType::T_BOOL, + 13); w.writeBool(s.includeNoteResourceApplicationDataFullMap.ref()); w.writeFieldEnd(); } if (s.includeSharedNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 17); + w.writeFieldBegin( + QStringLiteral("includeSharedNotes"), + ThriftFieldType::T_BOOL, + 17); w.writeBool(s.includeSharedNotes.ref()); w.writeFieldEnd(); } if (s.omitSharedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("omitSharedNotebooks"), ThriftFieldType::T_BOOL, 16); + w.writeFieldBegin( + QStringLiteral("omitSharedNotebooks"), + ThriftFieldType::T_BOOL, + 16); w.writeBool(s.omitSharedNotebooks.ref()); w.writeFieldEnd(); } if (s.requireNoteContentClass.isSet()) { - w.writeFieldBegin(QStringLiteral("requireNoteContentClass"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("requireNoteContentClass"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.requireNoteContentClass.ref()); w.writeFieldEnd(); } if (s.notebookGuids.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuids"), ThriftFieldType::T_SET, 15); + w.writeFieldBegin( + QStringLiteral("notebookGuids"), + ThriftFieldType::T_SET, + 15); w.writeSetBegin(ThriftFieldType::T_STRING, s.notebookGuids.ref().count()); for(const auto & value: qAsConst(s.notebookGuids.ref())) { w.writeString(value); @@ -1032,7 +1141,7 @@ void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_SET) { - QSet< QString > v; + QSet v; qint32 size; ThriftFieldType::type elemType; r.readSetBegin(elemType, size); @@ -1060,27 +1169,42 @@ void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeStructBegin(QStringLiteral("NoteFilter")); if (s.order.isSet()) { - w.writeFieldBegin(QStringLiteral("order"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("order"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.order.ref()); w.writeFieldEnd(); } if (s.ascending.isSet()) { - w.writeFieldBegin(QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("ascending"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.ascending.ref()); w.writeFieldEnd(); } if (s.words.isSet()) { - w.writeFieldBegin(QStringLiteral("words"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("words"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.words.ref()); w.writeFieldEnd(); } if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.tagGuids.isSet()) { - w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("tagGuids"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { w.writeString(value); @@ -1089,42 +1213,66 @@ void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeFieldEnd(); } if (s.timeZone.isSet()) { - w.writeFieldBegin(QStringLiteral("timeZone"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("timeZone"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.timeZone.ref()); w.writeFieldEnd(); } if (s.inactive.isSet()) { - w.writeFieldBegin(QStringLiteral("inactive"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("inactive"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.inactive.ref()); w.writeFieldEnd(); } if (s.emphasized.isSet()) { - w.writeFieldBegin(QStringLiteral("emphasized"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("emphasized"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.emphasized.ref()); w.writeFieldEnd(); } if (s.includeAllReadableNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includeAllReadableNotebooks"), ThriftFieldType::T_BOOL, 9); + w.writeFieldBegin( + QStringLiteral("includeAllReadableNotebooks"), + ThriftFieldType::T_BOOL, + 9); w.writeBool(s.includeAllReadableNotebooks.ref()); w.writeFieldEnd(); } if (s.includeAllReadableWorkspaces.isSet()) { - w.writeFieldBegin(QStringLiteral("includeAllReadableWorkspaces"), ThriftFieldType::T_BOOL, 15); + w.writeFieldBegin( + QStringLiteral("includeAllReadableWorkspaces"), + ThriftFieldType::T_BOOL, + 15); w.writeBool(s.includeAllReadableWorkspaces.ref()); w.writeFieldEnd(); } if (s.context.isSet()) { - w.writeFieldBegin(QStringLiteral("context"), ThriftFieldType::T_STRING, 10); + w.writeFieldBegin( + QStringLiteral("context"), + ThriftFieldType::T_STRING, + 10); w.writeString(s.context.ref()); w.writeFieldEnd(); } if (s.rawWords.isSet()) { - w.writeFieldBegin(QStringLiteral("rawWords"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("rawWords"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.rawWords.ref()); w.writeFieldEnd(); } if (s.searchContextBytes.isSet()) { - w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 12); + w.writeFieldBegin( + QStringLiteral("searchContextBytes"), + ThriftFieldType::T_STRING, + 12); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); } @@ -1179,7 +1327,7 @@ void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1278,13 +1426,22 @@ void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeStructBegin(QStringLiteral("NoteList")); - w.writeFieldBegin(QStringLiteral("startIndex"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("startIndex"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.startIndex); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("totalNotes"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("totalNotes"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.totalNotes); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("notes"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); for(const auto & value: qAsConst(s.notes)) { writeNote(w, value); @@ -1292,7 +1449,10 @@ void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeListEnd(); w.writeFieldEnd(); if (s.stoppedWords.isSet()) { - w.writeFieldBegin(QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("stoppedWords"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); for(const auto & value: qAsConst(s.stoppedWords.ref())) { w.writeString(value); @@ -1301,7 +1461,10 @@ void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeFieldEnd(); } if (s.searchedWords.isSet()) { - w.writeFieldBegin(QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("searchedWords"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); for(const auto & value: qAsConst(s.searchedWords.ref())) { w.writeString(value); @@ -1310,17 +1473,26 @@ void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeFieldEnd(); } if (s.updateCount.isSet()) { - w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); + w.writeFieldBegin( + QStringLiteral("updateCount"), + ThriftFieldType::T_I32, + 6); w.writeI32(s.updateCount.ref()); w.writeFieldEnd(); } if (s.searchContextBytes.isSet()) { - w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("searchContextBytes"), + ThriftFieldType::T_STRING, + 7); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); } if (s.debugInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("debugInfo"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); } @@ -1363,7 +1535,7 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { notes_isset = true; - QList< Note > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1458,46 +1630,73 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeStructBegin(QStringLiteral("NoteMetadata")); - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid); w.writeFieldEnd(); if (s.title.isSet()) { - w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } if (s.contentLength.isSet()) { - w.writeFieldBegin(QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("contentLength"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.contentLength.ref()); w.writeFieldEnd(); } if (s.created.isSet()) { - w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 6); + w.writeFieldBegin( + QStringLiteral("created"), + ThriftFieldType::T_I64, + 6); w.writeI64(s.created.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } if (s.deleted.isSet()) { - w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("deleted"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 10); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.tagGuids.isSet()) { - w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); + w.writeFieldBegin( + QStringLiteral("tagGuids"), + ThriftFieldType::T_LIST, + 12); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { w.writeString(value); @@ -1506,17 +1705,26 @@ void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeFieldEnd(); } if (s.attributes.isSet()) { - w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); + w.writeFieldBegin( + QStringLiteral("attributes"), + ThriftFieldType::T_STRUCT, + 14); writeNoteAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } if (s.largestResourceMime.isSet()) { - w.writeFieldBegin(QStringLiteral("largestResourceMime"), ThriftFieldType::T_STRING, 20); + w.writeFieldBegin( + QStringLiteral("largestResourceMime"), + ThriftFieldType::T_STRING, + 20); w.writeString(s.largestResourceMime.ref()); w.writeFieldEnd(); } if (s.largestResourceSize.isSet()) { - w.writeFieldBegin(QStringLiteral("largestResourceSize"), ThriftFieldType::T_I32, 21); + w.writeFieldBegin( + QStringLiteral("largestResourceSize"), + ThriftFieldType::T_I32, + 21); w.writeI32(s.largestResourceSize.ref()); w.writeFieldEnd(); } @@ -1609,7 +1817,7 @@ void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1664,13 +1872,22 @@ void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataList & s) { w.writeStructBegin(QStringLiteral("NotesMetadataList")); - w.writeFieldBegin(QStringLiteral("startIndex"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("startIndex"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.startIndex); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("totalNotes"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("totalNotes"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.totalNotes); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("notes"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); for(const auto & value: qAsConst(s.notes)) { writeNoteMetadata(w, value); @@ -1678,7 +1895,10 @@ void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataLis w.writeListEnd(); w.writeFieldEnd(); if (s.stoppedWords.isSet()) { - w.writeFieldBegin(QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("stoppedWords"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); for(const auto & value: qAsConst(s.stoppedWords.ref())) { w.writeString(value); @@ -1687,7 +1907,10 @@ void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataLis w.writeFieldEnd(); } if (s.searchedWords.isSet()) { - w.writeFieldBegin(QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("searchedWords"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); for(const auto & value: qAsConst(s.searchedWords.ref())) { w.writeString(value); @@ -1696,17 +1919,26 @@ void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataLis w.writeFieldEnd(); } if (s.updateCount.isSet()) { - w.writeFieldBegin(QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); + w.writeFieldBegin( + QStringLiteral("updateCount"), + ThriftFieldType::T_I32, + 6); w.writeI32(s.updateCount.ref()); w.writeFieldEnd(); } if (s.searchContextBytes.isSet()) { - w.writeFieldBegin(QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("searchContextBytes"), + ThriftFieldType::T_STRING, + 7); w.writeBinary(s.searchContextBytes.ref()); w.writeFieldEnd(); } if (s.debugInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("debugInfo"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); } @@ -1749,7 +1981,7 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { notes_isset = true; - QList< NoteMetadata > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -1845,57 +2077,90 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s) { w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); if (s.includeTitle.isSet()) { - w.writeFieldBegin(QStringLiteral("includeTitle"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("includeTitle"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.includeTitle.ref()); w.writeFieldEnd(); } if (s.includeContentLength.isSet()) { - w.writeFieldBegin(QStringLiteral("includeContentLength"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("includeContentLength"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.includeContentLength.ref()); w.writeFieldEnd(); } if (s.includeCreated.isSet()) { - w.writeFieldBegin(QStringLiteral("includeCreated"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("includeCreated"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.includeCreated.ref()); w.writeFieldEnd(); } if (s.includeUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("includeUpdated"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("includeUpdated"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.includeUpdated.ref()); w.writeFieldEnd(); } if (s.includeDeleted.isSet()) { - w.writeFieldBegin(QStringLiteral("includeDeleted"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("includeDeleted"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.includeDeleted.ref()); w.writeFieldEnd(); } if (s.includeUpdateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("includeUpdateSequenceNum"), ThriftFieldType::T_BOOL, 10); + w.writeFieldBegin( + QStringLiteral("includeUpdateSequenceNum"), + ThriftFieldType::T_BOOL, + 10); w.writeBool(s.includeUpdateSequenceNum.ref()); w.writeFieldEnd(); } if (s.includeNotebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNotebookGuid"), ThriftFieldType::T_BOOL, 11); + w.writeFieldBegin( + QStringLiteral("includeNotebookGuid"), + ThriftFieldType::T_BOOL, + 11); w.writeBool(s.includeNotebookGuid.ref()); w.writeFieldEnd(); } if (s.includeTagGuids.isSet()) { - w.writeFieldBegin(QStringLiteral("includeTagGuids"), ThriftFieldType::T_BOOL, 12); + w.writeFieldBegin( + QStringLiteral("includeTagGuids"), + ThriftFieldType::T_BOOL, + 12); w.writeBool(s.includeTagGuids.ref()); w.writeFieldEnd(); } if (s.includeAttributes.isSet()) { - w.writeFieldBegin(QStringLiteral("includeAttributes"), ThriftFieldType::T_BOOL, 14); + w.writeFieldBegin( + QStringLiteral("includeAttributes"), + ThriftFieldType::T_BOOL, + 14); w.writeBool(s.includeAttributes.ref()); w.writeFieldEnd(); } if (s.includeLargestResourceMime.isSet()) { - w.writeFieldBegin(QStringLiteral("includeLargestResourceMime"), ThriftFieldType::T_BOOL, 20); + w.writeFieldBegin( + QStringLiteral("includeLargestResourceMime"), + ThriftFieldType::T_BOOL, + 20); w.writeBool(s.includeLargestResourceMime.ref()); w.writeFieldEnd(); } if (s.includeLargestResourceSize.isSet()) { - w.writeFieldBegin(QStringLiteral("includeLargestResourceSize"), ThriftFieldType::T_BOOL, 21); + w.writeFieldBegin( + QStringLiteral("includeLargestResourceSize"), + ThriftFieldType::T_BOOL, + 21); w.writeBool(s.includeLargestResourceSize.ref()); w.writeFieldEnd(); } @@ -2022,7 +2287,10 @@ void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResu void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectionCounts & s) { w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); if (s.notebookCounts.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookCounts"), ThriftFieldType::T_MAP, 1); + w.writeFieldBegin( + QStringLiteral("notebookCounts"), + ThriftFieldType::T_MAP, + 1); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); for(const auto & it: toRange(s.notebookCounts.ref())) { w.writeString(it.key()); @@ -2032,7 +2300,10 @@ void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectio w.writeFieldEnd(); } if (s.tagCounts.isSet()) { - w.writeFieldBegin(QStringLiteral("tagCounts"), ThriftFieldType::T_MAP, 2); + w.writeFieldBegin( + QStringLiteral("tagCounts"), + ThriftFieldType::T_MAP, + 2); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); for(const auto & it: toRange(s.tagCounts.ref())) { w.writeString(it.key()); @@ -2042,7 +2313,10 @@ void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectio w.writeFieldEnd(); } if (s.trashCount.isSet()) { - w.writeFieldBegin(QStringLiteral("trashCount"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("trashCount"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.trashCount.ref()); w.writeFieldEnd(); } @@ -2061,7 +2335,7 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_MAP) { - QMap< Guid, qint32 > v; + QMap v; qint32 size; ThriftFieldType::type keyType; ThriftFieldType::type elemType; @@ -2083,7 +2357,7 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_MAP) { - QMap< Guid, qint32 > v; + QMap v; qint32 size; ThriftFieldType::type keyType; ThriftFieldType::type elemType; @@ -2123,42 +2397,66 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s) { w.writeStructBegin(QStringLiteral("NoteResultSpec")); if (s.includeContent.isSet()) { - w.writeFieldBegin(QStringLiteral("includeContent"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("includeContent"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.includeContent.ref()); w.writeFieldEnd(); } if (s.includeResourcesData.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResourcesData"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("includeResourcesData"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.includeResourcesData.ref()); w.writeFieldEnd(); } if (s.includeResourcesRecognition.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResourcesRecognition"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("includeResourcesRecognition"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.includeResourcesRecognition.ref()); w.writeFieldEnd(); } if (s.includeResourcesAlternateData.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResourcesAlternateData"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("includeResourcesAlternateData"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.includeResourcesAlternateData.ref()); w.writeFieldEnd(); } if (s.includeSharedNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("includeSharedNotes"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.includeSharedNotes.ref()); w.writeFieldEnd(); } if (s.includeNoteAppDataValues.isSet()) { - w.writeFieldBegin(QStringLiteral("includeNoteAppDataValues"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("includeNoteAppDataValues"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.includeNoteAppDataValues.ref()); w.writeFieldEnd(); } if (s.includeResourceAppDataValues.isSet()) { - w.writeFieldBegin(QStringLiteral("includeResourceAppDataValues"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("includeResourceAppDataValues"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.includeResourceAppDataValues.ref()); w.writeFieldEnd(); } if (s.includeAccountLimits.isSet()) { - w.writeFieldBegin(QStringLiteral("includeAccountLimits"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("includeAccountLimits"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.includeAccountLimits.ref()); w.writeFieldEnd(); } @@ -2258,17 +2556,26 @@ void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s) { void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParameters & s) { w.writeStructBegin(QStringLiteral("NoteEmailParameters")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.note.isSet()) { - w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 2); writeNote(w, s.note.ref()); w.writeFieldEnd(); } if (s.toAddresses.isSet()) { - w.writeFieldBegin(QStringLiteral("toAddresses"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("toAddresses"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRING, s.toAddresses.ref().length()); for(const auto & value: qAsConst(s.toAddresses.ref())) { w.writeString(value); @@ -2277,7 +2584,10 @@ void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParam w.writeFieldEnd(); } if (s.ccAddresses.isSet()) { - w.writeFieldBegin(QStringLiteral("ccAddresses"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("ccAddresses"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRING, s.ccAddresses.ref().length()); for(const auto & value: qAsConst(s.ccAddresses.ref())) { w.writeString(value); @@ -2286,12 +2596,18 @@ void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParam w.writeFieldEnd(); } if (s.subject.isSet()) { - w.writeFieldBegin(QStringLiteral("subject"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("subject"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.subject.ref()); w.writeFieldEnd(); } if (s.message.isSet()) { - w.writeFieldBegin(QStringLiteral("message"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("message"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.message.ref()); w.writeFieldEnd(); } @@ -2392,20 +2708,35 @@ void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { w.writeStructBegin(QStringLiteral("NoteVersionId")); - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.updateSequenceNum); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.updated); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("saved"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("saved"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.saved); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.title); w.writeFieldEnd(); if (s.lastEditorId.isSet()) { - w.writeFieldBegin(QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("lastEditorId"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.lastEditorId.ref()); w.writeFieldEnd(); } @@ -2490,32 +2821,50 @@ void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s) { void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s) { w.writeStructBegin(QStringLiteral("RelatedQuery")); if (s.noteGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } if (s.plainText.isSet()) { - w.writeFieldBegin(QStringLiteral("plainText"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("plainText"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.plainText.ref()); w.writeFieldEnd(); } if (s.filter.isSet()) { - w.writeFieldBegin(QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("filter"), + ThriftFieldType::T_STRUCT, + 3); writeNoteFilter(w, s.filter.ref()); w.writeFieldEnd(); } if (s.referenceUri.isSet()) { - w.writeFieldBegin(QStringLiteral("referenceUri"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("referenceUri"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.referenceUri.ref()); w.writeFieldEnd(); } if (s.context.isSet()) { - w.writeFieldBegin(QStringLiteral("context"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("context"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.context.ref()); w.writeFieldEnd(); } if (s.cacheKey.isSet()) { - w.writeFieldBegin(QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("cacheKey"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.cacheKey.ref()); w.writeFieldEnd(); } @@ -2597,7 +2946,10 @@ void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s) { void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeStructBegin(QStringLiteral("RelatedResult")); if (s.notes.isSet()) { - w.writeFieldBegin(QStringLiteral("notes"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("notes"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); for(const auto & value: qAsConst(s.notes.ref())) { writeNote(w, value); @@ -2606,7 +2958,10 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.notebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("notebooks"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); for(const auto & value: qAsConst(s.notebooks.ref())) { writeNotebook(w, value); @@ -2615,7 +2970,10 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.tags.isSet()) { - w.writeFieldBegin(QStringLiteral("tags"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("tags"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); for(const auto & value: qAsConst(s.tags.ref())) { writeTag(w, value); @@ -2624,7 +2982,10 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.containingNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("containingNotebooks"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("containingNotebooks"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.containingNotebooks.ref().length()); for(const auto & value: qAsConst(s.containingNotebooks.ref())) { writeNotebookDescriptor(w, value); @@ -2633,12 +2994,18 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.debugInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("debugInfo"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.debugInfo.ref()); w.writeFieldEnd(); } if (s.experts.isSet()) { - w.writeFieldBegin(QStringLiteral("experts"), ThriftFieldType::T_LIST, 6); + w.writeFieldBegin( + QStringLiteral("experts"), + ThriftFieldType::T_LIST, + 6); w.writeListBegin(ThriftFieldType::T_STRUCT, s.experts.ref().length()); for(const auto & value: qAsConst(s.experts.ref())) { writeUserProfile(w, value); @@ -2647,7 +3014,10 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.relatedContent.isSet()) { - w.writeFieldBegin(QStringLiteral("relatedContent"), ThriftFieldType::T_LIST, 7); + w.writeFieldBegin( + QStringLiteral("relatedContent"), + ThriftFieldType::T_LIST, + 7); w.writeListBegin(ThriftFieldType::T_STRUCT, s.relatedContent.ref().length()); for(const auto & value: qAsConst(s.relatedContent.ref())) { writeRelatedContent(w, value); @@ -2656,12 +3026,18 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeFieldEnd(); } if (s.cacheKey.isSet()) { - w.writeFieldBegin(QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("cacheKey"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.cacheKey.ref()); w.writeFieldEnd(); } if (s.cacheExpires.isSet()) { - w.writeFieldBegin(QStringLiteral("cacheExpires"), ThriftFieldType::T_I32, 9); + w.writeFieldBegin( + QStringLiteral("cacheExpires"), + ThriftFieldType::T_I32, + 9); w.writeI32(s.cacheExpires.ref()); w.writeFieldEnd(); } @@ -2680,7 +3056,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Note > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2699,7 +3075,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Notebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2718,7 +3094,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Tag > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2737,7 +3113,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { - QList< NotebookDescriptor > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2765,7 +3141,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_LIST) { - QList< UserProfile > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2784,7 +3160,7 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_LIST) { - QList< RelatedContent > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -2830,47 +3206,74 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpec & s) { w.writeStructBegin(QStringLiteral("RelatedResultSpec")); if (s.maxNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("maxNotes"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("maxNotes"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.maxNotes.ref()); w.writeFieldEnd(); } if (s.maxNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("maxNotebooks"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("maxNotebooks"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.maxNotebooks.ref()); w.writeFieldEnd(); } if (s.maxTags.isSet()) { - w.writeFieldBegin(QStringLiteral("maxTags"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("maxTags"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.maxTags.ref()); w.writeFieldEnd(); } if (s.writableNotebooksOnly.isSet()) { - w.writeFieldBegin(QStringLiteral("writableNotebooksOnly"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("writableNotebooksOnly"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.writableNotebooksOnly.ref()); w.writeFieldEnd(); } if (s.includeContainingNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includeContainingNotebooks"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("includeContainingNotebooks"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.includeContainingNotebooks.ref()); w.writeFieldEnd(); } if (s.includeDebugInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("includeDebugInfo"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("includeDebugInfo"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.includeDebugInfo.ref()); w.writeFieldEnd(); } if (s.maxExperts.isSet()) { - w.writeFieldBegin(QStringLiteral("maxExperts"), ThriftFieldType::T_I32, 7); + w.writeFieldBegin( + QStringLiteral("maxExperts"), + ThriftFieldType::T_I32, + 7); w.writeI32(s.maxExperts.ref()); w.writeFieldEnd(); } if (s.maxRelatedContent.isSet()) { - w.writeFieldBegin(QStringLiteral("maxRelatedContent"), ThriftFieldType::T_I32, 8); + w.writeFieldBegin( + QStringLiteral("maxRelatedContent"), + ThriftFieldType::T_I32, + 8); w.writeI32(s.maxRelatedContent.ref()); w.writeFieldEnd(); } if (s.relatedContentTypes.isSet()) { - w.writeFieldBegin(QStringLiteral("relatedContentTypes"), ThriftFieldType::T_SET, 9); + w.writeFieldBegin( + QStringLiteral("relatedContentTypes"), + ThriftFieldType::T_SET, + 9); w.writeSetBegin(ThriftFieldType::T_I32, s.relatedContentTypes.ref().count()); for(const auto & value: qAsConst(s.relatedContentTypes.ref())) { w.writeI32(static_cast(value)); @@ -2965,7 +3368,7 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_SET) { - QSet< RelatedContentType > v; + QSet v; qint32 size; ThriftFieldType::type elemType; r.readSetBegin(elemType, size); @@ -2993,12 +3396,18 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s) { w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); if (s.note.isSet()) { - w.writeFieldBegin(QStringLiteral("note"), ThriftFieldType::T_STRUCT, 1); + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 1); writeNote(w, s.note.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.updated.ref()); w.writeFieldEnd(); } @@ -3044,22 +3453,34 @@ void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIf void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const ShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); if (s.noSetReadOnly.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetReadOnly"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("noSetReadOnly"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.noSetReadOnly.ref()); w.writeFieldEnd(); } if (s.noSetReadPlusActivity.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetReadPlusActivity"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("noSetReadPlusActivity"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.noSetReadPlusActivity.ref()); w.writeFieldEnd(); } if (s.noSetModify.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetModify"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("noSetModify"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.noSetModify.ref()); w.writeFieldEnd(); } if (s.noSetFullAccess.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("noSetFullAccess"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.noSetFullAccess.ref()); w.writeFieldEnd(); } @@ -3123,22 +3544,34 @@ void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelati void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const InvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("InvitationShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("displayName"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } if (s.recipientUserIdentity.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientUserIdentity"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("recipientUserIdentity"), + ThriftFieldType::T_STRUCT, + 2); writeUserIdentity(w, s.recipientUserIdentity.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.sharerUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("sharerUserId"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } @@ -3202,32 +3635,50 @@ void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationSha void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("MemberShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("displayName"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } if (s.recipientUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("recipientUserId"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } if (s.bestPrivilege.isSet()) { - w.writeFieldBegin(QStringLiteral("bestPrivilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("bestPrivilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.bestPrivilege.ref())); w.writeFieldEnd(); } if (s.individualPrivilege.isSet()) { - w.writeFieldBegin(QStringLiteral("individualPrivilege"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("individualPrivilege"), + ThriftFieldType::T_I32, + 4); w.writeI32(static_cast(s.individualPrivilege.ref())); w.writeFieldEnd(); } if (s.restrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 5); + w.writeFieldBegin( + QStringLiteral("restrictions"), + ThriftFieldType::T_STRUCT, + 5); writeShareRelationshipRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } if (s.sharerUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 6); + w.writeFieldBegin( + QStringLiteral("sharerUserId"), + ThriftFieldType::T_I32, + 6); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } @@ -3309,7 +3760,10 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationships & s) { w.writeStructBegin(QStringLiteral("ShareRelationships")); if (s.invitations.isSet()) { - w.writeFieldBegin(QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("invitations"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); for(const auto & value: qAsConst(s.invitations.ref())) { writeInvitationShareRelationship(w, value); @@ -3318,7 +3772,10 @@ void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationsh w.writeFieldEnd(); } if (s.memberships.isSet()) { - w.writeFieldBegin(QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("memberships"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); for(const auto & value: qAsConst(s.memberships.ref())) { writeMemberShareRelationship(w, value); @@ -3327,7 +3784,10 @@ void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationsh w.writeFieldEnd(); } if (s.invitationRestrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("invitationRestrictions"), + ThriftFieldType::T_STRUCT, + 3); writeShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); w.writeFieldEnd(); } @@ -3346,7 +3806,7 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { - QList< InvitationShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3365,7 +3825,7 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< MemberShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3402,17 +3862,26 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.inviteMessage.isSet()) { - w.writeFieldBegin(QStringLiteral("inviteMessage"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("inviteMessage"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.inviteMessage.ref()); w.writeFieldEnd(); } if (s.membershipsToUpdate.isSet()) { - w.writeFieldBegin(QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("membershipsToUpdate"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { writeMemberShareRelationship(w, value); @@ -3421,7 +3890,10 @@ void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const Man w.writeFieldEnd(); } if (s.invitationsToCreateOrUpdate.isSet()) { - w.writeFieldBegin(QStringLiteral("invitationsToCreateOrUpdate"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("invitationsToCreateOrUpdate"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToCreateOrUpdate.ref().length()); for(const auto & value: qAsConst(s.invitationsToCreateOrUpdate.ref())) { writeInvitationShareRelationship(w, value); @@ -3430,7 +3902,10 @@ void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const Man w.writeFieldEnd(); } if (s.unshares.isSet()) { - w.writeFieldBegin(QStringLiteral("unshares"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("unshares"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRUCT, s.unshares.ref().length()); for(const auto & value: qAsConst(s.unshares.ref())) { writeUserIdentity(w, value); @@ -3471,7 +3946,7 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { - QList< MemberShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3490,7 +3965,7 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { - QList< InvitationShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3509,7 +3984,7 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { - QList< UserIdentity > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3537,17 +4012,26 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote void writeManageNotebookSharesError(ThriftBinaryBufferWriter & w, const ManageNotebookSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); if (s.userIdentity.isSet()) { - w.writeFieldBegin(QStringLiteral("userIdentity"), ThriftFieldType::T_STRUCT, 1); + w.writeFieldBegin( + QStringLiteral("userIdentity"), + ThriftFieldType::T_STRUCT, + 1); writeUserIdentity(w, s.userIdentity.ref()); w.writeFieldEnd(); } if (s.userException.isSet()) { - w.writeFieldBegin(QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("userException"), + ThriftFieldType::T_STRUCT, + 2); writeEDAMUserException(w, s.userException.ref()); w.writeFieldEnd(); } if (s.notFoundException.isSet()) { - w.writeFieldBegin(QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("notFoundException"), + ThriftFieldType::T_STRUCT, + 3); writeEDAMNotFoundException(w, s.notFoundException.ref()); w.writeFieldEnd(); } @@ -3602,7 +4086,10 @@ void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookS void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); if (s.errors.isSet()) { - w.writeFieldBegin(QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("errors"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); for(const auto & value: qAsConst(s.errors.ref())) { writeManageNotebookSharesError(w, value); @@ -3625,7 +4112,7 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { - QList< ManageNotebookSharesError > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3653,17 +4140,26 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTemplate & s) { w.writeStructBegin(QStringLiteral("SharedNoteTemplate")); if (s.noteGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } if (s.recipientThreadId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); + w.writeFieldBegin( + QStringLiteral("recipientThreadId"), + ThriftFieldType::T_I64, + 4); w.writeI64(s.recipientThreadId.ref()); w.writeFieldEnd(); } if (s.recipientContacts.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("recipientContacts"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); for(const auto & value: qAsConst(s.recipientContacts.ref())) { writeContact(w, value); @@ -3672,7 +4168,10 @@ void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTempl w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } @@ -3709,7 +4208,7 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Contact > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3746,17 +4245,26 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShareTemplate & s) { w.writeStructBegin(QStringLiteral("NotebookShareTemplate")); if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.recipientThreadId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); + w.writeFieldBegin( + QStringLiteral("recipientThreadId"), + ThriftFieldType::T_I64, + 4); w.writeI64(s.recipientThreadId.ref()); w.writeFieldEnd(); } if (s.recipientContacts.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("recipientContacts"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); for(const auto & value: qAsConst(s.recipientContacts.ref())) { writeContact(w, value); @@ -3765,7 +4273,10 @@ void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShar w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } @@ -3802,7 +4313,7 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Contact > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3839,12 +4350,18 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const CreateOrUpdateNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.matchingShares.isSet()) { - w.writeFieldBegin(QStringLiteral("matchingShares"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("matchingShares"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.matchingShares.ref().length()); for(const auto & value: qAsConst(s.matchingShares.ref())) { writeSharedNotebook(w, value); @@ -3876,7 +4393,7 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< SharedNotebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -3904,17 +4421,26 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const NoteShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); if (s.noSetReadNote.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetReadNote"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("noSetReadNote"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.noSetReadNote.ref()); w.writeFieldEnd(); } if (s.noSetModifyNote.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetModifyNote"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("noSetModifyNote"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.noSetModifyNote.ref()); w.writeFieldEnd(); } if (s.noSetFullAccess.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("noSetFullAccess"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.noSetFullAccess.ref()); w.writeFieldEnd(); } @@ -3969,27 +4495,42 @@ void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteSha void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("displayName"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } if (s.recipientUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("recipientUserId"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.restrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 4); + w.writeFieldBegin( + QStringLiteral("restrictions"), + ThriftFieldType::T_STRUCT, + 4); writeNoteShareRelationshipRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } if (s.sharerUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("sharerUserId"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } @@ -4062,22 +4603,34 @@ void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberSha void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const NoteInvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin(QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("displayName"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.displayName.ref()); w.writeFieldEnd(); } if (s.recipientIdentityId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("recipientIdentityId"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.recipientIdentityId.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.sharerUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("sharerUserId"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } @@ -4141,7 +4694,10 @@ void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvit void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRelationships & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationships")); if (s.invitations.isSet()) { - w.writeFieldBegin(QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("invitations"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); for(const auto & value: qAsConst(s.invitations.ref())) { writeNoteInvitationShareRelationship(w, value); @@ -4150,7 +4706,10 @@ void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRe w.writeFieldEnd(); } if (s.memberships.isSet()) { - w.writeFieldBegin(QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("memberships"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); for(const auto & value: qAsConst(s.memberships.ref())) { writeNoteMemberShareRelationship(w, value); @@ -4159,7 +4718,10 @@ void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRe w.writeFieldEnd(); } if (s.invitationRestrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("invitationRestrictions"), + ThriftFieldType::T_STRUCT, + 3); writeNoteShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); w.writeFieldEnd(); } @@ -4178,7 +4740,7 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { - QList< NoteInvitationShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4197,7 +4759,7 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< NoteMemberShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4234,12 +4796,18 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageNoteSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); if (s.noteGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } if (s.membershipsToUpdate.isSet()) { - w.writeFieldBegin(QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 2); + w.writeFieldBegin( + QStringLiteral("membershipsToUpdate"), + ThriftFieldType::T_LIST, + 2); w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { writeNoteMemberShareRelationship(w, value); @@ -4248,7 +4816,10 @@ void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageN w.writeFieldEnd(); } if (s.invitationsToUpdate.isSet()) { - w.writeFieldBegin(QStringLiteral("invitationsToUpdate"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("invitationsToUpdate"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToUpdate.ref().length()); for(const auto & value: qAsConst(s.invitationsToUpdate.ref())) { writeNoteInvitationShareRelationship(w, value); @@ -4257,7 +4828,10 @@ void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageN w.writeFieldEnd(); } if (s.membershipsToUnshare.isSet()) { - w.writeFieldBegin(QStringLiteral("membershipsToUnshare"), ThriftFieldType::T_LIST, 4); + w.writeFieldBegin( + QStringLiteral("membershipsToUnshare"), + ThriftFieldType::T_LIST, + 4); w.writeListBegin(ThriftFieldType::T_I32, s.membershipsToUnshare.ref().length()); for(const auto & value: qAsConst(s.membershipsToUnshare.ref())) { w.writeI32(value); @@ -4266,7 +4840,10 @@ void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageN w.writeFieldEnd(); } if (s.invitationsToUnshare.isSet()) { - w.writeFieldBegin(QStringLiteral("invitationsToUnshare"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("invitationsToUnshare"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_I64, s.invitationsToUnshare.ref().length()); for(const auto & value: qAsConst(s.invitationsToUnshare.ref())) { w.writeI64(value); @@ -4298,7 +4875,7 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { - QList< NoteMemberShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4317,7 +4894,7 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { - QList< NoteInvitationShareRelationship > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4336,7 +4913,7 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { - QList< UserID > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4355,7 +4932,7 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { - QList< IdentityID > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4383,22 +4960,34 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesError")); if (s.identityID.isSet()) { - w.writeFieldBegin(QStringLiteral("identityID"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("identityID"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.identityID.ref()); w.writeFieldEnd(); } if (s.userID.isSet()) { - w.writeFieldBegin(QStringLiteral("userID"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("userID"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.userID.ref()); w.writeFieldEnd(); } if (s.userException.isSet()) { - w.writeFieldBegin(QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("userException"), + ThriftFieldType::T_STRUCT, + 3); writeEDAMUserException(w, s.userException.ref()); w.writeFieldEnd(); } if (s.notFoundException.isSet()) { - w.writeFieldBegin(QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 4); + w.writeFieldBegin( + QStringLiteral("notFoundException"), + ThriftFieldType::T_STRUCT, + 4); writeEDAMNotFoundException(w, s.notFoundException.ref()); w.writeFieldEnd(); } @@ -4462,7 +5051,10 @@ void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesErr void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); if (s.errors.isSet()) { - w.writeFieldBegin(QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("errors"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); for(const auto & value: qAsConst(s.errors.ref())) { writeManageNoteSharesError(w, value); @@ -4485,7 +5077,7 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { - QList< ManageNoteSharesError > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -4513,17 +5105,26 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe void writeData(ThriftBinaryBufferWriter & w, const Data & s) { w.writeStructBegin(QStringLiteral("Data")); if (s.bodyHash.isSet()) { - w.writeFieldBegin(QStringLiteral("bodyHash"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("bodyHash"), + ThriftFieldType::T_STRING, + 1); w.writeBinary(s.bodyHash.ref()); w.writeFieldEnd(); } if (s.size.isSet()) { - w.writeFieldBegin(QStringLiteral("size"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("size"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.size.ref()); w.writeFieldEnd(); } if (s.body.isSet()) { - w.writeFieldBegin(QStringLiteral("body"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("body"), + ThriftFieldType::T_STRING, + 3); w.writeBinary(s.body.ref()); w.writeFieldEnd(); } @@ -4578,27 +5179,42 @@ void readData(ThriftBinaryBufferReader & r, Data & s) { void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) { w.writeStructBegin(QStringLiteral("UserAttributes")); if (s.defaultLocationName.isSet()) { - w.writeFieldBegin(QStringLiteral("defaultLocationName"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("defaultLocationName"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.defaultLocationName.ref()); w.writeFieldEnd(); } if (s.defaultLatitude.isSet()) { - w.writeFieldBegin(QStringLiteral("defaultLatitude"), ThriftFieldType::T_DOUBLE, 2); + w.writeFieldBegin( + QStringLiteral("defaultLatitude"), + ThriftFieldType::T_DOUBLE, + 2); w.writeDouble(s.defaultLatitude.ref()); w.writeFieldEnd(); } if (s.defaultLongitude.isSet()) { - w.writeFieldBegin(QStringLiteral("defaultLongitude"), ThriftFieldType::T_DOUBLE, 3); + w.writeFieldBegin( + QStringLiteral("defaultLongitude"), + ThriftFieldType::T_DOUBLE, + 3); w.writeDouble(s.defaultLongitude.ref()); w.writeFieldEnd(); } if (s.preactivation.isSet()) { - w.writeFieldBegin(QStringLiteral("preactivation"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("preactivation"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.preactivation.ref()); w.writeFieldEnd(); } if (s.viewedPromotions.isSet()) { - w.writeFieldBegin(QStringLiteral("viewedPromotions"), ThriftFieldType::T_LIST, 5); + w.writeFieldBegin( + QStringLiteral("viewedPromotions"), + ThriftFieldType::T_LIST, + 5); w.writeListBegin(ThriftFieldType::T_STRING, s.viewedPromotions.ref().length()); for(const auto & value: qAsConst(s.viewedPromotions.ref())) { w.writeString(value); @@ -4607,12 +5223,18 @@ void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) w.writeFieldEnd(); } if (s.incomingEmailAddress.isSet()) { - w.writeFieldBegin(QStringLiteral("incomingEmailAddress"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("incomingEmailAddress"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.incomingEmailAddress.ref()); w.writeFieldEnd(); } if (s.recentMailedAddresses.isSet()) { - w.writeFieldBegin(QStringLiteral("recentMailedAddresses"), ThriftFieldType::T_LIST, 7); + w.writeFieldBegin( + QStringLiteral("recentMailedAddresses"), + ThriftFieldType::T_LIST, + 7); w.writeListBegin(ThriftFieldType::T_STRING, s.recentMailedAddresses.ref().length()); for(const auto & value: qAsConst(s.recentMailedAddresses.ref())) { w.writeString(value); @@ -4621,142 +5243,226 @@ void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) w.writeFieldEnd(); } if (s.comments.isSet()) { - w.writeFieldBegin(QStringLiteral("comments"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("comments"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.comments.ref()); w.writeFieldEnd(); } if (s.dateAgreedToTermsOfService.isSet()) { - w.writeFieldBegin(QStringLiteral("dateAgreedToTermsOfService"), ThriftFieldType::T_I64, 11); + w.writeFieldBegin( + QStringLiteral("dateAgreedToTermsOfService"), + ThriftFieldType::T_I64, + 11); w.writeI64(s.dateAgreedToTermsOfService.ref()); w.writeFieldEnd(); } if (s.maxReferrals.isSet()) { - w.writeFieldBegin(QStringLiteral("maxReferrals"), ThriftFieldType::T_I32, 12); + w.writeFieldBegin( + QStringLiteral("maxReferrals"), + ThriftFieldType::T_I32, + 12); w.writeI32(s.maxReferrals.ref()); w.writeFieldEnd(); } if (s.referralCount.isSet()) { - w.writeFieldBegin(QStringLiteral("referralCount"), ThriftFieldType::T_I32, 13); + w.writeFieldBegin( + QStringLiteral("referralCount"), + ThriftFieldType::T_I32, + 13); w.writeI32(s.referralCount.ref()); w.writeFieldEnd(); } if (s.refererCode.isSet()) { - w.writeFieldBegin(QStringLiteral("refererCode"), ThriftFieldType::T_STRING, 14); + w.writeFieldBegin( + QStringLiteral("refererCode"), + ThriftFieldType::T_STRING, + 14); w.writeString(s.refererCode.ref()); w.writeFieldEnd(); } if (s.sentEmailDate.isSet()) { - w.writeFieldBegin(QStringLiteral("sentEmailDate"), ThriftFieldType::T_I64, 15); + w.writeFieldBegin( + QStringLiteral("sentEmailDate"), + ThriftFieldType::T_I64, + 15); w.writeI64(s.sentEmailDate.ref()); w.writeFieldEnd(); } if (s.sentEmailCount.isSet()) { - w.writeFieldBegin(QStringLiteral("sentEmailCount"), ThriftFieldType::T_I32, 16); + w.writeFieldBegin( + QStringLiteral("sentEmailCount"), + ThriftFieldType::T_I32, + 16); w.writeI32(s.sentEmailCount.ref()); w.writeFieldEnd(); } if (s.dailyEmailLimit.isSet()) { - w.writeFieldBegin(QStringLiteral("dailyEmailLimit"), ThriftFieldType::T_I32, 17); + w.writeFieldBegin( + QStringLiteral("dailyEmailLimit"), + ThriftFieldType::T_I32, + 17); w.writeI32(s.dailyEmailLimit.ref()); w.writeFieldEnd(); } if (s.emailOptOutDate.isSet()) { - w.writeFieldBegin(QStringLiteral("emailOptOutDate"), ThriftFieldType::T_I64, 18); + w.writeFieldBegin( + QStringLiteral("emailOptOutDate"), + ThriftFieldType::T_I64, + 18); w.writeI64(s.emailOptOutDate.ref()); w.writeFieldEnd(); } if (s.partnerEmailOptInDate.isSet()) { - w.writeFieldBegin(QStringLiteral("partnerEmailOptInDate"), ThriftFieldType::T_I64, 19); + w.writeFieldBegin( + QStringLiteral("partnerEmailOptInDate"), + ThriftFieldType::T_I64, + 19); w.writeI64(s.partnerEmailOptInDate.ref()); w.writeFieldEnd(); } if (s.preferredLanguage.isSet()) { - w.writeFieldBegin(QStringLiteral("preferredLanguage"), ThriftFieldType::T_STRING, 20); + w.writeFieldBegin( + QStringLiteral("preferredLanguage"), + ThriftFieldType::T_STRING, + 20); w.writeString(s.preferredLanguage.ref()); w.writeFieldEnd(); } if (s.preferredCountry.isSet()) { - w.writeFieldBegin(QStringLiteral("preferredCountry"), ThriftFieldType::T_STRING, 21); + w.writeFieldBegin( + QStringLiteral("preferredCountry"), + ThriftFieldType::T_STRING, + 21); w.writeString(s.preferredCountry.ref()); w.writeFieldEnd(); } if (s.clipFullPage.isSet()) { - w.writeFieldBegin(QStringLiteral("clipFullPage"), ThriftFieldType::T_BOOL, 22); + w.writeFieldBegin( + QStringLiteral("clipFullPage"), + ThriftFieldType::T_BOOL, + 22); w.writeBool(s.clipFullPage.ref()); w.writeFieldEnd(); } if (s.twitterUserName.isSet()) { - w.writeFieldBegin(QStringLiteral("twitterUserName"), ThriftFieldType::T_STRING, 23); + w.writeFieldBegin( + QStringLiteral("twitterUserName"), + ThriftFieldType::T_STRING, + 23); w.writeString(s.twitterUserName.ref()); w.writeFieldEnd(); } if (s.twitterId.isSet()) { - w.writeFieldBegin(QStringLiteral("twitterId"), ThriftFieldType::T_STRING, 24); + w.writeFieldBegin( + QStringLiteral("twitterId"), + ThriftFieldType::T_STRING, + 24); w.writeString(s.twitterId.ref()); w.writeFieldEnd(); } if (s.groupName.isSet()) { - w.writeFieldBegin(QStringLiteral("groupName"), ThriftFieldType::T_STRING, 25); + w.writeFieldBegin( + QStringLiteral("groupName"), + ThriftFieldType::T_STRING, + 25); w.writeString(s.groupName.ref()); w.writeFieldEnd(); } if (s.recognitionLanguage.isSet()) { - w.writeFieldBegin(QStringLiteral("recognitionLanguage"), ThriftFieldType::T_STRING, 26); + w.writeFieldBegin( + QStringLiteral("recognitionLanguage"), + ThriftFieldType::T_STRING, + 26); w.writeString(s.recognitionLanguage.ref()); w.writeFieldEnd(); } if (s.referralProof.isSet()) { - w.writeFieldBegin(QStringLiteral("referralProof"), ThriftFieldType::T_STRING, 28); + w.writeFieldBegin( + QStringLiteral("referralProof"), + ThriftFieldType::T_STRING, + 28); w.writeString(s.referralProof.ref()); w.writeFieldEnd(); } if (s.educationalDiscount.isSet()) { - w.writeFieldBegin(QStringLiteral("educationalDiscount"), ThriftFieldType::T_BOOL, 29); + w.writeFieldBegin( + QStringLiteral("educationalDiscount"), + ThriftFieldType::T_BOOL, + 29); w.writeBool(s.educationalDiscount.ref()); w.writeFieldEnd(); } if (s.businessAddress.isSet()) { - w.writeFieldBegin(QStringLiteral("businessAddress"), ThriftFieldType::T_STRING, 30); + w.writeFieldBegin( + QStringLiteral("businessAddress"), + ThriftFieldType::T_STRING, + 30); w.writeString(s.businessAddress.ref()); w.writeFieldEnd(); } if (s.hideSponsorBilling.isSet()) { - w.writeFieldBegin(QStringLiteral("hideSponsorBilling"), ThriftFieldType::T_BOOL, 31); + w.writeFieldBegin( + QStringLiteral("hideSponsorBilling"), + ThriftFieldType::T_BOOL, + 31); w.writeBool(s.hideSponsorBilling.ref()); w.writeFieldEnd(); } if (s.useEmailAutoFiling.isSet()) { - w.writeFieldBegin(QStringLiteral("useEmailAutoFiling"), ThriftFieldType::T_BOOL, 33); + w.writeFieldBegin( + QStringLiteral("useEmailAutoFiling"), + ThriftFieldType::T_BOOL, + 33); w.writeBool(s.useEmailAutoFiling.ref()); w.writeFieldEnd(); } if (s.reminderEmailConfig.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderEmailConfig"), ThriftFieldType::T_I32, 34); + w.writeFieldBegin( + QStringLiteral("reminderEmailConfig"), + ThriftFieldType::T_I32, + 34); w.writeI32(static_cast(s.reminderEmailConfig.ref())); w.writeFieldEnd(); } if (s.emailAddressLastConfirmed.isSet()) { - w.writeFieldBegin(QStringLiteral("emailAddressLastConfirmed"), ThriftFieldType::T_I64, 35); + w.writeFieldBegin( + QStringLiteral("emailAddressLastConfirmed"), + ThriftFieldType::T_I64, + 35); w.writeI64(s.emailAddressLastConfirmed.ref()); w.writeFieldEnd(); } if (s.passwordUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("passwordUpdated"), ThriftFieldType::T_I64, 36); + w.writeFieldBegin( + QStringLiteral("passwordUpdated"), + ThriftFieldType::T_I64, + 36); w.writeI64(s.passwordUpdated.ref()); w.writeFieldEnd(); } if (s.salesforcePushEnabled.isSet()) { - w.writeFieldBegin(QStringLiteral("salesforcePushEnabled"), ThriftFieldType::T_BOOL, 37); + w.writeFieldBegin( + QStringLiteral("salesforcePushEnabled"), + ThriftFieldType::T_BOOL, + 37); w.writeBool(s.salesforcePushEnabled.ref()); w.writeFieldEnd(); } if (s.shouldLogClientEvent.isSet()) { - w.writeFieldBegin(QStringLiteral("shouldLogClientEvent"), ThriftFieldType::T_BOOL, 38); + w.writeFieldBegin( + QStringLiteral("shouldLogClientEvent"), + ThriftFieldType::T_BOOL, + 38); w.writeBool(s.shouldLogClientEvent.ref()); w.writeFieldEnd(); } if (s.optOutMachineLearning.isSet()) { - w.writeFieldBegin(QStringLiteral("optOutMachineLearning"), ThriftFieldType::T_BOOL, 39); + w.writeFieldBegin( + QStringLiteral("optOutMachineLearning"), + ThriftFieldType::T_BOOL, + 39); w.writeBool(s.optOutMachineLearning.ref()); w.writeFieldEnd(); } @@ -5119,37 +5825,58 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s) { w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); if (s.title.isSet()) { - w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.title.ref()); w.writeFieldEnd(); } if (s.location.isSet()) { - w.writeFieldBegin(QStringLiteral("location"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("location"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.location.ref()); w.writeFieldEnd(); } if (s.department.isSet()) { - w.writeFieldBegin(QStringLiteral("department"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("department"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.department.ref()); w.writeFieldEnd(); } if (s.mobilePhone.isSet()) { - w.writeFieldBegin(QStringLiteral("mobilePhone"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("mobilePhone"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.mobilePhone.ref()); w.writeFieldEnd(); } if (s.linkedInProfileUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("linkedInProfileUrl"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("linkedInProfileUrl"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.linkedInProfileUrl.ref()); w.writeFieldEnd(); } if (s.workPhone.isSet()) { - w.writeFieldBegin(QStringLiteral("workPhone"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("workPhone"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.workPhone.ref()); w.writeFieldEnd(); } if (s.companyStartDate.isSet()) { - w.writeFieldBegin(QStringLiteral("companyStartDate"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("companyStartDate"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.companyStartDate.ref()); w.writeFieldEnd(); } @@ -5240,117 +5967,186 @@ void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttrib void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { w.writeStructBegin(QStringLiteral("Accounting")); if (s.uploadLimitEnd.isSet()) { - w.writeFieldBegin(QStringLiteral("uploadLimitEnd"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("uploadLimitEnd"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.uploadLimitEnd.ref()); w.writeFieldEnd(); } if (s.uploadLimitNextMonth.isSet()) { - w.writeFieldBegin(QStringLiteral("uploadLimitNextMonth"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("uploadLimitNextMonth"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.uploadLimitNextMonth.ref()); w.writeFieldEnd(); } if (s.premiumServiceStatus.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumServiceStatus"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("premiumServiceStatus"), + ThriftFieldType::T_I32, + 4); w.writeI32(static_cast(s.premiumServiceStatus.ref())); w.writeFieldEnd(); } if (s.premiumOrderNumber.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumOrderNumber"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("premiumOrderNumber"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.premiumOrderNumber.ref()); w.writeFieldEnd(); } if (s.premiumCommerceService.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumCommerceService"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("premiumCommerceService"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.premiumCommerceService.ref()); w.writeFieldEnd(); } if (s.premiumServiceStart.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumServiceStart"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("premiumServiceStart"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.premiumServiceStart.ref()); w.writeFieldEnd(); } if (s.premiumServiceSKU.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumServiceSKU"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("premiumServiceSKU"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.premiumServiceSKU.ref()); w.writeFieldEnd(); } if (s.lastSuccessfulCharge.isSet()) { - w.writeFieldBegin(QStringLiteral("lastSuccessfulCharge"), ThriftFieldType::T_I64, 9); + w.writeFieldBegin( + QStringLiteral("lastSuccessfulCharge"), + ThriftFieldType::T_I64, + 9); w.writeI64(s.lastSuccessfulCharge.ref()); w.writeFieldEnd(); } if (s.lastFailedCharge.isSet()) { - w.writeFieldBegin(QStringLiteral("lastFailedCharge"), ThriftFieldType::T_I64, 10); + w.writeFieldBegin( + QStringLiteral("lastFailedCharge"), + ThriftFieldType::T_I64, + 10); w.writeI64(s.lastFailedCharge.ref()); w.writeFieldEnd(); } if (s.lastFailedChargeReason.isSet()) { - w.writeFieldBegin(QStringLiteral("lastFailedChargeReason"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("lastFailedChargeReason"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.lastFailedChargeReason.ref()); w.writeFieldEnd(); } if (s.nextPaymentDue.isSet()) { - w.writeFieldBegin(QStringLiteral("nextPaymentDue"), ThriftFieldType::T_I64, 12); + w.writeFieldBegin( + QStringLiteral("nextPaymentDue"), + ThriftFieldType::T_I64, + 12); w.writeI64(s.nextPaymentDue.ref()); w.writeFieldEnd(); } if (s.premiumLockUntil.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumLockUntil"), ThriftFieldType::T_I64, 13); + w.writeFieldBegin( + QStringLiteral("premiumLockUntil"), + ThriftFieldType::T_I64, + 13); w.writeI64(s.premiumLockUntil.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 14); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 14); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } if (s.premiumSubscriptionNumber.isSet()) { - w.writeFieldBegin(QStringLiteral("premiumSubscriptionNumber"), ThriftFieldType::T_STRING, 16); + w.writeFieldBegin( + QStringLiteral("premiumSubscriptionNumber"), + ThriftFieldType::T_STRING, + 16); w.writeString(s.premiumSubscriptionNumber.ref()); w.writeFieldEnd(); } if (s.lastRequestedCharge.isSet()) { - w.writeFieldBegin(QStringLiteral("lastRequestedCharge"), ThriftFieldType::T_I64, 17); + w.writeFieldBegin( + QStringLiteral("lastRequestedCharge"), + ThriftFieldType::T_I64, + 17); w.writeI64(s.lastRequestedCharge.ref()); w.writeFieldEnd(); } if (s.currency.isSet()) { - w.writeFieldBegin(QStringLiteral("currency"), ThriftFieldType::T_STRING, 18); + w.writeFieldBegin( + QStringLiteral("currency"), + ThriftFieldType::T_STRING, + 18); w.writeString(s.currency.ref()); w.writeFieldEnd(); } if (s.unitPrice.isSet()) { - w.writeFieldBegin(QStringLiteral("unitPrice"), ThriftFieldType::T_I32, 19); + w.writeFieldBegin( + QStringLiteral("unitPrice"), + ThriftFieldType::T_I32, + 19); w.writeI32(s.unitPrice.ref()); w.writeFieldEnd(); } if (s.businessId.isSet()) { - w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 20); + w.writeFieldBegin( + QStringLiteral("businessId"), + ThriftFieldType::T_I32, + 20); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } if (s.businessName.isSet()) { - w.writeFieldBegin(QStringLiteral("businessName"), ThriftFieldType::T_STRING, 21); + w.writeFieldBegin( + QStringLiteral("businessName"), + ThriftFieldType::T_STRING, + 21); w.writeString(s.businessName.ref()); w.writeFieldEnd(); } if (s.businessRole.isSet()) { - w.writeFieldBegin(QStringLiteral("businessRole"), ThriftFieldType::T_I32, 22); + w.writeFieldBegin( + QStringLiteral("businessRole"), + ThriftFieldType::T_I32, + 22); w.writeI32(static_cast(s.businessRole.ref())); w.writeFieldEnd(); } if (s.unitDiscount.isSet()) { - w.writeFieldBegin(QStringLiteral("unitDiscount"), ThriftFieldType::T_I32, 23); + w.writeFieldBegin( + QStringLiteral("unitDiscount"), + ThriftFieldType::T_I32, + 23); w.writeI32(s.unitDiscount.ref()); w.writeFieldEnd(); } if (s.nextChargeDate.isSet()) { - w.writeFieldBegin(QStringLiteral("nextChargeDate"), ThriftFieldType::T_I64, 24); + w.writeFieldBegin( + QStringLiteral("nextChargeDate"), + ThriftFieldType::T_I64, + 24); w.writeI64(s.nextChargeDate.ref()); w.writeFieldEnd(); } if (s.availablePoints.isSet()) { - w.writeFieldBegin(QStringLiteral("availablePoints"), ThriftFieldType::T_I32, 25); + w.writeFieldBegin( + QStringLiteral("availablePoints"), + ThriftFieldType::T_I32, + 25); w.writeI32(s.availablePoints.ref()); w.writeFieldEnd(); } @@ -5585,27 +6381,42 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo & s) { w.writeStructBegin(QStringLiteral("BusinessUserInfo")); if (s.businessId.isSet()) { - w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("businessId"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } if (s.businessName.isSet()) { - w.writeFieldBegin(QStringLiteral("businessName"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("businessName"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.businessName.ref()); w.writeFieldEnd(); } if (s.role.isSet()) { - w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("role"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } if (s.email.isSet()) { - w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("email"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.email.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } @@ -5678,57 +6489,90 @@ void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s) { w.writeStructBegin(QStringLiteral("AccountLimits")); if (s.userMailLimitDaily.isSet()) { - w.writeFieldBegin(QStringLiteral("userMailLimitDaily"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("userMailLimitDaily"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.userMailLimitDaily.ref()); w.writeFieldEnd(); } if (s.noteSizeMax.isSet()) { - w.writeFieldBegin(QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("noteSizeMax"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.noteSizeMax.ref()); w.writeFieldEnd(); } if (s.resourceSizeMax.isSet()) { - w.writeFieldBegin(QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("resourceSizeMax"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.resourceSizeMax.ref()); w.writeFieldEnd(); } if (s.userLinkedNotebookMax.isSet()) { - w.writeFieldBegin(QStringLiteral("userLinkedNotebookMax"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("userLinkedNotebookMax"), + ThriftFieldType::T_I32, + 4); w.writeI32(s.userLinkedNotebookMax.ref()); w.writeFieldEnd(); } if (s.uploadLimit.isSet()) { - w.writeFieldBegin(QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("uploadLimit"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.uploadLimit.ref()); w.writeFieldEnd(); } if (s.userNoteCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("userNoteCountMax"), ThriftFieldType::T_I32, 6); + w.writeFieldBegin( + QStringLiteral("userNoteCountMax"), + ThriftFieldType::T_I32, + 6); w.writeI32(s.userNoteCountMax.ref()); w.writeFieldEnd(); } if (s.userNotebookCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("userNotebookCountMax"), ThriftFieldType::T_I32, 7); + w.writeFieldBegin( + QStringLiteral("userNotebookCountMax"), + ThriftFieldType::T_I32, + 7); w.writeI32(s.userNotebookCountMax.ref()); w.writeFieldEnd(); } if (s.userTagCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("userTagCountMax"), ThriftFieldType::T_I32, 8); + w.writeFieldBegin( + QStringLiteral("userTagCountMax"), + ThriftFieldType::T_I32, + 8); w.writeI32(s.userTagCountMax.ref()); w.writeFieldEnd(); } if (s.noteTagCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("noteTagCountMax"), ThriftFieldType::T_I32, 9); + w.writeFieldBegin( + QStringLiteral("noteTagCountMax"), + ThriftFieldType::T_I32, + 9); w.writeI32(s.noteTagCountMax.ref()); w.writeFieldEnd(); } if (s.userSavedSearchesMax.isSet()) { - w.writeFieldBegin(QStringLiteral("userSavedSearchesMax"), ThriftFieldType::T_I32, 10); + w.writeFieldBegin( + QStringLiteral("userSavedSearchesMax"), + ThriftFieldType::T_I32, + 10); w.writeI32(s.userSavedSearchesMax.ref()); w.writeFieldEnd(); } if (s.noteResourceCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 11); + w.writeFieldBegin( + QStringLiteral("noteResourceCountMax"), + ThriftFieldType::T_I32, + 11); w.writeI32(s.noteResourceCountMax.ref()); w.writeFieldEnd(); } @@ -5855,92 +6699,146 @@ void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s) { void writeUser(ThriftBinaryBufferWriter & w, const User & s) { w.writeStructBegin(QStringLiteral("User")); if (s.id.isSet()) { - w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.id.ref()); w.writeFieldEnd(); } if (s.username.isSet()) { - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.username.ref()); w.writeFieldEnd(); } if (s.email.isSet()) { - w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("email"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.email.ref()); w.writeFieldEnd(); } if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.timezone.isSet()) { - w.writeFieldBegin(QStringLiteral("timezone"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("timezone"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.timezone.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 7); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 7); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.serviceLevel.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 21); + w.writeFieldBegin( + QStringLiteral("serviceLevel"), + ThriftFieldType::T_I32, + 21); w.writeI32(static_cast(s.serviceLevel.ref())); w.writeFieldEnd(); } if (s.created.isSet()) { - w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 9); + w.writeFieldBegin( + QStringLiteral("created"), + ThriftFieldType::T_I64, + 9); w.writeI64(s.created.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 10); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 10); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } if (s.deleted.isSet()) { - w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 11); + w.writeFieldBegin( + QStringLiteral("deleted"), + ThriftFieldType::T_I64, + 11); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } if (s.active.isSet()) { - w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 13); + w.writeFieldBegin( + QStringLiteral("active"), + ThriftFieldType::T_BOOL, + 13); w.writeBool(s.active.ref()); w.writeFieldEnd(); } if (s.shardId.isSet()) { - w.writeFieldBegin(QStringLiteral("shardId"), ThriftFieldType::T_STRING, 14); + w.writeFieldBegin( + QStringLiteral("shardId"), + ThriftFieldType::T_STRING, + 14); w.writeString(s.shardId.ref()); w.writeFieldEnd(); } if (s.attributes.isSet()) { - w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 15); + w.writeFieldBegin( + QStringLiteral("attributes"), + ThriftFieldType::T_STRUCT, + 15); writeUserAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } if (s.accounting.isSet()) { - w.writeFieldBegin(QStringLiteral("accounting"), ThriftFieldType::T_STRUCT, 16); + w.writeFieldBegin( + QStringLiteral("accounting"), + ThriftFieldType::T_STRUCT, + 16); writeAccounting(w, s.accounting.ref()); w.writeFieldEnd(); } if (s.businessUserInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("businessUserInfo"), ThriftFieldType::T_STRUCT, 18); + w.writeFieldBegin( + QStringLiteral("businessUserInfo"), + ThriftFieldType::T_STRUCT, + 18); writeBusinessUserInfo(w, s.businessUserInfo.ref()); w.writeFieldEnd(); } if (s.photoUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 19); + w.writeFieldBegin( + QStringLiteral("photoUrl"), + ThriftFieldType::T_STRING, + 19); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 20); + w.writeFieldBegin( + QStringLiteral("photoLastUpdated"), + ThriftFieldType::T_I64, + 20); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } if (s.accountLimits.isSet()) { - w.writeFieldBegin(QStringLiteral("accountLimits"), ThriftFieldType::T_STRUCT, 22); + w.writeFieldBegin( + QStringLiteral("accountLimits"), + ThriftFieldType::T_STRUCT, + 22); writeAccountLimits(w, s.accountLimits.ref()); w.writeFieldEnd(); } @@ -6130,37 +7028,58 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { void writeContact(ThriftBinaryBufferWriter & w, const Contact & s) { w.writeStructBegin(QStringLiteral("Contact")); if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.id.isSet()) { - w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.id.ref()); w.writeFieldEnd(); } if (s.type.isSet()) { - w.writeFieldBegin(QStringLiteral("type"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("type"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.type.ref())); w.writeFieldEnd(); } if (s.photoUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("photoUrl"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("photoLastUpdated"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } if (s.messagingPermit.isSet()) { - w.writeFieldBegin(QStringLiteral("messagingPermit"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("messagingPermit"), + ThriftFieldType::T_STRING, + 6); w.writeBinary(s.messagingPermit.ref()); w.writeFieldEnd(); } if (s.messagingPermitExpires.isSet()) { - w.writeFieldBegin(QStringLiteral("messagingPermitExpires"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("messagingPermitExpires"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.messagingPermitExpires.ref()); w.writeFieldEnd(); } @@ -6250,41 +7169,65 @@ void readContact(ThriftBinaryBufferReader & r, Contact & s) { void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s) { w.writeStructBegin(QStringLiteral("Identity")); - w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.id); w.writeFieldEnd(); if (s.contact.isSet()) { - w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("contact"), + ThriftFieldType::T_STRUCT, + 2); writeContact(w, s.contact.ref()); w.writeFieldEnd(); } if (s.userId.isSet()) { - w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("userId"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.userId.ref()); w.writeFieldEnd(); } if (s.deactivated.isSet()) { - w.writeFieldBegin(QStringLiteral("deactivated"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("deactivated"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.deactivated.ref()); w.writeFieldEnd(); } if (s.sameBusiness.isSet()) { - w.writeFieldBegin(QStringLiteral("sameBusiness"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("sameBusiness"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.sameBusiness.ref()); w.writeFieldEnd(); } if (s.blocked.isSet()) { - w.writeFieldBegin(QStringLiteral("blocked"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("blocked"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.blocked.ref()); w.writeFieldEnd(); } if (s.userConnected.isSet()) { - w.writeFieldBegin(QStringLiteral("userConnected"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("userConnected"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.userConnected.ref()); w.writeFieldEnd(); } if (s.eventId.isSet()) { - w.writeFieldBegin(QStringLiteral("eventId"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("eventId"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.eventId.ref()); w.writeFieldEnd(); } @@ -6387,22 +7330,34 @@ void readIdentity(ThriftBinaryBufferReader & r, Identity & s) { void writeTag(ThriftBinaryBufferWriter & w, const Tag & s) { w.writeStructBegin(QStringLiteral("Tag")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.parentGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("parentGuid"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("parentGuid"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.parentGuid.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 4); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } @@ -6466,7 +7421,10 @@ void readTag(ThriftBinaryBufferReader & r, Tag & s) { void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeStructBegin(QStringLiteral("LazyMap")); if (s.keysOnly.isSet()) { - w.writeFieldBegin(QStringLiteral("keysOnly"), ThriftFieldType::T_SET, 1); + w.writeFieldBegin( + QStringLiteral("keysOnly"), + ThriftFieldType::T_SET, + 1); w.writeSetBegin(ThriftFieldType::T_STRING, s.keysOnly.ref().count()); for(const auto & value: qAsConst(s.keysOnly.ref())) { w.writeString(value); @@ -6475,7 +7433,10 @@ void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeFieldEnd(); } if (s.fullMap.isSet()) { - w.writeFieldBegin(QStringLiteral("fullMap"), ThriftFieldType::T_MAP, 2); + w.writeFieldBegin( + QStringLiteral("fullMap"), + ThriftFieldType::T_MAP, + 2); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.fullMap.ref().size()); for(const auto & it: toRange(s.fullMap.ref())) { w.writeString(it.key()); @@ -6499,7 +7460,7 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_SET) { - QSet< QString > v; + QSet v; qint32 size; ThriftFieldType::type elemType; r.readSetBegin(elemType, size); @@ -6518,7 +7479,7 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_MAP) { - QMap< QString, QString > v; + QMap v; qint32 size; ThriftFieldType::type keyType; ThriftFieldType::type elemType; @@ -6549,62 +7510,98 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttributes & s) { w.writeStructBegin(QStringLiteral("ResourceAttributes")); if (s.sourceURL.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("sourceURL"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.sourceURL.ref()); w.writeFieldEnd(); } if (s.timestamp.isSet()) { - w.writeFieldBegin(QStringLiteral("timestamp"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("timestamp"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.timestamp.ref()); w.writeFieldEnd(); } if (s.latitude.isSet()) { - w.writeFieldBegin(QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 3); + w.writeFieldBegin( + QStringLiteral("latitude"), + ThriftFieldType::T_DOUBLE, + 3); w.writeDouble(s.latitude.ref()); w.writeFieldEnd(); } if (s.longitude.isSet()) { - w.writeFieldBegin(QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 4); + w.writeFieldBegin( + QStringLiteral("longitude"), + ThriftFieldType::T_DOUBLE, + 4); w.writeDouble(s.longitude.ref()); w.writeFieldEnd(); } if (s.altitude.isSet()) { - w.writeFieldBegin(QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 5); + w.writeFieldBegin( + QStringLiteral("altitude"), + ThriftFieldType::T_DOUBLE, + 5); w.writeDouble(s.altitude.ref()); w.writeFieldEnd(); } if (s.cameraMake.isSet()) { - w.writeFieldBegin(QStringLiteral("cameraMake"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("cameraMake"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.cameraMake.ref()); w.writeFieldEnd(); } if (s.cameraModel.isSet()) { - w.writeFieldBegin(QStringLiteral("cameraModel"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("cameraModel"), + ThriftFieldType::T_STRING, + 7); w.writeString(s.cameraModel.ref()); w.writeFieldEnd(); } if (s.clientWillIndex.isSet()) { - w.writeFieldBegin(QStringLiteral("clientWillIndex"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("clientWillIndex"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.clientWillIndex.ref()); w.writeFieldEnd(); } if (s.recoType.isSet()) { - w.writeFieldBegin(QStringLiteral("recoType"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("recoType"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.recoType.ref()); w.writeFieldEnd(); } if (s.fileName.isSet()) { - w.writeFieldBegin(QStringLiteral("fileName"), ThriftFieldType::T_STRING, 10); + w.writeFieldBegin( + QStringLiteral("fileName"), + ThriftFieldType::T_STRING, + 10); w.writeString(s.fileName.ref()); w.writeFieldEnd(); } if (s.attachment.isSet()) { - w.writeFieldBegin(QStringLiteral("attachment"), ThriftFieldType::T_BOOL, 11); + w.writeFieldBegin( + QStringLiteral("attachment"), + ThriftFieldType::T_BOOL, + 11); w.writeBool(s.attachment.ref()); w.writeFieldEnd(); } if (s.applicationData.isSet()) { - w.writeFieldBegin(QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 12); + w.writeFieldBegin( + QStringLiteral("applicationData"), + ThriftFieldType::T_STRUCT, + 12); writeLazyMap(w, s.applicationData.ref()); w.writeFieldEnd(); } @@ -6740,62 +7737,98 @@ void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s void writeResource(ThriftBinaryBufferWriter & w, const Resource & s) { w.writeStructBegin(QStringLiteral("Resource")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.noteGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.noteGuid.ref()); w.writeFieldEnd(); } if (s.data.isSet()) { - w.writeFieldBegin(QStringLiteral("data"), ThriftFieldType::T_STRUCT, 3); + w.writeFieldBegin( + QStringLiteral("data"), + ThriftFieldType::T_STRUCT, + 3); writeData(w, s.data.ref()); w.writeFieldEnd(); } if (s.mime.isSet()) { - w.writeFieldBegin(QStringLiteral("mime"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("mime"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.mime.ref()); w.writeFieldEnd(); } if (s.width.isSet()) { - w.writeFieldBegin(QStringLiteral("width"), ThriftFieldType::T_I16, 5); + w.writeFieldBegin( + QStringLiteral("width"), + ThriftFieldType::T_I16, + 5); w.writeI16(s.width.ref()); w.writeFieldEnd(); } if (s.height.isSet()) { - w.writeFieldBegin(QStringLiteral("height"), ThriftFieldType::T_I16, 6); + w.writeFieldBegin( + QStringLiteral("height"), + ThriftFieldType::T_I16, + 6); w.writeI16(s.height.ref()); w.writeFieldEnd(); } if (s.duration.isSet()) { - w.writeFieldBegin(QStringLiteral("duration"), ThriftFieldType::T_I16, 7); + w.writeFieldBegin( + QStringLiteral("duration"), + ThriftFieldType::T_I16, + 7); w.writeI16(s.duration.ref()); w.writeFieldEnd(); } if (s.active.isSet()) { - w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("active"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.active.ref()); w.writeFieldEnd(); } if (s.recognition.isSet()) { - w.writeFieldBegin(QStringLiteral("recognition"), ThriftFieldType::T_STRUCT, 9); + w.writeFieldBegin( + QStringLiteral("recognition"), + ThriftFieldType::T_STRUCT, + 9); writeData(w, s.recognition.ref()); w.writeFieldEnd(); } if (s.attributes.isSet()) { - w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 11); + w.writeFieldBegin( + QStringLiteral("attributes"), + ThriftFieldType::T_STRUCT, + 11); writeResourceAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 12); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 12); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.alternateData.isSet()) { - w.writeFieldBegin(QStringLiteral("alternateData"), ThriftFieldType::T_STRUCT, 13); + w.writeFieldBegin( + QStringLiteral("alternateData"), + ThriftFieldType::T_STRUCT, + 13); writeData(w, s.alternateData.ref()); w.writeFieldEnd(); } @@ -6931,87 +7964,138 @@ void readResource(ThriftBinaryBufferReader & r, Resource & s) { void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) { w.writeStructBegin(QStringLiteral("NoteAttributes")); if (s.subjectDate.isSet()) { - w.writeFieldBegin(QStringLiteral("subjectDate"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("subjectDate"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.subjectDate.ref()); w.writeFieldEnd(); } if (s.latitude.isSet()) { - w.writeFieldBegin(QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 10); + w.writeFieldBegin( + QStringLiteral("latitude"), + ThriftFieldType::T_DOUBLE, + 10); w.writeDouble(s.latitude.ref()); w.writeFieldEnd(); } if (s.longitude.isSet()) { - w.writeFieldBegin(QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 11); + w.writeFieldBegin( + QStringLiteral("longitude"), + ThriftFieldType::T_DOUBLE, + 11); w.writeDouble(s.longitude.ref()); w.writeFieldEnd(); } if (s.altitude.isSet()) { - w.writeFieldBegin(QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 12); + w.writeFieldBegin( + QStringLiteral("altitude"), + ThriftFieldType::T_DOUBLE, + 12); w.writeDouble(s.altitude.ref()); w.writeFieldEnd(); } if (s.author.isSet()) { - w.writeFieldBegin(QStringLiteral("author"), ThriftFieldType::T_STRING, 13); + w.writeFieldBegin( + QStringLiteral("author"), + ThriftFieldType::T_STRING, + 13); w.writeString(s.author.ref()); w.writeFieldEnd(); } if (s.source.isSet()) { - w.writeFieldBegin(QStringLiteral("source"), ThriftFieldType::T_STRING, 14); + w.writeFieldBegin( + QStringLiteral("source"), + ThriftFieldType::T_STRING, + 14); w.writeString(s.source.ref()); w.writeFieldEnd(); } if (s.sourceURL.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 15); + w.writeFieldBegin( + QStringLiteral("sourceURL"), + ThriftFieldType::T_STRING, + 15); w.writeString(s.sourceURL.ref()); w.writeFieldEnd(); } if (s.sourceApplication.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceApplication"), ThriftFieldType::T_STRING, 16); + w.writeFieldBegin( + QStringLiteral("sourceApplication"), + ThriftFieldType::T_STRING, + 16); w.writeString(s.sourceApplication.ref()); w.writeFieldEnd(); } if (s.shareDate.isSet()) { - w.writeFieldBegin(QStringLiteral("shareDate"), ThriftFieldType::T_I64, 17); + w.writeFieldBegin( + QStringLiteral("shareDate"), + ThriftFieldType::T_I64, + 17); w.writeI64(s.shareDate.ref()); w.writeFieldEnd(); } if (s.reminderOrder.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderOrder"), ThriftFieldType::T_I64, 18); + w.writeFieldBegin( + QStringLiteral("reminderOrder"), + ThriftFieldType::T_I64, + 18); w.writeI64(s.reminderOrder.ref()); w.writeFieldEnd(); } if (s.reminderDoneTime.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderDoneTime"), ThriftFieldType::T_I64, 19); + w.writeFieldBegin( + QStringLiteral("reminderDoneTime"), + ThriftFieldType::T_I64, + 19); w.writeI64(s.reminderDoneTime.ref()); w.writeFieldEnd(); } if (s.reminderTime.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderTime"), ThriftFieldType::T_I64, 20); + w.writeFieldBegin( + QStringLiteral("reminderTime"), + ThriftFieldType::T_I64, + 20); w.writeI64(s.reminderTime.ref()); w.writeFieldEnd(); } if (s.placeName.isSet()) { - w.writeFieldBegin(QStringLiteral("placeName"), ThriftFieldType::T_STRING, 21); + w.writeFieldBegin( + QStringLiteral("placeName"), + ThriftFieldType::T_STRING, + 21); w.writeString(s.placeName.ref()); w.writeFieldEnd(); } if (s.contentClass.isSet()) { - w.writeFieldBegin(QStringLiteral("contentClass"), ThriftFieldType::T_STRING, 22); + w.writeFieldBegin( + QStringLiteral("contentClass"), + ThriftFieldType::T_STRING, + 22); w.writeString(s.contentClass.ref()); w.writeFieldEnd(); } if (s.applicationData.isSet()) { - w.writeFieldBegin(QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 23); + w.writeFieldBegin( + QStringLiteral("applicationData"), + ThriftFieldType::T_STRUCT, + 23); writeLazyMap(w, s.applicationData.ref()); w.writeFieldEnd(); } if (s.lastEditedBy.isSet()) { - w.writeFieldBegin(QStringLiteral("lastEditedBy"), ThriftFieldType::T_STRING, 24); + w.writeFieldBegin( + QStringLiteral("lastEditedBy"), + ThriftFieldType::T_STRING, + 24); w.writeString(s.lastEditedBy.ref()); w.writeFieldEnd(); } if (s.classifications.isSet()) { - w.writeFieldBegin(QStringLiteral("classifications"), ThriftFieldType::T_MAP, 26); + w.writeFieldBegin( + QStringLiteral("classifications"), + ThriftFieldType::T_MAP, + 26); w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.classifications.ref().size()); for(const auto & it: toRange(s.classifications.ref())) { w.writeString(it.key()); @@ -7021,27 +8105,42 @@ void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) w.writeFieldEnd(); } if (s.creatorId.isSet()) { - w.writeFieldBegin(QStringLiteral("creatorId"), ThriftFieldType::T_I32, 27); + w.writeFieldBegin( + QStringLiteral("creatorId"), + ThriftFieldType::T_I32, + 27); w.writeI32(s.creatorId.ref()); w.writeFieldEnd(); } if (s.lastEditorId.isSet()) { - w.writeFieldBegin(QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 28); + w.writeFieldBegin( + QStringLiteral("lastEditorId"), + ThriftFieldType::T_I32, + 28); w.writeI32(s.lastEditorId.ref()); w.writeFieldEnd(); } if (s.sharedWithBusiness.isSet()) { - w.writeFieldBegin(QStringLiteral("sharedWithBusiness"), ThriftFieldType::T_BOOL, 29); + w.writeFieldBegin( + QStringLiteral("sharedWithBusiness"), + ThriftFieldType::T_BOOL, + 29); w.writeBool(s.sharedWithBusiness.ref()); w.writeFieldEnd(); } if (s.conflictSourceNoteGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("conflictSourceNoteGuid"), ThriftFieldType::T_STRING, 30); + w.writeFieldBegin( + QStringLiteral("conflictSourceNoteGuid"), + ThriftFieldType::T_STRING, + 30); w.writeString(s.conflictSourceNoteGuid.ref()); w.writeFieldEnd(); } if (s.noteTitleQuality.isSet()) { - w.writeFieldBegin(QStringLiteral("noteTitleQuality"), ThriftFieldType::T_I32, 31); + w.writeFieldBegin( + QStringLiteral("noteTitleQuality"), + ThriftFieldType::T_I32, + 31); w.writeI32(s.noteTitleQuality.ref()); w.writeFieldEnd(); } @@ -7204,7 +8303,7 @@ void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { } else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_MAP) { - QMap< QString, QString > v; + QMap v; qint32 size; ThriftFieldType::type keyType; ThriftFieldType::type elemType; @@ -7280,32 +8379,50 @@ void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s) { w.writeStructBegin(QStringLiteral("SharedNote")); if (s.sharerUserID.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserID"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("sharerUserID"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.sharerUserID.ref()); w.writeFieldEnd(); } if (s.recipientIdentity.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientIdentity"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("recipientIdentity"), + ThriftFieldType::T_STRUCT, + 2); writeIdentity(w, s.recipientIdentity.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.serviceCreated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 4); + w.writeFieldBegin( + QStringLiteral("serviceCreated"), + ThriftFieldType::T_I64, + 4); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } if (s.serviceUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("serviceUpdated"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } if (s.serviceAssigned.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 6); + w.writeFieldBegin( + QStringLiteral("serviceAssigned"), + ThriftFieldType::T_I64, + 6); w.writeI64(s.serviceAssigned.ref()); w.writeFieldEnd(); } @@ -7387,27 +8504,42 @@ void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteRestrictions")); if (s.noUpdateTitle.isSet()) { - w.writeFieldBegin(QStringLiteral("noUpdateTitle"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("noUpdateTitle"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.noUpdateTitle.ref()); w.writeFieldEnd(); } if (s.noUpdateContent.isSet()) { - w.writeFieldBegin(QStringLiteral("noUpdateContent"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("noUpdateContent"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.noUpdateContent.ref()); w.writeFieldEnd(); } if (s.noEmail.isSet()) { - w.writeFieldBegin(QStringLiteral("noEmail"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("noEmail"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.noEmail.ref()); w.writeFieldEnd(); } if (s.noShare.isSet()) { - w.writeFieldBegin(QStringLiteral("noShare"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("noShare"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.noShare.ref()); w.writeFieldEnd(); } if (s.noSharePublicly.isSet()) { - w.writeFieldBegin(QStringLiteral("noSharePublicly"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("noSharePublicly"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.noSharePublicly.ref()); w.writeFieldEnd(); } @@ -7480,27 +8612,42 @@ void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s) { void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s) { w.writeStructBegin(QStringLiteral("NoteLimits")); if (s.noteResourceCountMax.isSet()) { - w.writeFieldBegin(QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("noteResourceCountMax"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.noteResourceCountMax.ref()); w.writeFieldEnd(); } if (s.uploadLimit.isSet()) { - w.writeFieldBegin(QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 2); + w.writeFieldBegin( + QStringLiteral("uploadLimit"), + ThriftFieldType::T_I64, + 2); w.writeI64(s.uploadLimit.ref()); w.writeFieldEnd(); } if (s.resourceSizeMax.isSet()) { - w.writeFieldBegin(QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("resourceSizeMax"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.resourceSizeMax.ref()); w.writeFieldEnd(); } if (s.noteSizeMax.isSet()) { - w.writeFieldBegin(QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 4); + w.writeFieldBegin( + QStringLiteral("noteSizeMax"), + ThriftFieldType::T_I64, + 4); w.writeI64(s.noteSizeMax.ref()); w.writeFieldEnd(); } if (s.uploaded.isSet()) { - w.writeFieldBegin(QStringLiteral("uploaded"), ThriftFieldType::T_I64, 5); + w.writeFieldBegin( + QStringLiteral("uploaded"), + ThriftFieldType::T_I64, + 5); w.writeI64(s.uploaded.ref()); w.writeFieldEnd(); } @@ -7573,62 +8720,98 @@ void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s) { void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeStructBegin(QStringLiteral("Note")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.title.isSet()) { - w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } if (s.content.isSet()) { - w.writeFieldBegin(QStringLiteral("content"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("content"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.content.ref()); w.writeFieldEnd(); } if (s.contentHash.isSet()) { - w.writeFieldBegin(QStringLiteral("contentHash"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("contentHash"), + ThriftFieldType::T_STRING, + 4); w.writeBinary(s.contentHash.ref()); w.writeFieldEnd(); } if (s.contentLength.isSet()) { - w.writeFieldBegin(QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("contentLength"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.contentLength.ref()); w.writeFieldEnd(); } if (s.created.isSet()) { - w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 6); + w.writeFieldBegin( + QStringLiteral("created"), + ThriftFieldType::T_I64, + 6); w.writeI64(s.created.ref()); w.writeFieldEnd(); } if (s.updated.isSet()) { - w.writeFieldBegin(QStringLiteral("updated"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.updated.ref()); w.writeFieldEnd(); } if (s.deleted.isSet()) { - w.writeFieldBegin(QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("deleted"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.deleted.ref()); w.writeFieldEnd(); } if (s.active.isSet()) { - w.writeFieldBegin(QStringLiteral("active"), ThriftFieldType::T_BOOL, 9); + w.writeFieldBegin( + QStringLiteral("active"), + ThriftFieldType::T_BOOL, + 9); w.writeBool(s.active.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 10); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.tagGuids.isSet()) { - w.writeFieldBegin(QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); + w.writeFieldBegin( + QStringLiteral("tagGuids"), + ThriftFieldType::T_LIST, + 12); w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { w.writeString(value); @@ -7637,7 +8820,10 @@ void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeFieldEnd(); } if (s.resources.isSet()) { - w.writeFieldBegin(QStringLiteral("resources"), ThriftFieldType::T_LIST, 13); + w.writeFieldBegin( + QStringLiteral("resources"), + ThriftFieldType::T_LIST, + 13); w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); for(const auto & value: qAsConst(s.resources.ref())) { writeResource(w, value); @@ -7646,12 +8832,18 @@ void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeFieldEnd(); } if (s.attributes.isSet()) { - w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); + w.writeFieldBegin( + QStringLiteral("attributes"), + ThriftFieldType::T_STRUCT, + 14); writeNoteAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } if (s.tagNames.isSet()) { - w.writeFieldBegin(QStringLiteral("tagNames"), ThriftFieldType::T_LIST, 15); + w.writeFieldBegin( + QStringLiteral("tagNames"), + ThriftFieldType::T_LIST, + 15); w.writeListBegin(ThriftFieldType::T_STRING, s.tagNames.ref().length()); for(const auto & value: qAsConst(s.tagNames.ref())) { w.writeString(value); @@ -7660,7 +8852,10 @@ void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeFieldEnd(); } if (s.sharedNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("sharedNotes"), ThriftFieldType::T_LIST, 16); + w.writeFieldBegin( + QStringLiteral("sharedNotes"), + ThriftFieldType::T_LIST, + 16); w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotes.ref().length()); for(const auto & value: qAsConst(s.sharedNotes.ref())) { writeSharedNote(w, value); @@ -7669,12 +8864,18 @@ void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeFieldEnd(); } if (s.restrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); + w.writeFieldBegin( + QStringLiteral("restrictions"), + ThriftFieldType::T_STRUCT, + 17); writeNoteRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } if (s.limits.isSet()) { - w.writeFieldBegin(QStringLiteral("limits"), ThriftFieldType::T_STRUCT, 18); + w.writeFieldBegin( + QStringLiteral("limits"), + ThriftFieldType::T_STRUCT, + 18); writeNoteLimits(w, s.limits.ref()); w.writeFieldEnd(); } @@ -7792,7 +8993,7 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Guid > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -7811,7 +9012,7 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { - QList< Resource > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -7858,7 +9059,7 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_LIST) { - QList< SharedNote > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -7904,22 +9105,34 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s) { w.writeStructBegin(QStringLiteral("Publishing")); if (s.uri.isSet()) { - w.writeFieldBegin(QStringLiteral("uri"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("uri"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.uri.ref()); w.writeFieldEnd(); } if (s.order.isSet()) { - w.writeFieldBegin(QStringLiteral("order"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("order"), + ThriftFieldType::T_I32, + 2); w.writeI32(static_cast(s.order.ref())); w.writeFieldEnd(); } if (s.ascending.isSet()) { - w.writeFieldBegin(QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("ascending"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.ascending.ref()); w.writeFieldEnd(); } if (s.publicDescription.isSet()) { - w.writeFieldBegin(QStringLiteral("publicDescription"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("publicDescription"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.publicDescription.ref()); w.writeFieldEnd(); } @@ -7983,17 +9196,26 @@ void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook & s) { w.writeStructBegin(QStringLiteral("BusinessNotebook")); if (s.notebookDescription.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookDescription"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("notebookDescription"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.notebookDescription.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 2); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.recommended.isSet()) { - w.writeFieldBegin(QStringLiteral("recommended"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("recommended"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.recommended.ref()); w.writeFieldEnd(); } @@ -8048,17 +9270,26 @@ void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope & s) { w.writeStructBegin(QStringLiteral("SavedSearchScope")); if (s.includeAccount.isSet()) { - w.writeFieldBegin(QStringLiteral("includeAccount"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("includeAccount"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.includeAccount.ref()); w.writeFieldEnd(); } if (s.includePersonalLinkedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includePersonalLinkedNotebooks"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("includePersonalLinkedNotebooks"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.includePersonalLinkedNotebooks.ref()); w.writeFieldEnd(); } if (s.includeBusinessLinkedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("includeBusinessLinkedNotebooks"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("includeBusinessLinkedNotebooks"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.includeBusinessLinkedNotebooks.ref()); w.writeFieldEnd(); } @@ -8113,32 +9344,50 @@ void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s) { void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s) { w.writeStructBegin(QStringLiteral("SavedSearch")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.query.isSet()) { - w.writeFieldBegin(QStringLiteral("query"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("query"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.query.ref()); w.writeFieldEnd(); } if (s.format.isSet()) { - w.writeFieldBegin(QStringLiteral("format"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("format"), + ThriftFieldType::T_I32, + 4); w.writeI32(static_cast(s.format.ref())); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.scope.isSet()) { - w.writeFieldBegin(QStringLiteral("scope"), ThriftFieldType::T_STRUCT, 6); + w.writeFieldBegin( + QStringLiteral("scope"), + ThriftFieldType::T_STRUCT, + 6); writeSavedSearchScope(w, s.scope.ref()); w.writeFieldEnd(); } @@ -8220,12 +9469,18 @@ void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const SharedNotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("reminderNotifyEmail"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.reminderNotifyEmail.ref()); w.writeFieldEnd(); } if (s.reminderNotifyInApp.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("reminderNotifyInApp"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.reminderNotifyInApp.ref()); w.writeFieldEnd(); } @@ -8271,27 +9526,42 @@ void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNot void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const NotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("reminderNotifyEmail"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.reminderNotifyEmail.ref()); w.writeFieldEnd(); } if (s.reminderNotifyInApp.isSet()) { - w.writeFieldBegin(QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("reminderNotifyInApp"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.reminderNotifyInApp.ref()); w.writeFieldEnd(); } if (s.inMyList.isSet()) { - w.writeFieldBegin(QStringLiteral("inMyList"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("inMyList"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.inMyList.ref()); w.writeFieldEnd(); } if (s.stack.isSet()) { - w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("stack"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.stack.ref()); w.writeFieldEnd(); } if (s.recipientStatus.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientStatus"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("recipientStatus"), + ThriftFieldType::T_I32, + 5); w.writeI32(static_cast(s.recipientStatus.ref())); w.writeFieldEnd(); } @@ -8364,82 +9634,130 @@ void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipie void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s) { w.writeStructBegin(QStringLiteral("SharedNotebook")); if (s.id.isSet()) { - w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.id.ref()); w.writeFieldEnd(); } if (s.userId.isSet()) { - w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("userId"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.userId.ref()); w.writeFieldEnd(); } if (s.notebookGuid.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("notebookGuid"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.notebookGuid.ref()); w.writeFieldEnd(); } if (s.email.isSet()) { - w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("email"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.email.ref()); w.writeFieldEnd(); } if (s.recipientIdentityId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 18); + w.writeFieldBegin( + QStringLiteral("recipientIdentityId"), + ThriftFieldType::T_I64, + 18); w.writeI64(s.recipientIdentityId.ref()); w.writeFieldEnd(); } if (s.notebookModifiable.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookModifiable"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("notebookModifiable"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.notebookModifiable.ref()); w.writeFieldEnd(); } if (s.serviceCreated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("serviceCreated"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } if (s.serviceUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 10); + w.writeFieldBegin( + QStringLiteral("serviceUpdated"), + ThriftFieldType::T_I64, + 10); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } if (s.globalId.isSet()) { - w.writeFieldBegin(QStringLiteral("globalId"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("globalId"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.globalId.ref()); w.writeFieldEnd(); } if (s.username.isSet()) { - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.username.ref()); w.writeFieldEnd(); } if (s.privilege.isSet()) { - w.writeFieldBegin(QStringLiteral("privilege"), ThriftFieldType::T_I32, 11); + w.writeFieldBegin( + QStringLiteral("privilege"), + ThriftFieldType::T_I32, + 11); w.writeI32(static_cast(s.privilege.ref())); w.writeFieldEnd(); } if (s.recipientSettings.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 13); + w.writeFieldBegin( + QStringLiteral("recipientSettings"), + ThriftFieldType::T_STRUCT, + 13); writeSharedNotebookRecipientSettings(w, s.recipientSettings.ref()); w.writeFieldEnd(); } if (s.sharerUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 14); + w.writeFieldBegin( + QStringLiteral("sharerUserId"), + ThriftFieldType::T_I32, + 14); w.writeI32(s.sharerUserId.ref()); w.writeFieldEnd(); } if (s.recipientUsername.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientUsername"), ThriftFieldType::T_STRING, 15); + w.writeFieldBegin( + QStringLiteral("recipientUsername"), + ThriftFieldType::T_STRING, + 15); w.writeString(s.recipientUsername.ref()); w.writeFieldEnd(); } if (s.recipientUserId.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 17); + w.writeFieldBegin( + QStringLiteral("recipientUserId"), + ThriftFieldType::T_I32, + 17); w.writeI32(s.recipientUserId.ref()); w.writeFieldEnd(); } if (s.serviceAssigned.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 16); + w.writeFieldBegin( + QStringLiteral("serviceAssigned"), + ThriftFieldType::T_I64, + 16); w.writeI64(s.serviceAssigned.ref()); w.writeFieldEnd(); } @@ -8611,7 +9929,10 @@ void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const CanMoveToContainerRestrictions & s) { w.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); if (s.canMoveToContainer.isSet()) { - w.writeFieldBegin(QStringLiteral("canMoveToContainer"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("canMoveToContainer"), + ThriftFieldType::T_I32, + 1); w.writeI32(static_cast(s.canMoveToContainer.ref())); w.writeFieldEnd(); } @@ -8648,147 +9969,234 @@ void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToC void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestrictions & s) { w.writeStructBegin(QStringLiteral("NotebookRestrictions")); if (s.noReadNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noReadNotes"), ThriftFieldType::T_BOOL, 1); + w.writeFieldBegin( + QStringLiteral("noReadNotes"), + ThriftFieldType::T_BOOL, + 1); w.writeBool(s.noReadNotes.ref()); w.writeFieldEnd(); } if (s.noCreateNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noCreateNotes"), ThriftFieldType::T_BOOL, 2); + w.writeFieldBegin( + QStringLiteral("noCreateNotes"), + ThriftFieldType::T_BOOL, + 2); w.writeBool(s.noCreateNotes.ref()); w.writeFieldEnd(); } if (s.noUpdateNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noUpdateNotes"), ThriftFieldType::T_BOOL, 3); + w.writeFieldBegin( + QStringLiteral("noUpdateNotes"), + ThriftFieldType::T_BOOL, + 3); w.writeBool(s.noUpdateNotes.ref()); w.writeFieldEnd(); } if (s.noExpungeNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noExpungeNotes"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("noExpungeNotes"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.noExpungeNotes.ref()); w.writeFieldEnd(); } if (s.noShareNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noShareNotes"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("noShareNotes"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.noShareNotes.ref()); w.writeFieldEnd(); } if (s.noEmailNotes.isSet()) { - w.writeFieldBegin(QStringLiteral("noEmailNotes"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("noEmailNotes"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.noEmailNotes.ref()); w.writeFieldEnd(); } if (s.noSendMessageToRecipients.isSet()) { - w.writeFieldBegin(QStringLiteral("noSendMessageToRecipients"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("noSendMessageToRecipients"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.noSendMessageToRecipients.ref()); w.writeFieldEnd(); } if (s.noUpdateNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("noUpdateNotebook"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("noUpdateNotebook"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.noUpdateNotebook.ref()); w.writeFieldEnd(); } if (s.noExpungeNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("noExpungeNotebook"), ThriftFieldType::T_BOOL, 9); + w.writeFieldBegin( + QStringLiteral("noExpungeNotebook"), + ThriftFieldType::T_BOOL, + 9); w.writeBool(s.noExpungeNotebook.ref()); w.writeFieldEnd(); } if (s.noSetDefaultNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetDefaultNotebook"), ThriftFieldType::T_BOOL, 10); + w.writeFieldBegin( + QStringLiteral("noSetDefaultNotebook"), + ThriftFieldType::T_BOOL, + 10); w.writeBool(s.noSetDefaultNotebook.ref()); w.writeFieldEnd(); } if (s.noSetNotebookStack.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetNotebookStack"), ThriftFieldType::T_BOOL, 11); + w.writeFieldBegin( + QStringLiteral("noSetNotebookStack"), + ThriftFieldType::T_BOOL, + 11); w.writeBool(s.noSetNotebookStack.ref()); w.writeFieldEnd(); } if (s.noPublishToPublic.isSet()) { - w.writeFieldBegin(QStringLiteral("noPublishToPublic"), ThriftFieldType::T_BOOL, 12); + w.writeFieldBegin( + QStringLiteral("noPublishToPublic"), + ThriftFieldType::T_BOOL, + 12); w.writeBool(s.noPublishToPublic.ref()); w.writeFieldEnd(); } if (s.noPublishToBusinessLibrary.isSet()) { - w.writeFieldBegin(QStringLiteral("noPublishToBusinessLibrary"), ThriftFieldType::T_BOOL, 13); + w.writeFieldBegin( + QStringLiteral("noPublishToBusinessLibrary"), + ThriftFieldType::T_BOOL, + 13); w.writeBool(s.noPublishToBusinessLibrary.ref()); w.writeFieldEnd(); } if (s.noCreateTags.isSet()) { - w.writeFieldBegin(QStringLiteral("noCreateTags"), ThriftFieldType::T_BOOL, 14); + w.writeFieldBegin( + QStringLiteral("noCreateTags"), + ThriftFieldType::T_BOOL, + 14); w.writeBool(s.noCreateTags.ref()); w.writeFieldEnd(); } if (s.noUpdateTags.isSet()) { - w.writeFieldBegin(QStringLiteral("noUpdateTags"), ThriftFieldType::T_BOOL, 15); + w.writeFieldBegin( + QStringLiteral("noUpdateTags"), + ThriftFieldType::T_BOOL, + 15); w.writeBool(s.noUpdateTags.ref()); w.writeFieldEnd(); } if (s.noExpungeTags.isSet()) { - w.writeFieldBegin(QStringLiteral("noExpungeTags"), ThriftFieldType::T_BOOL, 16); + w.writeFieldBegin( + QStringLiteral("noExpungeTags"), + ThriftFieldType::T_BOOL, + 16); w.writeBool(s.noExpungeTags.ref()); w.writeFieldEnd(); } if (s.noSetParentTag.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetParentTag"), ThriftFieldType::T_BOOL, 17); + w.writeFieldBegin( + QStringLiteral("noSetParentTag"), + ThriftFieldType::T_BOOL, + 17); w.writeBool(s.noSetParentTag.ref()); w.writeFieldEnd(); } if (s.noCreateSharedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("noCreateSharedNotebooks"), ThriftFieldType::T_BOOL, 18); + w.writeFieldBegin( + QStringLiteral("noCreateSharedNotebooks"), + ThriftFieldType::T_BOOL, + 18); w.writeBool(s.noCreateSharedNotebooks.ref()); w.writeFieldEnd(); } if (s.updateWhichSharedNotebookRestrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("updateWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 19); + w.writeFieldBegin( + QStringLiteral("updateWhichSharedNotebookRestrictions"), + ThriftFieldType::T_I32, + 19); w.writeI32(static_cast(s.updateWhichSharedNotebookRestrictions.ref())); w.writeFieldEnd(); } if (s.expungeWhichSharedNotebookRestrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("expungeWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 20); + w.writeFieldBegin( + QStringLiteral("expungeWhichSharedNotebookRestrictions"), + ThriftFieldType::T_I32, + 20); w.writeI32(static_cast(s.expungeWhichSharedNotebookRestrictions.ref())); w.writeFieldEnd(); } if (s.noShareNotesWithBusiness.isSet()) { - w.writeFieldBegin(QStringLiteral("noShareNotesWithBusiness"), ThriftFieldType::T_BOOL, 21); + w.writeFieldBegin( + QStringLiteral("noShareNotesWithBusiness"), + ThriftFieldType::T_BOOL, + 21); w.writeBool(s.noShareNotesWithBusiness.ref()); w.writeFieldEnd(); } if (s.noRenameNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("noRenameNotebook"), ThriftFieldType::T_BOOL, 22); + w.writeFieldBegin( + QStringLiteral("noRenameNotebook"), + ThriftFieldType::T_BOOL, + 22); w.writeBool(s.noRenameNotebook.ref()); w.writeFieldEnd(); } if (s.noSetInMyList.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetInMyList"), ThriftFieldType::T_BOOL, 23); + w.writeFieldBegin( + QStringLiteral("noSetInMyList"), + ThriftFieldType::T_BOOL, + 23); w.writeBool(s.noSetInMyList.ref()); w.writeFieldEnd(); } if (s.noChangeContact.isSet()) { - w.writeFieldBegin(QStringLiteral("noChangeContact"), ThriftFieldType::T_BOOL, 24); + w.writeFieldBegin( + QStringLiteral("noChangeContact"), + ThriftFieldType::T_BOOL, + 24); w.writeBool(s.noChangeContact.ref()); w.writeFieldEnd(); } if (s.canMoveToContainerRestrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("canMoveToContainerRestrictions"), ThriftFieldType::T_STRUCT, 26); + w.writeFieldBegin( + QStringLiteral("canMoveToContainerRestrictions"), + ThriftFieldType::T_STRUCT, + 26); writeCanMoveToContainerRestrictions(w, s.canMoveToContainerRestrictions.ref()); w.writeFieldEnd(); } if (s.noSetReminderNotifyEmail.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetReminderNotifyEmail"), ThriftFieldType::T_BOOL, 27); + w.writeFieldBegin( + QStringLiteral("noSetReminderNotifyEmail"), + ThriftFieldType::T_BOOL, + 27); w.writeBool(s.noSetReminderNotifyEmail.ref()); w.writeFieldEnd(); } if (s.noSetReminderNotifyInApp.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetReminderNotifyInApp"), ThriftFieldType::T_BOOL, 28); + w.writeFieldBegin( + QStringLiteral("noSetReminderNotifyInApp"), + ThriftFieldType::T_BOOL, + 28); w.writeBool(s.noSetReminderNotifyInApp.ref()); w.writeFieldEnd(); } if (s.noSetRecipientSettingsStack.isSet()) { - w.writeFieldBegin(QStringLiteral("noSetRecipientSettingsStack"), ThriftFieldType::T_BOOL, 29); + w.writeFieldBegin( + QStringLiteral("noSetRecipientSettingsStack"), + ThriftFieldType::T_BOOL, + 29); w.writeBool(s.noSetRecipientSettingsStack.ref()); w.writeFieldEnd(); } if (s.noCanMoveNote.isSet()) { - w.writeFieldBegin(QStringLiteral("noCanMoveNote"), ThriftFieldType::T_BOOL, 30); + w.writeFieldBegin( + QStringLiteral("noCanMoveNote"), + ThriftFieldType::T_BOOL, + 30); w.writeBool(s.noCanMoveNote.ref()); w.writeFieldEnd(); } @@ -9077,52 +10485,82 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeStructBegin(QStringLiteral("Notebook")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.defaultNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("defaultNotebook"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("defaultNotebook"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.defaultNotebook.ref()); w.writeFieldEnd(); } if (s.serviceCreated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("serviceCreated"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.serviceCreated.ref()); w.writeFieldEnd(); } if (s.serviceUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("serviceUpdated"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.serviceUpdated.ref()); w.writeFieldEnd(); } if (s.publishing.isSet()) { - w.writeFieldBegin(QStringLiteral("publishing"), ThriftFieldType::T_STRUCT, 10); + w.writeFieldBegin( + QStringLiteral("publishing"), + ThriftFieldType::T_STRUCT, + 10); writePublishing(w, s.publishing.ref()); w.writeFieldEnd(); } if (s.published.isSet()) { - w.writeFieldBegin(QStringLiteral("published"), ThriftFieldType::T_BOOL, 11); + w.writeFieldBegin( + QStringLiteral("published"), + ThriftFieldType::T_BOOL, + 11); w.writeBool(s.published.ref()); w.writeFieldEnd(); } if (s.stack.isSet()) { - w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 12); + w.writeFieldBegin( + QStringLiteral("stack"), + ThriftFieldType::T_STRING, + 12); w.writeString(s.stack.ref()); w.writeFieldEnd(); } if (s.sharedNotebookIds.isSet()) { - w.writeFieldBegin(QStringLiteral("sharedNotebookIds"), ThriftFieldType::T_LIST, 13); + w.writeFieldBegin( + QStringLiteral("sharedNotebookIds"), + ThriftFieldType::T_LIST, + 13); w.writeListBegin(ThriftFieldType::T_I64, s.sharedNotebookIds.ref().length()); for(const auto & value: qAsConst(s.sharedNotebookIds.ref())) { w.writeI64(value); @@ -9131,7 +10569,10 @@ void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeFieldEnd(); } if (s.sharedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("sharedNotebooks"), ThriftFieldType::T_LIST, 14); + w.writeFieldBegin( + QStringLiteral("sharedNotebooks"), + ThriftFieldType::T_LIST, + 14); w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotebooks.ref().length()); for(const auto & value: qAsConst(s.sharedNotebooks.ref())) { writeSharedNotebook(w, value); @@ -9140,22 +10581,34 @@ void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeFieldEnd(); } if (s.businessNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("businessNotebook"), ThriftFieldType::T_STRUCT, 15); + w.writeFieldBegin( + QStringLiteral("businessNotebook"), + ThriftFieldType::T_STRUCT, + 15); writeBusinessNotebook(w, s.businessNotebook.ref()); w.writeFieldEnd(); } if (s.contact.isSet()) { - w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 16); + w.writeFieldBegin( + QStringLiteral("contact"), + ThriftFieldType::T_STRUCT, + 16); writeUser(w, s.contact.ref()); w.writeFieldEnd(); } if (s.restrictions.isSet()) { - w.writeFieldBegin(QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); + w.writeFieldBegin( + QStringLiteral("restrictions"), + ThriftFieldType::T_STRUCT, + 17); writeNotebookRestrictions(w, s.restrictions.ref()); w.writeFieldEnd(); } if (s.recipientSettings.isSet()) { - w.writeFieldBegin(QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 18); + w.writeFieldBegin( + QStringLiteral("recipientSettings"), + ThriftFieldType::T_STRUCT, + 18); writeNotebookRecipientSettings(w, s.recipientSettings.ref()); w.writeFieldEnd(); } @@ -9255,7 +10708,7 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { - QList< qint64 > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -9274,7 +10727,7 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_LIST) { - QList< SharedNotebook > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -9338,57 +10791,90 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s) { w.writeStructBegin(QStringLiteral("LinkedNotebook")); if (s.shareName.isSet()) { - w.writeFieldBegin(QStringLiteral("shareName"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("shareName"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.shareName.ref()); w.writeFieldEnd(); } if (s.username.isSet()) { - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.username.ref()); w.writeFieldEnd(); } if (s.shardId.isSet()) { - w.writeFieldBegin(QStringLiteral("shardId"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("shardId"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.shardId.ref()); w.writeFieldEnd(); } if (s.sharedNotebookGlobalId.isSet()) { - w.writeFieldBegin(QStringLiteral("sharedNotebookGlobalId"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("sharedNotebookGlobalId"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.sharedNotebookGlobalId.ref()); w.writeFieldEnd(); } if (s.uri.isSet()) { - w.writeFieldBegin(QStringLiteral("uri"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("uri"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.uri.ref()); w.writeFieldEnd(); } if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 7); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin(QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 8); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 8); w.writeI32(s.updateSequenceNum.ref()); w.writeFieldEnd(); } if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("noteStoreUrl"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 10); + w.writeFieldBegin( + QStringLiteral("webApiUrlPrefix"), + ThriftFieldType::T_STRING, + 10); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } if (s.stack.isSet()) { - w.writeFieldBegin(QStringLiteral("stack"), ThriftFieldType::T_STRING, 11); + w.writeFieldBegin( + QStringLiteral("stack"), + ThriftFieldType::T_STRING, + 11); w.writeString(s.stack.ref()); w.writeFieldEnd(); } if (s.businessId.isSet()) { - w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 12); + w.writeFieldBegin( + QStringLiteral("businessId"), + ThriftFieldType::T_I32, + 12); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } @@ -9515,27 +11001,42 @@ void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s) { void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescriptor & s) { w.writeStructBegin(QStringLiteral("NotebookDescriptor")); if (s.guid.isSet()) { - w.writeFieldBegin(QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.guid.ref()); w.writeFieldEnd(); } if (s.notebookDisplayName.isSet()) { - w.writeFieldBegin(QStringLiteral("notebookDisplayName"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("notebookDisplayName"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.notebookDisplayName.ref()); w.writeFieldEnd(); } if (s.contactName.isSet()) { - w.writeFieldBegin(QStringLiteral("contactName"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("contactName"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.contactName.ref()); w.writeFieldEnd(); } if (s.hasSharedNotebook.isSet()) { - w.writeFieldBegin(QStringLiteral("hasSharedNotebook"), ThriftFieldType::T_BOOL, 4); + w.writeFieldBegin( + QStringLiteral("hasSharedNotebook"), + ThriftFieldType::T_BOOL, + 4); w.writeBool(s.hasSharedNotebook.ref()); w.writeFieldEnd(); } if (s.joinedUserCount.isSet()) { - w.writeFieldBegin(QStringLiteral("joinedUserCount"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("joinedUserCount"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.joinedUserCount.ref()); w.writeFieldEnd(); } @@ -9608,52 +11109,82 @@ void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s) { w.writeStructBegin(QStringLiteral("UserProfile")); if (s.id.isSet()) { - w.writeFieldBegin(QStringLiteral("id"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.id.ref()); w.writeFieldEnd(); } if (s.name.isSet()) { - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.name.ref()); w.writeFieldEnd(); } if (s.email.isSet()) { - w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("email"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.email.ref()); w.writeFieldEnd(); } if (s.username.isSet()) { - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.username.ref()); w.writeFieldEnd(); } if (s.attributes.isSet()) { - w.writeFieldBegin(QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 5); + w.writeFieldBegin( + QStringLiteral("attributes"), + ThriftFieldType::T_STRUCT, + 5); writeBusinessUserAttributes(w, s.attributes.ref()); w.writeFieldEnd(); } if (s.joined.isSet()) { - w.writeFieldBegin(QStringLiteral("joined"), ThriftFieldType::T_I64, 6); + w.writeFieldBegin( + QStringLiteral("joined"), + ThriftFieldType::T_I64, + 6); w.writeI64(s.joined.ref()); w.writeFieldEnd(); } if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin(QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("photoLastUpdated"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.photoLastUpdated.ref()); w.writeFieldEnd(); } if (s.photoUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 8); + w.writeFieldBegin( + QStringLiteral("photoUrl"), + ThriftFieldType::T_STRING, + 8); w.writeString(s.photoUrl.ref()); w.writeFieldEnd(); } if (s.role.isSet()) { - w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 9); + w.writeFieldBegin( + QStringLiteral("role"), + ThriftFieldType::T_I32, + 9); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } if (s.status.isSet()) { - w.writeFieldBegin(QStringLiteral("status"), ThriftFieldType::T_I32, 10); + w.writeFieldBegin( + QStringLiteral("status"), + ThriftFieldType::T_I32, + 10); w.writeI32(static_cast(s.status.ref())); w.writeFieldEnd(); } @@ -9771,27 +11302,42 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContentImage & s) { w.writeStructBegin(QStringLiteral("RelatedContentImage")); if (s.url.isSet()) { - w.writeFieldBegin(QStringLiteral("url"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("url"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.url.ref()); w.writeFieldEnd(); } if (s.width.isSet()) { - w.writeFieldBegin(QStringLiteral("width"), ThriftFieldType::T_I32, 2); + w.writeFieldBegin( + QStringLiteral("width"), + ThriftFieldType::T_I32, + 2); w.writeI32(s.width.ref()); w.writeFieldEnd(); } if (s.height.isSet()) { - w.writeFieldBegin(QStringLiteral("height"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("height"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.height.ref()); w.writeFieldEnd(); } if (s.pixelRatio.isSet()) { - w.writeFieldBegin(QStringLiteral("pixelRatio"), ThriftFieldType::T_DOUBLE, 4); + w.writeFieldBegin( + QStringLiteral("pixelRatio"), + ThriftFieldType::T_DOUBLE, + 4); w.writeDouble(s.pixelRatio.ref()); w.writeFieldEnd(); } if (s.fileSize.isSet()) { - w.writeFieldBegin(QStringLiteral("fileSize"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("fileSize"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.fileSize.ref()); w.writeFieldEnd(); } @@ -9864,52 +11410,82 @@ void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) { w.writeStructBegin(QStringLiteral("RelatedContent")); if (s.contentId.isSet()) { - w.writeFieldBegin(QStringLiteral("contentId"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("contentId"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.contentId.ref()); w.writeFieldEnd(); } if (s.title.isSet()) { - w.writeFieldBegin(QStringLiteral("title"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.title.ref()); w.writeFieldEnd(); } if (s.url.isSet()) { - w.writeFieldBegin(QStringLiteral("url"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("url"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.url.ref()); w.writeFieldEnd(); } if (s.sourceId.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceId"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("sourceId"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.sourceId.ref()); w.writeFieldEnd(); } if (s.sourceUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceUrl"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("sourceUrl"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.sourceUrl.ref()); w.writeFieldEnd(); } if (s.sourceFaviconUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceFaviconUrl"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("sourceFaviconUrl"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.sourceFaviconUrl.ref()); w.writeFieldEnd(); } if (s.sourceName.isSet()) { - w.writeFieldBegin(QStringLiteral("sourceName"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("sourceName"), + ThriftFieldType::T_STRING, + 7); w.writeString(s.sourceName.ref()); w.writeFieldEnd(); } if (s.date.isSet()) { - w.writeFieldBegin(QStringLiteral("date"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("date"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.date.ref()); w.writeFieldEnd(); } if (s.teaser.isSet()) { - w.writeFieldBegin(QStringLiteral("teaser"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("teaser"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.teaser.ref()); w.writeFieldEnd(); } if (s.thumbnails.isSet()) { - w.writeFieldBegin(QStringLiteral("thumbnails"), ThriftFieldType::T_LIST, 10); + w.writeFieldBegin( + QStringLiteral("thumbnails"), + ThriftFieldType::T_LIST, + 10); w.writeListBegin(ThriftFieldType::T_STRUCT, s.thumbnails.ref().length()); for(const auto & value: qAsConst(s.thumbnails.ref())) { writeRelatedContentImage(w, value); @@ -9918,32 +11494,50 @@ void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) w.writeFieldEnd(); } if (s.contentType.isSet()) { - w.writeFieldBegin(QStringLiteral("contentType"), ThriftFieldType::T_I32, 11); + w.writeFieldBegin( + QStringLiteral("contentType"), + ThriftFieldType::T_I32, + 11); w.writeI32(static_cast(s.contentType.ref())); w.writeFieldEnd(); } if (s.accessType.isSet()) { - w.writeFieldBegin(QStringLiteral("accessType"), ThriftFieldType::T_I32, 12); + w.writeFieldBegin( + QStringLiteral("accessType"), + ThriftFieldType::T_I32, + 12); w.writeI32(static_cast(s.accessType.ref())); w.writeFieldEnd(); } if (s.visibleUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("visibleUrl"), ThriftFieldType::T_STRING, 13); + w.writeFieldBegin( + QStringLiteral("visibleUrl"), + ThriftFieldType::T_STRING, + 13); w.writeString(s.visibleUrl.ref()); w.writeFieldEnd(); } if (s.clipUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("clipUrl"), ThriftFieldType::T_STRING, 14); + w.writeFieldBegin( + QStringLiteral("clipUrl"), + ThriftFieldType::T_STRING, + 14); w.writeString(s.clipUrl.ref()); w.writeFieldEnd(); } if (s.contact.isSet()) { - w.writeFieldBegin(QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 15); + w.writeFieldBegin( + QStringLiteral("contact"), + ThriftFieldType::T_STRUCT, + 15); writeContact(w, s.contact.ref()); w.writeFieldEnd(); } if (s.authors.isSet()) { - w.writeFieldBegin(QStringLiteral("authors"), ThriftFieldType::T_LIST, 16); + w.writeFieldBegin( + QStringLiteral("authors"), + ThriftFieldType::T_LIST, + 16); w.writeListBegin(ThriftFieldType::T_STRING, s.authors.ref().length()); for(const auto & value: qAsConst(s.authors.ref())) { w.writeString(value); @@ -10047,7 +11641,7 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_LIST) { - QList< RelatedContentImage > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -10139,42 +11733,66 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitation & s) { w.writeStructBegin(QStringLiteral("BusinessInvitation")); if (s.businessId.isSet()) { - w.writeFieldBegin(QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("businessId"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.businessId.ref()); w.writeFieldEnd(); } if (s.email.isSet()) { - w.writeFieldBegin(QStringLiteral("email"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("email"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.email.ref()); w.writeFieldEnd(); } if (s.role.isSet()) { - w.writeFieldBegin(QStringLiteral("role"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("role"), + ThriftFieldType::T_I32, + 3); w.writeI32(static_cast(s.role.ref())); w.writeFieldEnd(); } if (s.status.isSet()) { - w.writeFieldBegin(QStringLiteral("status"), ThriftFieldType::T_I32, 4); + w.writeFieldBegin( + QStringLiteral("status"), + ThriftFieldType::T_I32, + 4); w.writeI32(static_cast(s.status.ref())); w.writeFieldEnd(); } if (s.requesterId.isSet()) { - w.writeFieldBegin(QStringLiteral("requesterId"), ThriftFieldType::T_I32, 5); + w.writeFieldBegin( + QStringLiteral("requesterId"), + ThriftFieldType::T_I32, + 5); w.writeI32(s.requesterId.ref()); w.writeFieldEnd(); } if (s.fromWorkChat.isSet()) { - w.writeFieldBegin(QStringLiteral("fromWorkChat"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("fromWorkChat"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.fromWorkChat.ref()); w.writeFieldEnd(); } if (s.created.isSet()) { - w.writeFieldBegin(QStringLiteral("created"), ThriftFieldType::T_I64, 7); + w.writeFieldBegin( + QStringLiteral("created"), + ThriftFieldType::T_I64, + 7); w.writeI64(s.created.ref()); w.writeFieldEnd(); } if (s.mostRecentReminder.isSet()) { - w.writeFieldBegin(QStringLiteral("mostRecentReminder"), ThriftFieldType::T_I64, 8); + w.writeFieldBegin( + QStringLiteral("mostRecentReminder"), + ThriftFieldType::T_I64, + 8); w.writeI64(s.mostRecentReminder.ref()); w.writeFieldEnd(); } @@ -10274,17 +11892,26 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s) { w.writeStructBegin(QStringLiteral("UserIdentity")); if (s.type.isSet()) { - w.writeFieldBegin(QStringLiteral("type"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("type"), + ThriftFieldType::T_I32, + 1); w.writeI32(static_cast(s.type.ref())); w.writeFieldEnd(); } if (s.stringIdentifier.isSet()) { - w.writeFieldBegin(QStringLiteral("stringIdentifier"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("stringIdentifier"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.stringIdentifier.ref()); w.writeFieldEnd(); } if (s.longIdentifier.isSet()) { - w.writeFieldBegin(QStringLiteral("longIdentifier"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("longIdentifier"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.longIdentifier.ref()); w.writeFieldEnd(); } @@ -10338,26 +11965,41 @@ void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s) { void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s) { w.writeStructBegin(QStringLiteral("PublicUserInfo")); - w.writeFieldBegin(QStringLiteral("userId"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("userId"), + ThriftFieldType::T_I32, + 1); w.writeI32(s.userId); w.writeFieldEnd(); if (s.serviceLevel.isSet()) { - w.writeFieldBegin(QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 7); + w.writeFieldBegin( + QStringLiteral("serviceLevel"), + ThriftFieldType::T_I32, + 7); w.writeI32(static_cast(s.serviceLevel.ref())); w.writeFieldEnd(); } if (s.username.isSet()) { - w.writeFieldBegin(QStringLiteral("username"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("username"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.username.ref()); w.writeFieldEnd(); } if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("noteStoreUrl"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("webApiUrlPrefix"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } @@ -10433,32 +12075,50 @@ void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s) { w.writeStructBegin(QStringLiteral("UserUrls")); if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("noteStoreUrl"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("webApiUrlPrefix"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } if (s.userStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("userStoreUrl"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("userStoreUrl"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.userStoreUrl.ref()); w.writeFieldEnd(); } if (s.utilityUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("utilityUrl"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("utilityUrl"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.utilityUrl.ref()); w.writeFieldEnd(); } if (s.messageStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("messageStoreUrl"), ThriftFieldType::T_STRING, 5); + w.writeFieldBegin( + QStringLiteral("messageStoreUrl"), + ThriftFieldType::T_STRING, + 5); w.writeString(s.messageStoreUrl.ref()); w.writeFieldEnd(); } if (s.userWebSocketUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("userWebSocketUrl"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("userWebSocketUrl"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.userWebSocketUrl.ref()); w.writeFieldEnd(); } @@ -10539,47 +12199,77 @@ void readUserUrls(ThriftBinaryBufferReader & r, UserUrls & s) { void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const AuthenticationResult & s) { w.writeStructBegin(QStringLiteral("AuthenticationResult")); - w.writeFieldBegin(QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); + w.writeFieldBegin( + QStringLiteral("currentTime"), + ThriftFieldType::T_I64, + 1); w.writeI64(s.currentTime); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("authenticationToken"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.authenticationToken); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("expiration"), ThriftFieldType::T_I64, 3); + w.writeFieldBegin( + QStringLiteral("expiration"), + ThriftFieldType::T_I64, + 3); w.writeI64(s.expiration); w.writeFieldEnd(); if (s.user.isSet()) { - w.writeFieldBegin(QStringLiteral("user"), ThriftFieldType::T_STRUCT, 4); + w.writeFieldBegin( + QStringLiteral("user"), + ThriftFieldType::T_STRUCT, + 4); writeUser(w, s.user.ref()); w.writeFieldEnd(); } if (s.publicUserInfo.isSet()) { - w.writeFieldBegin(QStringLiteral("publicUserInfo"), ThriftFieldType::T_STRUCT, 5); + w.writeFieldBegin( + QStringLiteral("publicUserInfo"), + ThriftFieldType::T_STRUCT, + 5); writePublicUserInfo(w, s.publicUserInfo.ref()); w.writeFieldEnd(); } if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin(QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 6); + w.writeFieldBegin( + QStringLiteral("noteStoreUrl"), + ThriftFieldType::T_STRING, + 6); w.writeString(s.noteStoreUrl.ref()); w.writeFieldEnd(); } if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin(QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 7); + w.writeFieldBegin( + QStringLiteral("webApiUrlPrefix"), + ThriftFieldType::T_STRING, + 7); w.writeString(s.webApiUrlPrefix.ref()); w.writeFieldEnd(); } if (s.secondFactorRequired.isSet()) { - w.writeFieldBegin(QStringLiteral("secondFactorRequired"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("secondFactorRequired"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.secondFactorRequired.ref()); w.writeFieldEnd(); } if (s.secondFactorDeliveryHint.isSet()) { - w.writeFieldBegin(QStringLiteral("secondFactorDeliveryHint"), ThriftFieldType::T_STRING, 9); + w.writeFieldBegin( + QStringLiteral("secondFactorDeliveryHint"), + ThriftFieldType::T_STRING, + 9); w.writeString(s.secondFactorDeliveryHint.ref()); w.writeFieldEnd(); } if (s.urls.isSet()) { - w.writeFieldBegin(QStringLiteral("urls"), ThriftFieldType::T_STRUCT, 10); + w.writeFieldBegin( + QStringLiteral("urls"), + ThriftFieldType::T_STRUCT, + 10); writeUserUrls(w, s.urls.ref()); w.writeFieldEnd(); } @@ -10705,65 +12395,107 @@ void readAuthenticationResult(ThriftBinaryBufferReader & r, AuthenticationResult void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSettings & s) { w.writeStructBegin(QStringLiteral("BootstrapSettings")); - w.writeFieldBegin(QStringLiteral("serviceHost"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("serviceHost"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.serviceHost); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("marketingUrl"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("marketingUrl"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.marketingUrl); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("supportUrl"), ThriftFieldType::T_STRING, 3); + w.writeFieldBegin( + QStringLiteral("supportUrl"), + ThriftFieldType::T_STRING, + 3); w.writeString(s.supportUrl); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("accountEmailDomain"), ThriftFieldType::T_STRING, 4); + w.writeFieldBegin( + QStringLiteral("accountEmailDomain"), + ThriftFieldType::T_STRING, + 4); w.writeString(s.accountEmailDomain); w.writeFieldEnd(); if (s.enableFacebookSharing.isSet()) { - w.writeFieldBegin(QStringLiteral("enableFacebookSharing"), ThriftFieldType::T_BOOL, 5); + w.writeFieldBegin( + QStringLiteral("enableFacebookSharing"), + ThriftFieldType::T_BOOL, + 5); w.writeBool(s.enableFacebookSharing.ref()); w.writeFieldEnd(); } if (s.enableGiftSubscriptions.isSet()) { - w.writeFieldBegin(QStringLiteral("enableGiftSubscriptions"), ThriftFieldType::T_BOOL, 6); + w.writeFieldBegin( + QStringLiteral("enableGiftSubscriptions"), + ThriftFieldType::T_BOOL, + 6); w.writeBool(s.enableGiftSubscriptions.ref()); w.writeFieldEnd(); } if (s.enableSupportTickets.isSet()) { - w.writeFieldBegin(QStringLiteral("enableSupportTickets"), ThriftFieldType::T_BOOL, 7); + w.writeFieldBegin( + QStringLiteral("enableSupportTickets"), + ThriftFieldType::T_BOOL, + 7); w.writeBool(s.enableSupportTickets.ref()); w.writeFieldEnd(); } if (s.enableSharedNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("enableSharedNotebooks"), ThriftFieldType::T_BOOL, 8); + w.writeFieldBegin( + QStringLiteral("enableSharedNotebooks"), + ThriftFieldType::T_BOOL, + 8); w.writeBool(s.enableSharedNotebooks.ref()); w.writeFieldEnd(); } if (s.enableSingleNoteSharing.isSet()) { - w.writeFieldBegin(QStringLiteral("enableSingleNoteSharing"), ThriftFieldType::T_BOOL, 9); + w.writeFieldBegin( + QStringLiteral("enableSingleNoteSharing"), + ThriftFieldType::T_BOOL, + 9); w.writeBool(s.enableSingleNoteSharing.ref()); w.writeFieldEnd(); } if (s.enableSponsoredAccounts.isSet()) { - w.writeFieldBegin(QStringLiteral("enableSponsoredAccounts"), ThriftFieldType::T_BOOL, 10); + w.writeFieldBegin( + QStringLiteral("enableSponsoredAccounts"), + ThriftFieldType::T_BOOL, + 10); w.writeBool(s.enableSponsoredAccounts.ref()); w.writeFieldEnd(); } if (s.enableTwitterSharing.isSet()) { - w.writeFieldBegin(QStringLiteral("enableTwitterSharing"), ThriftFieldType::T_BOOL, 11); + w.writeFieldBegin( + QStringLiteral("enableTwitterSharing"), + ThriftFieldType::T_BOOL, + 11); w.writeBool(s.enableTwitterSharing.ref()); w.writeFieldEnd(); } if (s.enableLinkedInSharing.isSet()) { - w.writeFieldBegin(QStringLiteral("enableLinkedInSharing"), ThriftFieldType::T_BOOL, 12); + w.writeFieldBegin( + QStringLiteral("enableLinkedInSharing"), + ThriftFieldType::T_BOOL, + 12); w.writeBool(s.enableLinkedInSharing.ref()); w.writeFieldEnd(); } if (s.enablePublicNotebooks.isSet()) { - w.writeFieldBegin(QStringLiteral("enablePublicNotebooks"), ThriftFieldType::T_BOOL, 13); + w.writeFieldBegin( + QStringLiteral("enablePublicNotebooks"), + ThriftFieldType::T_BOOL, + 13); w.writeBool(s.enablePublicNotebooks.ref()); w.writeFieldEnd(); } if (s.enableGoogle.isSet()) { - w.writeFieldBegin(QStringLiteral("enableGoogle"), ThriftFieldType::T_BOOL, 16); + w.writeFieldBegin( + QStringLiteral("enableGoogle"), + ThriftFieldType::T_BOOL, + 16); w.writeBool(s.enableGoogle.ref()); w.writeFieldEnd(); } @@ -10928,10 +12660,16 @@ void readBootstrapSettings(ThriftBinaryBufferReader & r, BootstrapSettings & s) void writeBootstrapProfile(ThriftBinaryBufferWriter & w, const BootstrapProfile & s) { w.writeStructBegin(QStringLiteral("BootstrapProfile")); - w.writeFieldBegin(QStringLiteral("name"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.name); w.writeFieldEnd(); - w.writeFieldBegin(QStringLiteral("settings"), ThriftFieldType::T_STRUCT, 2); + w.writeFieldBegin( + QStringLiteral("settings"), + ThriftFieldType::T_STRUCT, + 2); writeBootstrapSettings(w, s.settings); w.writeFieldEnd(); w.writeFieldStop(); @@ -10981,7 +12719,10 @@ void readBootstrapProfile(ThriftBinaryBufferReader & r, BootstrapProfile & s) { void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s) { w.writeStructBegin(QStringLiteral("BootstrapInfo")); - w.writeFieldBegin(QStringLiteral("profiles"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("profiles"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.profiles.length()); for(const auto & value: qAsConst(s.profiles)) { writeBootstrapProfile(w, value); @@ -11005,7 +12746,7 @@ void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s) { if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { profiles_isset = true; - QList< BootstrapProfile > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -11040,11 +12781,17 @@ EDAMUserException::EDAMUserException(const EDAMUserException& other) : EvernoteE } void writeEDAMUserException(ThriftBinaryBufferWriter & w, const EDAMUserException & s) { w.writeStructBegin(QStringLiteral("EDAMUserException")); - w.writeFieldBegin(QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("errorCode"), + ThriftFieldType::T_I32, + 1); w.writeI32(static_cast(s.errorCode)); w.writeFieldEnd(); if (s.parameter.isSet()) { - w.writeFieldBegin(QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("parameter"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.parameter.ref()); w.writeFieldEnd(); } @@ -11100,16 +12847,25 @@ EDAMSystemException::EDAMSystemException(const EDAMSystemException& other) : Eve } void writeEDAMSystemException(ThriftBinaryBufferWriter & w, const EDAMSystemException & s) { w.writeStructBegin(QStringLiteral("EDAMSystemException")); - w.writeFieldBegin(QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); + w.writeFieldBegin( + QStringLiteral("errorCode"), + ThriftFieldType::T_I32, + 1); w.writeI32(static_cast(s.errorCode)); w.writeFieldEnd(); if (s.message.isSet()) { - w.writeFieldBegin(QStringLiteral("message"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("message"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.message.ref()); w.writeFieldEnd(); } if (s.rateLimitDuration.isSet()) { - w.writeFieldBegin(QStringLiteral("rateLimitDuration"), ThriftFieldType::T_I32, 3); + w.writeFieldBegin( + QStringLiteral("rateLimitDuration"), + ThriftFieldType::T_I32, + 3); w.writeI32(s.rateLimitDuration.ref()); w.writeFieldEnd(); } @@ -11174,12 +12930,18 @@ EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) void writeEDAMNotFoundException(ThriftBinaryBufferWriter & w, const EDAMNotFoundException & s) { w.writeStructBegin(QStringLiteral("EDAMNotFoundException")); if (s.identifier.isSet()) { - w.writeFieldBegin(QStringLiteral("identifier"), ThriftFieldType::T_STRING, 1); + w.writeFieldBegin( + QStringLiteral("identifier"), + ThriftFieldType::T_STRING, + 1); w.writeString(s.identifier.ref()); w.writeFieldEnd(); } if (s.key.isSet()) { - w.writeFieldBegin(QStringLiteral("key"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("key"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.key.ref()); w.writeFieldEnd(); } @@ -11232,7 +12994,10 @@ EDAMInvalidContactsException::EDAMInvalidContactsException(const EDAMInvalidCont } void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMInvalidContactsException & s) { w.writeStructBegin(QStringLiteral("EDAMInvalidContactsException")); - w.writeFieldBegin(QStringLiteral("contacts"), ThriftFieldType::T_LIST, 1); + w.writeFieldBegin( + QStringLiteral("contacts"), + ThriftFieldType::T_LIST, + 1); w.writeListBegin(ThriftFieldType::T_STRUCT, s.contacts.length()); for(const auto & value: qAsConst(s.contacts)) { writeContact(w, value); @@ -11240,12 +13005,18 @@ void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMI w.writeListEnd(); w.writeFieldEnd(); if (s.parameter.isSet()) { - w.writeFieldBegin(QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); + w.writeFieldBegin( + QStringLiteral("parameter"), + ThriftFieldType::T_STRING, + 2); w.writeString(s.parameter.ref()); w.writeFieldEnd(); } if (s.reasons.isSet()) { - w.writeFieldBegin(QStringLiteral("reasons"), ThriftFieldType::T_LIST, 3); + w.writeFieldBegin( + QStringLiteral("reasons"), + ThriftFieldType::T_LIST, + 3); w.writeListBegin(ThriftFieldType::T_I32, s.reasons.ref().length()); for(const auto & value: qAsConst(s.reasons.ref())) { w.writeI32(static_cast(value)); @@ -11270,7 +13041,7 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { contacts_isset = true; - QList< Contact > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); @@ -11298,7 +13069,7 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { - QList< EDAMInvalidContactReason > v; + QList v; qint32 size; ThriftFieldType::type elemType; r.readListBegin(elemType, size); diff --git a/QEverCloud/src/generated/Types_io.h b/QEverCloud/src/generated/Types_io.h index 200686d4..7e5187e8 100644 --- a/QEverCloud/src/generated/Types_io.h +++ b/QEverCloud/src/generated/Types_io.h @@ -2,7 +2,8 @@ * Original work: Copyright (c) 2014 Sergey Skoblikov * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * - * This file is a part of QEverCloud project and is distributed under the terms of MIT license: + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: * https://opensource.org/licenses/MIT * * This file was generated from Evernote Thrift API From 6a8d342702cb15bbe64e096c54f5410350e3edaf Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 25 Sep 2019 07:30:47 +0300 Subject: [PATCH 007/188] Indentation adjustment in declaration and definition of error codes print operators --- QEverCloud/headers/generated/EDAMErrorCode.h | 138 ++++++++++++------- QEverCloud/src/generated/EDAMErrorCode.cpp | 138 ++++++++++++------- 2 files changed, 184 insertions(+), 92 deletions(-) diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index e06c79a8..d172497b 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -136,11 +136,13 @@ inline uint qHash(EDAMErrorCode value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EDAMErrorCode value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const EDAMErrorCode value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EDAMErrorCode value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const EDAMErrorCode value); //////////////////////////////////////////////////////////////////////////////// @@ -191,11 +193,13 @@ inline uint qHash(EDAMInvalidContactReason value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EDAMInvalidContactReason value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const EDAMInvalidContactReason value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EDAMInvalidContactReason value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const EDAMInvalidContactReason value); //////////////////////////////////////////////////////////////////////////////// @@ -235,11 +239,13 @@ inline uint qHash(ShareRelationshipPrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ShareRelationshipPrivilegeLevel value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const ShareRelationshipPrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ShareRelationshipPrivilegeLevel value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const ShareRelationshipPrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// @@ -265,11 +271,13 @@ inline uint qHash(PrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const PrivilegeLevel value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const PrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const PrivilegeLevel value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const PrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// @@ -293,11 +301,13 @@ inline uint qHash(ServiceLevel value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ServiceLevel value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const ServiceLevel value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ServiceLevel value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const ServiceLevel value); //////////////////////////////////////////////////////////////////////////////// @@ -318,11 +328,13 @@ inline uint qHash(QueryFormat value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const QueryFormat value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const QueryFormat value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const QueryFormat value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const QueryFormat value); //////////////////////////////////////////////////////////////////////////////// @@ -346,11 +358,13 @@ inline uint qHash(NoteSortOrder value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const NoteSortOrder value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const NoteSortOrder value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const NoteSortOrder value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const NoteSortOrder value); //////////////////////////////////////////////////////////////////////////////// @@ -391,11 +405,13 @@ inline uint qHash(PremiumOrderStatus value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const PremiumOrderStatus value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const PremiumOrderStatus value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const PremiumOrderStatus value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const PremiumOrderStatus value); //////////////////////////////////////////////////////////////////////////////// @@ -451,11 +467,13 @@ inline uint qHash(SharedNotebookPrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotebookPrivilegeLevel value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const SharedNotebookPrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotebookPrivilegeLevel value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const SharedNotebookPrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// @@ -487,11 +505,13 @@ inline uint qHash(SharedNotePrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotePrivilegeLevel value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const SharedNotePrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotePrivilegeLevel value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const SharedNotePrivilegeLevel value); //////////////////////////////////////////////////////////////////////////////// @@ -518,11 +538,13 @@ inline uint qHash(SponsoredGroupRole value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SponsoredGroupRole value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const SponsoredGroupRole value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SponsoredGroupRole value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const SponsoredGroupRole value); //////////////////////////////////////////////////////////////////////////////// @@ -546,11 +568,13 @@ inline uint qHash(BusinessUserRole value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessUserRole value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const BusinessUserRole value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessUserRole value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const BusinessUserRole value); //////////////////////////////////////////////////////////////////////////////// @@ -580,11 +604,13 @@ inline uint qHash(BusinessUserStatus value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessUserStatus value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const BusinessUserStatus value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessUserStatus value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const BusinessUserStatus value); //////////////////////////////////////////////////////////////////////////////// @@ -611,11 +637,13 @@ inline uint qHash(SharedNotebookInstanceRestrictions value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const SharedNotebookInstanceRestrictions value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const SharedNotebookInstanceRestrictions value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const SharedNotebookInstanceRestrictions value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const SharedNotebookInstanceRestrictions value); //////////////////////////////////////////////////////////////////////////////// @@ -642,11 +670,13 @@ inline uint qHash(ReminderEmailConfig value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ReminderEmailConfig value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const ReminderEmailConfig value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ReminderEmailConfig value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const ReminderEmailConfig value); //////////////////////////////////////////////////////////////////////////////// @@ -677,11 +707,13 @@ inline uint qHash(BusinessInvitationStatus value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const BusinessInvitationStatus value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const BusinessInvitationStatus value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const BusinessInvitationStatus value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const BusinessInvitationStatus value); //////////////////////////////////////////////////////////////////////////////// @@ -705,11 +737,13 @@ inline uint qHash(ContactType value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const ContactType value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const ContactType value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const ContactType value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const ContactType value); //////////////////////////////////////////////////////////////////////////////// @@ -730,11 +764,13 @@ inline uint qHash(EntityType value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const EntityType value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const EntityType value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const EntityType value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const EntityType value); //////////////////////////////////////////////////////////////////////////////// @@ -766,11 +802,13 @@ inline uint qHash(RecipientStatus value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RecipientStatus value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const RecipientStatus value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RecipientStatus value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const RecipientStatus value); //////////////////////////////////////////////////////////////////////////////// @@ -806,11 +844,13 @@ inline uint qHash(CanMoveToContainerStatus value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const CanMoveToContainerStatus value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const CanMoveToContainerStatus value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const CanMoveToContainerStatus value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const CanMoveToContainerStatus value); //////////////////////////////////////////////////////////////////////////////// @@ -837,11 +877,13 @@ inline uint qHash(RelatedContentType value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RelatedContentType value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const RelatedContentType value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RelatedContentType value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const RelatedContentType value); //////////////////////////////////////////////////////////////////////////////// @@ -879,11 +921,13 @@ inline uint qHash(RelatedContentAccess value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const RelatedContentAccess value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const RelatedContentAccess value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const RelatedContentAccess value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const RelatedContentAccess value); //////////////////////////////////////////////////////////////////////////////// @@ -904,11 +948,13 @@ inline uint qHash(UserIdentityType value) //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream & out, const UserIdentityType value); +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const UserIdentityType value); //////////////////////////////////////////////////////////////////////////////// -QEVERCLOUD_EXPORT QDebug & operator<<(QDebug & out, const UserIdentityType value); +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const UserIdentityType value); } // namespace qevercloud diff --git a/QEverCloud/src/generated/EDAMErrorCode.cpp b/QEverCloud/src/generated/EDAMErrorCode.cpp index 5ffca081..9336f075 100644 --- a/QEverCloud/src/generated/EDAMErrorCode.cpp +++ b/QEverCloud/src/generated/EDAMErrorCode.cpp @@ -16,7 +16,8 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const EDAMErrorCode value) +QTextStream & operator<<( + QTextStream & out, const EDAMErrorCode value) { switch(value) { @@ -113,7 +114,8 @@ QTextStream & operator<<(QTextStream & out, const EDAMErrorCode value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const EDAMErrorCode value) +QDebug & operator<<( + QDebug & out, const EDAMErrorCode value) { switch(value) { @@ -210,7 +212,8 @@ QDebug & operator<<(QDebug & out, const EDAMErrorCode value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const EDAMInvalidContactReason value) +QTextStream & operator<<( + QTextStream & out, const EDAMInvalidContactReason value) { switch(value) { @@ -232,7 +235,8 @@ QTextStream & operator<<(QTextStream & out, const EDAMInvalidContactReason value //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const EDAMInvalidContactReason value) +QDebug & operator<<( + QDebug & out, const EDAMInvalidContactReason value) { switch(value) { @@ -254,7 +258,8 @@ QDebug & operator<<(QDebug & out, const EDAMInvalidContactReason value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const ShareRelationshipPrivilegeLevel value) +QTextStream & operator<<( + QTextStream & out, const ShareRelationshipPrivilegeLevel value) { switch(value) { @@ -279,7 +284,8 @@ QTextStream & operator<<(QTextStream & out, const ShareRelationshipPrivilegeLeve //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const ShareRelationshipPrivilegeLevel value) +QDebug & operator<<( + QDebug & out, const ShareRelationshipPrivilegeLevel value) { switch(value) { @@ -304,7 +310,8 @@ QDebug & operator<<(QDebug & out, const ShareRelationshipPrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const PrivilegeLevel value) +QTextStream & operator<<( + QTextStream & out, const PrivilegeLevel value) { switch(value) { @@ -335,7 +342,8 @@ QTextStream & operator<<(QTextStream & out, const PrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const PrivilegeLevel value) +QDebug & operator<<( + QDebug & out, const PrivilegeLevel value) { switch(value) { @@ -366,7 +374,8 @@ QDebug & operator<<(QDebug & out, const PrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const ServiceLevel value) +QTextStream & operator<<( + QTextStream & out, const ServiceLevel value) { switch(value) { @@ -391,7 +400,8 @@ QTextStream & operator<<(QTextStream & out, const ServiceLevel value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const ServiceLevel value) +QDebug & operator<<( + QDebug & out, const ServiceLevel value) { switch(value) { @@ -416,7 +426,8 @@ QDebug & operator<<(QDebug & out, const ServiceLevel value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const QueryFormat value) +QTextStream & operator<<( + QTextStream & out, const QueryFormat value) { switch(value) { @@ -435,7 +446,8 @@ QTextStream & operator<<(QTextStream & out, const QueryFormat value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const QueryFormat value) +QDebug & operator<<( + QDebug & out, const QueryFormat value) { switch(value) { @@ -454,7 +466,8 @@ QDebug & operator<<(QDebug & out, const QueryFormat value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const NoteSortOrder value) +QTextStream & operator<<( + QTextStream & out, const NoteSortOrder value) { switch(value) { @@ -482,7 +495,8 @@ QTextStream & operator<<(QTextStream & out, const NoteSortOrder value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const NoteSortOrder value) +QDebug & operator<<( + QDebug & out, const NoteSortOrder value) { switch(value) { @@ -510,7 +524,8 @@ QDebug & operator<<(QDebug & out, const NoteSortOrder value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const PremiumOrderStatus value) +QTextStream & operator<<( + QTextStream & out, const PremiumOrderStatus value) { switch(value) { @@ -541,7 +556,8 @@ QTextStream & operator<<(QTextStream & out, const PremiumOrderStatus value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const PremiumOrderStatus value) +QDebug & operator<<( + QDebug & out, const PremiumOrderStatus value) { switch(value) { @@ -572,7 +588,8 @@ QDebug & operator<<(QDebug & out, const PremiumOrderStatus value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const SharedNotebookPrivilegeLevel value) +QTextStream & operator<<( + QTextStream & out, const SharedNotebookPrivilegeLevel value) { switch(value) { @@ -603,7 +620,8 @@ QTextStream & operator<<(QTextStream & out, const SharedNotebookPrivilegeLevel v //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const SharedNotebookPrivilegeLevel value) +QDebug & operator<<( + QDebug & out, const SharedNotebookPrivilegeLevel value) { switch(value) { @@ -634,7 +652,8 @@ QDebug & operator<<(QDebug & out, const SharedNotebookPrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const SharedNotePrivilegeLevel value) +QTextStream & operator<<( + QTextStream & out, const SharedNotePrivilegeLevel value) { switch(value) { @@ -656,7 +675,8 @@ QTextStream & operator<<(QTextStream & out, const SharedNotePrivilegeLevel value //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const SharedNotePrivilegeLevel value) +QDebug & operator<<( + QDebug & out, const SharedNotePrivilegeLevel value) { switch(value) { @@ -678,7 +698,8 @@ QDebug & operator<<(QDebug & out, const SharedNotePrivilegeLevel value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const SponsoredGroupRole value) +QTextStream & operator<<( + QTextStream & out, const SponsoredGroupRole value) { switch(value) { @@ -700,7 +721,8 @@ QTextStream & operator<<(QTextStream & out, const SponsoredGroupRole value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const SponsoredGroupRole value) +QDebug & operator<<( + QDebug & out, const SponsoredGroupRole value) { switch(value) { @@ -722,7 +744,8 @@ QDebug & operator<<(QDebug & out, const SponsoredGroupRole value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const BusinessUserRole value) +QTextStream & operator<<( + QTextStream & out, const BusinessUserRole value) { switch(value) { @@ -741,7 +764,8 @@ QTextStream & operator<<(QTextStream & out, const BusinessUserRole value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const BusinessUserRole value) +QDebug & operator<<( + QDebug & out, const BusinessUserRole value) { switch(value) { @@ -760,7 +784,8 @@ QDebug & operator<<(QDebug & out, const BusinessUserRole value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const BusinessUserStatus value) +QTextStream & operator<<( + QTextStream & out, const BusinessUserStatus value) { switch(value) { @@ -779,7 +804,8 @@ QTextStream & operator<<(QTextStream & out, const BusinessUserStatus value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const BusinessUserStatus value) +QDebug & operator<<( + QDebug & out, const BusinessUserStatus value) { switch(value) { @@ -798,7 +824,8 @@ QDebug & operator<<(QDebug & out, const BusinessUserStatus value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const SharedNotebookInstanceRestrictions value) +QTextStream & operator<<( + QTextStream & out, const SharedNotebookInstanceRestrictions value) { switch(value) { @@ -817,7 +844,8 @@ QTextStream & operator<<(QTextStream & out, const SharedNotebookInstanceRestrict //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const SharedNotebookInstanceRestrictions value) +QDebug & operator<<( + QDebug & out, const SharedNotebookInstanceRestrictions value) { switch(value) { @@ -836,7 +864,8 @@ QDebug & operator<<(QDebug & out, const SharedNotebookInstanceRestrictions value //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const ReminderEmailConfig value) +QTextStream & operator<<( + QTextStream & out, const ReminderEmailConfig value) { switch(value) { @@ -855,7 +884,8 @@ QTextStream & operator<<(QTextStream & out, const ReminderEmailConfig value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const ReminderEmailConfig value) +QDebug & operator<<( + QDebug & out, const ReminderEmailConfig value) { switch(value) { @@ -874,7 +904,8 @@ QDebug & operator<<(QDebug & out, const ReminderEmailConfig value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const BusinessInvitationStatus value) +QTextStream & operator<<( + QTextStream & out, const BusinessInvitationStatus value) { switch(value) { @@ -896,7 +927,8 @@ QTextStream & operator<<(QTextStream & out, const BusinessInvitationStatus value //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const BusinessInvitationStatus value) +QDebug & operator<<( + QDebug & out, const BusinessInvitationStatus value) { switch(value) { @@ -918,7 +950,8 @@ QDebug & operator<<(QDebug & out, const BusinessInvitationStatus value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const ContactType value) +QTextStream & operator<<( + QTextStream & out, const ContactType value) { switch(value) { @@ -949,7 +982,8 @@ QTextStream & operator<<(QTextStream & out, const ContactType value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const ContactType value) +QDebug & operator<<( + QDebug & out, const ContactType value) { switch(value) { @@ -980,7 +1014,8 @@ QDebug & operator<<(QDebug & out, const ContactType value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const EntityType value) +QTextStream & operator<<( + QTextStream & out, const EntityType value) { switch(value) { @@ -1002,7 +1037,8 @@ QTextStream & operator<<(QTextStream & out, const EntityType value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const EntityType value) +QDebug & operator<<( + QDebug & out, const EntityType value) { switch(value) { @@ -1024,7 +1060,8 @@ QDebug & operator<<(QDebug & out, const EntityType value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const RecipientStatus value) +QTextStream & operator<<( + QTextStream & out, const RecipientStatus value) { switch(value) { @@ -1046,7 +1083,8 @@ QTextStream & operator<<(QTextStream & out, const RecipientStatus value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const RecipientStatus value) +QDebug & operator<<( + QDebug & out, const RecipientStatus value) { switch(value) { @@ -1068,7 +1106,8 @@ QDebug & operator<<(QDebug & out, const RecipientStatus value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const CanMoveToContainerStatus value) +QTextStream & operator<<( + QTextStream & out, const CanMoveToContainerStatus value) { switch(value) { @@ -1090,7 +1129,8 @@ QTextStream & operator<<(QTextStream & out, const CanMoveToContainerStatus value //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const CanMoveToContainerStatus value) +QDebug & operator<<( + QDebug & out, const CanMoveToContainerStatus value) { switch(value) { @@ -1112,7 +1152,8 @@ QDebug & operator<<(QDebug & out, const CanMoveToContainerStatus value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const RelatedContentType value) +QTextStream & operator<<( + QTextStream & out, const RelatedContentType value) { switch(value) { @@ -1137,7 +1178,8 @@ QTextStream & operator<<(QTextStream & out, const RelatedContentType value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const RelatedContentType value) +QDebug & operator<<( + QDebug & out, const RelatedContentType value) { switch(value) { @@ -1162,7 +1204,8 @@ QDebug & operator<<(QDebug & out, const RelatedContentType value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const RelatedContentAccess value) +QTextStream & operator<<( + QTextStream & out, const RelatedContentAccess value) { switch(value) { @@ -1187,7 +1230,8 @@ QTextStream & operator<<(QTextStream & out, const RelatedContentAccess value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const RelatedContentAccess value) +QDebug & operator<<( + QDebug & out, const RelatedContentAccess value) { switch(value) { @@ -1212,7 +1256,8 @@ QDebug & operator<<(QDebug & out, const RelatedContentAccess value) //////////////////////////////////////////////////////////////////////////////// -QTextStream & operator<<(QTextStream & out, const UserIdentityType value) +QTextStream & operator<<( + QTextStream & out, const UserIdentityType value) { switch(value) { @@ -1234,7 +1279,8 @@ QTextStream & operator<<(QTextStream & out, const UserIdentityType value) //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<(QDebug & out, const UserIdentityType value) +QDebug & operator<<( + QDebug & out, const UserIdentityType value) { switch(value) { From cfaa6a5eaf9ab10e25be37e198f996a6bdba292d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 27 Sep 2019 07:47:50 +0300 Subject: [PATCH 008/188] Add interface for RequestContext type --- QEverCloud/headers/RequestContext.h | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 QEverCloud/headers/RequestContext.h diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h new file mode 100644 index 00000000..2e15a786 --- /dev/null +++ b/QEverCloud/headers/RequestContext.h @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_REQUEST_CONTEXT_H +#define QEVERCLOUD_REQUEST_CONTEXT_H + +#include "Export.h" + +#include +#include +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +static constexpr quint64 DEFAULT_REQUEST_TIMEOUT_MSEC = 10'000ul; + +static constexpr bool DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE = true; + +static constexpr quint64 DEFAULT_MAX_REQUEST_TIMEOUT_MSEC = 600'000; + +static constexpr quint32 DEFAULT_MAX_REQUEST_RETRY_COUNT = 10; + +//////////////////////////////////////////////////////////////////////////////// + +/** + * IRequestContext carries several request scoped values defining the way + * request is handled by QEverCloud + */ +class QEVERCLOUD_EXPORT IRequestContext +{ +public: + /** Authentication token to use along with the request */ + virtual QString authenticationToken() = 0; + + /** Request timeout in milliseconds */ + virtual quint64 requestTimeout() = 0; + + /** Should request timeout be exponentially increase on retries or not */ + virtual bool increaseRequestTimeoutExponentially() = 0; + + /** Max request timeout in milliseconds */ + virtual quint64 maxRequestTimeout() = 0; + + /** Max number of attempts to retry a request */ + virtual quint32 maxRequestRetryCount() = 0; + + friend QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & strm, const IRequestContext & ctx); + + friend QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & strm, const IRequestContext & ctx); +}; + +using IRequestContextPtr = QSharedPointer; + +//////////////////////////////////////////////////////////////////////////////// + +IRequestContextPtr CreateRequestContext( + QString authenticationToken, + quint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, + bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + quint64 maxRequestTimeout = DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + quint32 maxRequestRetryCount = DEFAULT_MAX_REQUEST_RETRY_COUNT); + +} // namespace qevercloud + +#endif // QEVERCLOUD_REQUEST_CONTEXT_H From 83d1765470f4b9e5e21f29dfb97dd15d9c0985f1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 28 Sep 2019 19:10:46 +0300 Subject: [PATCH 009/188] First seemingly complete version of RequestContext class --- QEverCloud/CMakeLists.txt | 4 + .../modules/QEverCloudCompilerSettings.cmake | 35 +++---- QEverCloud/headers/RequestContext.h | 32 +++--- QEverCloud/src/RequestContext.cpp | 98 +++++++++++++++++++ 4 files changed, 131 insertions(+), 38 deletions(-) create mode 100644 QEverCloud/src/RequestContext.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index fe9c1c61..15c1ed99 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -23,6 +23,7 @@ set(NON_GENERATED_HEADERS headers/Helpers.h headers/InkNoteImageDownloader.h headers/Optional.h + headers/RequestContext.h headers/Thumbnail.h) if(BUILD_WITH_OAUTH_SUPPORT) @@ -50,6 +51,7 @@ set(SOURCES src/Globals.cpp src/Http.cpp src/InkNoteImageDownloader.cpp + src/RequestContext.cpp src/ServicesNonGenerated.cpp src/Thumbnail.cpp src/generated/Constants.cpp @@ -100,6 +102,8 @@ add_sanitizers(${LIBNAME}) set_target_properties(${LIBNAME} PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" SOVERSION ${PROJECT_VERSION_MAJOR} + CXX_STANDARD 17 + CXX_EXTENSIONS OFF MACOSX_RPATH 1 INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index 88f41b30..cbaa72ce 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -1,22 +1,17 @@ if(CMAKE_COMPILER_IS_GNUCXX) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) message(STATUS "Using GNU C++ compiler, version ${GCC_VERSION}") - if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) - message(STATUS "This version of GNU C++ compiler supports C++11 standard.") - set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") - add_definitions("-DCPP11_COMPLIANT=1") - if(GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0) - if(GCC_VERSION VERSION_LESS 8.2) - # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") - set(CMAKE_C_FLAGS_RELEASE "-g -O0") - set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") - endif() + set(CMAKE_CXX_FLAGS "-std=gnu++17 ${CMAKE_CXX_FLAGS}") + add_definitions("-DCPP11_COMPLIANT=1") + if(GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0) + if(GCC_VERSION VERSION_LESS 8.2) + # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") + set(CMAKE_C_FLAGS_RELEASE "-g -O0") + set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") endif() - elseif(NOT GCC_VERSION VERSION_LESS 4.4) - set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}") endif() if(BUILD_SHARED) set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}") @@ -30,15 +25,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION) message(STATUS "Using LLVM/Clang C++ compiler, version info: ${CLANG_VERSION}") - if(NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.1) - message(STATUS "Your compiler supports C++11 standard.") - add_definitions("-DCPP11_COMPLIANT=1") - else() - message(WARNING "Your compiler may not support all the necessary C++11 standard features - to build this project. If you'd get any compilation errors, consider - upgrading to a compiler version which fully supports the C++11 standard.") - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC") if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR USE_LIBCPP) find_library(LIBCPP NAMES libc++.so libc++.so.1.0 libc++.dylib OPTIONAL) if(LIBCPP) diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 2e15a786..7edab709 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -11,18 +11,19 @@ #include "Export.h" #include -#include #include +#include + namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -static constexpr quint64 DEFAULT_REQUEST_TIMEOUT_MSEC = 10'000ul; +static constexpr quint64 DEFAULT_REQUEST_TIMEOUT_MSEC = 10'000ull; static constexpr bool DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE = true; -static constexpr quint64 DEFAULT_MAX_REQUEST_TIMEOUT_MSEC = 600'000; +static constexpr quint64 DEFAULT_MAX_REQUEST_TIMEOUT_MSEC = 600'000ull; static constexpr quint32 DEFAULT_MAX_REQUEST_RETRY_COUNT = 10; @@ -36,33 +37,36 @@ class QEVERCLOUD_EXPORT IRequestContext { public: /** Authentication token to use along with the request */ - virtual QString authenticationToken() = 0; + virtual QString authenticationToken() const = 0; /** Request timeout in milliseconds */ - virtual quint64 requestTimeout() = 0; + virtual quint64 requestTimeout() const = 0; - /** Should request timeout be exponentially increase on retries or not */ - virtual bool increaseRequestTimeoutExponentially() = 0; + /** Should request timeout be exponentially increased on retries or not */ + virtual bool increaseRequestTimeoutExponentially() const = 0; - /** Max request timeout in milliseconds */ - virtual quint64 maxRequestTimeout() = 0; + /** + * Max request timeout in milliseconds (upper boundary for exponentially + * increasing timeouts on retries) + */ + virtual quint64 maxRequestTimeout() const = 0; /** Max number of attempts to retry a request */ - virtual quint32 maxRequestRetryCount() = 0; + virtual quint32 maxRequestRetryCount() const = 0; friend QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & strm, const IRequestContext & ctx); friend QEVERCLOUD_EXPORT QDebug & operator<<( - QDebug & strm, const IRequestContext & ctx); + QDebug & dbg, const IRequestContext & ctx); }; -using IRequestContextPtr = QSharedPointer; +using IRequestContextPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// -IRequestContextPtr CreateRequestContext( - QString authenticationToken, +IRequestContextPtr NewRequestContext( + QString authenticationToken = {}, quint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, quint64 maxRequestTimeout = DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp new file mode 100644 index 00000000..b433bf01 --- /dev/null +++ b/QEverCloud/src/RequestContext.cpp @@ -0,0 +1,98 @@ +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext +{ +public: + RequestContext(QString authenticationToken, quint64 requestTimeout, + bool increaseRequestTimeoutExponentially, + quint64 maxRequestTimeout, + quint32 maxRequestRetryCount) : + m_authenticationToken(std::move(authenticationToken)), + m_requestTimeout(requestTimeout), + m_increaseRequestTimeoutExponentially(increaseRequestTimeoutExponentially), + m_maxRequestTimeout(maxRequestTimeout), + m_maxRequestRetryCount(maxRequestRetryCount) + {} + + virtual QString authenticationToken() const Q_DECL_OVERRIDE + { + return m_authenticationToken; + } + + virtual quint64 requestTimeout() const Q_DECL_OVERRIDE + { + return m_requestTimeout; + } + + virtual bool increaseRequestTimeoutExponentially() const Q_DECL_OVERRIDE + { + return m_increaseRequestTimeoutExponentially; + } + + virtual quint64 maxRequestTimeout() const Q_DECL_OVERRIDE + { + return m_maxRequestTimeout; + } + + virtual quint32 maxRequestRetryCount() const Q_DECL_OVERRIDE + { + return m_maxRequestRetryCount; + } + +private: + QString m_authenticationToken; + quint64 m_requestTimeout; + bool m_increaseRequestTimeoutExponentially; + quint64 m_maxRequestTimeout; + quint32 m_maxRequestRetryCount; +}; + +//////////////////////////////////////////////////////////////////////////////// + +template +void PrintRequestContext(const IRequestContext & ctx, T & strm) +{ + strm << "RequestContext:\n" + << " authentication token = " << ctx.authenticationToken() << "\n" + << " request timeout = " << ctx.requestTimeout() << "\n" + << " increase request timeout exponentially = " + << (ctx.increaseRequestTimeoutExponentially() ? "yes" : "no") << "\n" + << " max request timeout = " << ctx.maxRequestTimeout() << "\n" + << " max request retry count = " << ctx.maxRequestRetryCount() << "\n"; +} + + +QTextStream & operator<<(QTextStream & strm, const IRequestContext & ctx) +{ + PrintRequestContext(ctx, strm); + return strm; +} + +QDebug & operator<<(QDebug & dbg, const IRequestContext & ctx) +{ + PrintRequestContext(ctx, dbg); + return dbg; +} + +//////////////////////////////////////////////////////////////////////////////// + +IRequestContextPtr NewRequestContext( + QString authenticationToken, + quint64 requestTimeout, + bool increaseRequestTimeoutExponentially, + quint64 maxRequestTimeout, + quint32 maxRequestRetryCount) +{ + return std::make_shared( + std::move(authenticationToken), + requestTimeout, + increaseRequestTimeoutExponentially, + maxRequestTimeout, + maxRequestRetryCount); +} + +} // namespace qevercloud From 6249b22acb82e1e71b1f087c3c2288f37c22f06a Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 28 Sep 2019 19:39:02 +0300 Subject: [PATCH 010/188] Bump required cmake version to 3.5.1 and dump Qt4 support --- CMakeLists.txt | 63 ++++----------- QEverCloud/CMakeLists.txt | 44 +++++------ .../modules/QEverCloudCompilerSettings.cmake | 4 +- .../cmake/modules/QEverCloudSetupQt.cmake | 78 ++++++++----------- 4 files changed, 73 insertions(+), 116 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 893021e5..4791a0fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.5.1) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/QEverCloud/cmake/modules") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/QEverCloud/cmake/modules/sanitizers") @@ -6,17 +6,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/QEverClo include(QEverCloudCMakePolicies) SET_POLICIES() -if("${CMAKE_MAJOR_VERSION}" GREATER "2") - project(QEverCloud - VERSION 4.1.0) -else() - project(QEverCloud) - set(PROJECT_VERSION_MAJOR "4") - set(PROJECT_VERSION_MINOR "1") - set(PROJECT_VERSION_PATCH "0") - set(PROJECT_VERSION_COUNT 3) - set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") -endif() +project(QEverCloud + VERSION 5.0.0) set(PROJECT_VENDOR "Dmitry Ivanov") set(PROJECT_COPYRIGHT_YEAR "2015-2019") @@ -51,14 +42,9 @@ endif() include(QEverCloudCompilerSettings) -set(BUILD_WITH_QT4 OFF CACHE BOOL "Build against Qt4 instead of Qt5") include(QEverCloudSetupQt) -if(BUILD_WITH_QT4) - set(QEVERCLOUD_QT_VERSION "qt4") -else() - set(QEVERCLOUD_QT_VERSION "qt5") -endif() +set(QEVERCLOUD_QT_VERSION "qt5") if(NOT CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") @@ -81,8 +67,6 @@ if(NOT INSTALL_CMAKE_DIR) endif() set(BUILD_SHARED ON CACHE BOOL "Build shared library, otherwise static library") -set(MAJOR_VERSION_LIB_NAME_SUFFIX OFF CACHE BOOL "If on, the project's major version would be added to the library's name as a suffix") -set(MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX OFF CACHE BOOL "If on, the project's major version would be added to the library's development headers' folder name as a suffix") if(MSVC) set(QEVERCLOUD_LIBNAME_PREFIX "lib") @@ -90,11 +74,6 @@ else() set(QEVERCLOUD_LIBNAME_PREFIX "") endif() -set(QEVERCLOUD_LIBNAME_SUFFIX "") -if(MAJOR_VERSION_LIB_NAME_SUFFIX) - set(QEVERCLOUD_LIBNAME_SUFFIX "${PROJECT_VERSION_MAJOR}") -endif() - if(QEVERCLOUD_USE_QT_WEB_ENGINE) set(QEVERCLOUD_USES_QT_WEB_ENGINE "set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE)") else() @@ -114,29 +93,19 @@ configure_file(QEverCloud/cmake/modules/QEverCloudConfig.cmake.in configure_file(QEverCloud/cmake/modules/QEverCloudConfigVersion.cmake.in ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}ConfigVersion.cmake @ONLY) -if(BUILD_WITH_QT4) - if(BUILD_WITH_OAUTH_SUPPORT) - file(COPY QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake DESTINATION ${PROJECT_BINARY_DIR}) - file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt4DependenciesWithWebKit.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake) +file(COPY QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesCore.cmake DESTINATION ${PROJECT_BINARY_DIR}) +file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt5DependenciesCore.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake) + +if(BUILD_WITH_OAUTH_SUPPORT) + if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) + file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebKit.cmake WEBKIT_DEPS_FILE) + file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBKIT_DEPS_FILE}") + elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") + file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineNoCore.cmake WEBENGINE_NO_CORE_DEPS_FILE) + file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_NO_CORE_DEPS_FILE}") else() - file(COPY QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake DESTINATION ${PROJECT_BINARY_DIR}) - file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt4Dependencies.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake) - endif() -else() - file(COPY QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesCore.cmake DESTINATION ${PROJECT_BINARY_DIR}) - file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt5DependenciesCore.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake) - - if(BUILD_WITH_OAUTH_SUPPORT) - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) - file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebKit.cmake WEBKIT_DEPS_FILE) - file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBKIT_DEPS_FILE}") - elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") - file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineNoCore.cmake WEBENGINE_NO_CORE_DEPS_FILE) - file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_NO_CORE_DEPS_FILE}") - else() - file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineCore.cmake WEBENGINE_CORE_DEPS_FILE) - file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_CORE_DEPS_FILE}") - endif() + file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineCore.cmake WEBENGINE_CORE_DEPS_FILE) + file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_CORE_DEPS_FILE}") endif() endif() diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 15c1ed99..0aa54c8d 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.5.1) include(QEverCloudCMakePolicies) SET_POLICIES() @@ -87,7 +87,7 @@ configure_file(headers/VersionInfo.h.in list(APPEND ALL_HEADERS_AND_SOURCES ${PROJECT_BINARY_DIR}/VersionInfo.h) include_directories(${PROJECT_BINARY_DIR}) -set(LIBNAME "${QEVERCLOUD_LIBNAME_PREFIX}${QEVERCLOUD_QT_VERSION}qevercloud${QEVERCLOUD_LIBNAME_SUFFIX}") +set(LIBNAME "${QEVERCLOUD_LIBNAME_PREFIX}${QEVERCLOUD_QT_VERSION}qevercloud") if(BUILD_SHARED) add_definitions("-DQEVERCLOUD_SHARED_LIBRARY") @@ -107,35 +107,38 @@ set_target_properties(${LIBNAME} PROPERTIES MACOSX_RPATH 1 INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -target_link_libraries(${LIBNAME} ${QT_LIBRARIES}) +target_compile_features(${LIBNAME} INTERFACE + cxx_auto_type + cxx_defaulted_functions + cxx_defaulted_move_initializers + cxx_deleted_functions + cxx_noexcept + cxx_nullptr + cxx_override + cxx_right_angle_brackets + cxx_rvalue_references + cxx_strong_enums) + +target_compile_features(${LIBNAME} PRIVATE + cxx_final + cxx_lambdas + cxx_range_for) -if(BUILD_WITH_QT4) - # NOTE: working around what seems to be a CMake bug - target_link_libraries(${LIBNAME} Qt4::QtWebKit) -endif() +target_link_libraries(${LIBNAME} ${QT_LIBRARIES}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/headers) add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT") # Tests -if(BUILD_WITH_QT4) - find_package(QT4 COMPONENTS QTCORE QTTEST QUIET) -else() - find_package(Qt5Test QUIET) -endif() - -if((NOT BUILD_WITH_QT4 AND Qt5Test_FOUND) OR (BUILD_WITH_QT4 AND Qt4_FOUND)) +find_package(Qt5Test QUIET) +if(Qt5Test_FOUND) set(TEST_SOURCES src/tests/TestQEverCloud.cpp) add_executable(test_${PROJECT_NAME} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) - if(BUILD_WITH_QT4) - target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} Qt4::QtCore Qt4::QtGui Qt4::QtNetwork Qt4::QtWebKit Qt4::QtTest) - else() - target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) - endif() + target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) else() message(STATUS "Haven't found Qt components required for building and running the unit tests") endif() @@ -148,9 +151,6 @@ install(TARGETS ${LIBNAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) set(DEV_HEADERS_FOLDER_NAME ${QEVERCLOUD_QT_VERSION}qevercloud) -if(MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX) - string(CONCAT DEV_HEADERS_FOLDER_NAME ${DEV_HEADERS_FOLDER_NAME} ${PROJECT_VERSION_MAJOR}) -endif() # install public headers foreach(ITEM ${PUBLIC_HEADERS}) diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index cbaa72ce..c8f117b0 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -1,8 +1,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) message(STATUS "Using GNU C++ compiler, version ${GCC_VERSION}") - set(CMAKE_CXX_FLAGS "-std=gnu++17 ${CMAKE_CXX_FLAGS}") - add_definitions("-DCPP11_COMPLIANT=1") if(GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0) if(GCC_VERSION VERSION_LESS 8.2) # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 @@ -25,7 +23,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE CLANG_VERSION) message(STATUS "Using LLVM/Clang C++ compiler, version info: ${CLANG_VERSION}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR USE_LIBCPP) find_library(LIBCPP NAMES libc++.so libc++.so.1.0 libc++.dylib OPTIONAL) if(LIBCPP) diff --git a/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake b/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake index a71df648..84604dde 100644 --- a/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake +++ b/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake @@ -1,56 +1,46 @@ -if(NOT BUILD_WITH_QT4) - set(QEVERCLOUD_FIND_PACKAGE_ARG "VERBOSE") +set(QEVERCLOUD_FIND_PACKAGE_ARG "VERBOSE") - find_package(Qt5Core QUIET REQUIRED) - message(STATUS "Found Qt5 installation, version ${Qt5Core_VERSION}") +find_package(Qt5Core QUIET REQUIRED) +message(STATUS "Found Qt5 installation, version ${Qt5Core_VERSION}") - include(QEverCloudFindPackageWrapperMacro) - include(QEverCloudFindQt5DependenciesCore) +include(QEverCloudFindPackageWrapperMacro) +include(QEverCloudFindQt5DependenciesCore) - list(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) +list(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +list(APPEND QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) +list(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) - if(BUILD_WITH_OAUTH_SUPPORT) - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) - include(QEverCloudFindQt5DependenciesWebKit) - elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") - include(QEverCloudFindQt5DependenciesWebEngineNoCore) - set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE) - else() - include(QEverCloudFindQt5DependenciesWebEngineCore) - set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE) - endif() +if(BUILD_WITH_OAUTH_SUPPORT) + if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) + include(QEverCloudFindQt5DependenciesWebKit) + elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") + include(QEverCloudFindQt5DependenciesWebEngineNoCore) + set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE) + else() + include(QEverCloudFindQt5DependenciesWebEngineCore) + set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE) + endif() - if(QEVERCLOUD_USE_QT_WEB_ENGINE) - add_definitions(-DQEVERCLOUD_USE_QT_WEB_ENGINE) - endif() + if(QEVERCLOUD_USE_QT_WEB_ENGINE) + add_definitions(-DQEVERCLOUD_USE_QT_WEB_ENGINE) + endif() - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebKit_INCLUDE_DIRS} ${Qt5WebKitWidgets_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebKit_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebKit_DEFINITIONS} ${Qt5WebKitWidgets_DEFINITIONS}) + if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) + list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebKit_INCLUDE_DIRS} ${Qt5WebKitWidgets_INCLUDE_DIRS}) + list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebKit_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES}) + list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebKit_DEFINITIONS} ${Qt5WebKitWidgets_DEFINITIONS}) + else() + if(Qt5WebEngine_VERSION VERSION_LESS "5.6.0") + list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngine_INCLUDE_DIRS} ${Qt5WebEngineWidgets_INCLUDE_DIRS}) + list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngine_LIBRARIES} ${Qt5WebEngineWidgets_LIBRARIES}) + list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngine_DEFINITIONS} ${Qt5WebEngineWidgets_DEFINITIONS}) else() - if(Qt5WebEngine_VERSION VERSION_LESS "5.6.0") - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngine_INCLUDE_DIRS} ${Qt5WebEngineWidgets_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngine_LIBRARIES} ${Qt5WebEngineWidgets_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngine_DEFINITIONS} ${Qt5WebEngineWidgets_DEFINITIONS}) - else() - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngineCore_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngineCore_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngineCore_DEFINITIONS}) - endif() + list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngineCore_INCLUDE_DIRS}) + list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngineCore_LIBRARIES}) + list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngineCore_DEFINITIONS}) endif() - endif(BUILD_WITH_OAUTH_SUPPORT) -else() - find_package(Qt4 COMPONENTS QTCORE QUIET REQUIRED) - message(STATUS "Found Qt4 installation, version ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") - if(BUILD_WITH_OAUTH_SUPPORT) - include(QEverCloudFindQt4DependenciesWithWebKit) - else() - include(QEverCloudFindQt4Dependencies) endif() -endif() +endif(BUILD_WITH_OAUTH_SUPPORT) list(REMOVE_DUPLICATES QT_INCLUDES) list(REMOVE_DUPLICATES QT_LIBRARIES) From c38f37d40c5e46e62e73087b9f38f27a419f31ae Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 28 Sep 2019 19:43:20 +0300 Subject: [PATCH 011/188] Update README.md --- README.md | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 747b87f8..95bc5664 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,7 @@ Prebuilt versions of the library can be downloaded from the following locations: The project can be built and shipped either as a static library or a shared library. Dll export/import symbols necessary for Windows platform are supported. Dependencies include the following Qt components: - * For Qt4: QtCore, QtGui, QtNetwork and, if the library is built with OAuth support, QtWebKit - * For Qt5: Qt5Core, Qt5Widgets, Qt5Network and, if the library is built with OAuth support, either: + * Qt5: Qt5Core, Qt5Widgets, Qt5Network and, if the library is built with OAuth support, either: * Qt5WebKit and Qt5WebKitWidgets - for Qt < 5.4 * Qt5WebEngine and Qt5WebEngineWidgets - for Qt < 5.6 * Qt5WebEngineCore and Qt5WebEngineWidgets - for Qt >= 5.6 @@ -56,7 +55,7 @@ Since QEverCloud 3.0.2 it is possible to choose Qt5WebKit over Qt5WebEngine usin Since QEverCloud 4.0.0 it is possible to build the library without OAuth support and thus without QtWebKit or QtWebEngine dependencies, for this use CMake option `BUILD_WITH_OAUTH_SUPPORT=NO`. -Also, if Qt4's QtTest or Qt5's Qt5Test modules are found during the pre-build configuration, the unit tests are enabled and can be run with `make test` command. +Also, if Qt5's Qt5Test modules are found during the pre-build configuration, the unit tests are enabled and can be run with `make test` command. The project uses CMake build system which can be used as simply as follows (on Unix platforms): ``` @@ -67,17 +66,11 @@ make make install ``` -Please note that installing the library somewhere is mandatory because it puts the library's headers into the subfolder dependent on used Qt version: either *qt4qevercloud* or *qt5qevercloud*. The intended use of library's headers is something like this: +Please note that installing the library somewhere is mandatory because it puts the library's headers into the subfolder *qt5qevercloud*. The intended use of library's headers is something like this: ``` -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include -#else #include -#endif ``` -If you just need to use the only one Qt version, you can skip the check and just include the header file you need. - More CMake configurations options available: *BUILD_DOCUMENTATION* - when *ON*, attempts to find Doxygen and in case of success adds *doc* target so the documentation can be built using `make doc` command after the `cmake ../` step. By default this option is on. @@ -88,48 +81,19 @@ More CMake configurations options available: If *BUILD_SHARED* is *ON*, `make install` would install the CMake module necessary for applications using CMake's `find_package` command to find the installation of the library. -If *MAJOR_VERSION_LIB_NAME_SUFFIX* is on, `make install` would add the major version as a suffix to the library's name. - -If *MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX* is on, `make install` would install the development headers into the folder which name would end with the major version of QEverCloud. - -The two latter options are intended to allow for easier installation of multiple major versions of QEverCloud. - Since QEverCloud 4.1.0 it is possible to build the library with enabled sanitizers using additional CMake options: * `-DSANITIZE_ADDRESS=ON` to enable address sanitizer * `-DSANITIZE_MEMORY=ON` to enable memory sanitizer * `-DSANITIZE_THREAD=ON` to enable thread sanitizer * `-DSANITIZE_UNDEFINED=ON` to enable undefined behaviour sanitizer -## Compatibility - -The library can be built with both Qt4 and Qt5 versions of the framework. Since QEverCloud 4.1.0 the default one is Qt5. In order to force building with Qt4 version pass `-DBUILD_WITH_QT4=ON` option to CMake. Prior to QEverCloud 4.1.0 version of Qt used by default was Qt4. For those old versions in order to force building with Qt5 one needs to pass `-DUSE_QT5=1` option to CMake. - -### API breaks from 2.x to 3.0 - -The API breaks only include the relocation of header files required in order to use the library: in 2.x one could simply do -``` -#include -``` -while since 3.0 the intended way to use the installed shared library is the following: -``` -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include -#else -#include -#endif -``` - -### API breaks from 3.x to 4.0 - -Tha API breaks in 4.0 inlcude a few changes caused by migration from Evernote API 1.25 to Evernote API 1.28. The breaks are listed in a [separate document](API_breaks_3_to_4.md). - ### QtWebKit vs QWebEngine -The library uses Qt's web facilities for OAuth authentication. These can be based on either QtWebKit (for Qt4 and older versions of Qt5) or QWebEngine (for more recent versions of Qt5). With CMake build system the choice happens automatically during the pre-build configuration based on the used version of Qt. One can also choose to use QtWebKit even with newer versions of Qt via CMake option `USE_QT5_WEBKIT`. +The library uses Qt's web facilities for OAuth authentication. These can be based on either QtWebKit (for older versions of Qt5) or QWebEngine (for more recent versions of Qt5). With CMake build system the choice happens automatically during the pre-build configuration based on the used version of Qt. One can also choose to use QtWebKit even with newer versions of Qt via CMake option `USE_QT5_WEBKIT`. -### C++11/14/17 features +### Compiler requirements -The library does not use any C++11/14/17 features directly but only through macros like `Q_DECL_OVERRIDE`, `Q_STATIC_ASSERT_X`, `QStringLiteral` and others. Some of these macros are also "backported" to Qt4 version of the library i.e. they are defined by the library itself for Qt4 version. So the library should be buildable even with not C++11/14/17-compliant compiler. +The library requires the compiler to support C++17 standard. CMake automatically checks whether the compiler is capable enough of building QEverCloud so if pre-build step was successful, the build should be successful as well. ## Include files for applications using the library From 16b10ff037d6712a1c58878267ac57e854646cd2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 28 Sep 2019 21:32:25 +0300 Subject: [PATCH 012/188] Start function name from lower case --- QEverCloud/headers/RequestContext.h | 2 +- QEverCloud/src/RequestContext.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 7edab709..15e1be59 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -65,7 +65,7 @@ using IRequestContextPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// -IRequestContextPtr NewRequestContext( +IRequestContextPtr newRequestContext( QString authenticationToken = {}, quint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index b433bf01..e1fc729f 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -80,7 +80,7 @@ QDebug & operator<<(QDebug & dbg, const IRequestContext & ctx) //////////////////////////////////////////////////////////////////////////////// -IRequestContextPtr NewRequestContext( +IRequestContextPtr newRequestContext( QString authenticationToken, quint64 requestTimeout, bool increaseRequestTimeoutExponentially, From 1df55821cc650f61e2427d70e62a992360be6b86 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 28 Sep 2019 22:16:16 +0300 Subject: [PATCH 013/188] Update generated services --- QEverCloud/CMakeLists.txt | 4 +- QEverCloud/headers/generated/Services.h | 919 ++++---- QEverCloud/src/ServicesNonGenerated.cpp | 85 - QEverCloud/src/generated/Services.cpp | 2628 ++++++++++++++++------- 4 files changed, 2326 insertions(+), 1310 deletions(-) delete mode 100644 QEverCloud/src/ServicesNonGenerated.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 0aa54c8d..bf349c9a 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -52,7 +52,6 @@ set(SOURCES src/Http.cpp src/InkNoteImageDownloader.cpp src/RequestContext.cpp - src/ServicesNonGenerated.cpp src/Thumbnail.cpp src/generated/Constants.cpp src/generated/EDAMErrorCode.cpp @@ -138,6 +137,9 @@ if(Qt5Test_FOUND) add_executable(test_${PROJECT_NAME} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) + set_target_properties(test_${PROJECT_NAME} PROPERTIES + CXX_STANDARD 17 + CXX_EXTENSIONS OFF) target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) else() message(STATUS "Haven't found Qt components required for building and running the unit tests") diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index c9a7dcf3..b8079425 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -16,12 +16,15 @@ #include "../AsyncResult.h" #include "../Optional.h" +#include "../RequestContext.h" #include "Constants.h" #include "Types.h" #include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + /** * Service: NoteStore *

    @@ -48,48 +51,26 @@ namespace qevercloud { * content. * */ -class QEVERCLOUD_EXPORT NoteStore: public QObject +class QEVERCLOUD_EXPORT INoteStore: public QObject { Q_OBJECT - Q_DISABLE_COPY(NoteStore) -public: - explicit NoteStore( - QString noteStoreUrl = QString(), - QString authenticationToken = QString(), - QObject * parent = nullptr); - - explicit NoteStore(QObject * parent); - - void setNoteStoreUrl(QString noteStoreUrl) - { - m_url = noteStoreUrl; - } - - QString noteStoreUrl() - { - return m_url; - } - - void setAuthenticationToken(QString authenticationToken) - { - m_authenticationToken = authenticationToken; - } - - QString authenticationToken() - { - return m_authenticationToken; - } + Q_DISABLE_COPY(INoteStore) +protected: + INoteStore(QObject * parent) : + QObject(parent) + {} +public: /** * Asks the NoteStore to provide information about the status of the user * account corresponding to the provided authentication token. */ - SyncState getSyncState( - QString authenticationToken = QString()); + virtual SyncState getSyncState( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getSyncState @endlink */ - AsyncResult * getSyncStateAsync( - QString authenticationToken = QString()); + virtual AsyncResult * getSyncStateAsync( + IRequestContextPtr ctx = {}) = 0; /** * Asks the NoteStore to provide the state of the account in order of @@ -124,18 +105,18 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncChunk getFilteredSyncChunk( + virtual SyncChunk getFilteredSyncChunk( qint32 afterUSN, qint32 maxEntries, - const SyncChunkFilter& filter, - QString authenticationToken = QString()); + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getFilteredSyncChunk @endlink */ - AsyncResult * getFilteredSyncChunkAsync( + virtual AsyncResult * getFilteredSyncChunkAsync( qint32 afterUSN, qint32 maxEntries, - const SyncChunkFilter& filter, - QString authenticationToken = QString()); + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) = 0; /** * Asks the NoteStore to provide information about the status of a linked @@ -178,14 +159,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncState getLinkedNotebookSyncState( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual SyncState getLinkedNotebookSyncState( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getLinkedNotebookSyncState @endlink */ - AsyncResult * getLinkedNotebookSyncStateAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual AsyncResult * getLinkedNotebookSyncStateAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** * Asks the NoteStore to provide information about the contents of a linked @@ -251,30 +232,30 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SyncChunk getLinkedNotebookSyncChunk( - const LinkedNotebook& linkedNotebook, + virtual SyncChunk getLinkedNotebookSyncChunk( + const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getLinkedNotebookSyncChunk @endlink */ - AsyncResult * getLinkedNotebookSyncChunkAsync( - const LinkedNotebook& linkedNotebook, + virtual AsyncResult * getLinkedNotebookSyncChunkAsync( + const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of all of the notebooks in the account. */ - QList listNotebooks( - QString authenticationToken = QString()); + virtual QList listNotebooks( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listNotebooks @endlink */ - AsyncResult * listNotebooksAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listNotebooksAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of all the notebooks in a business that the user has permission to access, @@ -289,12 +270,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * business auth token. * */ - QList listAccessibleBusinessNotebooks( - QString authenticationToken = QString()); + virtual QList listAccessibleBusinessNotebooks( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listAccessibleBusinessNotebooks @endlink */ - AsyncResult * listAccessibleBusinessNotebooksAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listAccessibleBusinessNotebooksAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of the notebook with the provided GUID. @@ -315,25 +296,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Notebook getNotebook( + virtual Notebook getNotebook( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNotebook @endlink */ - AsyncResult * getNotebookAsync( + virtual AsyncResult * getNotebookAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the notebook that should be used to store new notes in the * user's account when no other notebooks are specified. */ - Notebook getDefaultNotebook( - QString authenticationToken = QString()); + virtual Notebook getDefaultNotebook( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getDefaultNotebook @endlink */ - AsyncResult * getDefaultNotebookAsync( - QString authenticationToken = QString()); + virtual AsyncResult * getDefaultNotebookAsync( + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to make a notebook with the provided name. @@ -369,14 +350,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Notebook createNotebook( - const Notebook& notebook, - QString authenticationToken = QString()); + virtual Notebook createNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createNotebook @endlink */ - AsyncResult * createNotebookAsync( - const Notebook& notebook, - QString authenticationToken = QString()); + virtual AsyncResult * createNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) = 0; /** * Submits notebook changes to the service. The provided data must include the @@ -417,14 +398,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateNotebook( - const Notebook& notebook, - QString authenticationToken = QString()); + virtual qint32 updateNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateNotebook @endlink */ - AsyncResult * updateNotebookAsync( - const Notebook& notebook, - QString authenticationToken = QString()); + virtual AsyncResult * updateNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) = 0; /** * Permanently removes the notebook from the user's account. @@ -451,25 +432,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeNotebook( + virtual qint32 expungeNotebook( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link expungeNotebook @endlink */ - AsyncResult * expungeNotebookAsync( + virtual AsyncResult * expungeNotebookAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of the tags in the account. Evernote does not support * the undeletion of tags, so this will only include active tags. */ - QList listTags( - QString authenticationToken = QString()); + virtual QList listTags( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listTags @endlink */ - AsyncResult * listTagsAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listTagsAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of the tags that are applied to at least one note within @@ -484,14 +465,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QList listTagsByNotebook( + virtual QList listTagsByNotebook( Guid notebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listTagsByNotebook @endlink */ - AsyncResult * listTagsByNotebookAsync( + virtual AsyncResult * listTagsByNotebookAsync( Guid notebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of the Tag with the provided GUID. @@ -511,14 +492,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Tag getTag( + virtual Tag getTag( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getTag @endlink */ - AsyncResult * getTagAsync( + virtual AsyncResult * getTagAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to make a tag with a set of information. @@ -548,14 +529,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Tag createTag( - const Tag& tag, - QString authenticationToken = QString()); + virtual Tag createTag( + const Tag & tag, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createTag @endlink */ - AsyncResult * createTagAsync( - const Tag& tag, - QString authenticationToken = QString()); + virtual AsyncResult * createTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) = 0; /** * Submits tag changes to the service. The provided data must include @@ -588,14 +569,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateTag( - const Tag& tag, - QString authenticationToken = QString()); + virtual qint32 updateTag( + const Tag & tag, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateTag @endlink */ - AsyncResult * updateTagAsync( - const Tag& tag, - QString authenticationToken = QString()); + virtual AsyncResult * updateTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) = 0; /** * Removes the provided tag from every note that is currently tagged with @@ -623,14 +604,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - void untagAll( + virtual void untagAll( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link untagAll @endlink */ - AsyncResult * untagAllAsync( + virtual AsyncResult * untagAllAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Permanently deletes the tag with the provided GUID, if present. @@ -657,25 +638,25 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeTag( + virtual qint32 expungeTag( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link expungeTag @endlink */ - AsyncResult * expungeTagAsync( + virtual AsyncResult * expungeTagAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of the searches in the account. Evernote does not support * the undeletion of searches, so this will only include active searches. */ - QList listSearches( - QString authenticationToken = QString()); + virtual QList listSearches( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listSearches @endlink */ - AsyncResult * listSearchesAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listSearchesAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of the search with the provided GUID. @@ -694,14 +675,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SavedSearch getSearch( + virtual SavedSearch getSearch( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getSearch @endlink */ - AsyncResult * getSearchAsync( + virtual AsyncResult * getSearchAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to make a saved search with a set of information. @@ -727,14 +708,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SavedSearch createSearch( - const SavedSearch& search, - QString authenticationToken = QString()); + virtual SavedSearch createSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createSearch @endlink */ - AsyncResult * createSearchAsync( - const SavedSearch& search, - QString authenticationToken = QString()); + virtual AsyncResult * createSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) = 0; /** * Submits search changes to the service. The provided data must include @@ -763,14 +744,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateSearch( - const SavedSearch& search, - QString authenticationToken = QString()); + virtual qint32 updateSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateSearch @endlink */ - AsyncResult * updateSearchAsync( - const SavedSearch& search, - QString authenticationToken = QString()); + virtual AsyncResult * updateSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) = 0; /** * Permanently deletes the saved search with the provided GUID, if present. @@ -797,14 +778,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeSearch( + virtual qint32 expungeSearch( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link expungeSearch @endlink */ - AsyncResult * expungeSearchAsync( + virtual AsyncResult * expungeSearchAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Finds the position of a note within a sorted subset of all of the user's @@ -847,16 +828,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 findNoteOffset( - const NoteFilter& filter, + virtual qint32 findNoteOffset( + const NoteFilter & filter, Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link findNoteOffset @endlink */ - AsyncResult * findNoteOffsetAsync( - const NoteFilter& filter, + virtual AsyncResult * findNoteOffsetAsync( + const NoteFilter & filter, Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Used to find the high-level information about a set of the notes from a @@ -915,20 +896,20 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - NotesMetadataList findNotesMetadata( - const NoteFilter& filter, + virtual NotesMetadataList findNotesMetadata( + const NoteFilter & filter, qint32 offset, qint32 maxNotes, - const NotesMetadataResultSpec& resultSpec, - QString authenticationToken = QString()); + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link findNotesMetadata @endlink */ - AsyncResult * findNotesMetadataAsync( - const NoteFilter& filter, + virtual AsyncResult * findNotesMetadataAsync( + const NoteFilter & filter, qint32 offset, qint32 maxNotes, - const NotesMetadataResultSpec& resultSpec, - QString authenticationToken = QString()); + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** * This function is used to determine how many notes are found for each @@ -961,16 +942,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *

  • "Notebook.guid" - not found, by GUID
  • * */ - NoteCollectionCounts findNoteCounts( - const NoteFilter& filter, + virtual NoteCollectionCounts findNoteCounts( + const NoteFilter & filter, bool withTrash, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link findNoteCounts @endlink */ - AsyncResult * findNoteCountsAsync( - const NoteFilter& filter, + virtual AsyncResult * findNoteCountsAsync( + const NoteFilter & filter, bool withTrash, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of the note in the service with the provided @@ -1003,16 +984,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note getNoteWithResultSpec( + virtual Note getNoteWithResultSpec( Guid guid, - const NoteResultSpec& resultSpec, - QString authenticationToken = QString()); + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteWithResultSpec @endlink */ - AsyncResult * getNoteWithResultSpecAsync( + virtual AsyncResult * getNoteWithResultSpecAsync( Guid guid, - const NoteResultSpec& resultSpec, - QString authenticationToken = QString()); + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** * DEPRECATED. See getNoteWithResultSpec. @@ -1021,22 +1002,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * 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. */ - Note getNote( + virtual Note getNote( Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNote @endlink */ - AsyncResult * getNoteAsync( + virtual AsyncResult * getNoteAsync( Guid guid, bool withContent, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Get all of the application data for the note identified by GUID, @@ -1046,14 +1027,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * only needs to fetch its own applicationData entry, use * getNoteApplicationDataEntry instead. */ - LazyMap getNoteApplicationData( + virtual LazyMap getNoteApplicationData( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteApplicationData @endlink */ - AsyncResult * getNoteApplicationDataAsync( + virtual AsyncResult * getNoteApplicationDataAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Get the value of a single entry in the applicationData map @@ -1064,49 +1045,49 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "NoteAttributes.applicationData.key" - note not found, by key
  • * */ - QString getNoteApplicationDataEntry( + virtual QString getNoteApplicationDataEntry( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteApplicationDataEntry @endlink */ - AsyncResult * getNoteApplicationDataEntryAsync( + virtual AsyncResult * getNoteApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Update, or create, an entry in the applicationData map for * the note identified by guid. */ - qint32 setNoteApplicationDataEntry( + virtual qint32 setNoteApplicationDataEntry( Guid guid, QString key, QString value, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link setNoteApplicationDataEntry @endlink */ - AsyncResult * setNoteApplicationDataEntryAsync( + virtual AsyncResult * setNoteApplicationDataEntryAsync( Guid guid, QString key, QString value, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * 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. */ - qint32 unsetNoteApplicationDataEntry( + virtual qint32 unsetNoteApplicationDataEntry( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link unsetNoteApplicationDataEntry @endlink */ - AsyncResult * unsetNoteApplicationDataEntryAsync( + virtual AsyncResult * unsetNoteApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns XHTML contents of the note with the provided GUID. @@ -1128,14 +1109,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getNoteContent( + virtual QString getNoteContent( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteContent @endlink */ - AsyncResult * getNoteContentAsync( + virtual AsyncResult * getNoteContentAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a block of the extracted plain text contents of the note with the @@ -1171,18 +1152,18 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getNoteSearchText( + virtual QString getNoteSearchText( Guid guid, bool noteOnly, bool tokenizeForIndexing, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteSearchText @endlink */ - AsyncResult * getNoteSearchTextAsync( + virtual AsyncResult * getNoteSearchTextAsync( Guid guid, bool noteOnly, bool tokenizeForIndexing, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a block of the extracted plain text contents of the resource with @@ -1208,14 +1189,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QString getResourceSearchText( + virtual QString getResourceSearchText( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceSearchText @endlink */ - AsyncResult * getResourceSearchTextAsync( + virtual AsyncResult * getResourceSearchTextAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of the names of the tags for the note with the provided @@ -1235,14 +1216,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QStringList getNoteTagNames( + virtual QStringList getNoteTagNames( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteTagNames @endlink */ - AsyncResult * getNoteTagNamesAsync( + virtual AsyncResult * getNoteTagNamesAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to make a note with the provided set of information. @@ -1307,14 +1288,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note createNote( - const Note& note, - QString authenticationToken = QString()); + virtual Note createNote( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createNote @endlink */ - AsyncResult * createNoteAsync( - const Note& note, - QString authenticationToken = QString()); + virtual AsyncResult * createNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** * Submit a set of changes to a note to the service. The provided data @@ -1387,14 +1368,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note updateNote( - const Note& note, - QString authenticationToken = QString()); + virtual Note updateNote( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateNote @endlink */ - AsyncResult * updateNoteAsync( - const Note& note, - QString authenticationToken = QString()); + virtual AsyncResult * updateNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** * Moves the note into the trash. The note may still be undeleted, unless it @@ -1422,14 +1403,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 deleteNote( + virtual qint32 deleteNote( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link deleteNote @endlink */ - AsyncResult * deleteNoteAsync( + virtual AsyncResult * deleteNoteAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Permanently removes a Note, and all of its Resources, @@ -1455,14 +1436,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 expungeNote( + virtual qint32 expungeNote( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link expungeNote @endlink */ - AsyncResult * expungeNoteAsync( + virtual AsyncResult * expungeNoteAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Performs a deep copy of the Note with the provided GUID 'noteGuid' into @@ -1506,16 +1487,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note copyNote( + virtual Note copyNote( Guid noteGuid, Guid toNotebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link copyNote @endlink */ - AsyncResult * copyNoteAsync( + virtual AsyncResult * copyNoteAsync( Guid noteGuid, Guid toNotebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of the prior versions of a particular note that are @@ -1539,14 +1520,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QList listNoteVersions( + virtual QList listNoteVersions( Guid noteGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listNoteVersions @endlink */ - AsyncResult * listNoteVersionsAsync( + virtual AsyncResult * listNoteVersionsAsync( Guid noteGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * This can be used to retrieve a previous version of a Note after it has been @@ -1591,22 +1572,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Note getNoteVersion( + virtual Note getNoteVersion( Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNoteVersion @endlink */ - AsyncResult * getNoteVersionAsync( + virtual AsyncResult * getNoteVersionAsync( Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of the resource in the service with the @@ -1645,22 +1626,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Resource getResource( + virtual Resource getResource( Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResource @endlink */ - AsyncResult * getResourceAsync( + virtual AsyncResult * getResourceAsync( Guid guid, bool withData, bool withRecognition, bool withAttributes, bool withAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Get all of the application data for the Resource identified by GUID, @@ -1670,14 +1651,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * only needs to fetch its own applicationData entry, use * getResourceApplicationDataEntry instead. */ - LazyMap getResourceApplicationData( + virtual LazyMap getResourceApplicationData( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceApplicationData @endlink */ - AsyncResult * getResourceApplicationDataAsync( + virtual AsyncResult * getResourceApplicationDataAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Get the value of a single entry in the applicationData map @@ -1688,48 +1669,48 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "ResourceAttributes.applicationData.key" - Resource not found, by key
  • * */ - QString getResourceApplicationDataEntry( + virtual QString getResourceApplicationDataEntry( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceApplicationDataEntry @endlink */ - AsyncResult * getResourceApplicationDataEntryAsync( + virtual AsyncResult * getResourceApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Update, or create, an entry in the applicationData map for * the Resource identified by guid. */ - qint32 setResourceApplicationDataEntry( + virtual qint32 setResourceApplicationDataEntry( Guid guid, QString key, QString value, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link setResourceApplicationDataEntry @endlink */ - AsyncResult * setResourceApplicationDataEntryAsync( + virtual AsyncResult * setResourceApplicationDataEntryAsync( Guid guid, QString key, QString value, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Remove an entry identified by 'key' from the applicationData map for * the Resource identified by 'guid'. */ - qint32 unsetResourceApplicationDataEntry( + virtual qint32 unsetResourceApplicationDataEntry( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link unsetResourceApplicationDataEntry @endlink */ - AsyncResult * unsetResourceApplicationDataEntryAsync( + virtual AsyncResult * unsetResourceApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Submit a set of changes to a resource to the service. This can be used @@ -1780,14 +1761,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateResource( - const Resource& resource, - QString authenticationToken = QString()); + virtual qint32 updateResource( + const Resource & resource, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateResource @endlink */ - AsyncResult * updateResourceAsync( - const Resource& resource, - QString authenticationToken = QString()); + virtual AsyncResult * updateResourceAsync( + const Resource & resource, + IRequestContextPtr ctx = {}) = 0; /** * Returns binary data of the resource with the provided GUID. For @@ -1811,14 +1792,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceData( + virtual QByteArray getResourceData( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceData @endlink */ - AsyncResult * getResourceDataAsync( + virtual AsyncResult * getResourceDataAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the current state of a resource, referenced by containing @@ -1861,22 +1842,22 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - Resource getResourceByHash( + virtual Resource getResourceByHash( Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceByHash @endlink */ - AsyncResult * getResourceByHashAsync( + virtual AsyncResult * getResourceByHashAsync( Guid noteGuid, QByteArray contentHash, bool withData, bool withRecognition, bool withAlternateData, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the binary contents of the recognition index for the resource @@ -1902,14 +1883,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceRecognition( + virtual QByteArray getResourceRecognition( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceRecognition @endlink */ - AsyncResult * getResourceRecognitionAsync( + virtual AsyncResult * getResourceRecognitionAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * If the Resource with the provided GUID has an alternate data representation @@ -1935,14 +1916,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - QByteArray getResourceAlternateData( + virtual QByteArray getResourceAlternateData( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceAlternateData @endlink */ - AsyncResult * getResourceAlternateDataAsync( + virtual AsyncResult * getResourceAlternateDataAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns the set of attributes for the Resource with the provided GUID. @@ -1964,14 +1945,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - ResourceAttributes getResourceAttributes( + virtual ResourceAttributes getResourceAttributes( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getResourceAttributes @endlink */ - AsyncResult * getResourceAttributesAsync( + virtual AsyncResult * getResourceAttributesAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** *

    @@ -2007,14 +1988,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * down for the requester because of an IP-based country lookup. * */ - Notebook getPublicNotebook( + virtual Notebook getPublicNotebook( UserID userId, - QString publicUri); + QString publicUri, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getPublicNotebook @endlink */ - AsyncResult * getPublicNotebookAsync( + virtual AsyncResult * getPublicNotebookAsync( UserID userId, - QString publicUri); + QString publicUri, + IRequestContextPtr ctx = {}) = 0; /** * @Deprecated for first-party clients. See createOrUpdateNotebookShares. @@ -2093,16 +2076,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SharedNotebook shareNotebook( - const SharedNotebook& sharedNotebook, + virtual SharedNotebook shareNotebook( + const SharedNotebook & sharedNotebook, QString message, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link shareNotebook @endlink */ - AsyncResult * shareNotebookAsync( - const SharedNotebook& sharedNotebook, + virtual AsyncResult * shareNotebookAsync( + const SharedNotebook & sharedNotebook, QString message, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Share a notebook by a messaging thread ID or a list of contacts. This function is @@ -2158,26 +2141,26 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * specified, but no thread with that ID exists * */ - CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( - const NotebookShareTemplate& shareTemplate, - QString authenticationToken = QString()); + virtual CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createOrUpdateNotebookShares @endlink */ - AsyncResult * createOrUpdateNotebookSharesAsync( - const NotebookShareTemplate& shareTemplate, - QString authenticationToken = QString()); + virtual AsyncResult * createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) = 0; /** * @Deprecated See createOrUpdateNotebookShares and manageNotebookShares. */ - qint32 updateSharedNotebook( - const SharedNotebook& sharedNotebook, - QString authenticationToken = QString()); + virtual qint32 updateSharedNotebook( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateSharedNotebook @endlink */ - AsyncResult * updateSharedNotebookAsync( - const SharedNotebook& sharedNotebook, - QString authenticationToken = QString()); + virtual AsyncResult * updateSharedNotebookAsync( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) = 0; /** * Set values for the recipient settings associated with a notebook share. Only the @@ -2215,16 +2198,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * to false and any of reminder* settings to true. * */ - Notebook setNotebookRecipientSettings( + virtual Notebook setNotebookRecipientSettings( QString notebookGuid, - const NotebookRecipientSettings& recipientSettings, - QString authenticationToken = QString()); + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link setNotebookRecipientSettings @endlink */ - AsyncResult * setNotebookRecipientSettingsAsync( + virtual AsyncResult * setNotebookRecipientSettingsAsync( QString notebookGuid, - const NotebookRecipientSettings& recipientSettings, - QString authenticationToken = QString()); + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) = 0; /** * Lists the collection of shared notebooks for all notebooks in the @@ -2233,12 +2216,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * @return * The list of all SharedNotebooks for the user */ - QList listSharedNotebooks( - QString authenticationToken = QString()); + virtual QList listSharedNotebooks( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listSharedNotebooks @endlink */ - AsyncResult * listSharedNotebooksAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listSharedNotebooksAsync( + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to make a linked notebook with the provided name, username @@ -2277,14 +2260,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - LinkedNotebook createLinkedNotebook( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual LinkedNotebook createLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link createLinkedNotebook @endlink */ - AsyncResult * createLinkedNotebookAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual AsyncResult * createLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** * @param linkedNotebook @@ -2302,24 +2285,24 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - qint32 updateLinkedNotebook( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual qint32 updateLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateLinkedNotebook @endlink */ - AsyncResult * updateLinkedNotebookAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken = QString()); + virtual AsyncResult * updateLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of linked notebooks */ - QList listLinkedNotebooks( - QString authenticationToken = QString()); + virtual QList listLinkedNotebooks( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listLinkedNotebooks @endlink */ - AsyncResult * listLinkedNotebooksAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listLinkedNotebooksAsync( + IRequestContextPtr ctx = {}) = 0; /** * Permanently expunges the linked notebook from the account. @@ -2332,14 +2315,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * The LinkedNotebook.guid field of the LinkedNotebook to permanently remove * from the account. */ - qint32 expungeLinkedNotebook( + virtual qint32 expungeLinkedNotebook( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link expungeLinkedNotebook @endlink */ - AsyncResult * expungeLinkedNotebookAsync( + virtual AsyncResult * expungeLinkedNotebookAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to produce an authentication token that can be used to @@ -2391,14 +2374,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - AuthenticationResult authenticateToSharedNotebook( + virtual AuthenticationResult authenticateToSharedNotebook( QString shareKeyOrGlobalId, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link authenticateToSharedNotebook @endlink */ - AsyncResult * authenticateToSharedNotebookAsync( + virtual AsyncResult * authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * This function is used to retrieve extended information about a shared @@ -2425,12 +2408,12 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - SharedNotebook getSharedNotebookByAuth( - QString authenticationToken = QString()); + virtual SharedNotebook getSharedNotebookByAuth( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getSharedNotebookByAuth @endlink */ - AsyncResult * getSharedNotebookByAuthAsync( - QString authenticationToken = QString()); + virtual AsyncResult * getSharedNotebookByAuthAsync( + IRequestContextPtr ctx = {}) = 0; /** * Attempts to send a single note to one or more email recipients. @@ -2481,14 +2464,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - void emailNote( - const NoteEmailParameters& parameters, - QString authenticationToken = QString()); + virtual void emailNote( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link emailNote @endlink */ - AsyncResult * emailNoteAsync( - const NoteEmailParameters& parameters, - QString authenticationToken = QString()); + virtual AsyncResult * emailNoteAsync( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) = 0; /** * If this note is not already shared publicly (via its own direct URL), then this @@ -2513,14 +2496,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *

  • "Note.guid" - not found, by GUID
  • * */ - QString shareNote( + virtual QString shareNote( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link shareNote @endlink */ - AsyncResult * shareNoteAsync( + virtual AsyncResult * shareNoteAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * If this note is shared publicly then this will stop sharing that note @@ -2544,14 +2527,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject *
  • "Note.guid" - not found, by GUID
  • * */ - void stopSharingNote( + virtual void stopSharingNote( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link stopSharingNote @endlink */ - AsyncResult * stopSharingNoteAsync( + virtual AsyncResult * stopSharingNoteAsync( Guid guid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Asks the service to produce an authentication token that can be used to @@ -2595,16 +2578,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - AuthenticationResult authenticateToSharedNote( + virtual AuthenticationResult authenticateToSharedNote( QString guid, QString noteKey, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link authenticateToSharedNote @endlink */ - AsyncResult * authenticateToSharedNoteAsync( + virtual AsyncResult * authenticateToSharedNoteAsync( QString guid, QString noteKey, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Identify related entities on the service, such as notes, @@ -2655,16 +2638,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * * */ - RelatedResult findRelated( - const RelatedQuery& query, - const RelatedResultSpec& resultSpec, - QString authenticationToken = QString()); + virtual RelatedResult findRelated( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link findRelated @endlink */ - AsyncResult * findRelatedAsync( - const RelatedQuery& query, - const RelatedResultSpec& resultSpec, - QString authenticationToken = QString()); + virtual AsyncResult * findRelatedAsync( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) = 0; /** * Perform the same operation as updateNote() would provided that the update @@ -2693,14 +2676,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * not happen if your client is working correctly. * */ - UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( - const Note& note, - QString authenticationToken = QString()); + virtual UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateNoteIfUsnMatches @endlink */ - AsyncResult * updateNoteIfUsnMatchesAsync( - const Note& note, - QString authenticationToken = QString()); + virtual AsyncResult * updateNoteIfUsnMatchesAsync( + const Note & note, + IRequestContextPtr ctx = {}) = 0; /** * Manage invitations and memberships associated with a given notebook. @@ -2718,14 +2701,14 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * shares. * */ - ManageNotebookSharesResult manageNotebookShares( - const ManageNotebookSharesParameters& parameters, - QString authenticationToken = QString()); + virtual ManageNotebookSharesResult manageNotebookShares( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link manageNotebookShares @endlink */ - AsyncResult * manageNotebookSharesAsync( - const ManageNotebookSharesParameters& parameters, - QString authenticationToken = QString()); + virtual AsyncResult * manageNotebookSharesAsync( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) = 0; /** * Return the share relationships for the given notebook, including @@ -2735,20 +2718,19 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * limited use by Evernote clients that have discussed using this * routine with the platform team. */ - ShareRelationships getNotebookShares( + virtual ShareRelationships getNotebookShares( QString notebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getNotebookShares @endlink */ - AsyncResult * getNotebookSharesAsync( + virtual AsyncResult * getNotebookSharesAsync( QString notebookGuid, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; -private: - QString m_url; - QString m_authenticationToken; }; +//////////////////////////////////////////////////////////////////////////////// + /** * Service: UserStore *

    @@ -2768,26 +2750,16 @@ class QEVERCLOUD_EXPORT NoteStore: public QObject * privileges * */ -class QEVERCLOUD_EXPORT UserStore: public QObject +class QEVERCLOUD_EXPORT IUserStore: public QObject { Q_OBJECT - Q_DISABLE_COPY(UserStore) -public: - explicit UserStore( - QString host, - QString authenticationToken = QString(), - QObject * parent = nullptr); - - void setAuthenticationToken(QString authenticationToken) - { - m_authenticationToken = authenticationToken; - } - - QString authenticationToken() - { - return m_authenticationToken; - } + Q_DISABLE_COPY(IUserStore) +protected: + IUserStore(QObject * parent) : + QObject(parent) + {} +public: /** * 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 @@ -2814,16 +2786,18 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * client. This should be the current value of the EDAM_VERSION_MINOR * constant for the client. */ - bool checkVersion( + virtual bool checkVersion( QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, - qint16 edamVersionMinor = EDAM_VERSION_MINOR); + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link checkVersion @endlink */ - AsyncResult * checkVersionAsync( + virtual AsyncResult * checkVersionAsync( QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, - qint16 edamVersionMinor = EDAM_VERSION_MINOR); + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) = 0; /** * This provides bootstrap information to the client. Various bootstrap @@ -2837,12 +2811,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * @return * The bootstrap information suitable for this client. */ - BootstrapInfo getBootstrapInfo( - QString locale); + virtual BootstrapInfo getBootstrapInfo( + QString locale, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getBootstrapInfo @endlink */ - AsyncResult * getBootstrapInfoAsync( - QString locale); + virtual AsyncResult * getBootstrapInfoAsync( + QString locale, + IRequestContextPtr ctx = {}) = 0; /** * This is used to check a username and password in order to create a @@ -2930,24 +2906,26 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *

  • AUTH_EXPIRED "password" - user password is expired * */ - AuthenticationResult authenticateLongSession( + virtual AuthenticationResult authenticateLongSession( QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, - bool supportsTwoFactor); + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link authenticateLongSession @endlink */ - AsyncResult * authenticateLongSessionAsync( + virtual AsyncResult * authenticateLongSessionAsync( QString username, QString password, QString consumerKey, QString consumerSecret, QString deviceIdentifier, QString deviceDescription, - bool supportsTwoFactor); + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) = 0; /** * Complete the authentication process when a second factor is required. This @@ -2987,18 +2965,18 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * two-factor authentication.
  • * */ - AuthenticationResult completeTwoFactorAuthentication( + virtual AuthenticationResult completeTwoFactorAuthentication( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link completeTwoFactorAuthentication @endlink */ - AsyncResult * completeTwoFactorAuthenticationAsync( + virtual AsyncResult * completeTwoFactorAuthenticationAsync( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Revoke an existing long lived authentication token. This can be used to @@ -3018,12 +2996,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * is already revoked. * */ - void revokeLongSession( - QString authenticationToken = QString()); + virtual void revokeLongSession( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link revokeLongSession @endlink */ - AsyncResult * revokeLongSessionAsync( - QString authenticationToken = QString()); + virtual AsyncResult * revokeLongSessionAsync( + IRequestContextPtr ctx = {}) = 0; /** * This is used to take an existing authentication token that grants access @@ -3058,12 +3036,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * sign-on before authenticating to the business. * */ - AuthenticationResult authenticateToBusiness( - QString authenticationToken = QString()); + virtual AuthenticationResult authenticateToBusiness( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link authenticateToBusiness @endlink */ - AsyncResult * authenticateToBusinessAsync( - QString authenticationToken = QString()); + virtual AsyncResult * authenticateToBusinessAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns the User corresponding to the provided authentication token, @@ -3072,12 +3050,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * the access level granted by the token, so a web service client may receive * fewer fields than an integrated desktop client. */ - User getUser( - QString authenticationToken = QString()); + virtual User getUser( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getUser @endlink */ - AsyncResult * getUserAsync( - QString authenticationToken = QString()); + virtual AsyncResult * getUserAsync( + IRequestContextPtr ctx = {}) = 0; /** * Asks the UserStore about the publicly available location information for @@ -3087,12 +3065,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • DATA_REQUIRED "username" - username is empty * */ - PublicUserInfo getPublicUserInfo( - QString username); + virtual PublicUserInfo getPublicUserInfo( + QString username, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getPublicUserInfo @endlink */ - AsyncResult * getPublicUserInfoAsync( - QString username); + virtual AsyncResult * getPublicUserInfoAsync( + QString username, + IRequestContextPtr ctx = {}) = 0; /** *

    Returns the URLs that should be used when sending requests to the service on @@ -3103,12 +3083,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * UserStore#authenticateLongSession(). This method is typically only needed to look up * the correct URLs for an existing long-lived authentication token.

    */ - UserUrls getUserUrls( - QString authenticationToken = QString()); + virtual UserUrls getUserUrls( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getUserUrls @endlink */ - AsyncResult * getUserUrlsAsync( - QString authenticationToken = QString()); + virtual AsyncResult * getUserUrlsAsync( + IRequestContextPtr ctx = {}) = 0; /** * Invite a user to join an Evernote Business account. @@ -3153,14 +3133,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * user limit.
  • * */ - void inviteToBusiness( + virtual void inviteToBusiness( QString emailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link inviteToBusiness @endlink */ - AsyncResult * inviteToBusinessAsync( + virtual AsyncResult * inviteToBusinessAsync( QString emailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Remove a user from an Evernote Business account. Once removed, the user will no @@ -3186,14 +3166,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * business or that user was not invited via external provisioning. * */ - void removeFromBusiness( + virtual void removeFromBusiness( QString emailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link removeFromBusiness @endlink */ - AsyncResult * removeFromBusinessAsync( + virtual AsyncResult * removeFromBusinessAsync( QString emailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Update the email address used to uniquely identify an Evernote Business user. @@ -3237,16 +3217,16 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * in the business. * */ - void updateBusinessUserIdentifier( + virtual void updateBusinessUserIdentifier( QString oldEmailAddress, QString newEmailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link updateBusinessUserIdentifier @endlink */ - AsyncResult * updateBusinessUserIdentifierAsync( + virtual AsyncResult * updateBusinessUserIdentifierAsync( QString oldEmailAddress, QString newEmailAddress, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of active business users in a given business. @@ -3266,12 +3246,12 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * A business authentication token returned by authenticateToBusiness or with sufficient * privileges to manage Evernote Business membership. */ - QList listBusinessUsers( - QString authenticationToken = QString()); + virtual QList listBusinessUsers( + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listBusinessUsers @endlink */ - AsyncResult * listBusinessUsersAsync( - QString authenticationToken = QString()); + virtual AsyncResult * listBusinessUsersAsync( + IRequestContextPtr ctx = {}) = 0; /** * Returns a list of outstanding invitations to join an Evernote Business account. @@ -3287,14 +3267,14 @@ class QEVERCLOUD_EXPORT UserStore: public QObject * in the returned list. If false, only invitations with a status of * BusinessInvitationStatus.APPROVED will be included. */ - QList listBusinessInvitations( + virtual QList listBusinessInvitations( bool includeRequestedInvitations, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link listBusinessInvitations @endlink */ - AsyncResult * listBusinessInvitationsAsync( + virtual AsyncResult * listBusinessInvitationsAsync( bool includeRequestedInvitations, - QString authenticationToken = QString()); + IRequestContextPtr ctx = {}) = 0; /** * Retrieve the standard account limits for a given service level. This should only be @@ -3306,18 +3286,29 @@ class QEVERCLOUD_EXPORT UserStore: public QObject *
  • DATA_REQUIRED "serviceLevel" - serviceLevel is null
  • * */ - AccountLimits getAccountLimits( - ServiceLevel serviceLevel); + virtual AccountLimits getAccountLimits( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) = 0; /** Asynchronous version of @link getAccountLimits @endlink */ - AsyncResult * getAccountLimitsAsync( - ServiceLevel serviceLevel); + virtual AsyncResult * getAccountLimitsAsync( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) = 0; -private: - QString m_url; - QString m_authenticationToken; }; +//////////////////////////////////////////////////////////////////////////////// + +INoteStore * newNoteStore( + QString noteStoreUrl = QString(), + IRequestContextPtr ctx = {}, + QObject * parent = nullptr); + +IUserStore * newUserStore( + QString host, + IRequestContextPtr ctx = {}, + QObject * parent = nullptr); + } // namespace qevercloud Q_DECLARE_METATYPE(QList) diff --git a/QEverCloud/src/ServicesNonGenerated.cpp b/QEverCloud/src/ServicesNonGenerated.cpp deleted file mode 100644 index ddc3a1d7..00000000 --- a/QEverCloud/src/ServicesNonGenerated.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms - * of MIT license: - * https://opensource.org/licenses/MIT - */ - -#include -#include - -#include - -namespace qevercloud { - -/** - * @brief Constructs UserStore object. - * @param host - * www.evernote.com or sandbox.evernote.com - * @param authenticationToken - * This token that will be used as the default token. - */ -UserStore::UserStore(QString host, QString authenticationToken, QObject * parent) : - QObject(parent) -{ - QUrl url; - url.setScheme(QStringLiteral("https")); - url.setHost(host); - url.setPath(QStringLiteral("/edam/user")); - m_url = url.toString(QUrl::StripTrailingSlash); - setAuthenticationToken(authenticationToken); -} - -/** - * Constructs NoteStore object. - * @param noteStoreUrl - * EDAM NoteStore service url. In general it's different for different users. - * @param authenticationToken - * This token that will be used as the default token. - * - */ -NoteStore::NoteStore(QString noteStoreUrl, QString authenticationToken, - QObject * parent) : - QObject(parent) -{ - setNoteStoreUrl(noteStoreUrl); - setAuthenticationToken(authenticationToken); -} - -/** - * Constructs NoteStore object. - * - * noteStoreUrl and possibly authenticationToken are expected to be specified - * later. - */ -NoteStore::NoteStore(QObject * parent) : - QObject(parent) -{} - -/** @fn qevercloud::UserStore::setAuthenticationToken - * Sets a value that will be used as the default token. - * */ - -/** @fn qevercloud::UserStore::authenticationToken - * @returns the default authentication token value. - * */ - -/** @fn qevercloud::NoteStore::setAuthenticationToken - * Sets a value that will be used as the default token. - * */ - -/** @fn qevercloud::NoteStore::authenticationToken - * @returns the default authentication token value. - * */ - -/** @fn qevercloud::NoteStore::setNoteStoreUrl - * Sets a value that will be used as EDAM NoteStore service url by this object. - * */ - -/** @fn qevercloud::NoteStore::authenticationToken - * @returns EDAM NoteStore service url that is used by this NoteStore object. - * */ - -} // namespace qevercloud diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 9a6e4d87..d4aa81a0 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -19,6 +19,709 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN NoteStore: public INoteStore +{ + Q_OBJECT + Q_DISABLE_COPY(NoteStore) +public: + explicit NoteStore( + QString noteStoreUrl = QString(), + IRequestContextPtr ctx = {}, + QObject * parent = nullptr) : + INoteStore(parent), + m_url(std::move(noteStoreUrl)), + m_ctx(std::move(ctx)) + { + if (!m_ctx) { + m_ctx = newRequestContext(); + } + } + + explicit NoteStore(QObject * parent) : + INoteStore(parent) + { + m_ctx = newRequestContext(); + } + + void setNoteStoreUrl(QString noteStoreUrl) + { + m_url = std::move(noteStoreUrl); + } + + QString noteStoreUrl() + { + return m_url; + } + + virtual SyncState getSyncState( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSyncStateAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncChunk getFilteredSyncChunk( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getFilteredSyncChunkAsync( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncState getLinkedNotebookSyncState( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getLinkedNotebookSyncStateAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncChunk getLinkedNotebookSyncChunk( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getLinkedNotebookSyncChunkAsync( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listAccessibleBusinessNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listAccessibleBusinessNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getDefaultNotebook( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getDefaultNotebookAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook createNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listTags( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listTagsAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listTagsByNotebook( + Guid notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listTagsByNotebookAsync( + Guid notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Tag getTag( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getTagAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Tag createTag( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateTag( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void untagAll( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * untagAllAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeTag( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeTagAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listSearches( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listSearchesAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SavedSearch getSearch( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSearchAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SavedSearch createSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeSearch( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeSearchAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 findNoteOffset( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNoteOffsetAsync( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual NotesMetadataList findNotesMetadata( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNotesMetadataAsync( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual NoteCollectionCounts findNoteCounts( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNoteCountsAsync( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNoteWithResultSpec( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteWithResultSpecAsync( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNote( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteAsync( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LazyMap getNoteApplicationData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 setNoteApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 unsetNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * unsetNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteContent( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteContentAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteSearchText( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteSearchTextAsync( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getResourceSearchText( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceSearchTextAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QStringList getNoteTagNames( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteTagNamesAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note createNote( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note updateNote( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 deleteNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * deleteNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note copyNote( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * copyNoteAsync( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listNoteVersions( + Guid noteGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listNoteVersionsAsync( + Guid noteGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNoteVersion( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteVersionAsync( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Resource getResource( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAsync( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LazyMap getResourceApplicationData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 setResourceApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 unsetResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * unsetResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateResource( + const Resource & resource, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateResourceAsync( + const Resource & resource, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Resource getResourceByHash( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceByHashAsync( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceRecognition( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceRecognitionAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceAlternateData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAlternateDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ResourceAttributes getResourceAttributes( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAttributesAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getPublicNotebook( + UserID userId, + QString publicUri, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getPublicNotebookAsync( + UserID userId, + QString publicUri, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SharedNotebook shareNotebook( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * shareNotebookAsync( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateSharedNotebook( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateSharedNotebookAsync( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook setNotebookRecipientSettings( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setNotebookRecipientSettingsAsync( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listSharedNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listSharedNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LinkedNotebook createLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listLinkedNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listLinkedNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeLinkedNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeLinkedNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToSharedNotebook( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToSharedNotebookAsync( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SharedNotebook getSharedNotebookByAuth( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSharedNotebookByAuthAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void emailNote( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * emailNoteAsync( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString shareNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * shareNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void stopSharingNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * stopSharingNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToSharedNote( + QString guid, + QString noteKey, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToSharedNoteAsync( + QString guid, + QString noteKey, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual RelatedResult findRelated( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findRelatedAsync( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNoteIfUsnMatchesAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ManageNotebookSharesResult manageNotebookShares( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * manageNotebookSharesAsync( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ShareRelationships getNotebookShares( + QString notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNotebookSharesAsync( + QString notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + +private: + QString m_url; + IRequestContextPtr m_ctx; +}; + +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getSyncState_prepareParams( QString authenticationToken) { @@ -122,33 +825,35 @@ QVariant NoteStore_getSyncState_readReplyAsync(QByteArray reply) } SyncState NoteStore::getSyncState( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSyncState_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSyncState_readReply(reply); } AsyncResult* NoteStore::getSyncStateAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSyncState_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_getSyncState_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getFilteredSyncChunk_prepareParams( QString authenticationToken, qint32 afterUSN, qint32 maxEntries, - const SyncChunkFilter& filter) + const SyncChunkFilter & filter) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -270,14 +975,14 @@ QVariant NoteStore_getFilteredSyncChunk_readReplyAsync(QByteArray reply) SyncChunk NoteStore::getFilteredSyncChunk( qint32 afterUSN, qint32 maxEntries, - const SyncChunkFilter& filter, - QString authenticationToken) + const SyncChunkFilter & filter, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( - authenticationToken, + ctx->authenticationToken(), afterUSN, maxEntries, filter); @@ -288,23 +993,25 @@ SyncChunk NoteStore::getFilteredSyncChunk( AsyncResult* NoteStore::getFilteredSyncChunkAsync( qint32 afterUSN, qint32 maxEntries, - const SyncChunkFilter& filter, - QString authenticationToken) + const SyncChunkFilter & filter, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( - authenticationToken, + ctx->authenticationToken(), afterUSN, maxEntries, filter); return new AsyncResult(m_url, params, NoteStore_getFilteredSyncChunk_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( QString authenticationToken, - const LinkedNotebook& linkedNotebook) + const LinkedNotebook & linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -422,35 +1129,37 @@ QVariant NoteStore_getLinkedNotebookSyncState_readReplyAsync(QByteArray reply) } SyncState NoteStore::getLinkedNotebookSyncState( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_getLinkedNotebookSyncState_readReply(reply); } AsyncResult* NoteStore::getLinkedNotebookSyncStateAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncState_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( QString authenticationToken, - const LinkedNotebook& linkedNotebook, + const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly) @@ -589,17 +1298,17 @@ QVariant NoteStore_getLinkedNotebookSyncChunk_readReplyAsync(QByteArray reply) } SyncChunk NoteStore::getLinkedNotebookSyncChunk( - const LinkedNotebook& linkedNotebook, + const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook, afterUSN, maxEntries, @@ -609,17 +1318,17 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( } AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync( - const LinkedNotebook& linkedNotebook, + const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook, afterUSN, maxEntries, @@ -627,6 +1336,8 @@ AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync( return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncChunk_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listNotebooks_prepareParams( QString authenticationToken) { @@ -740,28 +1451,30 @@ QVariant NoteStore_listNotebooks_readReplyAsync(QByteArray reply) } QList NoteStore::listNotebooks( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listNotebooks_readReply(reply); } AsyncResult* NoteStore::listNotebooksAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listNotebooks_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( QString authenticationToken) { @@ -875,28 +1588,30 @@ QVariant NoteStore_listAccessibleBusinessNotebooks_readReplyAsync(QByteArray rep } QList NoteStore::listAccessibleBusinessNotebooks( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listAccessibleBusinessNotebooks_readReply(reply); } AsyncResult* NoteStore::listAccessibleBusinessNotebooksAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listAccessibleBusinessNotebooks_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -1018,13 +1733,13 @@ QVariant NoteStore_getNotebook_readReplyAsync(QByteArray reply) Notebook NoteStore::getNotebook( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNotebook_readReply(reply); @@ -1032,17 +1747,19 @@ Notebook NoteStore::getNotebook( AsyncResult* NoteStore::getNotebookAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getDefaultNotebook_prepareParams( QString authenticationToken) { @@ -1146,31 +1863,33 @@ QVariant NoteStore_getDefaultNotebook_readReplyAsync(QByteArray reply) } Notebook NoteStore::getDefaultNotebook( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getDefaultNotebook_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_getDefaultNotebook_readReply(reply); } AsyncResult* NoteStore::getDefaultNotebookAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getDefaultNotebook_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_getDefaultNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createNotebook_prepareParams( QString authenticationToken, - const Notebook& notebook) + const Notebook & notebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -1288,35 +2007,37 @@ QVariant NoteStore_createNotebook_readReplyAsync(QByteArray reply) } Notebook NoteStore::createNotebook( - const Notebook& notebook, - QString authenticationToken) + const Notebook & notebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_createNotebook_readReply(reply); } AsyncResult* NoteStore::createNotebookAsync( - const Notebook& notebook, - QString authenticationToken) + const Notebook & notebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebook); return new AsyncResult(m_url, params, NoteStore_createNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateNotebook_prepareParams( QString authenticationToken, - const Notebook& notebook) + const Notebook & notebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -1434,32 +2155,34 @@ QVariant NoteStore_updateNotebook_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateNotebook( - const Notebook& notebook, - QString authenticationToken) + const Notebook & notebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNotebook_readReply(reply); } AsyncResult* NoteStore::updateNotebookAsync( - const Notebook& notebook, - QString authenticationToken) + const Notebook & notebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebook); return new AsyncResult(m_url, params, NoteStore_updateNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_expungeNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -1581,13 +2304,13 @@ QVariant NoteStore_expungeNotebook_readReplyAsync(QByteArray reply) qint32 NoteStore::expungeNotebook( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeNotebook_readReply(reply); @@ -1595,17 +2318,19 @@ qint32 NoteStore::expungeNotebook( AsyncResult* NoteStore::expungeNotebookAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_expungeNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listTags_prepareParams( QString authenticationToken) { @@ -1719,28 +2444,30 @@ QVariant NoteStore_listTags_readReplyAsync(QByteArray reply) } QList NoteStore::listTags( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listTags_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listTags_readReply(reply); } AsyncResult* NoteStore::listTagsAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listTags_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listTags_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listTagsByNotebook_prepareParams( QString authenticationToken, Guid notebookGuid) @@ -1872,13 +2599,13 @@ QVariant NoteStore_listTagsByNotebook_readReplyAsync(QByteArray reply) QList NoteStore::listTagsByNotebook( Guid notebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listTagsByNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_listTagsByNotebook_readReply(reply); @@ -1886,17 +2613,19 @@ QList NoteStore::listTagsByNotebook( AsyncResult* NoteStore::listTagsByNotebookAsync( Guid notebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listTagsByNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid); return new AsyncResult(m_url, params, NoteStore_listTagsByNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getTag_prepareParams( QString authenticationToken, Guid guid) @@ -2018,13 +2747,13 @@ QVariant NoteStore_getTag_readReplyAsync(QByteArray reply) Tag NoteStore::getTag( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getTag_readReply(reply); @@ -2032,20 +2761,22 @@ Tag NoteStore::getTag( AsyncResult* NoteStore::getTagAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getTag_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createTag_prepareParams( QString authenticationToken, - const Tag& tag) + const Tag & tag) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2163,35 +2894,37 @@ QVariant NoteStore_createTag_readReplyAsync(QByteArray reply) } Tag NoteStore::createTag( - const Tag& tag, - QString authenticationToken) + const Tag & tag, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), tag); QByteArray reply = askEvernote(m_url, params); return NoteStore_createTag_readReply(reply); } AsyncResult* NoteStore::createTagAsync( - const Tag& tag, - QString authenticationToken) + const Tag & tag, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), tag); return new AsyncResult(m_url, params, NoteStore_createTag_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateTag_prepareParams( QString authenticationToken, - const Tag& tag) + const Tag & tag) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2309,32 +3042,34 @@ QVariant NoteStore_updateTag_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateTag( - const Tag& tag, - QString authenticationToken) + const Tag & tag, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), tag); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateTag_readReply(reply); } AsyncResult* NoteStore::updateTagAsync( - const Tag& tag, - QString authenticationToken) + const Tag & tag, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), tag); return new AsyncResult(m_url, params, NoteStore_updateTag_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_untagAll_prepareParams( QString authenticationToken, Guid guid) @@ -2439,13 +3174,13 @@ QVariant NoteStore_untagAll_readReplyAsync(QByteArray reply) void NoteStore::untagAll( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_untagAll_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); NoteStore_untagAll_readReply(reply); @@ -2453,17 +3188,19 @@ void NoteStore::untagAll( AsyncResult* NoteStore::untagAllAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_untagAll_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_untagAll_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_expungeTag_prepareParams( QString authenticationToken, Guid guid) @@ -2585,13 +3322,13 @@ QVariant NoteStore_expungeTag_readReplyAsync(QByteArray reply) qint32 NoteStore::expungeTag( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeTag_readReply(reply); @@ -2599,17 +3336,19 @@ qint32 NoteStore::expungeTag( AsyncResult* NoteStore::expungeTagAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeTag_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_expungeTag_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listSearches_prepareParams( QString authenticationToken) { @@ -2723,28 +3462,30 @@ QVariant NoteStore_listSearches_readReplyAsync(QByteArray reply) } QList NoteStore::listSearches( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listSearches_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listSearches_readReply(reply); } AsyncResult* NoteStore::listSearchesAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listSearches_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listSearches_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getSearch_prepareParams( QString authenticationToken, Guid guid) @@ -2866,13 +3607,13 @@ QVariant NoteStore_getSearch_readReplyAsync(QByteArray reply) SavedSearch NoteStore::getSearch( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSearch_readReply(reply); @@ -2880,20 +3621,22 @@ SavedSearch NoteStore::getSearch( AsyncResult* NoteStore::getSearchAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getSearch_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createSearch_prepareParams( QString authenticationToken, - const SavedSearch& search) + const SavedSearch & search) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3001,35 +3744,37 @@ QVariant NoteStore_createSearch_readReplyAsync(QByteArray reply) } SavedSearch NoteStore::createSearch( - const SavedSearch& search, - QString authenticationToken) + const SavedSearch & search, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), search); QByteArray reply = askEvernote(m_url, params); return NoteStore_createSearch_readReply(reply); } AsyncResult* NoteStore::createSearchAsync( - const SavedSearch& search, - QString authenticationToken) + const SavedSearch & search, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), search); return new AsyncResult(m_url, params, NoteStore_createSearch_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateSearch_prepareParams( QString authenticationToken, - const SavedSearch& search) + const SavedSearch & search) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3147,32 +3892,34 @@ QVariant NoteStore_updateSearch_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateSearch( - const SavedSearch& search, - QString authenticationToken) + const SavedSearch & search, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), search); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateSearch_readReply(reply); } AsyncResult* NoteStore::updateSearchAsync( - const SavedSearch& search, - QString authenticationToken) + const SavedSearch & search, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), search); return new AsyncResult(m_url, params, NoteStore_updateSearch_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_expungeSearch_prepareParams( QString authenticationToken, Guid guid) @@ -3294,13 +4041,13 @@ QVariant NoteStore_expungeSearch_readReplyAsync(QByteArray reply) qint32 NoteStore::expungeSearch( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeSearch_readReply(reply); @@ -3308,20 +4055,22 @@ qint32 NoteStore::expungeSearch( AsyncResult* NoteStore::expungeSearchAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeSearch_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_expungeSearch_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_findNoteOffset_prepareParams( QString authenticationToken, - const NoteFilter& filter, + const NoteFilter & filter, Guid guid) { ThriftBinaryBufferWriter w; @@ -3446,15 +4195,15 @@ QVariant NoteStore_findNoteOffset_readReplyAsync(QByteArray reply) } qint32 NoteStore::findNoteOffset( - const NoteFilter& filter, + const NoteFilter & filter, Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNoteOffset_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, guid); QByteArray reply = askEvernote(m_url, params); @@ -3462,26 +4211,28 @@ qint32 NoteStore::findNoteOffset( } AsyncResult* NoteStore::findNoteOffsetAsync( - const NoteFilter& filter, + const NoteFilter & filter, Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNoteOffset_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, guid); return new AsyncResult(m_url, params, NoteStore_findNoteOffset_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_findNotesMetadata_prepareParams( QString authenticationToken, - const NoteFilter& filter, + const NoteFilter & filter, qint32 offset, qint32 maxNotes, - const NotesMetadataResultSpec& resultSpec) + const NotesMetadataResultSpec & resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3617,17 +4368,17 @@ QVariant NoteStore_findNotesMetadata_readReplyAsync(QByteArray reply) } NotesMetadataList NoteStore::findNotesMetadata( - const NoteFilter& filter, + const NoteFilter & filter, qint32 offset, qint32 maxNotes, - const NotesMetadataResultSpec& resultSpec, - QString authenticationToken) + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNotesMetadata_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, offset, maxNotes, @@ -3637,17 +4388,17 @@ NotesMetadataList NoteStore::findNotesMetadata( } AsyncResult* NoteStore::findNotesMetadataAsync( - const NoteFilter& filter, + const NoteFilter & filter, qint32 offset, qint32 maxNotes, - const NotesMetadataResultSpec& resultSpec, - QString authenticationToken) + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNotesMetadata_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, offset, maxNotes, @@ -3655,9 +4406,11 @@ AsyncResult* NoteStore::findNotesMetadataAsync( return new AsyncResult(m_url, params, NoteStore_findNotesMetadata_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_findNoteCounts_prepareParams( QString authenticationToken, - const NoteFilter& filter, + const NoteFilter & filter, bool withTrash) { ThriftBinaryBufferWriter w; @@ -3782,15 +4535,15 @@ QVariant NoteStore_findNoteCounts_readReplyAsync(QByteArray reply) } NoteCollectionCounts NoteStore::findNoteCounts( - const NoteFilter& filter, + const NoteFilter & filter, bool withTrash, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNoteCounts_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, withTrash); QByteArray reply = askEvernote(m_url, params); @@ -3798,24 +4551,26 @@ NoteCollectionCounts NoteStore::findNoteCounts( } AsyncResult* NoteStore::findNoteCountsAsync( - const NoteFilter& filter, + const NoteFilter & filter, bool withTrash, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findNoteCounts_prepareParams( - authenticationToken, + ctx->authenticationToken(), filter, withTrash); return new AsyncResult(m_url, params, NoteStore_findNoteCounts_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteWithResultSpec_prepareParams( QString authenticationToken, Guid guid, - const NoteResultSpec& resultSpec) + const NoteResultSpec & resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3940,14 +4695,14 @@ QVariant NoteStore_getNoteWithResultSpec_readReplyAsync(QByteArray reply) Note NoteStore::getNoteWithResultSpec( Guid guid, - const NoteResultSpec& resultSpec, - QString authenticationToken) + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, resultSpec); QByteArray reply = askEvernote(m_url, params); @@ -3956,19 +4711,21 @@ Note NoteStore::getNoteWithResultSpec( AsyncResult* NoteStore::getNoteWithResultSpecAsync( Guid guid, - const NoteResultSpec& resultSpec, - QString authenticationToken) + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, resultSpec); return new AsyncResult(m_url, params, NoteStore_getNoteWithResultSpec_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNote_prepareParams( QString authenticationToken, Guid guid, @@ -4122,13 +4879,13 @@ Note NoteStore::getNote( bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, withContent, withResourcesData, @@ -4144,13 +4901,13 @@ AsyncResult* NoteStore::getNoteAsync( bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, withContent, withResourcesData, @@ -4159,6 +4916,8 @@ AsyncResult* NoteStore::getNoteAsync( return new AsyncResult(m_url, params, NoteStore_getNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteApplicationData_prepareParams( QString authenticationToken, Guid guid) @@ -4280,13 +5039,13 @@ QVariant NoteStore_getNoteApplicationData_readReplyAsync(QByteArray reply) LazyMap NoteStore::getNoteApplicationData( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteApplicationData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteApplicationData_readReply(reply); @@ -4294,17 +5053,19 @@ LazyMap NoteStore::getNoteApplicationData( AsyncResult* NoteStore::getNoteApplicationDataAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteApplicationData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getNoteApplicationData_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -4434,13 +5195,13 @@ QVariant NoteStore_getNoteApplicationDataEntry_readReplyAsync(QByteArray reply) QString NoteStore::getNoteApplicationDataEntry( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); QByteArray reply = askEvernote(m_url, params); @@ -4450,18 +5211,20 @@ QString NoteStore::getNoteApplicationDataEntry( AsyncResult* NoteStore::getNoteApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); return new AsyncResult(m_url, params, NoteStore_getNoteApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -4599,13 +5362,13 @@ qint32 NoteStore::setNoteApplicationDataEntry( Guid guid, QString key, QString value, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key, value); @@ -4617,19 +5380,21 @@ AsyncResult* NoteStore::setNoteApplicationDataEntryAsync( Guid guid, QString key, QString value, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key, value); return new AsyncResult(m_url, params, NoteStore_setNoteApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -4759,13 +5524,13 @@ QVariant NoteStore_unsetNoteApplicationDataEntry_readReplyAsync(QByteArray reply qint32 NoteStore::unsetNoteApplicationDataEntry( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); QByteArray reply = askEvernote(m_url, params); @@ -4775,18 +5540,20 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( AsyncResult* NoteStore::unsetNoteApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); return new AsyncResult(m_url, params, NoteStore_unsetNoteApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteContent_prepareParams( QString authenticationToken, Guid guid) @@ -4908,13 +5675,13 @@ QVariant NoteStore_getNoteContent_readReplyAsync(QByteArray reply) QString NoteStore::getNoteContent( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteContent_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteContent_readReply(reply); @@ -4922,17 +5689,19 @@ QString NoteStore::getNoteContent( AsyncResult* NoteStore::getNoteContentAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteContent_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getNoteContent_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteSearchText_prepareParams( QString authenticationToken, Guid guid, @@ -5070,13 +5839,13 @@ QString NoteStore::getNoteSearchText( Guid guid, bool noteOnly, bool tokenizeForIndexing, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteSearchText_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, noteOnly, tokenizeForIndexing); @@ -5088,19 +5857,21 @@ AsyncResult* NoteStore::getNoteSearchTextAsync( Guid guid, bool noteOnly, bool tokenizeForIndexing, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteSearchText_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, noteOnly, tokenizeForIndexing); return new AsyncResult(m_url, params, NoteStore_getNoteSearchText_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceSearchText_prepareParams( QString authenticationToken, Guid guid) @@ -5222,13 +5993,13 @@ QVariant NoteStore_getResourceSearchText_readReplyAsync(QByteArray reply) QString NoteStore::getResourceSearchText( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceSearchText_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceSearchText_readReply(reply); @@ -5236,17 +6007,19 @@ QString NoteStore::getResourceSearchText( AsyncResult* NoteStore::getResourceSearchTextAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceSearchText_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceSearchText_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteTagNames_prepareParams( QString authenticationToken, Guid guid) @@ -5378,13 +6151,13 @@ QVariant NoteStore_getNoteTagNames_readReplyAsync(QByteArray reply) QStringList NoteStore::getNoteTagNames( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteTagNames_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNoteTagNames_readReply(reply); @@ -5392,20 +6165,22 @@ QStringList NoteStore::getNoteTagNames( AsyncResult* NoteStore::getNoteTagNamesAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteTagNames_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getNoteTagNames_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createNote_prepareParams( QString authenticationToken, - const Note& note) + const Note & note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5523,35 +6298,37 @@ QVariant NoteStore_createNote_readReplyAsync(QByteArray reply) } Note NoteStore::createNote( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); QByteArray reply = askEvernote(m_url, params); return NoteStore_createNote_readReply(reply); } AsyncResult* NoteStore::createNoteAsync( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); return new AsyncResult(m_url, params, NoteStore_createNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateNote_prepareParams( QString authenticationToken, - const Note& note) + const Note & note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5669,32 +6446,34 @@ QVariant NoteStore_updateNote_readReplyAsync(QByteArray reply) } Note NoteStore::updateNote( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNote_readReply(reply); } AsyncResult* NoteStore::updateNoteAsync( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); return new AsyncResult(m_url, params, NoteStore_updateNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_deleteNote_prepareParams( QString authenticationToken, Guid guid) @@ -5816,13 +6595,13 @@ QVariant NoteStore_deleteNote_readReplyAsync(QByteArray reply) qint32 NoteStore::deleteNote( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_deleteNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_deleteNote_readReply(reply); @@ -5830,17 +6609,19 @@ qint32 NoteStore::deleteNote( AsyncResult* NoteStore::deleteNoteAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_deleteNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_deleteNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_expungeNote_prepareParams( QString authenticationToken, Guid guid) @@ -5962,13 +6743,13 @@ QVariant NoteStore_expungeNote_readReplyAsync(QByteArray reply) qint32 NoteStore::expungeNote( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeNote_readReply(reply); @@ -5976,17 +6757,19 @@ qint32 NoteStore::expungeNote( AsyncResult* NoteStore::expungeNoteAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_expungeNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_copyNote_prepareParams( QString authenticationToken, Guid noteGuid, @@ -6116,13 +6899,13 @@ QVariant NoteStore_copyNote_readReplyAsync(QByteArray reply) Note NoteStore::copyNote( Guid noteGuid, Guid toNotebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_copyNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, toNotebookGuid); QByteArray reply = askEvernote(m_url, params); @@ -6132,18 +6915,20 @@ Note NoteStore::copyNote( AsyncResult* NoteStore::copyNoteAsync( Guid noteGuid, Guid toNotebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_copyNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, toNotebookGuid); return new AsyncResult(m_url, params, NoteStore_copyNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listNoteVersions_prepareParams( QString authenticationToken, Guid noteGuid) @@ -6275,13 +7060,13 @@ QVariant NoteStore_listNoteVersions_readReplyAsync(QByteArray reply) QList NoteStore::listNoteVersions( Guid noteGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listNoteVersions_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_listNoteVersions_readReply(reply); @@ -6289,17 +7074,19 @@ QList NoteStore::listNoteVersions( AsyncResult* NoteStore::listNoteVersionsAsync( Guid noteGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listNoteVersions_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid); return new AsyncResult(m_url, params, NoteStore_listNoteVersions_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNoteVersion_prepareParams( QString authenticationToken, Guid noteGuid, @@ -6453,13 +7240,13 @@ Note NoteStore::getNoteVersion( bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteVersion_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, updateSequenceNum, withResourcesData, @@ -6475,13 +7262,13 @@ AsyncResult* NoteStore::getNoteVersionAsync( bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNoteVersion_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, updateSequenceNum, withResourcesData, @@ -6490,6 +7277,8 @@ AsyncResult* NoteStore::getNoteVersionAsync( return new AsyncResult(m_url, params, NoteStore_getNoteVersion_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResource_prepareParams( QString authenticationToken, Guid guid, @@ -6643,13 +7432,13 @@ Resource NoteStore::getResource( bool withRecognition, bool withAttributes, bool withAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResource_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, withData, withRecognition, @@ -6665,13 +7454,13 @@ AsyncResult* NoteStore::getResourceAsync( bool withRecognition, bool withAttributes, bool withAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResource_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, withData, withRecognition, @@ -6680,6 +7469,8 @@ AsyncResult* NoteStore::getResourceAsync( return new AsyncResult(m_url, params, NoteStore_getResource_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceApplicationData_prepareParams( QString authenticationToken, Guid guid) @@ -6801,13 +7592,13 @@ QVariant NoteStore_getResourceApplicationData_readReplyAsync(QByteArray reply) LazyMap NoteStore::getResourceApplicationData( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceApplicationData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceApplicationData_readReply(reply); @@ -6815,17 +7606,19 @@ LazyMap NoteStore::getResourceApplicationData( AsyncResult* NoteStore::getResourceApplicationDataAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceApplicationData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceApplicationData_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -6955,13 +7748,13 @@ QVariant NoteStore_getResourceApplicationDataEntry_readReplyAsync(QByteArray rep QString NoteStore::getResourceApplicationDataEntry( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); QByteArray reply = askEvernote(m_url, params); @@ -6971,18 +7764,20 @@ QString NoteStore::getResourceApplicationDataEntry( AsyncResult* NoteStore::getResourceApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); return new AsyncResult(m_url, params, NoteStore_getResourceApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -7120,13 +7915,13 @@ qint32 NoteStore::setResourceApplicationDataEntry( Guid guid, QString key, QString value, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key, value); @@ -7138,19 +7933,21 @@ AsyncResult* NoteStore::setResourceApplicationDataEntryAsync( Guid guid, QString key, QString value, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key, value); return new AsyncResult(m_url, params, NoteStore_setResourceApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -7280,13 +8077,13 @@ QVariant NoteStore_unsetResourceApplicationDataEntry_readReplyAsync(QByteArray r qint32 NoteStore::unsetResourceApplicationDataEntry( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); QByteArray reply = askEvernote(m_url, params); @@ -7296,21 +8093,23 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( AsyncResult* NoteStore::unsetResourceApplicationDataEntryAsync( Guid guid, QString key, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid, key); return new AsyncResult(m_url, params, NoteStore_unsetResourceApplicationDataEntry_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateResource_prepareParams( QString authenticationToken, - const Resource& resource) + const Resource & resource) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7428,32 +8227,34 @@ QVariant NoteStore_updateResource_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateResource( - const Resource& resource, - QString authenticationToken) + const Resource & resource, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateResource_prepareParams( - authenticationToken, + ctx->authenticationToken(), resource); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateResource_readReply(reply); } AsyncResult* NoteStore::updateResourceAsync( - const Resource& resource, - QString authenticationToken) + const Resource & resource, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateResource_prepareParams( - authenticationToken, + ctx->authenticationToken(), resource); return new AsyncResult(m_url, params, NoteStore_updateResource_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceData_prepareParams( QString authenticationToken, Guid guid) @@ -7575,13 +8376,13 @@ QVariant NoteStore_getResourceData_readReplyAsync(QByteArray reply) QByteArray NoteStore::getResourceData( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceData_readReply(reply); @@ -7589,17 +8390,19 @@ QByteArray NoteStore::getResourceData( AsyncResult* NoteStore::getResourceDataAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceData_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceByHash_prepareParams( QString authenticationToken, Guid noteGuid, @@ -7753,13 +8556,13 @@ Resource NoteStore::getResourceByHash( bool withData, bool withRecognition, bool withAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceByHash_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, contentHash, withData, @@ -7775,13 +8578,13 @@ AsyncResult* NoteStore::getResourceByHashAsync( bool withData, bool withRecognition, bool withAlternateData, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceByHash_prepareParams( - authenticationToken, + ctx->authenticationToken(), noteGuid, contentHash, withData, @@ -7790,6 +8593,8 @@ AsyncResult* NoteStore::getResourceByHashAsync( return new AsyncResult(m_url, params, NoteStore_getResourceByHash_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceRecognition_prepareParams( QString authenticationToken, Guid guid) @@ -7911,13 +8716,13 @@ QVariant NoteStore_getResourceRecognition_readReplyAsync(QByteArray reply) QByteArray NoteStore::getResourceRecognition( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceRecognition_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceRecognition_readReply(reply); @@ -7925,17 +8730,19 @@ QByteArray NoteStore::getResourceRecognition( AsyncResult* NoteStore::getResourceRecognitionAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceRecognition_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceRecognition_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceAlternateData_prepareParams( QString authenticationToken, Guid guid) @@ -8057,13 +8864,13 @@ QVariant NoteStore_getResourceAlternateData_readReplyAsync(QByteArray reply) QByteArray NoteStore::getResourceAlternateData( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceAlternateData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceAlternateData_readReply(reply); @@ -8071,17 +8878,19 @@ QByteArray NoteStore::getResourceAlternateData( AsyncResult* NoteStore::getResourceAlternateDataAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceAlternateData_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceAlternateData_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getResourceAttributes_prepareParams( QString authenticationToken, Guid guid) @@ -8203,13 +9012,13 @@ QVariant NoteStore_getResourceAttributes_readReplyAsync(QByteArray reply) ResourceAttributes NoteStore::getResourceAttributes( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceAttributes_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getResourceAttributes_readReply(reply); @@ -8217,17 +9026,19 @@ ResourceAttributes NoteStore::getResourceAttributes( AsyncResult* NoteStore::getResourceAttributesAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getResourceAttributes_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_getResourceAttributes_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getPublicNotebook_prepareParams( UserID userId, QString publicUri) @@ -8339,8 +9150,12 @@ QVariant NoteStore_getPublicNotebook_readReplyAsync(QByteArray reply) Notebook NoteStore::getPublicNotebook( UserID userId, - QString publicUri) + QString publicUri, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = NoteStore_getPublicNotebook_prepareParams( userId, publicUri); @@ -8350,17 +9165,23 @@ Notebook NoteStore::getPublicNotebook( AsyncResult* NoteStore::getPublicNotebookAsync( UserID userId, - QString publicUri) + QString publicUri, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = NoteStore_getPublicNotebook_prepareParams( userId, publicUri); return new AsyncResult(m_url, params, NoteStore_getPublicNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_shareNotebook_prepareParams( QString authenticationToken, - const SharedNotebook& sharedNotebook, + const SharedNotebook & sharedNotebook, QString message) { ThriftBinaryBufferWriter w; @@ -8485,15 +9306,15 @@ QVariant NoteStore_shareNotebook_readReplyAsync(QByteArray reply) } SharedNotebook NoteStore::shareNotebook( - const SharedNotebook& sharedNotebook, + const SharedNotebook & sharedNotebook, QString message, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_shareNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), sharedNotebook, message); QByteArray reply = askEvernote(m_url, params); @@ -8501,23 +9322,25 @@ SharedNotebook NoteStore::shareNotebook( } AsyncResult* NoteStore::shareNotebookAsync( - const SharedNotebook& sharedNotebook, + const SharedNotebook & sharedNotebook, QString message, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_shareNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), sharedNotebook, message); return new AsyncResult(m_url, params, NoteStore_shareNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( QString authenticationToken, - const NotebookShareTemplate& shareTemplate) + const NotebookShareTemplate & shareTemplate) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8645,35 +9468,37 @@ QVariant NoteStore_createOrUpdateNotebookShares_readReplyAsync(QByteArray reply) } CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( - const NotebookShareTemplate& shareTemplate, - QString authenticationToken) + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), shareTemplate); QByteArray reply = askEvernote(m_url, params); return NoteStore_createOrUpdateNotebookShares_readReply(reply); } AsyncResult* NoteStore::createOrUpdateNotebookSharesAsync( - const NotebookShareTemplate& shareTemplate, - QString authenticationToken) + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), shareTemplate); return new AsyncResult(m_url, params, NoteStore_createOrUpdateNotebookShares_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateSharedNotebook_prepareParams( QString authenticationToken, - const SharedNotebook& sharedNotebook) + const SharedNotebook & sharedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8791,36 +9616,38 @@ QVariant NoteStore_updateSharedNotebook_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateSharedNotebook( - const SharedNotebook& sharedNotebook, - QString authenticationToken) + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateSharedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), sharedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateSharedNotebook_readReply(reply); } AsyncResult* NoteStore::updateSharedNotebookAsync( - const SharedNotebook& sharedNotebook, - QString authenticationToken) + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateSharedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), sharedNotebook); return new AsyncResult(m_url, params, NoteStore_updateSharedNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( QString authenticationToken, QString notebookGuid, - const NotebookRecipientSettings& recipientSettings) + const NotebookRecipientSettings & recipientSettings) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8945,14 +9772,14 @@ QVariant NoteStore_setNotebookRecipientSettings_readReplyAsync(QByteArray reply) Notebook NoteStore::setNotebookRecipientSettings( QString notebookGuid, - const NotebookRecipientSettings& recipientSettings, - QString authenticationToken) + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid, recipientSettings); QByteArray reply = askEvernote(m_url, params); @@ -8961,19 +9788,21 @@ Notebook NoteStore::setNotebookRecipientSettings( AsyncResult* NoteStore::setNotebookRecipientSettingsAsync( QString notebookGuid, - const NotebookRecipientSettings& recipientSettings, - QString authenticationToken) + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid, recipientSettings); return new AsyncResult(m_url, params, NoteStore_setNotebookRecipientSettings_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listSharedNotebooks_prepareParams( QString authenticationToken) { @@ -9097,31 +9926,33 @@ QVariant NoteStore_listSharedNotebooks_readReplyAsync(QByteArray reply) } QList NoteStore::listSharedNotebooks( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listSharedNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listSharedNotebooks_readReply(reply); } AsyncResult* NoteStore::listSharedNotebooksAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listSharedNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listSharedNotebooks_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_createLinkedNotebook_prepareParams( QString authenticationToken, - const LinkedNotebook& linkedNotebook) + const LinkedNotebook & linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9239,35 +10070,37 @@ QVariant NoteStore_createLinkedNotebook_readReplyAsync(QByteArray reply) } LinkedNotebook NoteStore::createLinkedNotebook( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_createLinkedNotebook_readReply(reply); } AsyncResult* NoteStore::createLinkedNotebookAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_createLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); return new AsyncResult(m_url, params, NoteStore_createLinkedNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateLinkedNotebook_prepareParams( QString authenticationToken, - const LinkedNotebook& linkedNotebook) + const LinkedNotebook & linkedNotebook) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9385,32 +10218,34 @@ QVariant NoteStore_updateLinkedNotebook_readReplyAsync(QByteArray reply) } qint32 NoteStore::updateLinkedNotebook( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateLinkedNotebook_readReply(reply); } AsyncResult* NoteStore::updateLinkedNotebookAsync( - const LinkedNotebook& linkedNotebook, - QString authenticationToken) + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), linkedNotebook); return new AsyncResult(m_url, params, NoteStore_updateLinkedNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_listLinkedNotebooks_prepareParams( QString authenticationToken) { @@ -9534,28 +10369,30 @@ QVariant NoteStore_listLinkedNotebooks_readReplyAsync(QByteArray reply) } QList NoteStore::listLinkedNotebooks( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_listLinkedNotebooks_readReply(reply); } AsyncResult* NoteStore::listLinkedNotebooksAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_listLinkedNotebooks_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_expungeLinkedNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -9677,13 +10514,13 @@ QVariant NoteStore_expungeLinkedNotebook_readReplyAsync(QByteArray reply) qint32 NoteStore::expungeLinkedNotebook( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_expungeLinkedNotebook_readReply(reply); @@ -9691,17 +10528,19 @@ qint32 NoteStore::expungeLinkedNotebook( AsyncResult* NoteStore::expungeLinkedNotebookAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_expungeLinkedNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( QString shareKeyOrGlobalId, QString authenticationToken) @@ -9823,31 +10662,33 @@ QVariant NoteStore_authenticateToSharedNotebook_readReplyAsync(QByteArray reply) AuthenticationResult NoteStore::authenticateToSharedNotebook( QString shareKeyOrGlobalId, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( shareKeyOrGlobalId, - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_authenticateToSharedNotebook_readReply(reply); } AsyncResult* NoteStore::authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( shareKeyOrGlobalId, - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNotebook_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( QString authenticationToken) { @@ -9961,31 +10802,33 @@ QVariant NoteStore_getSharedNotebookByAuth_readReplyAsync(QByteArray reply) } SharedNotebook NoteStore::getSharedNotebookByAuth( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_getSharedNotebookByAuth_readReply(reply); } AsyncResult* NoteStore::getSharedNotebookByAuthAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_getSharedNotebookByAuth_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_emailNote_prepareParams( QString authenticationToken, - const NoteEmailParameters& parameters) + const NoteEmailParameters & parameters) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10086,32 +10929,34 @@ QVariant NoteStore_emailNote_readReplyAsync(QByteArray reply) } void NoteStore::emailNote( - const NoteEmailParameters& parameters, - QString authenticationToken) + const NoteEmailParameters & parameters, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_emailNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), parameters); QByteArray reply = askEvernote(m_url, params); NoteStore_emailNote_readReply(reply); } AsyncResult* NoteStore::emailNoteAsync( - const NoteEmailParameters& parameters, - QString authenticationToken) + const NoteEmailParameters & parameters, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_emailNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), parameters); return new AsyncResult(m_url, params, NoteStore_emailNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_shareNote_prepareParams( QString authenticationToken, Guid guid) @@ -10233,13 +11078,13 @@ QVariant NoteStore_shareNote_readReplyAsync(QByteArray reply) QString NoteStore::shareNote( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_shareNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); return NoteStore_shareNote_readReply(reply); @@ -10247,17 +11092,19 @@ QString NoteStore::shareNote( AsyncResult* NoteStore::shareNoteAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_shareNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_shareNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_stopSharingNote_prepareParams( QString authenticationToken, Guid guid) @@ -10362,13 +11209,13 @@ QVariant NoteStore_stopSharingNote_readReplyAsync(QByteArray reply) void NoteStore::stopSharingNote( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_stopSharingNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); QByteArray reply = askEvernote(m_url, params); NoteStore_stopSharingNote_readReply(reply); @@ -10376,17 +11223,19 @@ void NoteStore::stopSharingNote( AsyncResult* NoteStore::stopSharingNoteAsync( Guid guid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_stopSharingNote_prepareParams( - authenticationToken, + ctx->authenticationToken(), guid); return new AsyncResult(m_url, params, NoteStore_stopSharingNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_authenticateToSharedNote_prepareParams( QString guid, QString noteKey, @@ -10516,15 +11365,15 @@ QVariant NoteStore_authenticateToSharedNote_readReplyAsync(QByteArray reply) AuthenticationResult NoteStore::authenticateToSharedNote( QString guid, QString noteKey, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( guid, noteKey, - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return NoteStore_authenticateToSharedNote_readReply(reply); } @@ -10532,22 +11381,24 @@ AuthenticationResult NoteStore::authenticateToSharedNote( AsyncResult* NoteStore::authenticateToSharedNoteAsync( QString guid, QString noteKey, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( guid, noteKey, - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNote_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_findRelated_prepareParams( QString authenticationToken, - const RelatedQuery& query, - const RelatedResultSpec& resultSpec) + const RelatedQuery & query, + const RelatedResultSpec & resultSpec) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10671,15 +11522,15 @@ QVariant NoteStore_findRelated_readReplyAsync(QByteArray reply) } RelatedResult NoteStore::findRelated( - const RelatedQuery& query, - const RelatedResultSpec& resultSpec, - QString authenticationToken) + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findRelated_prepareParams( - authenticationToken, + ctx->authenticationToken(), query, resultSpec); QByteArray reply = askEvernote(m_url, params); @@ -10687,23 +11538,25 @@ RelatedResult NoteStore::findRelated( } AsyncResult* NoteStore::findRelatedAsync( - const RelatedQuery& query, - const RelatedResultSpec& resultSpec, - QString authenticationToken) + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_findRelated_prepareParams( - authenticationToken, + ctx->authenticationToken(), query, resultSpec); return new AsyncResult(m_url, params, NoteStore_findRelated_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( QString authenticationToken, - const Note& note) + const Note & note) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10821,35 +11674,37 @@ QVariant NoteStore_updateNoteIfUsnMatches_readReplyAsync(QByteArray reply) } UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); QByteArray reply = askEvernote(m_url, params); return NoteStore_updateNoteIfUsnMatches_readReply(reply); } AsyncResult* NoteStore::updateNoteIfUsnMatchesAsync( - const Note& note, - QString authenticationToken) + const Note & note, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( - authenticationToken, + ctx->authenticationToken(), note); return new AsyncResult(m_url, params, NoteStore_updateNoteIfUsnMatches_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_manageNotebookShares_prepareParams( QString authenticationToken, - const ManageNotebookSharesParameters& parameters) + const ManageNotebookSharesParameters & parameters) { ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10967,32 +11822,34 @@ QVariant NoteStore_manageNotebookShares_readReplyAsync(QByteArray reply) } ManageNotebookSharesResult NoteStore::manageNotebookShares( - const ManageNotebookSharesParameters& parameters, - QString authenticationToken) + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_manageNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), parameters); QByteArray reply = askEvernote(m_url, params); return NoteStore_manageNotebookShares_readReply(reply); } AsyncResult* NoteStore::manageNotebookSharesAsync( - const ManageNotebookSharesParameters& parameters, - QString authenticationToken) + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_manageNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), parameters); return new AsyncResult(m_url, params, NoteStore_manageNotebookShares_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray NoteStore_getNotebookShares_prepareParams( QString authenticationToken, QString notebookGuid) @@ -11114,13 +11971,13 @@ QVariant NoteStore_getNotebookShares_readReplyAsync(QByteArray reply) ShareRelationships NoteStore::getNotebookShares( QString notebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid); QByteArray reply = askEvernote(m_url, params); return NoteStore_getNotebookShares_readReply(reply); @@ -11128,17 +11985,181 @@ ShareRelationships NoteStore::getNotebookShares( AsyncResult* NoteStore::getNotebookSharesAsync( QString notebookGuid, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = NoteStore_getNotebookShares_prepareParams( - authenticationToken, + ctx->authenticationToken(), notebookGuid); return new AsyncResult(m_url, params, NoteStore_getNotebookShares_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN UserStore: public IUserStore +{ + Q_OBJECT + Q_DISABLE_COPY(UserStore) +public: + explicit UserStore( + QString host, + IRequestContextPtr ctx = {}, + QObject * parent = nullptr) : + IUserStore(parent), + m_ctx(std::move(ctx)) + { + if (!m_ctx) { + m_ctx = newRequestContext(); + } + + QUrl url; + url.setScheme(QStringLiteral("https")); + url.setHost(host); + url.setPath(QStringLiteral("/edam/user")); + m_url = url.toString(QUrl::StripTrailingSlash); + } + + virtual bool checkVersion( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * checkVersionAsync( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual BootstrapInfo getBootstrapInfo( + QString locale, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getBootstrapInfoAsync( + QString locale, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateLongSession( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateLongSessionAsync( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult completeTwoFactorAuthentication( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * completeTwoFactorAuthenticationAsync( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void revokeLongSession( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * revokeLongSessionAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToBusiness( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToBusinessAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual User getUser( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getUserAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual PublicUserInfo getPublicUserInfo( + QString username, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getPublicUserInfoAsync( + QString username, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual UserUrls getUserUrls( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getUserUrlsAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void inviteToBusiness( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * inviteToBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void removeFromBusiness( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * removeFromBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void updateBusinessUserIdentifier( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateBusinessUserIdentifierAsync( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listBusinessUsers( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listBusinessUsersAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listBusinessInvitations( + bool includeRequestedInvitations, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listBusinessInvitationsAsync( + bool includeRequestedInvitations, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AccountLimits getAccountLimits( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getAccountLimitsAsync( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + +private: + QString m_url; + IRequestContextPtr m_ctx; +}; + +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_checkVersion_prepareParams( QString clientName, qint16 edamVersionMajor, @@ -11238,8 +12259,12 @@ QVariant UserStore_checkVersion_readReplyAsync(QByteArray reply) bool UserStore::checkVersion( QString clientName, qint16 edamVersionMajor, - qint16 edamVersionMinor) + qint16 edamVersionMinor, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_checkVersion_prepareParams( clientName, edamVersionMajor, @@ -11251,8 +12276,12 @@ bool UserStore::checkVersion( AsyncResult* UserStore::checkVersionAsync( QString clientName, qint16 edamVersionMajor, - qint16 edamVersionMinor) + qint16 edamVersionMinor, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_checkVersion_prepareParams( clientName, edamVersionMajor, @@ -11260,6 +12289,8 @@ AsyncResult* UserStore::checkVersionAsync( return new AsyncResult(m_url, params, UserStore_checkVersion_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_getBootstrapInfo_prepareParams( QString locale) { @@ -11343,8 +12374,12 @@ QVariant UserStore_getBootstrapInfo_readReplyAsync(QByteArray reply) } BootstrapInfo UserStore::getBootstrapInfo( - QString locale) + QString locale, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getBootstrapInfo_prepareParams( locale); QByteArray reply = askEvernote(m_url, params); @@ -11352,13 +12387,19 @@ BootstrapInfo UserStore::getBootstrapInfo( } AsyncResult* UserStore::getBootstrapInfoAsync( - QString locale) + QString locale, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getBootstrapInfo_prepareParams( locale); return new AsyncResult(m_url, params, UserStore_getBootstrapInfo_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_authenticateLongSession_prepareParams( QString username, QString password, @@ -11510,8 +12551,12 @@ AuthenticationResult UserStore::authenticateLongSession( QString consumerSecret, QString deviceIdentifier, QString deviceDescription, - bool supportsTwoFactor) + bool supportsTwoFactor, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_authenticateLongSession_prepareParams( username, password, @@ -11531,8 +12576,12 @@ AsyncResult* UserStore::authenticateLongSessionAsync( QString consumerSecret, QString deviceIdentifier, QString deviceDescription, - bool supportsTwoFactor) + bool supportsTwoFactor, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_authenticateLongSession_prepareParams( username, password, @@ -11544,6 +12593,8 @@ AsyncResult* UserStore::authenticateLongSessionAsync( return new AsyncResult(m_url, params, UserStore_authenticateLongSession_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( QString authenticationToken, QString oneTimeCode, @@ -11671,13 +12722,13 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( - authenticationToken, + ctx->authenticationToken(), oneTimeCode, deviceIdentifier, deviceDescription); @@ -11689,19 +12740,21 @@ AsyncResult* UserStore::completeTwoFactorAuthenticationAsync( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( - authenticationToken, + ctx->authenticationToken(), oneTimeCode, deviceIdentifier, deviceDescription); return new AsyncResult(m_url, params, UserStore_completeTwoFactorAuthentication_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_revokeLongSession_prepareParams( QString authenticationToken) { @@ -11788,28 +12841,30 @@ QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) } void UserStore::revokeLongSession( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_revokeLongSession_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); UserStore_revokeLongSession_readReply(reply); } AsyncResult* UserStore::revokeLongSessionAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_revokeLongSession_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, UserStore_revokeLongSession_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_authenticateToBusiness_prepareParams( QString authenticationToken) { @@ -11913,28 +12968,30 @@ QVariant UserStore_authenticateToBusiness_readReplyAsync(QByteArray reply) } AuthenticationResult UserStore::authenticateToBusiness( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_authenticateToBusiness_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return UserStore_authenticateToBusiness_readReply(reply); } AsyncResult* UserStore::authenticateToBusinessAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_authenticateToBusiness_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, UserStore_authenticateToBusiness_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_getUser_prepareParams( QString authenticationToken) { @@ -12038,28 +13095,30 @@ QVariant UserStore_getUser_readReplyAsync(QByteArray reply) } User UserStore::getUser( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_getUser_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return UserStore_getUser_readReply(reply); } AsyncResult* UserStore::getUserAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_getUser_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, UserStore_getUser_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_getPublicUserInfo_prepareParams( QString username) { @@ -12173,8 +13232,12 @@ QVariant UserStore_getPublicUserInfo_readReplyAsync(QByteArray reply) } PublicUserInfo UserStore::getPublicUserInfo( - QString username) + QString username, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getPublicUserInfo_prepareParams( username); QByteArray reply = askEvernote(m_url, params); @@ -12182,13 +13245,19 @@ PublicUserInfo UserStore::getPublicUserInfo( } AsyncResult* UserStore::getPublicUserInfoAsync( - QString username) + QString username, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getPublicUserInfo_prepareParams( username); return new AsyncResult(m_url, params, UserStore_getPublicUserInfo_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_getUserUrls_prepareParams( QString authenticationToken) { @@ -12292,28 +13361,30 @@ QVariant UserStore_getUserUrls_readReplyAsync(QByteArray reply) } UserUrls UserStore::getUserUrls( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_getUserUrls_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return UserStore_getUserUrls_readReply(reply); } AsyncResult* UserStore::getUserUrlsAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_getUserUrls_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, UserStore_getUserUrls_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_inviteToBusiness_prepareParams( QString authenticationToken, QString emailAddress) @@ -12408,13 +13479,13 @@ QVariant UserStore_inviteToBusiness_readReplyAsync(QByteArray reply) void UserStore::inviteToBusiness( QString emailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_inviteToBusiness_prepareParams( - authenticationToken, + ctx->authenticationToken(), emailAddress); QByteArray reply = askEvernote(m_url, params); UserStore_inviteToBusiness_readReply(reply); @@ -12422,17 +13493,19 @@ void UserStore::inviteToBusiness( AsyncResult* UserStore::inviteToBusinessAsync( QString emailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_inviteToBusiness_prepareParams( - authenticationToken, + ctx->authenticationToken(), emailAddress); return new AsyncResult(m_url, params, UserStore_inviteToBusiness_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_removeFromBusiness_prepareParams( QString authenticationToken, QString emailAddress) @@ -12537,13 +13610,13 @@ QVariant UserStore_removeFromBusiness_readReplyAsync(QByteArray reply) void UserStore::removeFromBusiness( QString emailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_removeFromBusiness_prepareParams( - authenticationToken, + ctx->authenticationToken(), emailAddress); QByteArray reply = askEvernote(m_url, params); UserStore_removeFromBusiness_readReply(reply); @@ -12551,17 +13624,19 @@ void UserStore::removeFromBusiness( AsyncResult* UserStore::removeFromBusinessAsync( QString emailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_removeFromBusiness_prepareParams( - authenticationToken, + ctx->authenticationToken(), emailAddress); return new AsyncResult(m_url, params, UserStore_removeFromBusiness_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( QString authenticationToken, QString oldEmailAddress, @@ -12674,13 +13749,13 @@ QVariant UserStore_updateBusinessUserIdentifier_readReplyAsync(QByteArray reply) void UserStore::updateBusinessUserIdentifier( QString oldEmailAddress, QString newEmailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( - authenticationToken, + ctx->authenticationToken(), oldEmailAddress, newEmailAddress); QByteArray reply = askEvernote(m_url, params); @@ -12690,18 +13765,20 @@ void UserStore::updateBusinessUserIdentifier( AsyncResult* UserStore::updateBusinessUserIdentifierAsync( QString oldEmailAddress, QString newEmailAddress, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( - authenticationToken, + ctx->authenticationToken(), oldEmailAddress, newEmailAddress); return new AsyncResult(m_url, params, UserStore_updateBusinessUserIdentifier_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_listBusinessUsers_prepareParams( QString authenticationToken) { @@ -12815,28 +13892,30 @@ QVariant UserStore_listBusinessUsers_readReplyAsync(QByteArray reply) } QList UserStore::listBusinessUsers( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_listBusinessUsers_prepareParams( - authenticationToken); + ctx->authenticationToken()); QByteArray reply = askEvernote(m_url, params); return UserStore_listBusinessUsers_readReply(reply); } AsyncResult* UserStore::listBusinessUsersAsync( - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_listBusinessUsers_prepareParams( - authenticationToken); + ctx->authenticationToken()); return new AsyncResult(m_url, params, UserStore_listBusinessUsers_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_listBusinessInvitations_prepareParams( QString authenticationToken, bool includeRequestedInvitations) @@ -12958,13 +14037,13 @@ QVariant UserStore_listBusinessInvitations_readReplyAsync(QByteArray reply) QList UserStore::listBusinessInvitations( bool includeRequestedInvitations, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_listBusinessInvitations_prepareParams( - authenticationToken, + ctx->authenticationToken(), includeRequestedInvitations); QByteArray reply = askEvernote(m_url, params); return UserStore_listBusinessInvitations_readReply(reply); @@ -12972,17 +14051,19 @@ QList UserStore::listBusinessInvitations( AsyncResult* UserStore::listBusinessInvitationsAsync( bool includeRequestedInvitations, - QString authenticationToken) + IRequestContextPtr ctx) { - if (authenticationToken.isEmpty()) { - authenticationToken = m_authenticationToken; + if (!ctx) { + ctx = m_ctx; } QByteArray params = UserStore_listBusinessInvitations_prepareParams( - authenticationToken, + ctx->authenticationToken(), includeRequestedInvitations); return new AsyncResult(m_url, params, UserStore_listBusinessInvitations_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + QByteArray UserStore_getAccountLimits_prepareParams( ServiceLevel serviceLevel) { @@ -13076,8 +14157,12 @@ QVariant UserStore_getAccountLimits_readReplyAsync(QByteArray reply) } AccountLimits UserStore::getAccountLimits( - ServiceLevel serviceLevel) + ServiceLevel serviceLevel, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getAccountLimits_prepareParams( serviceLevel); QByteArray reply = askEvernote(m_url, params); @@ -13085,12 +14170,35 @@ AccountLimits UserStore::getAccountLimits( } AsyncResult* UserStore::getAccountLimitsAsync( - ServiceLevel serviceLevel) + ServiceLevel serviceLevel, + IRequestContextPtr ctx) { + if (!ctx) { + ctx = m_ctx; + } QByteArray params = UserStore_getAccountLimits_prepareParams( serviceLevel); return new AsyncResult(m_url, params, UserStore_getAccountLimits_readReplyAsync); } +//////////////////////////////////////////////////////////////////////////////// + +INoteStore * newNoteStore( + QString noteStoreUrl, + IRequestContextPtr ctx, + QObject * parent) +{ + return new NoteStore(noteStoreUrl, ctx, parent); +} + +IUserStore * newUserStore( + QString host, + IRequestContextPtr ctx, + QObject * parent) +{ + return new UserStore(host, ctx, parent); +} } // namespace qevercloud + +#include From b404b97fbf5faa5b71c87db5bd4f82af4e843c8f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 4 Oct 2019 07:40:07 +0300 Subject: [PATCH 014/188] Add a king of "secret mode" to AsyncResult: if neither url nor post data is set, don't start reply fetcher I don't really like it this way. Maybe this would be changed in future. What is really needed here is a proper future/promise which can be subscribed to through signal emittance. Maybe some day I'd implement one for QEverCloud --- QEverCloud/headers/AsyncResult.h | 3 ++- QEverCloud/src/AsyncResult.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index a6d3dcf5..974fe60e 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -81,7 +81,8 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * error.isNull() != true in case of an error. See EverCloudExceptionData * for more details. * - * AsyncResult deletes itself after emitting this signal. You don't have to + * AsyncResult deletes itself after emitting this signal (if autoDelete + * parameter passed to its constructor was set to true). You don't have to * manage it's lifetime explicitly. */ void finished(QVariant result, QSharedPointer error); diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index d0b84b9c..37fe8622 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -118,6 +118,10 @@ bool AsyncResult::waitForFinished(int timeout) void AsyncResult::start() { Q_D(AsyncResult); + if (d->m_request.url().isEmpty() && d->m_postData.isEmpty()) { + return; + } + ReplyFetcher * replyFetcher = new ReplyFetcher; QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &AsyncResult::onReplyFetched); From d2d98037a50f8a1a0c1577627d311ca26cd9fc1b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 4 Oct 2019 07:40:41 +0300 Subject: [PATCH 015/188] Update generated services code --- QEverCloud/headers/generated/Services.h | 4 + QEverCloud/src/generated/Services.cpp | 7441 ++++++++++++++++++++++- 2 files changed, 7353 insertions(+), 92 deletions(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index b8079425..cadc49e7 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -2729,6 +2729,8 @@ class QEVERCLOUD_EXPORT INoteStore: public QObject }; +using INoteStorePtr = std::shared_ptr; + //////////////////////////////////////////////////////////////////////////////// /** @@ -3297,6 +3299,8 @@ class QEVERCLOUD_EXPORT IUserStore: public QObject }; +using IUserStorePtr = std::shared_ptr; + //////////////////////////////////////////////////////////////////////////////// INoteStore * newNoteStore( diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index d4aa81a0..9507034b 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -14,20 +14,20 @@ #include "../Impl.h" #include "Types_io.h" #include +#include +#include namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - class Q_DECL_HIDDEN NoteStore: public INoteStore { Q_OBJECT Q_DISABLE_COPY(NoteStore) public: explicit NoteStore( - QString noteStoreUrl = QString(), + QString noteStoreUrl = {}, IRequestContextPtr ctx = {}, QObject * parent = nullptr) : INoteStore(parent), @@ -722,6 +722,8 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getSyncState_prepareParams( QString authenticationToken) { @@ -824,6 +826,8 @@ QVariant NoteStore_getSyncState_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSyncState_readReply(reply)); } +} // namespace + SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { @@ -836,7 +840,7 @@ SyncState NoteStore::getSyncState( return NoteStore_getSyncState_readReply(reply); } -AsyncResult* NoteStore::getSyncStateAsync( +AsyncResult * NoteStore::getSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -849,6 +853,8 @@ AsyncResult* NoteStore::getSyncStateAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getFilteredSyncChunk_prepareParams( QString authenticationToken, qint32 afterUSN, @@ -972,6 +978,8 @@ QVariant NoteStore_getFilteredSyncChunk_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getFilteredSyncChunk_readReply(reply)); } +} // namespace + SyncChunk NoteStore::getFilteredSyncChunk( qint32 afterUSN, qint32 maxEntries, @@ -990,7 +998,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( return NoteStore_getFilteredSyncChunk_readReply(reply); } -AsyncResult* NoteStore::getFilteredSyncChunkAsync( +AsyncResult * NoteStore::getFilteredSyncChunkAsync( qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter, @@ -1009,6 +1017,8 @@ AsyncResult* NoteStore::getFilteredSyncChunkAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) @@ -1128,6 +1138,8 @@ QVariant NoteStore_getLinkedNotebookSyncState_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getLinkedNotebookSyncState_readReply(reply)); } +} // namespace + SyncState NoteStore::getLinkedNotebookSyncState( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) @@ -1142,7 +1154,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( return NoteStore_getLinkedNotebookSyncState_readReply(reply); } -AsyncResult* NoteStore::getLinkedNotebookSyncStateAsync( +AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { @@ -1157,6 +1169,8 @@ AsyncResult* NoteStore::getLinkedNotebookSyncStateAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook, @@ -1297,6 +1311,8 @@ QVariant NoteStore_getLinkedNotebookSyncChunk_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getLinkedNotebookSyncChunk_readReply(reply)); } +} // namespace + SyncChunk NoteStore::getLinkedNotebookSyncChunk( const LinkedNotebook & linkedNotebook, qint32 afterUSN, @@ -1317,7 +1333,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( return NoteStore_getLinkedNotebookSyncChunk_readReply(reply); } -AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync( +AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, @@ -1338,6 +1354,8 @@ AsyncResult* NoteStore::getLinkedNotebookSyncChunkAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listNotebooks_prepareParams( QString authenticationToken) { @@ -1450,6 +1468,8 @@ QVariant NoteStore_listNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listNotebooks_readReply(reply)); } +} // namespace + QList NoteStore::listNotebooks( IRequestContextPtr ctx) { @@ -1462,7 +1482,7 @@ QList NoteStore::listNotebooks( return NoteStore_listNotebooks_readReply(reply); } -AsyncResult* NoteStore::listNotebooksAsync( +AsyncResult * NoteStore::listNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -1475,6 +1495,8 @@ AsyncResult* NoteStore::listNotebooksAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( QString authenticationToken) { @@ -1587,6 +1609,8 @@ QVariant NoteStore_listAccessibleBusinessNotebooks_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_listAccessibleBusinessNotebooks_readReply(reply)); } +} // namespace + QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { @@ -1599,7 +1623,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( return NoteStore_listAccessibleBusinessNotebooks_readReply(reply); } -AsyncResult* NoteStore::listAccessibleBusinessNotebooksAsync( +AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -1612,6 +1636,8 @@ AsyncResult* NoteStore::listAccessibleBusinessNotebooksAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -1731,6 +1757,8 @@ QVariant NoteStore_getNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNotebook_readReply(reply)); } +} // namespace + Notebook NoteStore::getNotebook( Guid guid, IRequestContextPtr ctx) @@ -1745,7 +1773,7 @@ Notebook NoteStore::getNotebook( return NoteStore_getNotebook_readReply(reply); } -AsyncResult* NoteStore::getNotebookAsync( +AsyncResult * NoteStore::getNotebookAsync( Guid guid, IRequestContextPtr ctx) { @@ -1760,6 +1788,8 @@ AsyncResult* NoteStore::getNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getDefaultNotebook_prepareParams( QString authenticationToken) { @@ -1862,6 +1892,8 @@ QVariant NoteStore_getDefaultNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getDefaultNotebook_readReply(reply)); } +} // namespace + Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { @@ -1874,7 +1906,7 @@ Notebook NoteStore::getDefaultNotebook( return NoteStore_getDefaultNotebook_readReply(reply); } -AsyncResult* NoteStore::getDefaultNotebookAsync( +AsyncResult * NoteStore::getDefaultNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -1887,6 +1919,8 @@ AsyncResult* NoteStore::getDefaultNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createNotebook_prepareParams( QString authenticationToken, const Notebook & notebook) @@ -2006,6 +2040,8 @@ QVariant NoteStore_createNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createNotebook_readReply(reply)); } +} // namespace + Notebook NoteStore::createNotebook( const Notebook & notebook, IRequestContextPtr ctx) @@ -2020,7 +2056,7 @@ Notebook NoteStore::createNotebook( return NoteStore_createNotebook_readReply(reply); } -AsyncResult* NoteStore::createNotebookAsync( +AsyncResult * NoteStore::createNotebookAsync( const Notebook & notebook, IRequestContextPtr ctx) { @@ -2035,6 +2071,8 @@ AsyncResult* NoteStore::createNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateNotebook_prepareParams( QString authenticationToken, const Notebook & notebook) @@ -2154,6 +2192,8 @@ QVariant NoteStore_updateNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNotebook_readReply(reply)); } +} // namespace + qint32 NoteStore::updateNotebook( const Notebook & notebook, IRequestContextPtr ctx) @@ -2168,7 +2208,7 @@ qint32 NoteStore::updateNotebook( return NoteStore_updateNotebook_readReply(reply); } -AsyncResult* NoteStore::updateNotebookAsync( +AsyncResult * NoteStore::updateNotebookAsync( const Notebook & notebook, IRequestContextPtr ctx) { @@ -2183,6 +2223,8 @@ AsyncResult* NoteStore::updateNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_expungeNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -2302,6 +2344,8 @@ QVariant NoteStore_expungeNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeNotebook_readReply(reply)); } +} // namespace + qint32 NoteStore::expungeNotebook( Guid guid, IRequestContextPtr ctx) @@ -2316,7 +2360,7 @@ qint32 NoteStore::expungeNotebook( return NoteStore_expungeNotebook_readReply(reply); } -AsyncResult* NoteStore::expungeNotebookAsync( +AsyncResult * NoteStore::expungeNotebookAsync( Guid guid, IRequestContextPtr ctx) { @@ -2331,6 +2375,8 @@ AsyncResult* NoteStore::expungeNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listTags_prepareParams( QString authenticationToken) { @@ -2443,6 +2489,8 @@ QVariant NoteStore_listTags_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listTags_readReply(reply)); } +} // namespace + QList NoteStore::listTags( IRequestContextPtr ctx) { @@ -2455,7 +2503,7 @@ QList NoteStore::listTags( return NoteStore_listTags_readReply(reply); } -AsyncResult* NoteStore::listTagsAsync( +AsyncResult * NoteStore::listTagsAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -2468,6 +2516,8 @@ AsyncResult* NoteStore::listTagsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listTagsByNotebook_prepareParams( QString authenticationToken, Guid notebookGuid) @@ -2597,6 +2647,8 @@ QVariant NoteStore_listTagsByNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listTagsByNotebook_readReply(reply)); } +} // namespace + QList NoteStore::listTagsByNotebook( Guid notebookGuid, IRequestContextPtr ctx) @@ -2611,7 +2663,7 @@ QList NoteStore::listTagsByNotebook( return NoteStore_listTagsByNotebook_readReply(reply); } -AsyncResult* NoteStore::listTagsByNotebookAsync( +AsyncResult * NoteStore::listTagsByNotebookAsync( Guid notebookGuid, IRequestContextPtr ctx) { @@ -2626,6 +2678,8 @@ AsyncResult* NoteStore::listTagsByNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getTag_prepareParams( QString authenticationToken, Guid guid) @@ -2745,6 +2799,8 @@ QVariant NoteStore_getTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getTag_readReply(reply)); } +} // namespace + Tag NoteStore::getTag( Guid guid, IRequestContextPtr ctx) @@ -2759,7 +2815,7 @@ Tag NoteStore::getTag( return NoteStore_getTag_readReply(reply); } -AsyncResult* NoteStore::getTagAsync( +AsyncResult * NoteStore::getTagAsync( Guid guid, IRequestContextPtr ctx) { @@ -2774,6 +2830,8 @@ AsyncResult* NoteStore::getTagAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createTag_prepareParams( QString authenticationToken, const Tag & tag) @@ -2893,6 +2951,8 @@ QVariant NoteStore_createTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createTag_readReply(reply)); } +} // namespace + Tag NoteStore::createTag( const Tag & tag, IRequestContextPtr ctx) @@ -2907,7 +2967,7 @@ Tag NoteStore::createTag( return NoteStore_createTag_readReply(reply); } -AsyncResult* NoteStore::createTagAsync( +AsyncResult * NoteStore::createTagAsync( const Tag & tag, IRequestContextPtr ctx) { @@ -2922,6 +2982,8 @@ AsyncResult* NoteStore::createTagAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateTag_prepareParams( QString authenticationToken, const Tag & tag) @@ -3041,6 +3103,8 @@ QVariant NoteStore_updateTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateTag_readReply(reply)); } +} // namespace + qint32 NoteStore::updateTag( const Tag & tag, IRequestContextPtr ctx) @@ -3055,7 +3119,7 @@ qint32 NoteStore::updateTag( return NoteStore_updateTag_readReply(reply); } -AsyncResult* NoteStore::updateTagAsync( +AsyncResult * NoteStore::updateTagAsync( const Tag & tag, IRequestContextPtr ctx) { @@ -3070,6 +3134,8 @@ AsyncResult* NoteStore::updateTagAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_untagAll_prepareParams( QString authenticationToken, Guid guid) @@ -3172,6 +3238,8 @@ QVariant NoteStore_untagAll_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void NoteStore::untagAll( Guid guid, IRequestContextPtr ctx) @@ -3186,7 +3254,7 @@ void NoteStore::untagAll( NoteStore_untagAll_readReply(reply); } -AsyncResult* NoteStore::untagAllAsync( +AsyncResult * NoteStore::untagAllAsync( Guid guid, IRequestContextPtr ctx) { @@ -3201,6 +3269,8 @@ AsyncResult* NoteStore::untagAllAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_expungeTag_prepareParams( QString authenticationToken, Guid guid) @@ -3320,6 +3390,8 @@ QVariant NoteStore_expungeTag_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeTag_readReply(reply)); } +} // namespace + qint32 NoteStore::expungeTag( Guid guid, IRequestContextPtr ctx) @@ -3334,7 +3406,7 @@ qint32 NoteStore::expungeTag( return NoteStore_expungeTag_readReply(reply); } -AsyncResult* NoteStore::expungeTagAsync( +AsyncResult * NoteStore::expungeTagAsync( Guid guid, IRequestContextPtr ctx) { @@ -3349,6 +3421,8 @@ AsyncResult* NoteStore::expungeTagAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listSearches_prepareParams( QString authenticationToken) { @@ -3461,6 +3535,8 @@ QVariant NoteStore_listSearches_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listSearches_readReply(reply)); } +} // namespace + QList NoteStore::listSearches( IRequestContextPtr ctx) { @@ -3473,7 +3549,7 @@ QList NoteStore::listSearches( return NoteStore_listSearches_readReply(reply); } -AsyncResult* NoteStore::listSearchesAsync( +AsyncResult * NoteStore::listSearchesAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -3486,6 +3562,8 @@ AsyncResult* NoteStore::listSearchesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getSearch_prepareParams( QString authenticationToken, Guid guid) @@ -3605,6 +3683,8 @@ QVariant NoteStore_getSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSearch_readReply(reply)); } +} // namespace + SavedSearch NoteStore::getSearch( Guid guid, IRequestContextPtr ctx) @@ -3619,7 +3699,7 @@ SavedSearch NoteStore::getSearch( return NoteStore_getSearch_readReply(reply); } -AsyncResult* NoteStore::getSearchAsync( +AsyncResult * NoteStore::getSearchAsync( Guid guid, IRequestContextPtr ctx) { @@ -3634,6 +3714,8 @@ AsyncResult* NoteStore::getSearchAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createSearch_prepareParams( QString authenticationToken, const SavedSearch & search) @@ -3743,6 +3825,8 @@ QVariant NoteStore_createSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createSearch_readReply(reply)); } +} // namespace + SavedSearch NoteStore::createSearch( const SavedSearch & search, IRequestContextPtr ctx) @@ -3757,7 +3841,7 @@ SavedSearch NoteStore::createSearch( return NoteStore_createSearch_readReply(reply); } -AsyncResult* NoteStore::createSearchAsync( +AsyncResult * NoteStore::createSearchAsync( const SavedSearch & search, IRequestContextPtr ctx) { @@ -3772,6 +3856,8 @@ AsyncResult* NoteStore::createSearchAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateSearch_prepareParams( QString authenticationToken, const SavedSearch & search) @@ -3891,6 +3977,8 @@ QVariant NoteStore_updateSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateSearch_readReply(reply)); } +} // namespace + qint32 NoteStore::updateSearch( const SavedSearch & search, IRequestContextPtr ctx) @@ -3905,7 +3993,7 @@ qint32 NoteStore::updateSearch( return NoteStore_updateSearch_readReply(reply); } -AsyncResult* NoteStore::updateSearchAsync( +AsyncResult * NoteStore::updateSearchAsync( const SavedSearch & search, IRequestContextPtr ctx) { @@ -3920,6 +4008,8 @@ AsyncResult* NoteStore::updateSearchAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_expungeSearch_prepareParams( QString authenticationToken, Guid guid) @@ -4039,6 +4129,8 @@ QVariant NoteStore_expungeSearch_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeSearch_readReply(reply)); } +} // namespace + qint32 NoteStore::expungeSearch( Guid guid, IRequestContextPtr ctx) @@ -4053,7 +4145,7 @@ qint32 NoteStore::expungeSearch( return NoteStore_expungeSearch_readReply(reply); } -AsyncResult* NoteStore::expungeSearchAsync( +AsyncResult * NoteStore::expungeSearchAsync( Guid guid, IRequestContextPtr ctx) { @@ -4068,6 +4160,8 @@ AsyncResult* NoteStore::expungeSearchAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_findNoteOffset_prepareParams( QString authenticationToken, const NoteFilter & filter, @@ -4194,6 +4288,8 @@ QVariant NoteStore_findNoteOffset_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNoteOffset_readReply(reply)); } +} // namespace + qint32 NoteStore::findNoteOffset( const NoteFilter & filter, Guid guid, @@ -4210,7 +4306,7 @@ qint32 NoteStore::findNoteOffset( return NoteStore_findNoteOffset_readReply(reply); } -AsyncResult* NoteStore::findNoteOffsetAsync( +AsyncResult * NoteStore::findNoteOffsetAsync( const NoteFilter & filter, Guid guid, IRequestContextPtr ctx) @@ -4227,6 +4323,8 @@ AsyncResult* NoteStore::findNoteOffsetAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_findNotesMetadata_prepareParams( QString authenticationToken, const NoteFilter & filter, @@ -4367,6 +4465,8 @@ QVariant NoteStore_findNotesMetadata_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNotesMetadata_readReply(reply)); } +} // namespace + NotesMetadataList NoteStore::findNotesMetadata( const NoteFilter & filter, qint32 offset, @@ -4387,7 +4487,7 @@ NotesMetadataList NoteStore::findNotesMetadata( return NoteStore_findNotesMetadata_readReply(reply); } -AsyncResult* NoteStore::findNotesMetadataAsync( +AsyncResult * NoteStore::findNotesMetadataAsync( const NoteFilter & filter, qint32 offset, qint32 maxNotes, @@ -4408,6 +4508,8 @@ AsyncResult* NoteStore::findNotesMetadataAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_findNoteCounts_prepareParams( QString authenticationToken, const NoteFilter & filter, @@ -4534,6 +4636,8 @@ QVariant NoteStore_findNoteCounts_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findNoteCounts_readReply(reply)); } +} // namespace + NoteCollectionCounts NoteStore::findNoteCounts( const NoteFilter & filter, bool withTrash, @@ -4550,7 +4654,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( return NoteStore_findNoteCounts_readReply(reply); } -AsyncResult* NoteStore::findNoteCountsAsync( +AsyncResult * NoteStore::findNoteCountsAsync( const NoteFilter & filter, bool withTrash, IRequestContextPtr ctx) @@ -4567,6 +4671,8 @@ AsyncResult* NoteStore::findNoteCountsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteWithResultSpec_prepareParams( QString authenticationToken, Guid guid, @@ -4693,6 +4799,8 @@ QVariant NoteStore_getNoteWithResultSpec_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteWithResultSpec_readReply(reply)); } +} // namespace + Note NoteStore::getNoteWithResultSpec( Guid guid, const NoteResultSpec & resultSpec, @@ -4709,7 +4817,7 @@ Note NoteStore::getNoteWithResultSpec( return NoteStore_getNoteWithResultSpec_readReply(reply); } -AsyncResult* NoteStore::getNoteWithResultSpecAsync( +AsyncResult * NoteStore::getNoteWithResultSpecAsync( Guid guid, const NoteResultSpec & resultSpec, IRequestContextPtr ctx) @@ -4726,6 +4834,8 @@ AsyncResult* NoteStore::getNoteWithResultSpecAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNote_prepareParams( QString authenticationToken, Guid guid, @@ -4873,6 +4983,8 @@ QVariant NoteStore_getNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNote_readReply(reply)); } +} // namespace + Note NoteStore::getNote( Guid guid, bool withContent, @@ -4895,7 +5007,7 @@ Note NoteStore::getNote( return NoteStore_getNote_readReply(reply); } -AsyncResult* NoteStore::getNoteAsync( +AsyncResult * NoteStore::getNoteAsync( Guid guid, bool withContent, bool withResourcesData, @@ -4918,6 +5030,8 @@ AsyncResult* NoteStore::getNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteApplicationData_prepareParams( QString authenticationToken, Guid guid) @@ -5037,6 +5151,8 @@ QVariant NoteStore_getNoteApplicationData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteApplicationData_readReply(reply)); } +} // namespace + LazyMap NoteStore::getNoteApplicationData( Guid guid, IRequestContextPtr ctx) @@ -5051,7 +5167,7 @@ LazyMap NoteStore::getNoteApplicationData( return NoteStore_getNoteApplicationData_readReply(reply); } -AsyncResult* NoteStore::getNoteApplicationDataAsync( +AsyncResult * NoteStore::getNoteApplicationDataAsync( Guid guid, IRequestContextPtr ctx) { @@ -5066,6 +5182,8 @@ AsyncResult* NoteStore::getNoteApplicationDataAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -5192,6 +5310,8 @@ QVariant NoteStore_getNoteApplicationDataEntry_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteApplicationDataEntry_readReply(reply)); } +} // namespace + QString NoteStore::getNoteApplicationDataEntry( Guid guid, QString key, @@ -5208,7 +5328,7 @@ QString NoteStore::getNoteApplicationDataEntry( return NoteStore_getNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::getNoteApplicationDataEntryAsync( +AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( Guid guid, QString key, IRequestContextPtr ctx) @@ -5225,6 +5345,8 @@ AsyncResult* NoteStore::getNoteApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -5358,6 +5480,8 @@ QVariant NoteStore_setNoteApplicationDataEntry_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_setNoteApplicationDataEntry_readReply(reply)); } +} // namespace + qint32 NoteStore::setNoteApplicationDataEntry( Guid guid, QString key, @@ -5376,7 +5500,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( return NoteStore_setNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::setNoteApplicationDataEntryAsync( +AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( Guid guid, QString key, QString value, @@ -5395,6 +5519,8 @@ AsyncResult* NoteStore::setNoteApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -5521,6 +5647,8 @@ QVariant NoteStore_unsetNoteApplicationDataEntry_readReplyAsync(QByteArray reply return QVariant::fromValue(NoteStore_unsetNoteApplicationDataEntry_readReply(reply)); } +} // namespace + qint32 NoteStore::unsetNoteApplicationDataEntry( Guid guid, QString key, @@ -5537,7 +5665,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( return NoteStore_unsetNoteApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::unsetNoteApplicationDataEntryAsync( +AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( Guid guid, QString key, IRequestContextPtr ctx) @@ -5554,6 +5682,8 @@ AsyncResult* NoteStore::unsetNoteApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteContent_prepareParams( QString authenticationToken, Guid guid) @@ -5673,6 +5803,8 @@ QVariant NoteStore_getNoteContent_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteContent_readReply(reply)); } +} // namespace + QString NoteStore::getNoteContent( Guid guid, IRequestContextPtr ctx) @@ -5687,7 +5819,7 @@ QString NoteStore::getNoteContent( return NoteStore_getNoteContent_readReply(reply); } -AsyncResult* NoteStore::getNoteContentAsync( +AsyncResult * NoteStore::getNoteContentAsync( Guid guid, IRequestContextPtr ctx) { @@ -5702,6 +5834,8 @@ AsyncResult* NoteStore::getNoteContentAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteSearchText_prepareParams( QString authenticationToken, Guid guid, @@ -5835,6 +5969,8 @@ QVariant NoteStore_getNoteSearchText_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteSearchText_readReply(reply)); } +} // namespace + QString NoteStore::getNoteSearchText( Guid guid, bool noteOnly, @@ -5853,7 +5989,7 @@ QString NoteStore::getNoteSearchText( return NoteStore_getNoteSearchText_readReply(reply); } -AsyncResult* NoteStore::getNoteSearchTextAsync( +AsyncResult * NoteStore::getNoteSearchTextAsync( Guid guid, bool noteOnly, bool tokenizeForIndexing, @@ -5872,6 +6008,8 @@ AsyncResult* NoteStore::getNoteSearchTextAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceSearchText_prepareParams( QString authenticationToken, Guid guid) @@ -5991,6 +6129,8 @@ QVariant NoteStore_getResourceSearchText_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceSearchText_readReply(reply)); } +} // namespace + QString NoteStore::getResourceSearchText( Guid guid, IRequestContextPtr ctx) @@ -6005,7 +6145,7 @@ QString NoteStore::getResourceSearchText( return NoteStore_getResourceSearchText_readReply(reply); } -AsyncResult* NoteStore::getResourceSearchTextAsync( +AsyncResult * NoteStore::getResourceSearchTextAsync( Guid guid, IRequestContextPtr ctx) { @@ -6020,6 +6160,8 @@ AsyncResult* NoteStore::getResourceSearchTextAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteTagNames_prepareParams( QString authenticationToken, Guid guid) @@ -6149,6 +6291,8 @@ QVariant NoteStore_getNoteTagNames_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteTagNames_readReply(reply)); } +} // namespace + QStringList NoteStore::getNoteTagNames( Guid guid, IRequestContextPtr ctx) @@ -6163,7 +6307,7 @@ QStringList NoteStore::getNoteTagNames( return NoteStore_getNoteTagNames_readReply(reply); } -AsyncResult* NoteStore::getNoteTagNamesAsync( +AsyncResult * NoteStore::getNoteTagNamesAsync( Guid guid, IRequestContextPtr ctx) { @@ -6178,6 +6322,8 @@ AsyncResult* NoteStore::getNoteTagNamesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createNote_prepareParams( QString authenticationToken, const Note & note) @@ -6297,6 +6443,8 @@ QVariant NoteStore_createNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createNote_readReply(reply)); } +} // namespace + Note NoteStore::createNote( const Note & note, IRequestContextPtr ctx) @@ -6311,7 +6459,7 @@ Note NoteStore::createNote( return NoteStore_createNote_readReply(reply); } -AsyncResult* NoteStore::createNoteAsync( +AsyncResult * NoteStore::createNoteAsync( const Note & note, IRequestContextPtr ctx) { @@ -6326,6 +6474,8 @@ AsyncResult* NoteStore::createNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateNote_prepareParams( QString authenticationToken, const Note & note) @@ -6445,6 +6595,8 @@ QVariant NoteStore_updateNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNote_readReply(reply)); } +} // namespace + Note NoteStore::updateNote( const Note & note, IRequestContextPtr ctx) @@ -6459,7 +6611,7 @@ Note NoteStore::updateNote( return NoteStore_updateNote_readReply(reply); } -AsyncResult* NoteStore::updateNoteAsync( +AsyncResult * NoteStore::updateNoteAsync( const Note & note, IRequestContextPtr ctx) { @@ -6474,6 +6626,8 @@ AsyncResult* NoteStore::updateNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_deleteNote_prepareParams( QString authenticationToken, Guid guid) @@ -6593,6 +6747,8 @@ QVariant NoteStore_deleteNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_deleteNote_readReply(reply)); } +} // namespace + qint32 NoteStore::deleteNote( Guid guid, IRequestContextPtr ctx) @@ -6607,7 +6763,7 @@ qint32 NoteStore::deleteNote( return NoteStore_deleteNote_readReply(reply); } -AsyncResult* NoteStore::deleteNoteAsync( +AsyncResult * NoteStore::deleteNoteAsync( Guid guid, IRequestContextPtr ctx) { @@ -6622,6 +6778,8 @@ AsyncResult* NoteStore::deleteNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_expungeNote_prepareParams( QString authenticationToken, Guid guid) @@ -6741,6 +6899,8 @@ QVariant NoteStore_expungeNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeNote_readReply(reply)); } +} // namespace + qint32 NoteStore::expungeNote( Guid guid, IRequestContextPtr ctx) @@ -6755,7 +6915,7 @@ qint32 NoteStore::expungeNote( return NoteStore_expungeNote_readReply(reply); } -AsyncResult* NoteStore::expungeNoteAsync( +AsyncResult * NoteStore::expungeNoteAsync( Guid guid, IRequestContextPtr ctx) { @@ -6770,6 +6930,8 @@ AsyncResult* NoteStore::expungeNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_copyNote_prepareParams( QString authenticationToken, Guid noteGuid, @@ -6896,6 +7058,8 @@ QVariant NoteStore_copyNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_copyNote_readReply(reply)); } +} // namespace + Note NoteStore::copyNote( Guid noteGuid, Guid toNotebookGuid, @@ -6912,7 +7076,7 @@ Note NoteStore::copyNote( return NoteStore_copyNote_readReply(reply); } -AsyncResult* NoteStore::copyNoteAsync( +AsyncResult * NoteStore::copyNoteAsync( Guid noteGuid, Guid toNotebookGuid, IRequestContextPtr ctx) @@ -6929,6 +7093,8 @@ AsyncResult* NoteStore::copyNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listNoteVersions_prepareParams( QString authenticationToken, Guid noteGuid) @@ -7058,6 +7224,8 @@ QVariant NoteStore_listNoteVersions_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listNoteVersions_readReply(reply)); } +} // namespace + QList NoteStore::listNoteVersions( Guid noteGuid, IRequestContextPtr ctx) @@ -7072,7 +7240,7 @@ QList NoteStore::listNoteVersions( return NoteStore_listNoteVersions_readReply(reply); } -AsyncResult* NoteStore::listNoteVersionsAsync( +AsyncResult * NoteStore::listNoteVersionsAsync( Guid noteGuid, IRequestContextPtr ctx) { @@ -7087,6 +7255,8 @@ AsyncResult* NoteStore::listNoteVersionsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNoteVersion_prepareParams( QString authenticationToken, Guid noteGuid, @@ -7234,6 +7404,8 @@ QVariant NoteStore_getNoteVersion_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNoteVersion_readReply(reply)); } +} // namespace + Note NoteStore::getNoteVersion( Guid noteGuid, qint32 updateSequenceNum, @@ -7256,7 +7428,7 @@ Note NoteStore::getNoteVersion( return NoteStore_getNoteVersion_readReply(reply); } -AsyncResult* NoteStore::getNoteVersionAsync( +AsyncResult * NoteStore::getNoteVersionAsync( Guid noteGuid, qint32 updateSequenceNum, bool withResourcesData, @@ -7279,6 +7451,8 @@ AsyncResult* NoteStore::getNoteVersionAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResource_prepareParams( QString authenticationToken, Guid guid, @@ -7426,6 +7600,8 @@ QVariant NoteStore_getResource_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResource_readReply(reply)); } +} // namespace + Resource NoteStore::getResource( Guid guid, bool withData, @@ -7448,7 +7624,7 @@ Resource NoteStore::getResource( return NoteStore_getResource_readReply(reply); } -AsyncResult* NoteStore::getResourceAsync( +AsyncResult * NoteStore::getResourceAsync( Guid guid, bool withData, bool withRecognition, @@ -7471,6 +7647,8 @@ AsyncResult* NoteStore::getResourceAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceApplicationData_prepareParams( QString authenticationToken, Guid guid) @@ -7590,6 +7768,8 @@ QVariant NoteStore_getResourceApplicationData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceApplicationData_readReply(reply)); } +} // namespace + LazyMap NoteStore::getResourceApplicationData( Guid guid, IRequestContextPtr ctx) @@ -7604,7 +7784,7 @@ LazyMap NoteStore::getResourceApplicationData( return NoteStore_getResourceApplicationData_readReply(reply); } -AsyncResult* NoteStore::getResourceApplicationDataAsync( +AsyncResult * NoteStore::getResourceApplicationDataAsync( Guid guid, IRequestContextPtr ctx) { @@ -7619,6 +7799,8 @@ AsyncResult* NoteStore::getResourceApplicationDataAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -7745,6 +7927,8 @@ QVariant NoteStore_getResourceApplicationDataEntry_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_getResourceApplicationDataEntry_readReply(reply)); } +} // namespace + QString NoteStore::getResourceApplicationDataEntry( Guid guid, QString key, @@ -7761,7 +7945,7 @@ QString NoteStore::getResourceApplicationDataEntry( return NoteStore_getResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::getResourceApplicationDataEntryAsync( +AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( Guid guid, QString key, IRequestContextPtr ctx) @@ -7778,6 +7962,8 @@ AsyncResult* NoteStore::getResourceApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -7911,6 +8097,8 @@ QVariant NoteStore_setResourceApplicationDataEntry_readReplyAsync(QByteArray rep return QVariant::fromValue(NoteStore_setResourceApplicationDataEntry_readReply(reply)); } +} // namespace + qint32 NoteStore::setResourceApplicationDataEntry( Guid guid, QString key, @@ -7929,7 +8117,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( return NoteStore_setResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::setResourceApplicationDataEntryAsync( +AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( Guid guid, QString key, QString value, @@ -7948,6 +8136,8 @@ AsyncResult* NoteStore::setResourceApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( QString authenticationToken, Guid guid, @@ -8074,6 +8264,8 @@ QVariant NoteStore_unsetResourceApplicationDataEntry_readReplyAsync(QByteArray r return QVariant::fromValue(NoteStore_unsetResourceApplicationDataEntry_readReply(reply)); } +} // namespace + qint32 NoteStore::unsetResourceApplicationDataEntry( Guid guid, QString key, @@ -8090,7 +8282,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( return NoteStore_unsetResourceApplicationDataEntry_readReply(reply); } -AsyncResult* NoteStore::unsetResourceApplicationDataEntryAsync( +AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( Guid guid, QString key, IRequestContextPtr ctx) @@ -8107,6 +8299,8 @@ AsyncResult* NoteStore::unsetResourceApplicationDataEntryAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateResource_prepareParams( QString authenticationToken, const Resource & resource) @@ -8226,6 +8420,8 @@ QVariant NoteStore_updateResource_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateResource_readReply(reply)); } +} // namespace + qint32 NoteStore::updateResource( const Resource & resource, IRequestContextPtr ctx) @@ -8240,7 +8436,7 @@ qint32 NoteStore::updateResource( return NoteStore_updateResource_readReply(reply); } -AsyncResult* NoteStore::updateResourceAsync( +AsyncResult * NoteStore::updateResourceAsync( const Resource & resource, IRequestContextPtr ctx) { @@ -8255,6 +8451,8 @@ AsyncResult* NoteStore::updateResourceAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceData_prepareParams( QString authenticationToken, Guid guid) @@ -8374,6 +8572,8 @@ QVariant NoteStore_getResourceData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceData_readReply(reply)); } +} // namespace + QByteArray NoteStore::getResourceData( Guid guid, IRequestContextPtr ctx) @@ -8388,7 +8588,7 @@ QByteArray NoteStore::getResourceData( return NoteStore_getResourceData_readReply(reply); } -AsyncResult* NoteStore::getResourceDataAsync( +AsyncResult * NoteStore::getResourceDataAsync( Guid guid, IRequestContextPtr ctx) { @@ -8403,6 +8603,8 @@ AsyncResult* NoteStore::getResourceDataAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceByHash_prepareParams( QString authenticationToken, Guid noteGuid, @@ -8550,6 +8752,8 @@ QVariant NoteStore_getResourceByHash_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceByHash_readReply(reply)); } +} // namespace + Resource NoteStore::getResourceByHash( Guid noteGuid, QByteArray contentHash, @@ -8572,7 +8776,7 @@ Resource NoteStore::getResourceByHash( return NoteStore_getResourceByHash_readReply(reply); } -AsyncResult* NoteStore::getResourceByHashAsync( +AsyncResult * NoteStore::getResourceByHashAsync( Guid noteGuid, QByteArray contentHash, bool withData, @@ -8595,6 +8799,8 @@ AsyncResult* NoteStore::getResourceByHashAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceRecognition_prepareParams( QString authenticationToken, Guid guid) @@ -8714,6 +8920,8 @@ QVariant NoteStore_getResourceRecognition_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceRecognition_readReply(reply)); } +} // namespace + QByteArray NoteStore::getResourceRecognition( Guid guid, IRequestContextPtr ctx) @@ -8728,7 +8936,7 @@ QByteArray NoteStore::getResourceRecognition( return NoteStore_getResourceRecognition_readReply(reply); } -AsyncResult* NoteStore::getResourceRecognitionAsync( +AsyncResult * NoteStore::getResourceRecognitionAsync( Guid guid, IRequestContextPtr ctx) { @@ -8743,6 +8951,8 @@ AsyncResult* NoteStore::getResourceRecognitionAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceAlternateData_prepareParams( QString authenticationToken, Guid guid) @@ -8862,6 +9072,8 @@ QVariant NoteStore_getResourceAlternateData_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceAlternateData_readReply(reply)); } +} // namespace + QByteArray NoteStore::getResourceAlternateData( Guid guid, IRequestContextPtr ctx) @@ -8876,7 +9088,7 @@ QByteArray NoteStore::getResourceAlternateData( return NoteStore_getResourceAlternateData_readReply(reply); } -AsyncResult* NoteStore::getResourceAlternateDataAsync( +AsyncResult * NoteStore::getResourceAlternateDataAsync( Guid guid, IRequestContextPtr ctx) { @@ -8891,6 +9103,8 @@ AsyncResult* NoteStore::getResourceAlternateDataAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getResourceAttributes_prepareParams( QString authenticationToken, Guid guid) @@ -9010,6 +9224,8 @@ QVariant NoteStore_getResourceAttributes_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getResourceAttributes_readReply(reply)); } +} // namespace + ResourceAttributes NoteStore::getResourceAttributes( Guid guid, IRequestContextPtr ctx) @@ -9024,7 +9240,7 @@ ResourceAttributes NoteStore::getResourceAttributes( return NoteStore_getResourceAttributes_readReply(reply); } -AsyncResult* NoteStore::getResourceAttributesAsync( +AsyncResult * NoteStore::getResourceAttributesAsync( Guid guid, IRequestContextPtr ctx) { @@ -9039,6 +9255,8 @@ AsyncResult* NoteStore::getResourceAttributesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getPublicNotebook_prepareParams( UserID userId, QString publicUri) @@ -9148,6 +9366,8 @@ QVariant NoteStore_getPublicNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getPublicNotebook_readReply(reply)); } +} // namespace + Notebook NoteStore::getPublicNotebook( UserID userId, QString publicUri, @@ -9163,7 +9383,7 @@ Notebook NoteStore::getPublicNotebook( return NoteStore_getPublicNotebook_readReply(reply); } -AsyncResult* NoteStore::getPublicNotebookAsync( +AsyncResult * NoteStore::getPublicNotebookAsync( UserID userId, QString publicUri, IRequestContextPtr ctx) @@ -9179,6 +9399,8 @@ AsyncResult* NoteStore::getPublicNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_shareNotebook_prepareParams( QString authenticationToken, const SharedNotebook & sharedNotebook, @@ -9305,6 +9527,8 @@ QVariant NoteStore_shareNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_shareNotebook_readReply(reply)); } +} // namespace + SharedNotebook NoteStore::shareNotebook( const SharedNotebook & sharedNotebook, QString message, @@ -9321,7 +9545,7 @@ SharedNotebook NoteStore::shareNotebook( return NoteStore_shareNotebook_readReply(reply); } -AsyncResult* NoteStore::shareNotebookAsync( +AsyncResult * NoteStore::shareNotebookAsync( const SharedNotebook & sharedNotebook, QString message, IRequestContextPtr ctx) @@ -9338,6 +9562,8 @@ AsyncResult* NoteStore::shareNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( QString authenticationToken, const NotebookShareTemplate & shareTemplate) @@ -9467,6 +9693,8 @@ QVariant NoteStore_createOrUpdateNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createOrUpdateNotebookShares_readReply(reply)); } +} // namespace + CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( const NotebookShareTemplate & shareTemplate, IRequestContextPtr ctx) @@ -9481,7 +9709,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( return NoteStore_createOrUpdateNotebookShares_readReply(reply); } -AsyncResult* NoteStore::createOrUpdateNotebookSharesAsync( +AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( const NotebookShareTemplate & shareTemplate, IRequestContextPtr ctx) { @@ -9496,6 +9724,8 @@ AsyncResult* NoteStore::createOrUpdateNotebookSharesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateSharedNotebook_prepareParams( QString authenticationToken, const SharedNotebook & sharedNotebook) @@ -9615,6 +9845,8 @@ QVariant NoteStore_updateSharedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateSharedNotebook_readReply(reply)); } +} // namespace + qint32 NoteStore::updateSharedNotebook( const SharedNotebook & sharedNotebook, IRequestContextPtr ctx) @@ -9629,7 +9861,7 @@ qint32 NoteStore::updateSharedNotebook( return NoteStore_updateSharedNotebook_readReply(reply); } -AsyncResult* NoteStore::updateSharedNotebookAsync( +AsyncResult * NoteStore::updateSharedNotebookAsync( const SharedNotebook & sharedNotebook, IRequestContextPtr ctx) { @@ -9644,6 +9876,8 @@ AsyncResult* NoteStore::updateSharedNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( QString authenticationToken, QString notebookGuid, @@ -9770,6 +10004,8 @@ QVariant NoteStore_setNotebookRecipientSettings_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_setNotebookRecipientSettings_readReply(reply)); } +} // namespace + Notebook NoteStore::setNotebookRecipientSettings( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, @@ -9786,7 +10022,7 @@ Notebook NoteStore::setNotebookRecipientSettings( return NoteStore_setNotebookRecipientSettings_readReply(reply); } -AsyncResult* NoteStore::setNotebookRecipientSettingsAsync( +AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, IRequestContextPtr ctx) @@ -9803,6 +10039,8 @@ AsyncResult* NoteStore::setNotebookRecipientSettingsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listSharedNotebooks_prepareParams( QString authenticationToken) { @@ -9925,6 +10163,8 @@ QVariant NoteStore_listSharedNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listSharedNotebooks_readReply(reply)); } +} // namespace + QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { @@ -9937,7 +10177,7 @@ QList NoteStore::listSharedNotebooks( return NoteStore_listSharedNotebooks_readReply(reply); } -AsyncResult* NoteStore::listSharedNotebooksAsync( +AsyncResult * NoteStore::listSharedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -9950,6 +10190,8 @@ AsyncResult* NoteStore::listSharedNotebooksAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_createLinkedNotebook_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) @@ -10069,6 +10311,8 @@ QVariant NoteStore_createLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_createLinkedNotebook_readReply(reply)); } +} // namespace + LinkedNotebook NoteStore::createLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) @@ -10083,7 +10327,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( return NoteStore_createLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::createLinkedNotebookAsync( +AsyncResult * NoteStore::createLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { @@ -10098,6 +10342,8 @@ AsyncResult* NoteStore::createLinkedNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateLinkedNotebook_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) @@ -10217,6 +10463,8 @@ QVariant NoteStore_updateLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateLinkedNotebook_readReply(reply)); } +} // namespace + qint32 NoteStore::updateLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) @@ -10231,7 +10479,7 @@ qint32 NoteStore::updateLinkedNotebook( return NoteStore_updateLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::updateLinkedNotebookAsync( +AsyncResult * NoteStore::updateLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { @@ -10246,6 +10494,8 @@ AsyncResult* NoteStore::updateLinkedNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_listLinkedNotebooks_prepareParams( QString authenticationToken) { @@ -10368,6 +10618,8 @@ QVariant NoteStore_listLinkedNotebooks_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_listLinkedNotebooks_readReply(reply)); } +} // namespace + QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { @@ -10380,7 +10632,7 @@ QList NoteStore::listLinkedNotebooks( return NoteStore_listLinkedNotebooks_readReply(reply); } -AsyncResult* NoteStore::listLinkedNotebooksAsync( +AsyncResult * NoteStore::listLinkedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -10393,6 +10645,8 @@ AsyncResult* NoteStore::listLinkedNotebooksAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_expungeLinkedNotebook_prepareParams( QString authenticationToken, Guid guid) @@ -10512,6 +10766,8 @@ QVariant NoteStore_expungeLinkedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_expungeLinkedNotebook_readReply(reply)); } +} // namespace + qint32 NoteStore::expungeLinkedNotebook( Guid guid, IRequestContextPtr ctx) @@ -10526,7 +10782,7 @@ qint32 NoteStore::expungeLinkedNotebook( return NoteStore_expungeLinkedNotebook_readReply(reply); } -AsyncResult* NoteStore::expungeLinkedNotebookAsync( +AsyncResult * NoteStore::expungeLinkedNotebookAsync( Guid guid, IRequestContextPtr ctx) { @@ -10541,6 +10797,8 @@ AsyncResult* NoteStore::expungeLinkedNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( QString shareKeyOrGlobalId, QString authenticationToken) @@ -10660,6 +10918,8 @@ QVariant NoteStore_authenticateToSharedNotebook_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_authenticateToSharedNotebook_readReply(reply)); } +} // namespace + AuthenticationResult NoteStore::authenticateToSharedNotebook( QString shareKeyOrGlobalId, IRequestContextPtr ctx) @@ -10674,7 +10934,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( return NoteStore_authenticateToSharedNotebook_readReply(reply); } -AsyncResult* NoteStore::authenticateToSharedNotebookAsync( +AsyncResult * NoteStore::authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, IRequestContextPtr ctx) { @@ -10689,6 +10949,8 @@ AsyncResult* NoteStore::authenticateToSharedNotebookAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( QString authenticationToken) { @@ -10801,6 +11063,8 @@ QVariant NoteStore_getSharedNotebookByAuth_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getSharedNotebookByAuth_readReply(reply)); } +} // namespace + SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { @@ -10813,7 +11077,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( return NoteStore_getSharedNotebookByAuth_readReply(reply); } -AsyncResult* NoteStore::getSharedNotebookByAuthAsync( +AsyncResult * NoteStore::getSharedNotebookByAuthAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -10826,6 +11090,8 @@ AsyncResult* NoteStore::getSharedNotebookByAuthAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_emailNote_prepareParams( QString authenticationToken, const NoteEmailParameters & parameters) @@ -10928,6 +11194,8 @@ QVariant NoteStore_emailNote_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void NoteStore::emailNote( const NoteEmailParameters & parameters, IRequestContextPtr ctx) @@ -10942,7 +11210,7 @@ void NoteStore::emailNote( NoteStore_emailNote_readReply(reply); } -AsyncResult* NoteStore::emailNoteAsync( +AsyncResult * NoteStore::emailNoteAsync( const NoteEmailParameters & parameters, IRequestContextPtr ctx) { @@ -10957,6 +11225,8 @@ AsyncResult* NoteStore::emailNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_shareNote_prepareParams( QString authenticationToken, Guid guid) @@ -11076,6 +11346,8 @@ QVariant NoteStore_shareNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_shareNote_readReply(reply)); } +} // namespace + QString NoteStore::shareNote( Guid guid, IRequestContextPtr ctx) @@ -11090,7 +11362,7 @@ QString NoteStore::shareNote( return NoteStore_shareNote_readReply(reply); } -AsyncResult* NoteStore::shareNoteAsync( +AsyncResult * NoteStore::shareNoteAsync( Guid guid, IRequestContextPtr ctx) { @@ -11105,6 +11377,8 @@ AsyncResult* NoteStore::shareNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_stopSharingNote_prepareParams( QString authenticationToken, Guid guid) @@ -11207,6 +11481,8 @@ QVariant NoteStore_stopSharingNote_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void NoteStore::stopSharingNote( Guid guid, IRequestContextPtr ctx) @@ -11221,7 +11497,7 @@ void NoteStore::stopSharingNote( NoteStore_stopSharingNote_readReply(reply); } -AsyncResult* NoteStore::stopSharingNoteAsync( +AsyncResult * NoteStore::stopSharingNoteAsync( Guid guid, IRequestContextPtr ctx) { @@ -11236,6 +11512,8 @@ AsyncResult* NoteStore::stopSharingNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_authenticateToSharedNote_prepareParams( QString guid, QString noteKey, @@ -11362,6 +11640,8 @@ QVariant NoteStore_authenticateToSharedNote_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_authenticateToSharedNote_readReply(reply)); } +} // namespace + AuthenticationResult NoteStore::authenticateToSharedNote( QString guid, QString noteKey, @@ -11378,7 +11658,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( return NoteStore_authenticateToSharedNote_readReply(reply); } -AsyncResult* NoteStore::authenticateToSharedNoteAsync( +AsyncResult * NoteStore::authenticateToSharedNoteAsync( QString guid, QString noteKey, IRequestContextPtr ctx) @@ -11395,6 +11675,8 @@ AsyncResult* NoteStore::authenticateToSharedNoteAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_findRelated_prepareParams( QString authenticationToken, const RelatedQuery & query, @@ -11521,6 +11803,8 @@ QVariant NoteStore_findRelated_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_findRelated_readReply(reply)); } +} // namespace + RelatedResult NoteStore::findRelated( const RelatedQuery & query, const RelatedResultSpec & resultSpec, @@ -11537,7 +11821,7 @@ RelatedResult NoteStore::findRelated( return NoteStore_findRelated_readReply(reply); } -AsyncResult* NoteStore::findRelatedAsync( +AsyncResult * NoteStore::findRelatedAsync( const RelatedQuery & query, const RelatedResultSpec & resultSpec, IRequestContextPtr ctx) @@ -11554,6 +11838,8 @@ AsyncResult* NoteStore::findRelatedAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( QString authenticationToken, const Note & note) @@ -11673,6 +11959,8 @@ QVariant NoteStore_updateNoteIfUsnMatches_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_updateNoteIfUsnMatches_readReply(reply)); } +} // namespace + UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( const Note & note, IRequestContextPtr ctx) @@ -11687,7 +11975,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( return NoteStore_updateNoteIfUsnMatches_readReply(reply); } -AsyncResult* NoteStore::updateNoteIfUsnMatchesAsync( +AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( const Note & note, IRequestContextPtr ctx) { @@ -11702,6 +11990,8 @@ AsyncResult* NoteStore::updateNoteIfUsnMatchesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_manageNotebookShares_prepareParams( QString authenticationToken, const ManageNotebookSharesParameters & parameters) @@ -11821,6 +12111,8 @@ QVariant NoteStore_manageNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_manageNotebookShares_readReply(reply)); } +} // namespace + ManageNotebookSharesResult NoteStore::manageNotebookShares( const ManageNotebookSharesParameters & parameters, IRequestContextPtr ctx) @@ -11835,7 +12127,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( return NoteStore_manageNotebookShares_readReply(reply); } -AsyncResult* NoteStore::manageNotebookSharesAsync( +AsyncResult * NoteStore::manageNotebookSharesAsync( const ManageNotebookSharesParameters & parameters, IRequestContextPtr ctx) { @@ -11850,6 +12142,8 @@ AsyncResult* NoteStore::manageNotebookSharesAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray NoteStore_getNotebookShares_prepareParams( QString authenticationToken, QString notebookGuid) @@ -11969,6 +12263,8 @@ QVariant NoteStore_getNotebookShares_readReplyAsync(QByteArray reply) return QVariant::fromValue(NoteStore_getNotebookShares_readReply(reply)); } +} // namespace + ShareRelationships NoteStore::getNotebookShares( QString notebookGuid, IRequestContextPtr ctx) @@ -11983,7 +12279,7 @@ ShareRelationships NoteStore::getNotebookShares( return NoteStore_getNotebookShares_readReply(reply); } -AsyncResult* NoteStore::getNotebookSharesAsync( +AsyncResult * NoteStore::getNotebookSharesAsync( QString notebookGuid, IRequestContextPtr ctx) { @@ -12160,6 +12456,8 @@ class Q_DECL_HIDDEN UserStore: public IUserStore //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_checkVersion_prepareParams( QString clientName, qint16 edamVersionMajor, @@ -12256,6 +12554,8 @@ QVariant UserStore_checkVersion_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_checkVersion_readReply(reply)); } +} // namespace + bool UserStore::checkVersion( QString clientName, qint16 edamVersionMajor, @@ -12273,7 +12573,7 @@ bool UserStore::checkVersion( return UserStore_checkVersion_readReply(reply); } -AsyncResult* UserStore::checkVersionAsync( +AsyncResult * UserStore::checkVersionAsync( QString clientName, qint16 edamVersionMajor, qint16 edamVersionMinor, @@ -12291,6 +12591,8 @@ AsyncResult* UserStore::checkVersionAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_getBootstrapInfo_prepareParams( QString locale) { @@ -12373,6 +12675,8 @@ QVariant UserStore_getBootstrapInfo_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getBootstrapInfo_readReply(reply)); } +} // namespace + BootstrapInfo UserStore::getBootstrapInfo( QString locale, IRequestContextPtr ctx) @@ -12386,7 +12690,7 @@ BootstrapInfo UserStore::getBootstrapInfo( return UserStore_getBootstrapInfo_readReply(reply); } -AsyncResult* UserStore::getBootstrapInfoAsync( +AsyncResult * UserStore::getBootstrapInfoAsync( QString locale, IRequestContextPtr ctx) { @@ -12400,6 +12704,8 @@ AsyncResult* UserStore::getBootstrapInfoAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_authenticateLongSession_prepareParams( QString username, QString password, @@ -12544,6 +12850,8 @@ QVariant UserStore_authenticateLongSession_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_authenticateLongSession_readReply(reply)); } +} // namespace + AuthenticationResult UserStore::authenticateLongSession( QString username, QString password, @@ -12569,7 +12877,7 @@ AuthenticationResult UserStore::authenticateLongSession( return UserStore_authenticateLongSession_readReply(reply); } -AsyncResult* UserStore::authenticateLongSessionAsync( +AsyncResult * UserStore::authenticateLongSessionAsync( QString username, QString password, QString consumerKey, @@ -12595,6 +12903,8 @@ AsyncResult* UserStore::authenticateLongSessionAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( QString authenticationToken, QString oneTimeCode, @@ -12718,6 +13028,8 @@ QVariant UserStore_completeTwoFactorAuthentication_readReplyAsync(QByteArray rep return QVariant::fromValue(UserStore_completeTwoFactorAuthentication_readReply(reply)); } +} // namespace + AuthenticationResult UserStore::completeTwoFactorAuthentication( QString oneTimeCode, QString deviceIdentifier, @@ -12736,7 +13048,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( return UserStore_completeTwoFactorAuthentication_readReply(reply); } -AsyncResult* UserStore::completeTwoFactorAuthenticationAsync( +AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, @@ -12755,6 +13067,8 @@ AsyncResult* UserStore::completeTwoFactorAuthenticationAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_revokeLongSession_prepareParams( QString authenticationToken) { @@ -12840,6 +13154,8 @@ QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void UserStore::revokeLongSession( IRequestContextPtr ctx) { @@ -12852,7 +13168,7 @@ void UserStore::revokeLongSession( UserStore_revokeLongSession_readReply(reply); } -AsyncResult* UserStore::revokeLongSessionAsync( +AsyncResult * UserStore::revokeLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -12865,6 +13181,8 @@ AsyncResult* UserStore::revokeLongSessionAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_authenticateToBusiness_prepareParams( QString authenticationToken) { @@ -12967,6 +13285,8 @@ QVariant UserStore_authenticateToBusiness_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_authenticateToBusiness_readReply(reply)); } +} // namespace + AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { @@ -12979,7 +13299,7 @@ AuthenticationResult UserStore::authenticateToBusiness( return UserStore_authenticateToBusiness_readReply(reply); } -AsyncResult* UserStore::authenticateToBusinessAsync( +AsyncResult * UserStore::authenticateToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -12992,6 +13312,8 @@ AsyncResult* UserStore::authenticateToBusinessAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_getUser_prepareParams( QString authenticationToken) { @@ -13094,6 +13416,8 @@ QVariant UserStore_getUser_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getUser_readReply(reply)); } +} // namespace + User UserStore::getUser( IRequestContextPtr ctx) { @@ -13106,7 +13430,7 @@ User UserStore::getUser( return UserStore_getUser_readReply(reply); } -AsyncResult* UserStore::getUserAsync( +AsyncResult * UserStore::getUserAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -13119,6 +13443,8 @@ AsyncResult* UserStore::getUserAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_getPublicUserInfo_prepareParams( QString username) { @@ -13231,6 +13557,8 @@ QVariant UserStore_getPublicUserInfo_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getPublicUserInfo_readReply(reply)); } +} // namespace + PublicUserInfo UserStore::getPublicUserInfo( QString username, IRequestContextPtr ctx) @@ -13244,7 +13572,7 @@ PublicUserInfo UserStore::getPublicUserInfo( return UserStore_getPublicUserInfo_readReply(reply); } -AsyncResult* UserStore::getPublicUserInfoAsync( +AsyncResult * UserStore::getPublicUserInfoAsync( QString username, IRequestContextPtr ctx) { @@ -13258,6 +13586,8 @@ AsyncResult* UserStore::getPublicUserInfoAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_getUserUrls_prepareParams( QString authenticationToken) { @@ -13360,6 +13690,8 @@ QVariant UserStore_getUserUrls_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getUserUrls_readReply(reply)); } +} // namespace + UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { @@ -13372,7 +13704,7 @@ UserUrls UserStore::getUserUrls( return UserStore_getUserUrls_readReply(reply); } -AsyncResult* UserStore::getUserUrlsAsync( +AsyncResult * UserStore::getUserUrlsAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -13385,6 +13717,8 @@ AsyncResult* UserStore::getUserUrlsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_inviteToBusiness_prepareParams( QString authenticationToken, QString emailAddress) @@ -13477,6 +13811,8 @@ QVariant UserStore_inviteToBusiness_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void UserStore::inviteToBusiness( QString emailAddress, IRequestContextPtr ctx) @@ -13491,7 +13827,7 @@ void UserStore::inviteToBusiness( UserStore_inviteToBusiness_readReply(reply); } -AsyncResult* UserStore::inviteToBusinessAsync( +AsyncResult * UserStore::inviteToBusinessAsync( QString emailAddress, IRequestContextPtr ctx) { @@ -13506,6 +13842,8 @@ AsyncResult* UserStore::inviteToBusinessAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_removeFromBusiness_prepareParams( QString authenticationToken, QString emailAddress) @@ -13608,6 +13946,8 @@ QVariant UserStore_removeFromBusiness_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void UserStore::removeFromBusiness( QString emailAddress, IRequestContextPtr ctx) @@ -13622,7 +13962,7 @@ void UserStore::removeFromBusiness( UserStore_removeFromBusiness_readReply(reply); } -AsyncResult* UserStore::removeFromBusinessAsync( +AsyncResult * UserStore::removeFromBusinessAsync( QString emailAddress, IRequestContextPtr ctx) { @@ -13637,6 +13977,8 @@ AsyncResult* UserStore::removeFromBusinessAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( QString authenticationToken, QString oldEmailAddress, @@ -13746,6 +14088,8 @@ QVariant UserStore_updateBusinessUserIdentifier_readReplyAsync(QByteArray reply) return QVariant(); } +} // namespace + void UserStore::updateBusinessUserIdentifier( QString oldEmailAddress, QString newEmailAddress, @@ -13762,7 +14106,7 @@ void UserStore::updateBusinessUserIdentifier( UserStore_updateBusinessUserIdentifier_readReply(reply); } -AsyncResult* UserStore::updateBusinessUserIdentifierAsync( +AsyncResult * UserStore::updateBusinessUserIdentifierAsync( QString oldEmailAddress, QString newEmailAddress, IRequestContextPtr ctx) @@ -13779,6 +14123,8 @@ AsyncResult* UserStore::updateBusinessUserIdentifierAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_listBusinessUsers_prepareParams( QString authenticationToken) { @@ -13891,6 +14237,8 @@ QVariant UserStore_listBusinessUsers_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_listBusinessUsers_readReply(reply)); } +} // namespace + QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { @@ -13903,7 +14251,7 @@ QList UserStore::listBusinessUsers( return UserStore_listBusinessUsers_readReply(reply); } -AsyncResult* UserStore::listBusinessUsersAsync( +AsyncResult * UserStore::listBusinessUsersAsync( IRequestContextPtr ctx) { if (!ctx) { @@ -13916,6 +14264,8 @@ AsyncResult* UserStore::listBusinessUsersAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_listBusinessInvitations_prepareParams( QString authenticationToken, bool includeRequestedInvitations) @@ -14035,6 +14385,8 @@ QVariant UserStore_listBusinessInvitations_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_listBusinessInvitations_readReply(reply)); } +} // namespace + QList UserStore::listBusinessInvitations( bool includeRequestedInvitations, IRequestContextPtr ctx) @@ -14049,7 +14401,7 @@ QList UserStore::listBusinessInvitations( return UserStore_listBusinessInvitations_readReply(reply); } -AsyncResult* UserStore::listBusinessInvitationsAsync( +AsyncResult * UserStore::listBusinessInvitationsAsync( bool includeRequestedInvitations, IRequestContextPtr ctx) { @@ -14064,6 +14416,8 @@ AsyncResult* UserStore::listBusinessInvitationsAsync( //////////////////////////////////////////////////////////////////////////////// +namespace { + QByteArray UserStore_getAccountLimits_prepareParams( ServiceLevel serviceLevel) { @@ -14156,6 +14510,8 @@ QVariant UserStore_getAccountLimits_readReplyAsync(QByteArray reply) return QVariant::fromValue(UserStore_getAccountLimits_readReply(reply)); } +} // namespace + AccountLimits UserStore::getAccountLimits( ServiceLevel serviceLevel, IRequestContextPtr ctx) @@ -14169,7 +14525,7 @@ AccountLimits UserStore::getAccountLimits( return UserStore_getAccountLimits_readReply(reply); } -AsyncResult* UserStore::getAccountLimitsAsync( +AsyncResult * UserStore::getAccountLimitsAsync( ServiceLevel serviceLevel, IRequestContextPtr ctx) { @@ -14183,6 +14539,6907 @@ AsyncResult* UserStore::getAccountLimitsAsync( //////////////////////////////////////////////////////////////////////////////// +class Q_DECL_HIDDEN DurableNoteStore: public INoteStore +{ + Q_OBJECT + Q_DISABLE_COPY(DurableNoteStore) +public: + explicit DurableNoteStore( + INoteStorePtr service, + IRequestContextPtr ctx = {}, + QObject * parent = nullptr) : + INoteStore(parent), + m_service(std::move(service)), + m_ctx(std::move(ctx)) + { + if (!m_ctx) { + m_ctx = newRequestContext(); + } + } + + virtual SyncState getSyncState( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSyncStateAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncChunk getFilteredSyncChunk( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getFilteredSyncChunkAsync( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncState getLinkedNotebookSyncState( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getLinkedNotebookSyncStateAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SyncChunk getLinkedNotebookSyncChunk( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getLinkedNotebookSyncChunkAsync( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listAccessibleBusinessNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listAccessibleBusinessNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getDefaultNotebook( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getDefaultNotebookAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook createNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateNotebook( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listTags( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listTagsAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listTagsByNotebook( + Guid notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listTagsByNotebookAsync( + Guid notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Tag getTag( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getTagAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Tag createTag( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateTag( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateTagAsync( + const Tag & tag, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void untagAll( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * untagAllAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeTag( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeTagAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listSearches( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listSearchesAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SavedSearch getSearch( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSearchAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SavedSearch createSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateSearch( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeSearch( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeSearchAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 findNoteOffset( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNoteOffsetAsync( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual NotesMetadataList findNotesMetadata( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNotesMetadataAsync( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual NoteCollectionCounts findNoteCounts( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findNoteCountsAsync( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNoteWithResultSpec( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteWithResultSpecAsync( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNote( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteAsync( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LazyMap getNoteApplicationData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 setNoteApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 unsetNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * unsetNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteContent( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteContentAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getNoteSearchText( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteSearchTextAsync( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getResourceSearchText( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceSearchTextAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QStringList getNoteTagNames( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteTagNamesAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note createNote( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note updateNote( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNoteAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 deleteNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * deleteNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note copyNote( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * copyNoteAsync( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listNoteVersions( + Guid noteGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listNoteVersionsAsync( + Guid noteGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Note getNoteVersion( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNoteVersionAsync( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Resource getResource( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAsync( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LazyMap getResourceApplicationData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString getResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 setResourceApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 unsetResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * unsetResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateResource( + const Resource & resource, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateResourceAsync( + const Resource & resource, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Resource getResourceByHash( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceByHashAsync( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceRecognition( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceRecognitionAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QByteArray getResourceAlternateData( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAlternateDataAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ResourceAttributes getResourceAttributes( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getResourceAttributesAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook getPublicNotebook( + UserID userId, + QString publicUri, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getPublicNotebookAsync( + UserID userId, + QString publicUri, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SharedNotebook shareNotebook( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * shareNotebookAsync( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateSharedNotebook( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateSharedNotebookAsync( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual Notebook setNotebookRecipientSettings( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * setNotebookRecipientSettingsAsync( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listSharedNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listSharedNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual LinkedNotebook createLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * createLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 updateLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listLinkedNotebooks( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listLinkedNotebooksAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual qint32 expungeLinkedNotebook( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * expungeLinkedNotebookAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToSharedNotebook( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToSharedNotebookAsync( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual SharedNotebook getSharedNotebookByAuth( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getSharedNotebookByAuthAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void emailNote( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * emailNoteAsync( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QString shareNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * shareNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void stopSharingNote( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * stopSharingNoteAsync( + Guid guid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToSharedNote( + QString guid, + QString noteKey, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToSharedNoteAsync( + QString guid, + QString noteKey, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual RelatedResult findRelated( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * findRelatedAsync( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateNoteIfUsnMatchesAsync( + const Note & note, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ManageNotebookSharesResult manageNotebookShares( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * manageNotebookSharesAsync( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual ShareRelationships getNotebookShares( + QString notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getNotebookSharesAsync( + QString notebookGuid, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + +private: + INoteStorePtr m_service; + IRequestContextPtr m_ctx; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN DurableUserStore: public IUserStore +{ + Q_OBJECT + Q_DISABLE_COPY(DurableUserStore) +public: + explicit DurableUserStore( + IUserStorePtr service, + IRequestContextPtr ctx = {}, + QObject * parent = nullptr) : + IUserStore(parent), + m_service(std::move(service)), + m_ctx(std::move(ctx)) + { + if (!m_ctx) { + m_ctx = newRequestContext(); + } + + } + + virtual bool checkVersion( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * checkVersionAsync( + QString clientName, + qint16 edamVersionMajor = EDAM_VERSION_MAJOR, + qint16 edamVersionMinor = EDAM_VERSION_MINOR, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual BootstrapInfo getBootstrapInfo( + QString locale, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getBootstrapInfoAsync( + QString locale, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateLongSession( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateLongSessionAsync( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult completeTwoFactorAuthentication( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * completeTwoFactorAuthenticationAsync( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void revokeLongSession( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * revokeLongSessionAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AuthenticationResult authenticateToBusiness( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * authenticateToBusinessAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual User getUser( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getUserAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual PublicUserInfo getPublicUserInfo( + QString username, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getPublicUserInfoAsync( + QString username, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual UserUrls getUserUrls( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getUserUrlsAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void inviteToBusiness( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * inviteToBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void removeFromBusiness( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * removeFromBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual void updateBusinessUserIdentifier( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * updateBusinessUserIdentifierAsync( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listBusinessUsers( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listBusinessUsersAsync( + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual QList listBusinessInvitations( + bool includeRequestedInvitations, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * listBusinessInvitationsAsync( + bool includeRequestedInvitations, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AccountLimits getAccountLimits( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + + virtual AsyncResult * getAccountLimitsAsync( + ServiceLevel serviceLevel, + IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + +private: + IUserStorePtr m_service; + IRequestContextPtr m_ctx; +}; + +//////////////////////////////////////////////////////////////////////////////// + +struct RetryState +{ + const quint64 m_started = QDateTime::currentMSecsSinceEpoch(); + quint32 m_retryCount = 0; +}; + +template +struct RequestState +{ + T m_request; + AsyncResult * m_response; + + RequestState(T && request, AsyncResult * response) : + m_request(std::move(request)), + m_response(response) + {} +}; + +quint64 exponentiallyIncreasedTimeoutMsec(quint64 timeout, const quint64 maxTimeout) +{ + timeout = static_cast(std::floor(timeout * 1.6 + 0.5)); + timeout = std::min(timeout, maxTimeout); + return timeout; +} + +//////////////////////////////////////////////////////////////////////////////// + +SyncState DurableNoteStore::getSyncState( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getSyncState( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getSyncStateAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getSyncStateAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SyncChunk DurableNoteStore::getFilteredSyncChunk( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( + qint32 afterUSN, + qint32 maxEntries, + const SyncChunkFilter & filter, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SyncState DurableNoteStore::getLinkedNotebookSyncState( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( + const LinkedNotebook & linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listNotebooks( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listNotebooks( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listNotebooksAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listNotebooksAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listAccessibleBusinessNotebooks( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listAccessibleBusinessNotebooks( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listAccessibleBusinessNotebooksAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Notebook DurableNoteStore::getNotebook( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNotebook( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNotebookAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNotebookAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Notebook DurableNoteStore::getDefaultNotebook( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getDefaultNotebook( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getDefaultNotebookAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getDefaultNotebookAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Notebook DurableNoteStore::createNotebook( + const Notebook & notebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createNotebook( + notebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createNotebookAsync( + notebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateNotebook( + const Notebook & notebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateNotebook( + notebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateNotebookAsync( + const Notebook & notebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateNotebookAsync( + notebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::expungeNotebook( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->expungeNotebook( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::expungeNotebookAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->expungeNotebookAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listTags( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listTags( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listTagsAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listTagsAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listTagsByNotebook( + Guid notebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listTagsByNotebook( + notebookGuid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listTagsByNotebookAsync( + Guid notebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listTagsByNotebookAsync( + notebookGuid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Tag DurableNoteStore::getTag( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getTag( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getTagAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getTagAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Tag DurableNoteStore::createTag( + const Tag & tag, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createTag( + tag, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createTagAsync( + const Tag & tag, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createTagAsync( + tag, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateTag( + const Tag & tag, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateTag( + tag, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateTagAsync( + const Tag & tag, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateTagAsync( + tag, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableNoteStore::untagAll( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->untagAll( + guid, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::untagAllAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->untagAllAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::expungeTag( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->expungeTag( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::expungeTagAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->expungeTagAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listSearches( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listSearches( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listSearchesAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listSearchesAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SavedSearch DurableNoteStore::getSearch( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getSearch( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getSearchAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getSearchAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SavedSearch DurableNoteStore::createSearch( + const SavedSearch & search, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createSearch( + search, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createSearchAsync( + search, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateSearch( + const SavedSearch & search, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateSearch( + search, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateSearchAsync( + const SavedSearch & search, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateSearchAsync( + search, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::expungeSearch( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->expungeSearch( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::expungeSearchAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->expungeSearchAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::findNoteOffset( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->findNoteOffset( + filter, + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::findNoteOffsetAsync( + const NoteFilter & filter, + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->findNoteOffsetAsync( + filter, + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +NotesMetadataList DurableNoteStore::findNotesMetadata( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::findNotesMetadataAsync( + const NoteFilter & filter, + qint32 offset, + qint32 maxNotes, + const NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +NoteCollectionCounts DurableNoteStore::findNoteCounts( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->findNoteCounts( + filter, + withTrash, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::findNoteCountsAsync( + const NoteFilter & filter, + bool withTrash, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->findNoteCountsAsync( + filter, + withTrash, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::getNoteWithResultSpec( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( + Guid guid, + const NoteResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::getNote( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteAsync( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +LazyMap DurableNoteStore::getNoteApplicationData( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteApplicationData( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteApplicationDataAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::getNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteApplicationDataEntry( + guid, + key, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::setNoteApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::unsetNoteApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::getNoteContent( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteContent( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteContentAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteContentAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::getNoteSearchText( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteSearchTextAsync( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::getResourceSearchText( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceSearchText( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceSearchTextAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceSearchTextAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QStringList DurableNoteStore::getNoteTagNames( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteTagNames( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteTagNamesAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteTagNamesAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::createNote( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createNote( + note, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createNoteAsync( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createNoteAsync( + note, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::updateNote( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateNote( + note, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateNoteAsync( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateNoteAsync( + note, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::deleteNote( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->deleteNote( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::deleteNoteAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->deleteNoteAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::expungeNote( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->expungeNote( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::expungeNoteAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->expungeNoteAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::copyNote( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->copyNote( + noteGuid, + toNotebookGuid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::copyNoteAsync( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->copyNoteAsync( + noteGuid, + toNotebookGuid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listNoteVersions( + Guid noteGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listNoteVersions( + noteGuid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listNoteVersionsAsync( + Guid noteGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listNoteVersionsAsync( + noteGuid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Note DurableNoteStore::getNoteVersion( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNoteVersionAsync( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Resource DurableNoteStore::getResource( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceAsync( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +LazyMap DurableNoteStore::getResourceApplicationData( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceApplicationData( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceApplicationDataAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::getResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceApplicationDataEntry( + guid, + key, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceApplicationDataEntryAsync( + guid, + key, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::setResourceApplicationDataEntry( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->setResourceApplicationDataEntryAsync( + guid, + key, + value, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::unsetResourceApplicationDataEntry( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( + Guid guid, + QString key, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->unsetResourceApplicationDataEntryAsync( + guid, + key, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateResource( + const Resource & resource, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateResource( + resource, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateResourceAsync( + const Resource & resource, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateResourceAsync( + resource, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QByteArray DurableNoteStore::getResourceData( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceData( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceDataAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceDataAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Resource DurableNoteStore::getResourceByHash( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceByHashAsync( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QByteArray DurableNoteStore::getResourceRecognition( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceRecognition( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceRecognitionAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceRecognitionAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QByteArray DurableNoteStore::getResourceAlternateData( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceAlternateData( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceAlternateDataAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +ResourceAttributes DurableNoteStore::getResourceAttributes( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getResourceAttributes( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getResourceAttributesAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getResourceAttributesAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Notebook DurableNoteStore::getPublicNotebook( + UserID userId, + QString publicUri, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getPublicNotebook( + userId, + publicUri, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getPublicNotebookAsync( + UserID userId, + QString publicUri, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getPublicNotebookAsync( + userId, + publicUri, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SharedNotebook DurableNoteStore::shareNotebook( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->shareNotebook( + sharedNotebook, + message, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::shareNotebookAsync( + const SharedNotebook & sharedNotebook, + QString message, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->shareNotebookAsync( + sharedNotebook, + message, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShares( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createOrUpdateNotebookShares( + shareTemplate, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( + const NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createOrUpdateNotebookSharesAsync( + shareTemplate, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateSharedNotebook( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateSharedNotebook( + sharedNotebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateSharedNotebookAsync( + const SharedNotebook & sharedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateSharedNotebookAsync( + sharedNotebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +Notebook DurableNoteStore::setNotebookRecipientSettings( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( + QString notebookGuid, + const NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listSharedNotebooks( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listSharedNotebooks( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listSharedNotebooksAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listSharedNotebooksAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +LinkedNotebook DurableNoteStore::createLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->createLinkedNotebook( + linkedNotebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::createLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->createLinkedNotebookAsync( + linkedNotebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::updateLinkedNotebook( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateLinkedNotebook( + linkedNotebook, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( + const LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateLinkedNotebookAsync( + linkedNotebook, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableNoteStore::listLinkedNotebooks( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listLinkedNotebooks( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listLinkedNotebooksAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +qint32 DurableNoteStore::expungeLinkedNotebook( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->expungeLinkedNotebook( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->expungeLinkedNotebookAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +SharedNotebook DurableNoteStore::getSharedNotebookByAuth( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getSharedNotebookByAuth( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getSharedNotebookByAuthAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableNoteStore::emailNote( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->emailNote( + parameters, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::emailNoteAsync( + const NoteEmailParameters & parameters, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->emailNoteAsync( + parameters, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QString DurableNoteStore::shareNote( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->shareNote( + guid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::shareNoteAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->shareNoteAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableNoteStore::stopSharingNote( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->stopSharingNote( + guid, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::stopSharingNoteAsync( + Guid guid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->stopSharingNoteAsync( + guid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AuthenticationResult DurableNoteStore::authenticateToSharedNote( + QString guid, + QString noteKey, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->authenticateToSharedNote( + guid, + noteKey, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( + QString guid, + QString noteKey, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->authenticateToSharedNoteAsync( + guid, + noteKey, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +RelatedResult DurableNoteStore::findRelated( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->findRelated( + query, + resultSpec, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::findRelatedAsync( + const RelatedQuery & query, + const RelatedResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->findRelatedAsync( + query, + resultSpec, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->updateNoteIfUsnMatches( + note, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( + const Note & note, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateNoteIfUsnMatchesAsync( + note, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->manageNotebookShares( + parameters, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::manageNotebookSharesAsync( + const ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->manageNotebookSharesAsync( + parameters, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +ShareRelationships DurableNoteStore::getNotebookShares( + QString notebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getNotebookShares( + notebookGuid, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableNoteStore::getNotebookSharesAsync( + QString notebookGuid, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getNotebookSharesAsync( + notebookGuid, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +//////////////////////////////////////////////////////////////////////////////// + +bool DurableUserStore::checkVersion( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->checkVersion( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::checkVersionAsync( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->checkVersionAsync( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +BootstrapInfo DurableUserStore::getBootstrapInfo( + QString locale, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getBootstrapInfo( + locale, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::getBootstrapInfoAsync( + QString locale, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getBootstrapInfoAsync( + locale, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AuthenticationResult DurableUserStore::authenticateLongSession( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::authenticateLongSessionAsync( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableUserStore::revokeLongSession( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->revokeLongSession( + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::revokeLongSessionAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->revokeLongSessionAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AuthenticationResult DurableUserStore::authenticateToBusiness( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->authenticateToBusiness( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::authenticateToBusinessAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->authenticateToBusinessAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +User DurableUserStore::getUser( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getUser( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::getUserAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getUserAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +PublicUserInfo DurableUserStore::getPublicUserInfo( + QString username, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getPublicUserInfo( + username, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::getPublicUserInfoAsync( + QString username, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getPublicUserInfoAsync( + username, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +UserUrls DurableUserStore::getUserUrls( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getUserUrls( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::getUserUrlsAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getUserUrlsAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableUserStore::inviteToBusiness( + QString emailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->inviteToBusiness( + emailAddress, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::inviteToBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->inviteToBusinessAsync( + emailAddress, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableUserStore::removeFromBusiness( + QString emailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->removeFromBusiness( + emailAddress, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::removeFromBusinessAsync( + QString emailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->removeFromBusinessAsync( + emailAddress, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +void DurableUserStore::updateBusinessUserIdentifier( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + m_service->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableUserStore::listBusinessUsers( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listBusinessUsers( + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::listBusinessUsersAsync( + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listBusinessUsersAsync( + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +QList DurableUserStore::listBusinessInvitations( + bool includeRequestedInvitations, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->listBusinessInvitations( + includeRequestedInvitations, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::listBusinessInvitationsAsync( + bool includeRequestedInvitations, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->listBusinessInvitationsAsync( + includeRequestedInvitations, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +AccountLimits DurableUserStore::getAccountLimits( + ServiceLevel serviceLevel, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + while(state.m_retryCount) + { + try + { + auto res = m_service->getAccountLimits( + serviceLevel, + ctx); + return res; + } + catch(...) + { + --state.m_retryCount; + if (!state.m_retryCount) { + throw; + } + + if (ctx->increaseRequestTimeoutExponentially()) { + quint64 maxRequestTimeout = ctx->maxRequestTimeout(); + quint64 timeout = exponentiallyIncreasedTimeoutMsec( + ctx->requestTimeout(), + maxRequestTimeout); + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxRequestTimeout, + ctx->maxRequestRetryCount()); + } + } + } + + throw EverCloudException("no retry attempts left"); +} + +AsyncResult * DurableUserStore::getAccountLimitsAsync( + ServiceLevel serviceLevel, + IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + AsyncResult * result = new AsyncResult(QString(), QByteArray()); + auto res = m_service->getAccountLimitsAsync( + serviceLevel, + ctx); + QObject::connect(res, &AsyncResult::finished, + [=] (QVariant result, QSharedPointer error) { + Q_UNUSED(result) + Q_UNUSED(error) + // TODO: implement + }); + + return result; +} + +//////////////////////////////////////////////////////////////////////////////// + INoteStore * newNoteStore( QString noteStoreUrl, IRequestContextPtr ctx, From e0d788bcef92228b609983595cc1c01007e672c0 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 5 Oct 2019 19:24:57 +0300 Subject: [PATCH 016/188] Remove private slots from AsyncResult, move them to private class counterpart Also move private class declaration into a separate header + add friend class declaration to AsyncResult in order to prepare to use it as a kind of promise --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/headers/AsyncResult.h | 6 +- QEverCloud/headers/EverCloudException.h | 3 +- QEverCloud/src/AsyncResult.cpp | 112 +------------------- QEverCloud/src/AsyncResult_p.cpp | 129 ++++++++++++++++++++++++ QEverCloud/src/AsyncResult_p.h | 53 ++++++++++ 6 files changed, 192 insertions(+), 113 deletions(-) create mode 100644 QEverCloud/src/AsyncResult_p.cpp create mode 100644 QEverCloud/src/AsyncResult_p.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index bf349c9a..c892ea5e 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -38,6 +38,7 @@ set(GENERATED_HEADERS headers/generated/EDAMErrorCode.h) set(PRIVATE_HEADERS + src/AsyncResult_p.h src/Http.h src/Impl.h src/Thrift.h @@ -45,6 +46,7 @@ set(PRIVATE_HEADERS set(SOURCES src/AsyncResult.cpp + src/AsyncResult_p.cpp src/EventLoopFinisher.cpp src/EverCloudException.cpp src/Exceptions.cpp diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 974fe60e..db0e4eab 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -19,6 +19,7 @@ namespace qevercloud { QT_FORWARD_DECLARE_CLASS(AsyncResultPrivate) +QT_FORWARD_DECLARE_CLASS(DurableService) /** * @brief Returned by asynchonous versions of functions. @@ -87,9 +88,8 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject */ void finished(QVariant result, QSharedPointer error); -private Q_SLOTS: - void onReplyFetched(QObject * rp); - void start(); +private: + friend class DurableService; private: AsyncResultPrivate * const d_ptr; diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index 4463d5d4..d853ac0e 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -23,7 +23,7 @@ namespace qevercloud { class QEVERCLOUD_EXPORT EverCloudExceptionData; /** - * All exceptions throws by the library are of this class or its descendants. + * All exceptions thrown by the library are of this class or its descendants. */ class QEVERCLOUD_EXPORT EverCloudException: public std::exception { @@ -35,6 +35,7 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception explicit EverCloudException(QString error); explicit EverCloudException(const std::string & error); explicit EverCloudException(const char * error); + ~EverCloudException() noexcept; const char * what() const noexcept; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 37fe8622..9721f84f 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -7,6 +7,7 @@ * https://opensource.org/licenses/MIT */ +#include "AsyncResult_p.h" #include "Http.h" #include @@ -19,53 +20,6 @@ namespace qevercloud { -class AsyncResultPrivate -{ -public: - explicit AsyncResultPrivate(QString url, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q); - - explicit AsyncResultPrivate(QNetworkRequest request, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q); - - virtual ~AsyncResultPrivate(); - - QNetworkRequest m_request; - QByteArray m_postData; - AsyncResult::ReadFunctionType m_readFunction; - bool m_autoDelete; - -private: - AsyncResult * const q_ptr; - Q_DECLARE_PUBLIC(AsyncResult) -}; - -AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q) : - m_request(createEvernoteRequest(url)), - m_postData(postData), - m_readFunction(readFunction), - m_autoDelete(autoDelete), - q_ptr(q) -{} - -AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, - QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q) : - m_request(request), - m_postData(postData), - m_readFunction(readFunction), - m_autoDelete(autoDelete), - q_ptr(q) -{} - - -AsyncResultPrivate::~AsyncResultPrivate() -{} QVariant AsyncResult::asIs(QByteArray replyData) { @@ -78,7 +32,7 @@ AsyncResult::AsyncResult(QString url, QByteArray postData, QObject(parent), d_ptr(new AsyncResultPrivate(url, postData, readFunction, autoDelete, this)) { - QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); + QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, @@ -87,7 +41,7 @@ AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, QObject(parent), d_ptr(new AsyncResultPrivate(request, postData, readFunction, autoDelete, this)) { - QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); + QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } AsyncResult::~AsyncResult() @@ -115,64 +69,4 @@ bool AsyncResult::waitForFinished(int timeout) return res; } -void AsyncResult::start() -{ - Q_D(AsyncResult); - if (d->m_request.url().isEmpty() && d->m_postData.isEmpty()) { - return; - } - - ReplyFetcher * replyFetcher = new ReplyFetcher; - QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, - this, &AsyncResult::onReplyFetched); - replyFetcher->start( - evernoteNetworkAccessManager(), d->m_request, d->m_postData); -} - -void AsyncResult::onReplyFetched(QObject * rp) -{ - Q_D(AsyncResult); - - ReplyFetcher * reply = qobject_cast(rp); - QSharedPointer error; - QVariant result; - - try - { - if (reply->isError()) { - error = QSharedPointer( - new EverCloudExceptionData(reply->errorText())); - } - else if(reply->httpStatusCode() != 200) { - error = QSharedPointer( - new EverCloudExceptionData( - QString::fromUtf8("HTTP Status Code = %1") - .arg(reply->httpStatusCode()))); - } - else { - result = d->m_readFunction(reply->receivedData()); - } - } - catch(const EverCloudException & e) { - error = e.exceptionData(); - } - catch(const std::exception & e) { - error = QSharedPointer( - new EverCloudExceptionData( - QString::fromUtf8("Exception of type \"%1\" with the message: %2") - .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); - } - catch(...) { - error = QSharedPointer( - new EverCloudExceptionData(QStringLiteral("Unknown exception"))); - } - - emit finished(result, error); - reply->deleteLater(); - - if (d->m_autoDelete) { - this->deleteLater(); - } -} - } // namespace qevercloud diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp new file mode 100644 index 00000000..307b6b51 --- /dev/null +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -0,0 +1,129 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#include "AsyncResult_p.h" +#include "Http.h" + +namespace qevercloud { + +AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, + bool autoDelete, AsyncResult * q) : + m_request(createEvernoteRequest(url)), + m_postData(postData), + m_readFunction(readFunction), + m_autoDelete(autoDelete), + q_ptr(q) +{} + +AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, + QByteArray postData, + AsyncResult::ReadFunctionType readFunction, + bool autoDelete, AsyncResult * q) : + m_request(request), + m_postData(postData), + m_readFunction(readFunction), + m_autoDelete(autoDelete), + q_ptr(q) +{} + +AsyncResultPrivate::~AsyncResultPrivate() +{} + +void AsyncResultPrivate::start() +{ + if (m_request.url().isEmpty() && m_postData.isEmpty()) { + // No network request to start, will wait for value to be set explicitly + return; + } + + ReplyFetcher * replyFetcher = new ReplyFetcher; + QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, + this, &AsyncResultPrivate::onReplyFetched); + replyFetcher->start( + evernoteNetworkAccessManager(), m_request, m_postData); +} + +void AsyncResultPrivate::onReplyFetched(QObject * rp) +{ + ReplyFetcher * reply = qobject_cast(rp); + QSharedPointer error; + QVariant result; + + try + { + if (reply->isError()) { + error = QSharedPointer( + new EverCloudExceptionData(reply->errorText())); + } + else if(reply->httpStatusCode() != 200) { + error = QSharedPointer( + new EverCloudExceptionData( + QString::fromUtf8("HTTP Status Code = %1") + .arg(reply->httpStatusCode()))); + } + else { + result = m_readFunction(reply->receivedData()); + } + } + catch(const EverCloudException & e) { + error = e.exceptionData(); + } + catch(const std::exception & e) { + error = QSharedPointer( + new EverCloudExceptionData( + QString::fromUtf8("Exception of type \"%1\" with the message: %2") + .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); + } + catch(...) { + error = QSharedPointer( + new EverCloudExceptionData(QStringLiteral("Unknown exception"))); + } + + Q_EMIT finished(result, error); + reply->deleteLater(); + + if (m_autoDelete) { + Q_Q(AsyncResult); + q->deleteLater(); + } +} + +void AsyncResultPrivate::setValue( + QByteArray value, QSharedPointer error) +{ + QVariant result; + if (error.isNull()) + { + try { + result = m_readFunction(value); + } + catch(const EverCloudException & e) { + error = e.exceptionData(); + } + catch(const std::exception & e) { + error = QSharedPointer( + new EverCloudExceptionData( + QString::fromUtf8("Exception of type \"%1\" with the message: %2") + .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); + } + catch(...) { + error = QSharedPointer( + new EverCloudExceptionData(QStringLiteral("Unknown exception"))); + } + } + + Q_EMIT finished(result, error); + + if (m_autoDelete) { + Q_Q(AsyncResult); + q->deleteLater(); + } +} + +} // namespace qevercloud diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h new file mode 100644 index 00000000..4f566ce7 --- /dev/null +++ b/QEverCloud/src/AsyncResult_p.h @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_ASYNC_RESULT_PRIVATE_H +#define QEVERCLOUD_ASYNC_RESULT_PRIVATE_H + +#include + +namespace qevercloud { + +class AsyncResultPrivate: public QObject +{ + Q_OBJECT +public: + explicit AsyncResultPrivate(QString url, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, + bool autoDelete, AsyncResult * q); + + explicit AsyncResultPrivate(QNetworkRequest request, QByteArray postData, + AsyncResult::ReadFunctionType readFunction, + bool autoDelete, AsyncResult * q); + + virtual ~AsyncResultPrivate(); + +Q_SIGNALS: + void finished(QVariant result, QSharedPointer error); + +public Q_SLOTS: + void start(); + + void onReplyFetched(QObject * rp); + + void setValue(QByteArray value, QSharedPointer error); + +public: + QNetworkRequest m_request; + QByteArray m_postData; + AsyncResult::ReadFunctionType m_readFunction; + bool m_autoDelete; + +private: + AsyncResult * const q_ptr; + Q_DECLARE_PUBLIC(AsyncResult) +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_ASYNC_RESULT_PRIVATE_H From 0c703ad1cfb82fd73895a3851633c06e7d8a7d13 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 7 Oct 2019 08:39:58 +0300 Subject: [PATCH 017/188] Start implementing generic DurableService class to encapsulate retries logic there --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/headers/AsyncResult.h | 9 ++- QEverCloud/src/AsyncResult.cpp | 5 ++ QEverCloud/src/AsyncResult_p.cpp | 29 ++----- QEverCloud/src/AsyncResult_p.h | 4 +- QEverCloud/src/DurableService.cpp | 121 ++++++++++++++++++++++++++++++ QEverCloud/src/DurableService.h | 72 ++++++++++++++++++ 7 files changed, 216 insertions(+), 26 deletions(-) create mode 100644 QEverCloud/src/DurableService.cpp create mode 100644 QEverCloud/src/DurableService.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index c892ea5e..51de8280 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -39,6 +39,7 @@ set(GENERATED_HEADERS set(PRIVATE_HEADERS src/AsyncResult_p.h + src/DurableService.h src/Http.h src/Impl.h src/Thrift.h @@ -47,6 +48,7 @@ set(PRIVATE_HEADERS set(SOURCES src/AsyncResult.cpp src/AsyncResult_p.cpp + src/DurableService.cpp src/EventLoopFinisher.cpp src/EverCloudException.cpp src/Exceptions.cpp diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index db0e4eab..0003a78a 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -53,16 +53,21 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject private: static QVariant asIs(QByteArray replyData); + /** + * Constructor for use by QEverCloud internals only + */ + AsyncResult(bool autoDelete = true, QObject * parent = nullptr); + public: typedef QVariant (*ReadFunctionType)(QByteArray replyData); AsyncResult(QString url, QByteArray postData, ReadFunctionType readFunction = AsyncResult::asIs, - bool autoDelete = true, QObject * parent = Q_NULLPTR); + bool autoDelete = true, QObject * parent = nullptr); AsyncResult(QNetworkRequest request, QByteArray postData, ReadFunctionType readFunction = AsyncResult::asIs, - bool autoDelete = true, QObject * parent = Q_NULLPTR); + bool autoDelete = true, QObject * parent = nullptr); ~AsyncResult(); diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 9721f84f..820ce5a6 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -26,6 +26,11 @@ QVariant AsyncResult::asIs(QByteArray replyData) return replyData; } +AsyncResult::AsyncResult(bool autoDelete, QObject * parent) : + QObject(parent), + d_ptr(new AsyncResultPrivate(autoDelete, this)) +{} + AsyncResult::AsyncResult(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 307b6b51..7d14a415 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -11,6 +11,11 @@ namespace qevercloud { +AsyncResultPrivate::AsyncResultPrivate(bool autoDelete, AsyncResult * q) : + m_autoDelete(autoDelete), + q_ptr(q) +{} + AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : @@ -94,30 +99,8 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } } -void AsyncResultPrivate::setValue( - QByteArray value, QSharedPointer error) +void AsyncResultPrivate::setValue(QVariant result, QSharedPointer error) { - QVariant result; - if (error.isNull()) - { - try { - result = m_readFunction(value); - } - catch(const EverCloudException & e) { - error = e.exceptionData(); - } - catch(const std::exception & e) { - error = QSharedPointer( - new EverCloudExceptionData( - QString::fromUtf8("Exception of type \"%1\" with the message: %2") - .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); - } - catch(...) { - error = QSharedPointer( - new EverCloudExceptionData(QStringLiteral("Unknown exception"))); - } - } - Q_EMIT finished(result, error); if (m_autoDelete) { diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 4f566ce7..20ea1f69 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -17,6 +17,8 @@ class AsyncResultPrivate: public QObject { Q_OBJECT public: + explicit AsyncResultPrivate(bool autoDelete, AsyncResult * q); + explicit AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); @@ -35,7 +37,7 @@ public Q_SLOTS: void onReplyFetched(QObject * rp); - void setValue(QByteArray value, QSharedPointer error); + void setValue(QVariant result, QSharedPointer error); public: QNetworkRequest m_request; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp new file mode 100644 index 00000000..9b2db8d9 --- /dev/null +++ b/QEverCloud/src/DurableService.cpp @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#include "AsyncResult_p.h" +#include "DurableService.h" + +namespace qevercloud { + +DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) : + m_retryPolicy(std::move(retryPolicy)), + m_ctx(std::move(ctx)) +{} + +DurableService::SyncResult DurableService::ExecuteSyncRequest( + SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + + SyncResult result; + + while(state.m_retryCount) + { + try { + result = syncServiceCall(); + } + catch(const EverCloudException & e) { + result.second = e.exceptionData(); + } + catch(const std::exception & e) { + result.second = QSharedPointer( + new EverCloudExceptionData(QString::fromLocal8Bit(e.what()))); + return result; + } + + if (result.second) + { + if (!m_retryPolicy->ShouldRetry(result.second)) { + return result; + } + + --state.m_retryCount; + continue; + } + + break; + } + + return result; +} + +AsyncResult * DurableService::ExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) +{ + if (!ctx) { + ctx = m_ctx; + } + + RetryState state; + state.m_retryCount = ctx->maxRequestRetryCount(); + + AsyncResult * result = new AsyncResult; + DoExecuteAsyncRequest(std::move(asyncServiceCall), std::move(ctx), + std::move(state), result); + + return result; +} + +void DurableService::DoExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + RetryState && retryState, AsyncResult * result) +{ + AsyncResult * attemptRes = asyncServiceCall(); + QObject::connect(attemptRes, &AsyncResult::finished, + [=, retryPolicy = m_retryPolicy] ( + QVariant value, + QSharedPointer exceptionData) mutable + { + if (!exceptionData) { + result->d_ptr->setValue(value, {}); + return; + } + + if (!retryPolicy->ShouldRetry(exceptionData)) { + result->d_ptr->setValue({}, exceptionData); + return; + } + + --retryState.m_retryCount; + if (!retryState.m_retryCount) { + result->d_ptr->setValue({}, exceptionData); + return; + } + + quint64 requestTimeout = ctx->requestTimeout(); + if (ctx->increaseRequestTimeoutExponentially()) { + // TODO: increase timeout + } + + auto newCtx = newRequestContext( + ctx->authenticationToken(), + requestTimeout, + ctx->increaseRequestTimeoutExponentially(), + ctx->maxRequestTimeout(), + ctx->maxRequestRetryCount()); + + DoExecuteAsyncRequest( + std::move(asyncServiceCall), std::move(newCtx), + std::move(retryState), result); + }); +} + +} // namespace qevercloud diff --git a/QEverCloud/src/DurableService.h b/QEverCloud/src/DurableService.h new file mode 100644 index 00000000..3cec2be3 --- /dev/null +++ b/QEverCloud/src/DurableService.h @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_DURABLE_SERVICE_H +#define QEVERCLOUD_DURABLE_SERVICE_H + +#include +#include + +#include +#include + +#include +#include +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN RetryState +{ + qint64 m_started = QDateTime::currentMSecsSinceEpoch(); + quint32 m_retryCount = 0; +}; + +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN IRetryPolicy +{ + virtual bool ShouldRetry( + QSharedPointer exceptionData) = 0; +}; + +using IRetryPolicyPtr = std::shared_ptr; + +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN DurableService: public QObject +{ + Q_OBJECT +public: + using SyncResult = std::pair>; + using SyncServiceCall = std::function; + using AsyncServiceCall = std::function; + +public: + DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); + + SyncResult ExecuteSyncRequest( + SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); + + AsyncResult * ExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx); + +private: + void DoExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + RetryState && retryState, AsyncResult * result); + +private: + IRetryPolicyPtr m_retryPolicy; + IRequestContextPtr m_ctx; +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_DURABLE_SERVICE_H From 0c833252889bf3bd7657676f8614ac0aaa856e38 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 8 Oct 2019 07:52:07 +0300 Subject: [PATCH 018/188] Finalize durable service class implementation --- QEverCloud/src/DurableService.cpp | 155 ++++++++++++++++++++++-------- QEverCloud/src/DurableService.h | 148 ++++++++++++++-------------- 2 files changed, 192 insertions(+), 111 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 9b2db8d9..034a0732 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -8,8 +8,29 @@ #include "AsyncResult_p.h" #include "DurableService.h" +#include + +#include +#include + namespace qevercloud { +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +quint64 exponentiallyIncreasedTimeoutMsec( + quint64 timeout, const quint64 maxTimeout) +{ + timeout = static_cast(std::floor(timeout * 1.6 + 0.5)); + timeout = std::min(timeout, maxTimeout); + return timeout; +} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) : m_retryPolicy(std::move(retryPolicy)), m_ctx(std::move(ctx)) @@ -30,7 +51,7 @@ DurableService::SyncResult DurableService::ExecuteSyncRequest( while(state.m_retryCount) { try { - result = syncServiceCall(); + result = syncServiceCall(ctx); } catch(const EverCloudException & e) { result.second = e.exceptionData(); @@ -48,6 +69,21 @@ DurableService::SyncResult DurableService::ExecuteSyncRequest( } --state.m_retryCount; + + if (state.m_retryCount && ctx->increaseRequestTimeoutExponentially()) + { + auto timeout = ctx->requestTimeout(); + auto maxTimeout = ctx->maxRequestTimeout(); + timeout = exponentiallyIncreasedTimeoutMsec(timeout, maxTimeout); + + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxTimeout, + ctx->maxRequestRetryCount()); + } + continue; } @@ -78,44 +114,85 @@ void DurableService::DoExecuteAsyncRequest( AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, RetryState && retryState, AsyncResult * result) { - AsyncResult * attemptRes = asyncServiceCall(); - QObject::connect(attemptRes, &AsyncResult::finished, - [=, retryPolicy = m_retryPolicy] ( - QVariant value, - QSharedPointer exceptionData) mutable - { - if (!exceptionData) { - result->d_ptr->setValue(value, {}); - return; - } - - if (!retryPolicy->ShouldRetry(exceptionData)) { - result->d_ptr->setValue({}, exceptionData); - return; - } - - --retryState.m_retryCount; - if (!retryState.m_retryCount) { - result->d_ptr->setValue({}, exceptionData); - return; - } - - quint64 requestTimeout = ctx->requestTimeout(); - if (ctx->increaseRequestTimeoutExponentially()) { - // TODO: increase timeout - } - - auto newCtx = newRequestContext( - ctx->authenticationToken(), - requestTimeout, - ctx->increaseRequestTimeoutExponentially(), - ctx->maxRequestTimeout(), - ctx->maxRequestRetryCount()); - - DoExecuteAsyncRequest( - std::move(asyncServiceCall), std::move(newCtx), - std::move(retryState), result); - }); + AsyncResult * attemptRes = asyncServiceCall(ctx); + QObject::connect( + attemptRes, + &AsyncResult::finished, + result, + [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( + QVariant value, + QSharedPointer exceptionData) mutable + { + if (!exceptionData) { + result->d_ptr->setValue(value, {}); + return; + } + + if (!retryPolicy->ShouldRetry(exceptionData)) { + result->d_ptr->setValue({}, exceptionData); + return; + } + + --retryState.m_retryCount; + if (!retryState.m_retryCount) { + result->d_ptr->setValue({}, exceptionData); + return; + } + + quint64 requestTimeout = ctx->requestTimeout(); + if (ctx->increaseRequestTimeoutExponentially()) + { + auto timeout = ctx->requestTimeout(); + auto maxTimeout = ctx->maxRequestTimeout(); + timeout = exponentiallyIncreasedTimeoutMsec(timeout, maxTimeout); + + ctx = newRequestContext( + ctx->authenticationToken(), + timeout, + /* increase request timeout exponentially = */ true, + maxTimeout, + ctx->maxRequestRetryCount()); + } + + DoExecuteAsyncRequest( + std::move(asyncServiceCall), std::move(ctx), + std::move(retryState), result); + }, + Qt::QueuedConnection); +} + +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy +{ + virtual bool ShouldRetry( + QSharedPointer exceptionData) override + { + if (Q_UNLIKELY(exceptionData.isNull())) { + return true; + } + + try { + exceptionData->throwException(); + } + catch(const ThriftException &) { + return true; + } + catch(const EDAMSystemException &) { + return true; + } + catch(...) { + } + + return false; + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +IRetryPolicyPtr newRetryPolicy() +{ + return std::make_shared(); } } // namespace qevercloud diff --git a/QEverCloud/src/DurableService.h b/QEverCloud/src/DurableService.h index 3cec2be3..78748c82 100644 --- a/QEverCloud/src/DurableService.h +++ b/QEverCloud/src/DurableService.h @@ -1,72 +1,76 @@ -/** - * Copyright (c) 2019 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms - * of MIT license: https://opensource.org/licenses/MIT - */ - -#ifndef QEVERCLOUD_DURABLE_SERVICE_H -#define QEVERCLOUD_DURABLE_SERVICE_H - -#include -#include - -#include -#include - -#include -#include -#include - -namespace qevercloud { - -//////////////////////////////////////////////////////////////////////////////// - -struct Q_DECL_HIDDEN RetryState -{ - qint64 m_started = QDateTime::currentMSecsSinceEpoch(); - quint32 m_retryCount = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct Q_DECL_HIDDEN IRetryPolicy -{ - virtual bool ShouldRetry( - QSharedPointer exceptionData) = 0; -}; - -using IRetryPolicyPtr = std::shared_ptr; - -//////////////////////////////////////////////////////////////////////////////// - -class Q_DECL_HIDDEN DurableService: public QObject -{ - Q_OBJECT -public: - using SyncResult = std::pair>; - using SyncServiceCall = std::function; - using AsyncServiceCall = std::function; - -public: - DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); - - SyncResult ExecuteSyncRequest( - SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); - - AsyncResult * ExecuteAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx); - -private: - void DoExecuteAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, - RetryState && retryState, AsyncResult * result); - -private: - IRetryPolicyPtr m_retryPolicy; - IRequestContextPtr m_ctx; -}; - -} // namespace qevercloud - -#endif // QEVERCLOUD_DURABLE_SERVICE_H +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_DURABLE_SERVICE_H +#define QEVERCLOUD_DURABLE_SERVICE_H + +#include +#include + +#include +#include + +#include +#include +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN RetryState +{ + qint64 m_started = QDateTime::currentMSecsSinceEpoch(); + quint32 m_retryCount = 0; +}; + +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN IRetryPolicy +{ + virtual bool ShouldRetry( + QSharedPointer exceptionData) = 0; +}; + +using IRetryPolicyPtr = std::shared_ptr; + +//////////////////////////////////////////////////////////////////////////////// + +class Q_DECL_HIDDEN DurableService: public QObject +{ + Q_OBJECT +public: + using SyncResult = std::pair>; + using SyncServiceCall = std::function; + using AsyncServiceCall = std::function; + +public: + DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); + + SyncResult ExecuteSyncRequest( + SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); + + AsyncResult * ExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx); + +private: + void DoExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + RetryState && retryState, AsyncResult * result); + +private: + IRetryPolicyPtr m_retryPolicy; + IRequestContextPtr m_ctx; +}; + +//////////////////////////////////////////////////////////////////////////////// + +IRetryPolicyPtr newRetryPolicy(); + +} // namespace qevercloud + +#endif // QEVERCLOUD_DURABLE_SERVICE_H From cc3c3ac8637553a2af6182edbd0cc4302b9a49ef Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 9 Oct 2019 07:45:27 +0300 Subject: [PATCH 019/188] Coding style fixes + add method to create new requestless AsyncResult objects --- QEverCloud/src/DurableService.cpp | 21 +++++++++++++-------- QEverCloud/src/DurableService.h | 10 ++++++---- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 034a0732..49b29c02 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -36,7 +36,12 @@ DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr c m_ctx(std::move(ctx)) {} -DurableService::SyncResult DurableService::ExecuteSyncRequest( +AsyncResult * DurableService::newAsyncResult() +{ + return new AsyncResult; +} + +DurableService::SyncResult DurableService::executeSyncRequest( SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) { if (!ctx) { @@ -64,7 +69,7 @@ DurableService::SyncResult DurableService::ExecuteSyncRequest( if (result.second) { - if (!m_retryPolicy->ShouldRetry(result.second)) { + if (!m_retryPolicy->shouldRetry(result.second)) { return result; } @@ -93,7 +98,7 @@ DurableService::SyncResult DurableService::ExecuteSyncRequest( return result; } -AsyncResult * DurableService::ExecuteAsyncRequest( +AsyncResult * DurableService::executeAsyncRequest( AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) { if (!ctx) { @@ -104,13 +109,13 @@ AsyncResult * DurableService::ExecuteAsyncRequest( state.m_retryCount = ctx->maxRequestRetryCount(); AsyncResult * result = new AsyncResult; - DoExecuteAsyncRequest(std::move(asyncServiceCall), std::move(ctx), + doExecuteAsyncRequest(std::move(asyncServiceCall), std::move(ctx), std::move(state), result); return result; } -void DurableService::DoExecuteAsyncRequest( +void DurableService::doExecuteAsyncRequest( AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, RetryState && retryState, AsyncResult * result) { @@ -128,7 +133,7 @@ void DurableService::DoExecuteAsyncRequest( return; } - if (!retryPolicy->ShouldRetry(exceptionData)) { + if (!retryPolicy->shouldRetry(exceptionData)) { result->d_ptr->setValue({}, exceptionData); return; } @@ -154,7 +159,7 @@ void DurableService::DoExecuteAsyncRequest( ctx->maxRequestRetryCount()); } - DoExecuteAsyncRequest( + doExecuteAsyncRequest( std::move(asyncServiceCall), std::move(ctx), std::move(retryState), result); }, @@ -165,7 +170,7 @@ void DurableService::DoExecuteAsyncRequest( struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy { - virtual bool ShouldRetry( + virtual bool shouldRetry( QSharedPointer exceptionData) override { if (Q_UNLIKELY(exceptionData.isNull())) { diff --git a/QEverCloud/src/DurableService.h b/QEverCloud/src/DurableService.h index 78748c82..675854b6 100644 --- a/QEverCloud/src/DurableService.h +++ b/QEverCloud/src/DurableService.h @@ -32,7 +32,7 @@ struct Q_DECL_HIDDEN RetryState struct Q_DECL_HIDDEN IRetryPolicy { - virtual bool ShouldRetry( + virtual bool shouldRetry( QSharedPointer exceptionData) = 0; }; @@ -51,14 +51,16 @@ class Q_DECL_HIDDEN DurableService: public QObject public: DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); - SyncResult ExecuteSyncRequest( + AsyncResult * newAsyncResult(); + + SyncResult executeSyncRequest( SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); - AsyncResult * ExecuteAsyncRequest( + AsyncResult * executeAsyncRequest( AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx); private: - void DoExecuteAsyncRequest( + void doExecuteAsyncRequest( AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, RetryState && retryState, AsyncResult * result); From 4d6b8f614de7a5c63081b0918495755a1080b1ad Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 9 Oct 2019 07:45:40 +0300 Subject: [PATCH 020/188] Update generated code --- QEverCloud/headers/generated/EDAMErrorCode.h | 25 + QEverCloud/headers/generated/Types.h | 2 - QEverCloud/src/generated/Services.cpp | 3318 ++++-------------- 3 files changed, 742 insertions(+), 2603 deletions(-) diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index d172497b..0ad79735 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -15,6 +15,7 @@ #include "../Export.h" #include +#include #include namespace qevercloud { @@ -958,4 +959,28 @@ QEVERCLOUD_EXPORT QDebug & operator<<( } // namespace qevercloud +Q_DECLARE_METATYPE(qevercloud::EDAMErrorCode) +Q_DECLARE_METATYPE(qevercloud::EDAMInvalidContactReason) +Q_DECLARE_METATYPE(qevercloud::ShareRelationshipPrivilegeLevel) +Q_DECLARE_METATYPE(qevercloud::PrivilegeLevel) +Q_DECLARE_METATYPE(qevercloud::ServiceLevel) +Q_DECLARE_METATYPE(qevercloud::QueryFormat) +Q_DECLARE_METATYPE(qevercloud::NoteSortOrder) +Q_DECLARE_METATYPE(qevercloud::PremiumOrderStatus) +Q_DECLARE_METATYPE(qevercloud::SharedNotebookPrivilegeLevel) +Q_DECLARE_METATYPE(qevercloud::SharedNotePrivilegeLevel) +Q_DECLARE_METATYPE(qevercloud::SponsoredGroupRole) +Q_DECLARE_METATYPE(qevercloud::BusinessUserRole) +Q_DECLARE_METATYPE(qevercloud::BusinessUserStatus) +Q_DECLARE_METATYPE(qevercloud::SharedNotebookInstanceRestrictions) +Q_DECLARE_METATYPE(qevercloud::ReminderEmailConfig) +Q_DECLARE_METATYPE(qevercloud::BusinessInvitationStatus) +Q_DECLARE_METATYPE(qevercloud::ContactType) +Q_DECLARE_METATYPE(qevercloud::EntityType) +Q_DECLARE_METATYPE(qevercloud::RecipientStatus) +Q_DECLARE_METATYPE(qevercloud::CanMoveToContainerStatus) +Q_DECLARE_METATYPE(qevercloud::RelatedContentType) +Q_DECLARE_METATYPE(qevercloud::RelatedContentAccess) +Q_DECLARE_METATYPE(qevercloud::UserIdentityType) + #endif // QEVERCLOUD_GENERATED_EDAMERRORCODE_H diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 6a2c8022..eaeacfe8 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -5753,8 +5753,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { }; - - } // namespace qevercloud Q_DECLARE_METATYPE(qevercloud::SyncState) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 9507034b..6ba93820 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -11,6 +11,7 @@ #include #include "../Impl.h" +#include "../DurableService.h" #include "../Impl.h" #include "Types_io.h" #include @@ -14550,6 +14551,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore QObject * parent = nullptr) : INoteStore(parent), m_service(std::move(service)), + m_durableService(newRetryPolicy(), ctx), m_ctx(std::move(ctx)) { if (!m_ctx) { @@ -15219,6 +15221,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore private: INoteStorePtr m_service; + DurableService m_durableService; IRequestContextPtr m_ctx; }; @@ -15235,6 +15238,7 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore QObject * parent = nullptr) : IUserStore(parent), m_service(std::move(service)), + m_durableService(newRetryPolicy(), ctx), m_ctx(std::move(ctx)) { if (!m_ctx) { @@ -15377,38 +15381,12 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore private: IUserStorePtr m_service; + DurableService m_durableService; IRequestContextPtr m_ctx; }; //////////////////////////////////////////////////////////////////////////////// -struct RetryState -{ - const quint64 m_started = QDateTime::currentMSecsSinceEpoch(); - quint32 m_retryCount = 0; -}; - -template -struct RequestState -{ - T m_request; - AsyncResult * m_response; - - RequestState(T && request, AsyncResult * response) : - m_request(std::move(request)), - m_response(response) - {} -}; - -quint64 exponentiallyIncreasedTimeoutMsec(quint64 timeout, const quint64 maxTimeout) -{ - timeout = static_cast(std::floor(timeout * 1.6 + 0.5)); - timeout = std::min(timeout, maxTimeout); - return timeout; -} - -//////////////////////////////////////////////////////////////////////////////// - SyncState DurableNoteStore::getSyncState( IRequestContextPtr ctx) { @@ -15416,39 +15394,18 @@ SyncState DurableNoteStore::getSyncState( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getSyncState( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getSyncStateAsync( @@ -15458,7 +15415,7 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getSyncStateAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -15481,42 +15438,21 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getFilteredSyncChunk( afterUSN, maxEntries, filter, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( @@ -15529,7 +15465,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getFilteredSyncChunkAsync( afterUSN, maxEntries, @@ -15553,40 +15489,19 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getLinkedNotebookSyncState( linkedNotebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( @@ -15597,7 +15512,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getLinkedNotebookSyncStateAsync( linkedNotebook, ctx); @@ -15622,11 +15537,8 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getLinkedNotebookSyncChunk( linkedNotebook, @@ -15634,31 +15546,13 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( maxEntries, fullSyncOnly, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( @@ -15672,7 +15566,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getLinkedNotebookSyncChunkAsync( linkedNotebook, afterUSN, @@ -15696,39 +15590,18 @@ QList DurableNoteStore::listNotebooks( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listNotebooks( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listNotebooksAsync( @@ -15738,7 +15611,7 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listNotebooksAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -15758,39 +15631,18 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listAccessibleBusinessNotebooks( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( @@ -15800,7 +15652,7 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listAccessibleBusinessNotebooksAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -15821,40 +15673,19 @@ Notebook DurableNoteStore::getNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNotebook( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNotebookAsync( @@ -15865,7 +15696,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNotebookAsync( guid, ctx); @@ -15886,39 +15717,18 @@ Notebook DurableNoteStore::getDefaultNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getDefaultNotebook( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getDefaultNotebookAsync( @@ -15928,7 +15738,7 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getDefaultNotebookAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -15949,40 +15759,19 @@ Notebook DurableNoteStore::createNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createNotebook( notebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createNotebookAsync( @@ -15993,7 +15782,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createNotebookAsync( notebook, ctx); @@ -16015,40 +15804,19 @@ qint32 DurableNoteStore::updateNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateNotebook( notebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateNotebookAsync( @@ -16059,7 +15827,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateNotebookAsync( notebook, ctx); @@ -16081,40 +15849,19 @@ qint32 DurableNoteStore::expungeNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->expungeNotebook( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::expungeNotebookAsync( @@ -16125,7 +15872,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->expungeNotebookAsync( guid, ctx); @@ -16146,39 +15893,18 @@ QList DurableNoteStore::listTags( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listTags( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listTagsAsync( @@ -16188,7 +15914,7 @@ AsyncResult * DurableNoteStore::listTagsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listTagsAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -16209,40 +15935,19 @@ QList DurableNoteStore::listTagsByNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listTagsByNotebook( notebookGuid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listTagsByNotebookAsync( @@ -16253,7 +15958,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listTagsByNotebookAsync( notebookGuid, ctx); @@ -16275,40 +15980,19 @@ Tag DurableNoteStore::getTag( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getTag( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getTagAsync( @@ -16319,7 +16003,7 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getTagAsync( guid, ctx); @@ -16341,40 +16025,19 @@ Tag DurableNoteStore::createTag( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createTag( tag, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createTagAsync( @@ -16385,7 +16048,7 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createTagAsync( tag, ctx); @@ -16407,40 +16070,19 @@ qint32 DurableNoteStore::updateTag( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateTag( tag, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateTagAsync( @@ -16451,7 +16093,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateTagAsync( tag, ctx); @@ -16473,39 +16115,19 @@ void DurableNoteStore::untagAll( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->untagAll( guid, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableNoteStore::untagAllAsync( @@ -16516,7 +16138,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->untagAllAsync( guid, ctx); @@ -16538,40 +16160,19 @@ qint32 DurableNoteStore::expungeTag( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->expungeTag( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::expungeTagAsync( @@ -16582,7 +16183,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->expungeTagAsync( guid, ctx); @@ -16603,39 +16204,18 @@ QList DurableNoteStore::listSearches( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listSearches( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listSearchesAsync( @@ -16645,7 +16225,7 @@ AsyncResult * DurableNoteStore::listSearchesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listSearchesAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -16666,40 +16246,19 @@ SavedSearch DurableNoteStore::getSearch( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getSearch( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getSearchAsync( @@ -16710,7 +16269,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getSearchAsync( guid, ctx); @@ -16732,40 +16291,19 @@ SavedSearch DurableNoteStore::createSearch( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createSearch( search, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createSearchAsync( @@ -16776,7 +16314,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createSearchAsync( search, ctx); @@ -16798,40 +16336,19 @@ qint32 DurableNoteStore::updateSearch( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateSearch( search, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateSearchAsync( @@ -16842,7 +16359,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateSearchAsync( search, ctx); @@ -16864,40 +16381,19 @@ qint32 DurableNoteStore::expungeSearch( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->expungeSearch( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::expungeSearchAsync( @@ -16908,7 +16404,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->expungeSearchAsync( guid, ctx); @@ -16931,41 +16427,20 @@ qint32 DurableNoteStore::findNoteOffset( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->findNoteOffset( filter, guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::findNoteOffsetAsync( @@ -16977,7 +16452,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->findNoteOffsetAsync( filter, guid, @@ -17003,11 +16478,8 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->findNotesMetadata( filter, @@ -17015,31 +16487,13 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( maxNotes, resultSpec, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::findNotesMetadataAsync( @@ -17053,7 +16507,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->findNotesMetadataAsync( filter, offset, @@ -17079,41 +16533,20 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->findNoteCounts( filter, withTrash, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::findNoteCountsAsync( @@ -17125,7 +16558,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->findNoteCountsAsync( filter, withTrash, @@ -17149,41 +16582,20 @@ Note DurableNoteStore::getNoteWithResultSpec( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteWithResultSpec( guid, resultSpec, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( @@ -17195,7 +16607,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteWithResultSpecAsync( guid, resultSpec, @@ -17222,11 +16634,8 @@ Note DurableNoteStore::getNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNote( guid, @@ -17235,31 +16644,13 @@ Note DurableNoteStore::getNote( withResourcesRecognition, withResourcesAlternateData, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNoteAsync( @@ -17274,7 +16665,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteAsync( guid, withContent, @@ -17300,40 +16691,19 @@ LazyMap DurableNoteStore::getNoteApplicationData( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteApplicationData( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( @@ -17344,7 +16714,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteApplicationDataAsync( guid, ctx); @@ -17367,41 +16737,20 @@ QString DurableNoteStore::getNoteApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteApplicationDataEntry( guid, key, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( @@ -17413,7 +16762,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteApplicationDataEntryAsync( guid, key, @@ -17438,42 +16787,21 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->setNoteApplicationDataEntry( guid, key, value, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( @@ -17486,7 +16814,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->setNoteApplicationDataEntryAsync( guid, key, @@ -17511,41 +16839,20 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->unsetNoteApplicationDataEntry( guid, key, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( @@ -17557,7 +16864,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->unsetNoteApplicationDataEntryAsync( guid, key, @@ -17580,40 +16887,19 @@ QString DurableNoteStore::getNoteContent( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteContent( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::getNoteContentAsync( @@ -17624,7 +16910,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteContentAsync( guid, ctx); @@ -17648,42 +16934,21 @@ QString DurableNoteStore::getNoteSearchText( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteSearchText( guid, noteOnly, tokenizeForIndexing, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::getNoteSearchTextAsync( @@ -17696,7 +16961,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteSearchTextAsync( guid, noteOnly, @@ -17720,40 +16985,19 @@ QString DurableNoteStore::getResourceSearchText( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceSearchText( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::getResourceSearchTextAsync( @@ -17764,7 +17008,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceSearchTextAsync( guid, ctx); @@ -17786,40 +17030,19 @@ QStringList DurableNoteStore::getNoteTagNames( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteTagNames( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toStringList(); } AsyncResult * DurableNoteStore::getNoteTagNamesAsync( @@ -17830,7 +17053,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteTagNamesAsync( guid, ctx); @@ -17852,40 +17075,19 @@ Note DurableNoteStore::createNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createNote( note, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createNoteAsync( @@ -17896,7 +17098,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createNoteAsync( note, ctx); @@ -17918,40 +17120,19 @@ Note DurableNoteStore::updateNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateNote( note, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateNoteAsync( @@ -17962,7 +17143,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateNoteAsync( note, ctx); @@ -17984,40 +17165,19 @@ qint32 DurableNoteStore::deleteNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->deleteNote( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::deleteNoteAsync( @@ -18028,7 +17188,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->deleteNoteAsync( guid, ctx); @@ -18050,40 +17210,19 @@ qint32 DurableNoteStore::expungeNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->expungeNote( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::expungeNoteAsync( @@ -18094,7 +17233,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->expungeNoteAsync( guid, ctx); @@ -18117,41 +17256,20 @@ Note DurableNoteStore::copyNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->copyNote( noteGuid, toNotebookGuid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::copyNoteAsync( @@ -18163,7 +17281,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->copyNoteAsync( noteGuid, toNotebookGuid, @@ -18186,40 +17304,19 @@ QList DurableNoteStore::listNoteVersions( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listNoteVersions( noteGuid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listNoteVersionsAsync( @@ -18230,7 +17327,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listNoteVersionsAsync( noteGuid, ctx); @@ -18256,11 +17353,8 @@ Note DurableNoteStore::getNoteVersion( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteVersion( noteGuid, @@ -18269,31 +17363,13 @@ Note DurableNoteStore::getNoteVersion( withResourcesRecognition, withResourcesAlternateData, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNoteVersionAsync( @@ -18308,7 +17384,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNoteVersionAsync( noteGuid, updateSequenceNum, @@ -18338,11 +17414,8 @@ Resource DurableNoteStore::getResource( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResource( guid, @@ -18351,31 +17424,13 @@ Resource DurableNoteStore::getResource( withAttributes, withAlternateData, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getResourceAsync( @@ -18390,7 +17445,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceAsync( guid, withData, @@ -18416,40 +17471,19 @@ LazyMap DurableNoteStore::getResourceApplicationData( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceApplicationData( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( @@ -18460,7 +17494,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceApplicationDataAsync( guid, ctx); @@ -18483,41 +17517,20 @@ QString DurableNoteStore::getResourceApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceApplicationDataEntry( guid, key, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( @@ -18529,7 +17542,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceApplicationDataEntryAsync( guid, key, @@ -18554,42 +17567,21 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->setResourceApplicationDataEntry( guid, key, value, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( @@ -18602,7 +17594,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->setResourceApplicationDataEntryAsync( guid, key, @@ -18627,41 +17619,20 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->unsetResourceApplicationDataEntry( guid, key, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( @@ -18673,7 +17644,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->unsetResourceApplicationDataEntryAsync( guid, key, @@ -18696,40 +17667,19 @@ qint32 DurableNoteStore::updateResource( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateResource( resource, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateResourceAsync( @@ -18740,7 +17690,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateResourceAsync( resource, ctx); @@ -18762,40 +17712,19 @@ QByteArray DurableNoteStore::getResourceData( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceData( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toByteArray(); } AsyncResult * DurableNoteStore::getResourceDataAsync( @@ -18806,7 +17735,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceDataAsync( guid, ctx); @@ -18832,11 +17761,8 @@ Resource DurableNoteStore::getResourceByHash( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceByHash( noteGuid, @@ -18845,31 +17771,13 @@ Resource DurableNoteStore::getResourceByHash( withRecognition, withAlternateData, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getResourceByHashAsync( @@ -18884,7 +17792,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceByHashAsync( noteGuid, contentHash, @@ -18910,40 +17818,19 @@ QByteArray DurableNoteStore::getResourceRecognition( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceRecognition( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toByteArray(); } AsyncResult * DurableNoteStore::getResourceRecognitionAsync( @@ -18954,7 +17841,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceRecognitionAsync( guid, ctx); @@ -18976,40 +17863,19 @@ QByteArray DurableNoteStore::getResourceAlternateData( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceAlternateData( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toByteArray(); } AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( @@ -19020,7 +17886,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceAlternateDataAsync( guid, ctx); @@ -19042,40 +17908,19 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceAttributes( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getResourceAttributesAsync( @@ -19086,7 +17931,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getResourceAttributesAsync( guid, ctx); @@ -19109,41 +17954,20 @@ Notebook DurableNoteStore::getPublicNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getPublicNotebook( userId, publicUri, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getPublicNotebookAsync( @@ -19155,7 +17979,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getPublicNotebookAsync( userId, publicUri, @@ -19179,41 +18003,20 @@ SharedNotebook DurableNoteStore::shareNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->shareNotebook( sharedNotebook, message, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::shareNotebookAsync( @@ -19225,7 +18028,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->shareNotebookAsync( sharedNotebook, message, @@ -19248,40 +18051,19 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createOrUpdateNotebookShares( shareTemplate, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( @@ -19292,7 +18074,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createOrUpdateNotebookSharesAsync( shareTemplate, ctx); @@ -19314,40 +18096,19 @@ qint32 DurableNoteStore::updateSharedNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateSharedNotebook( sharedNotebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateSharedNotebookAsync( @@ -19358,7 +18119,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateSharedNotebookAsync( sharedNotebook, ctx); @@ -19381,41 +18142,20 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->setNotebookRecipientSettings( notebookGuid, recipientSettings, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( @@ -19427,7 +18167,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->setNotebookRecipientSettingsAsync( notebookGuid, recipientSettings, @@ -19449,39 +18189,18 @@ QList DurableNoteStore::listSharedNotebooks( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listSharedNotebooks( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listSharedNotebooksAsync( @@ -19491,7 +18210,7 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listSharedNotebooksAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -19512,40 +18231,19 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->createLinkedNotebook( linkedNotebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::createLinkedNotebookAsync( @@ -19556,7 +18254,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->createLinkedNotebookAsync( linkedNotebook, ctx); @@ -19578,40 +18276,19 @@ qint32 DurableNoteStore::updateLinkedNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateLinkedNotebook( linkedNotebook, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( @@ -19622,7 +18299,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateLinkedNotebookAsync( linkedNotebook, ctx); @@ -19643,39 +18320,18 @@ QList DurableNoteStore::listLinkedNotebooks( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listLinkedNotebooks( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( @@ -19685,7 +18341,7 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listLinkedNotebooksAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -19706,40 +18362,19 @@ qint32 DurableNoteStore::expungeLinkedNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->expungeLinkedNotebook( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( @@ -19750,7 +18385,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->expungeLinkedNotebookAsync( guid, ctx); @@ -19772,40 +18407,19 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToSharedNotebook( shareKeyOrGlobalId, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( @@ -19816,7 +18430,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->authenticateToSharedNotebookAsync( shareKeyOrGlobalId, ctx); @@ -19837,39 +18451,18 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getSharedNotebookByAuth( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( @@ -19879,7 +18472,7 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getSharedNotebookByAuthAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -19900,39 +18493,19 @@ void DurableNoteStore::emailNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->emailNote( parameters, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableNoteStore::emailNoteAsync( @@ -19943,7 +18516,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->emailNoteAsync( parameters, ctx); @@ -19965,40 +18538,19 @@ QString DurableNoteStore::shareNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->shareNote( guid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toString(); } AsyncResult * DurableNoteStore::shareNoteAsync( @@ -20009,7 +18561,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->shareNoteAsync( guid, ctx); @@ -20031,39 +18583,19 @@ void DurableNoteStore::stopSharingNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->stopSharingNote( guid, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableNoteStore::stopSharingNoteAsync( @@ -20074,7 +18606,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->stopSharingNoteAsync( guid, ctx); @@ -20097,41 +18629,20 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToSharedNote( guid, noteKey, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( @@ -20143,7 +18654,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->authenticateToSharedNoteAsync( guid, noteKey, @@ -20167,41 +18678,20 @@ RelatedResult DurableNoteStore::findRelated( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->findRelated( query, resultSpec, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::findRelatedAsync( @@ -20213,7 +18703,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->findRelatedAsync( query, resultSpec, @@ -20236,40 +18726,19 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->updateNoteIfUsnMatches( note, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( @@ -20280,7 +18749,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateNoteIfUsnMatchesAsync( note, ctx); @@ -20302,40 +18771,19 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->manageNotebookShares( parameters, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::manageNotebookSharesAsync( @@ -20346,7 +18794,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->manageNotebookSharesAsync( parameters, ctx); @@ -20368,40 +18816,19 @@ ShareRelationships DurableNoteStore::getNotebookShares( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getNotebookShares( notebookGuid, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableNoteStore::getNotebookSharesAsync( @@ -20412,7 +18839,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getNotebookSharesAsync( notebookGuid, ctx); @@ -20438,42 +18865,21 @@ bool DurableUserStore::checkVersion( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->checkVersion( clientName, edamVersionMajor, edamVersionMinor, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.toBool(); } AsyncResult * DurableUserStore::checkVersionAsync( @@ -20486,7 +18892,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->checkVersionAsync( clientName, edamVersionMajor, @@ -20510,40 +18916,19 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getBootstrapInfo( locale, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::getBootstrapInfoAsync( @@ -20554,7 +18939,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getBootstrapInfoAsync( locale, ctx); @@ -20582,11 +18967,8 @@ AuthenticationResult DurableUserStore::authenticateLongSession( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateLongSession( username, @@ -20597,31 +18979,13 @@ AuthenticationResult DurableUserStore::authenticateLongSession( deviceDescription, supportsTwoFactor, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::authenticateLongSessionAsync( @@ -20638,7 +19002,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->authenticateLongSessionAsync( username, password, @@ -20668,42 +19032,21 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->completeTwoFactorAuthentication( oneTimeCode, deviceIdentifier, deviceDescription, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( @@ -20716,7 +19059,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->completeTwoFactorAuthenticationAsync( oneTimeCode, deviceIdentifier, @@ -20739,38 +19082,18 @@ void DurableUserStore::revokeLongSession( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->revokeLongSession( ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableUserStore::revokeLongSessionAsync( @@ -20780,7 +19103,7 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->revokeLongSessionAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -20800,39 +19123,18 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToBusiness( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::authenticateToBusinessAsync( @@ -20842,7 +19144,7 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->authenticateToBusinessAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -20862,39 +19164,18 @@ User DurableUserStore::getUser( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getUser( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::getUserAsync( @@ -20904,7 +19185,7 @@ AsyncResult * DurableUserStore::getUserAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getUserAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -20925,40 +19206,19 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getPublicUserInfo( username, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::getPublicUserInfoAsync( @@ -20969,7 +19229,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getPublicUserInfoAsync( username, ctx); @@ -20990,39 +19250,18 @@ UserUrls DurableUserStore::getUserUrls( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getUserUrls( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::getUserUrlsAsync( @@ -21032,7 +19271,7 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getUserUrlsAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -21053,39 +19292,19 @@ void DurableUserStore::inviteToBusiness( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->inviteToBusiness( emailAddress, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableUserStore::inviteToBusinessAsync( @@ -21096,7 +19315,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->inviteToBusinessAsync( emailAddress, ctx); @@ -21118,39 +19337,19 @@ void DurableUserStore::removeFromBusiness( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->removeFromBusiness( emailAddress, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableUserStore::removeFromBusinessAsync( @@ -21161,7 +19360,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->removeFromBusinessAsync( emailAddress, ctx); @@ -21184,40 +19383,20 @@ void DurableUserStore::updateBusinessUserIdentifier( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { m_service->updateBusinessUserIdentifier( oldEmailAddress, newEmailAddress, ctx); - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant(), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return; } AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( @@ -21229,7 +19408,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->updateBusinessUserIdentifierAsync( oldEmailAddress, newEmailAddress, @@ -21251,39 +19430,18 @@ QList DurableUserStore::listBusinessUsers( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listBusinessUsers( ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableUserStore::listBusinessUsersAsync( @@ -21293,7 +19451,7 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listBusinessUsersAsync( ctx); QObject::connect(res, &AsyncResult::finished, @@ -21314,40 +19472,19 @@ QList DurableUserStore::listBusinessInvitations( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->listBusinessInvitations( includeRequestedInvitations, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value>(); } AsyncResult * DurableUserStore::listBusinessInvitationsAsync( @@ -21358,7 +19495,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->listBusinessInvitationsAsync( includeRequestedInvitations, ctx); @@ -21380,40 +19517,19 @@ AccountLimits DurableUserStore::getAccountLimits( ctx = m_ctx; } - RetryState state; - state.m_retryCount = ctx->maxRequestRetryCount(); - while(state.m_retryCount) - { - try + auto call = DurableService::SyncServiceCall( + [&] (IRequestContextPtr ctx) { auto res = m_service->getAccountLimits( serviceLevel, ctx); - return res; - } - catch(...) - { - --state.m_retryCount; - if (!state.m_retryCount) { - throw; - } + return DurableService::SyncResult(QVariant::fromValue(res), {}); + }); - if (ctx->increaseRequestTimeoutExponentially()) { - quint64 maxRequestTimeout = ctx->maxRequestTimeout(); - quint64 timeout = exponentiallyIncreasedTimeoutMsec( - ctx->requestTimeout(), - maxRequestTimeout); - ctx = newRequestContext( - ctx->authenticationToken(), - timeout, - /* increase request timeout exponentially = */ true, - maxRequestTimeout, - ctx->maxRequestRetryCount()); - } - } - } + auto result = m_durableService.executeSyncRequest( + std::move(call), ctx); - throw EverCloudException("no retry attempts left"); + return result.first.value(); } AsyncResult * DurableUserStore::getAccountLimitsAsync( @@ -21424,7 +19540,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx = m_ctx; } - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = m_durableService.newAsyncResult(); auto res = m_service->getAccountLimitsAsync( serviceLevel, ctx); From 59034790458672a8f76f8f935e2f84cfb14ac4b3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 10 Oct 2019 07:34:51 +0300 Subject: [PATCH 021/188] Update generated code --- QEverCloud/src/generated/Services.cpp | 1771 ++++++++++++------------- 1 file changed, 841 insertions(+), 930 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 6ba93820..d6972753 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15415,17 +15415,16 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getSyncStateAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getSyncStateAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SyncChunk DurableNoteStore::getFilteredSyncChunk( @@ -15465,20 +15464,19 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getFilteredSyncChunkAsync( - afterUSN, - maxEntries, - filter, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SyncState DurableNoteStore::getLinkedNotebookSyncState( @@ -15512,18 +15510,17 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getLinkedNotebookSyncStateAsync( - linkedNotebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( @@ -15566,21 +15563,20 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getLinkedNotebookSyncChunkAsync( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listNotebooks( @@ -15611,17 +15607,16 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listNotebooksAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listNotebooksAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listAccessibleBusinessNotebooks( @@ -15652,17 +15647,16 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listAccessibleBusinessNotebooksAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listAccessibleBusinessNotebooksAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Notebook DurableNoteStore::getNotebook( @@ -15696,18 +15690,17 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNotebookAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNotebookAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Notebook DurableNoteStore::getDefaultNotebook( @@ -15738,17 +15731,16 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getDefaultNotebookAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getDefaultNotebookAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Notebook DurableNoteStore::createNotebook( @@ -15782,18 +15774,17 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createNotebookAsync( - notebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createNotebookAsync( + notebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateNotebook( @@ -15827,18 +15818,17 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateNotebookAsync( - notebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateNotebookAsync( + notebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::expungeNotebook( @@ -15872,18 +15862,17 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->expungeNotebookAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->expungeNotebookAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listTags( @@ -15914,17 +15903,16 @@ AsyncResult * DurableNoteStore::listTagsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listTagsAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listTagsAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listTagsByNotebook( @@ -15958,18 +15946,17 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listTagsByNotebookAsync( - notebookGuid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listTagsByNotebookAsync( + notebookGuid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Tag DurableNoteStore::getTag( @@ -16003,18 +15990,17 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getTagAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getTagAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Tag DurableNoteStore::createTag( @@ -16048,18 +16034,17 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createTagAsync( - tag, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createTagAsync( + tag, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateTag( @@ -16093,18 +16078,17 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateTagAsync( - tag, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateTagAsync( + tag, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableNoteStore::untagAll( @@ -16138,18 +16122,17 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->untagAllAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->untagAllAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::expungeTag( @@ -16183,18 +16166,17 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->expungeTagAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->expungeTagAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listSearches( @@ -16225,17 +16207,16 @@ AsyncResult * DurableNoteStore::listSearchesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listSearchesAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listSearchesAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SavedSearch DurableNoteStore::getSearch( @@ -16269,18 +16250,17 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getSearchAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getSearchAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SavedSearch DurableNoteStore::createSearch( @@ -16314,18 +16294,17 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createSearchAsync( - search, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createSearchAsync( + search, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateSearch( @@ -16359,18 +16338,17 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateSearchAsync( - search, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateSearchAsync( + search, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::expungeSearch( @@ -16404,18 +16382,17 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->expungeSearchAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->expungeSearchAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::findNoteOffset( @@ -16452,19 +16429,18 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->findNoteOffsetAsync( - filter, - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->findNoteOffsetAsync( + filter, + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } NotesMetadataList DurableNoteStore::findNotesMetadata( @@ -16507,21 +16483,20 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->findNotesMetadataAsync( - filter, - offset, - maxNotes, - resultSpec, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } NoteCollectionCounts DurableNoteStore::findNoteCounts( @@ -16558,19 +16533,18 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->findNoteCountsAsync( - filter, - withTrash, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->findNoteCountsAsync( + filter, + withTrash, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::getNoteWithResultSpec( @@ -16607,19 +16581,18 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteWithResultSpecAsync( - guid, - resultSpec, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::getNote( @@ -16665,22 +16638,21 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteAsync( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } LazyMap DurableNoteStore::getNoteApplicationData( @@ -16714,18 +16686,17 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteApplicationDataAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteApplicationDataAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::getNoteApplicationDataEntry( @@ -16762,19 +16733,18 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteApplicationDataEntryAsync( - guid, - key, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::setNoteApplicationDataEntry( @@ -16814,20 +16784,19 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->setNoteApplicationDataEntryAsync( - guid, - key, - value, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::unsetNoteApplicationDataEntry( @@ -16864,19 +16833,18 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->unsetNoteApplicationDataEntryAsync( - guid, - key, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::getNoteContent( @@ -16910,18 +16878,17 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteContentAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteContentAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::getNoteSearchText( @@ -16961,20 +16928,19 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteSearchTextAsync( - guid, - noteOnly, - tokenizeForIndexing, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::getResourceSearchText( @@ -17008,18 +16974,17 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceSearchTextAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceSearchTextAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QStringList DurableNoteStore::getNoteTagNames( @@ -17053,18 +17018,17 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteTagNamesAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteTagNamesAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::createNote( @@ -17098,18 +17062,17 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createNoteAsync( - note, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createNoteAsync( + note, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::updateNote( @@ -17143,18 +17106,17 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateNoteAsync( - note, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateNoteAsync( + note, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::deleteNote( @@ -17188,18 +17150,17 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->deleteNoteAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->deleteNoteAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::expungeNote( @@ -17233,18 +17194,17 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->expungeNoteAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->expungeNoteAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::copyNote( @@ -17281,19 +17241,18 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->copyNoteAsync( - noteGuid, - toNotebookGuid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->copyNoteAsync( + noteGuid, + toNotebookGuid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listNoteVersions( @@ -17327,18 +17286,17 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listNoteVersionsAsync( - noteGuid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listNoteVersionsAsync( + noteGuid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Note DurableNoteStore::getNoteVersion( @@ -17384,22 +17342,21 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNoteVersionAsync( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Resource DurableNoteStore::getResource( @@ -17445,22 +17402,21 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceAsync( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } LazyMap DurableNoteStore::getResourceApplicationData( @@ -17494,18 +17450,17 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceApplicationDataAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceApplicationDataAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::getResourceApplicationDataEntry( @@ -17542,19 +17497,18 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceApplicationDataEntryAsync( - guid, - key, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceApplicationDataEntryAsync( + guid, + key, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::setResourceApplicationDataEntry( @@ -17594,20 +17548,19 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->setResourceApplicationDataEntryAsync( - guid, - key, - value, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->setResourceApplicationDataEntryAsync( + guid, + key, + value, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::unsetResourceApplicationDataEntry( @@ -17644,19 +17597,18 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->unsetResourceApplicationDataEntryAsync( - guid, - key, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->unsetResourceApplicationDataEntryAsync( + guid, + key, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateResource( @@ -17690,18 +17642,17 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateResourceAsync( - resource, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateResourceAsync( + resource, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QByteArray DurableNoteStore::getResourceData( @@ -17735,18 +17686,17 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceDataAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceDataAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Resource DurableNoteStore::getResourceByHash( @@ -17792,22 +17742,21 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceByHashAsync( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QByteArray DurableNoteStore::getResourceRecognition( @@ -17841,18 +17790,17 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceRecognitionAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceRecognitionAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QByteArray DurableNoteStore::getResourceAlternateData( @@ -17886,18 +17834,17 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceAlternateDataAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceAlternateDataAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } ResourceAttributes DurableNoteStore::getResourceAttributes( @@ -17931,18 +17878,17 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getResourceAttributesAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getResourceAttributesAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Notebook DurableNoteStore::getPublicNotebook( @@ -17979,19 +17925,18 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getPublicNotebookAsync( - userId, - publicUri, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getPublicNotebookAsync( + userId, + publicUri, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SharedNotebook DurableNoteStore::shareNotebook( @@ -18028,19 +17973,18 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->shareNotebookAsync( - sharedNotebook, - message, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->shareNotebookAsync( + sharedNotebook, + message, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShares( @@ -18074,18 +18018,17 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createOrUpdateNotebookSharesAsync( - shareTemplate, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createOrUpdateNotebookSharesAsync( + shareTemplate, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateSharedNotebook( @@ -18119,18 +18062,17 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateSharedNotebookAsync( - sharedNotebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateSharedNotebookAsync( + sharedNotebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } Notebook DurableNoteStore::setNotebookRecipientSettings( @@ -18167,19 +18109,18 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->setNotebookRecipientSettingsAsync( - notebookGuid, - recipientSettings, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listSharedNotebooks( @@ -18210,17 +18151,16 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listSharedNotebooksAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listSharedNotebooksAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } LinkedNotebook DurableNoteStore::createLinkedNotebook( @@ -18254,18 +18194,17 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->createLinkedNotebookAsync( - linkedNotebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->createLinkedNotebookAsync( + linkedNotebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::updateLinkedNotebook( @@ -18299,18 +18238,17 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateLinkedNotebookAsync( - linkedNotebook, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateLinkedNotebookAsync( + linkedNotebook, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableNoteStore::listLinkedNotebooks( @@ -18341,17 +18279,16 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listLinkedNotebooksAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listLinkedNotebooksAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } qint32 DurableNoteStore::expungeLinkedNotebook( @@ -18385,18 +18322,17 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->expungeLinkedNotebookAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->expungeLinkedNotebookAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( @@ -18430,18 +18366,17 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->authenticateToSharedNotebookAsync( - shareKeyOrGlobalId, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } SharedNotebook DurableNoteStore::getSharedNotebookByAuth( @@ -18472,17 +18407,16 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getSharedNotebookByAuthAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getSharedNotebookByAuthAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableNoteStore::emailNote( @@ -18516,18 +18450,17 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->emailNoteAsync( - parameters, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->emailNoteAsync( + parameters, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QString DurableNoteStore::shareNote( @@ -18561,18 +18494,17 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->shareNoteAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->shareNoteAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableNoteStore::stopSharingNote( @@ -18606,18 +18538,17 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->stopSharingNoteAsync( - guid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->stopSharingNoteAsync( + guid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AuthenticationResult DurableNoteStore::authenticateToSharedNote( @@ -18654,19 +18585,18 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->authenticateToSharedNoteAsync( - guid, - noteKey, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->authenticateToSharedNoteAsync( + guid, + noteKey, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } RelatedResult DurableNoteStore::findRelated( @@ -18703,19 +18633,18 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->findRelatedAsync( - query, - resultSpec, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->findRelatedAsync( + query, + resultSpec, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( @@ -18749,18 +18678,17 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateNoteIfUsnMatchesAsync( - note, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateNoteIfUsnMatchesAsync( + note, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( @@ -18794,18 +18722,17 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->manageNotebookSharesAsync( - parameters, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->manageNotebookSharesAsync( + parameters, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } ShareRelationships DurableNoteStore::getNotebookShares( @@ -18839,18 +18766,17 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getNotebookSharesAsync( - notebookGuid, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getNotebookSharesAsync( + notebookGuid, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } //////////////////////////////////////////////////////////////////////////////// @@ -18892,20 +18818,19 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->checkVersionAsync( - clientName, - edamVersionMajor, - edamVersionMinor, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->checkVersionAsync( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } BootstrapInfo DurableUserStore::getBootstrapInfo( @@ -18939,18 +18864,17 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getBootstrapInfoAsync( - locale, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getBootstrapInfoAsync( + locale, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AuthenticationResult DurableUserStore::authenticateLongSession( @@ -19002,24 +18926,23 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->authenticateLongSessionAsync( - username, - password, - consumerKey, - consumerSecret, - deviceIdentifier, - deviceDescription, - supportsTwoFactor, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( @@ -19059,20 +18982,19 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->completeTwoFactorAuthenticationAsync( - oneTimeCode, - deviceIdentifier, - deviceDescription, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableUserStore::revokeLongSession( @@ -19103,17 +19025,16 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->revokeLongSessionAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->revokeLongSessionAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AuthenticationResult DurableUserStore::authenticateToBusiness( @@ -19144,17 +19065,16 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->authenticateToBusinessAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->authenticateToBusinessAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } User DurableUserStore::getUser( @@ -19185,17 +19105,16 @@ AsyncResult * DurableUserStore::getUserAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getUserAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getUserAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } PublicUserInfo DurableUserStore::getPublicUserInfo( @@ -19229,18 +19148,17 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getPublicUserInfoAsync( - username, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getPublicUserInfoAsync( + username, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } UserUrls DurableUserStore::getUserUrls( @@ -19271,17 +19189,16 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getUserUrlsAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getUserUrlsAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableUserStore::inviteToBusiness( @@ -19315,18 +19232,17 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->inviteToBusinessAsync( - emailAddress, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->inviteToBusinessAsync( + emailAddress, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableUserStore::removeFromBusiness( @@ -19360,18 +19276,17 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->removeFromBusinessAsync( - emailAddress, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->removeFromBusinessAsync( + emailAddress, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } void DurableUserStore::updateBusinessUserIdentifier( @@ -19408,19 +19323,18 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->updateBusinessUserIdentifierAsync( - oldEmailAddress, - newEmailAddress, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableUserStore::listBusinessUsers( @@ -19451,17 +19365,16 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listBusinessUsersAsync( - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listBusinessUsersAsync( + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } QList DurableUserStore::listBusinessInvitations( @@ -19495,18 +19408,17 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->listBusinessInvitationsAsync( - includeRequestedInvitations, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->listBusinessInvitationsAsync( + includeRequestedInvitations, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } AccountLimits DurableUserStore::getAccountLimits( @@ -19540,18 +19452,17 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx = m_ctx; } - AsyncResult * result = m_durableService.newAsyncResult(); - auto res = m_service->getAccountLimitsAsync( - serviceLevel, - ctx); - QObject::connect(res, &AsyncResult::finished, - [=] (QVariant result, QSharedPointer error) { - Q_UNUSED(result) - Q_UNUSED(error) - // TODO: implement + auto call = DurableService::AsyncServiceCall( + [=, service=m_service] (IRequestContextPtr ctx) + { + return service->getAccountLimitsAsync( + serviceLevel, + ctx); }); - return result; + return m_durableService.executeAsyncRequest( + std::move(call), ctx); + } //////////////////////////////////////////////////////////////////////////////// From 16264cd3dbb7c4b1fc4c4c88fdc2077e9e36863d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 10 Oct 2019 07:37:30 +0300 Subject: [PATCH 022/188] Remove not actually needed code for creating AsyncResult via DurableService --- QEverCloud/src/DurableService.cpp | 5 ----- QEverCloud/src/DurableService.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 49b29c02..8342efc8 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -36,11 +36,6 @@ DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr c m_ctx(std::move(ctx)) {} -AsyncResult * DurableService::newAsyncResult() -{ - return new AsyncResult; -} - DurableService::SyncResult DurableService::executeSyncRequest( SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) { diff --git a/QEverCloud/src/DurableService.h b/QEverCloud/src/DurableService.h index 675854b6..a8545eac 100644 --- a/QEverCloud/src/DurableService.h +++ b/QEverCloud/src/DurableService.h @@ -51,8 +51,6 @@ class Q_DECL_HIDDEN DurableService: public QObject public: DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); - AsyncResult * newAsyncResult(); - SyncResult executeSyncRequest( SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); From b05ef12e907ed14702191223b59b1c49bcf64f45 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 11:53:52 +0300 Subject: [PATCH 023/188] Split single TestQEverCloud source into several ones So that each test gets its own source file --- QEverCloud/CMakeLists.txt | 5 +- QEverCloud/src/AsyncResult.cpp | 1 - QEverCloud/src/tests/TestOptional.cpp | 101 +++++++++++++++++++ QEverCloud/src/tests/TestQEverCloud.cpp | 128 +++--------------------- QEverCloud/src/tests/TestQEverCloud.h | 36 +++++++ 5 files changed, 156 insertions(+), 115 deletions(-) create mode 100644 QEverCloud/src/tests/TestOptional.cpp create mode 100644 QEverCloud/src/tests/TestQEverCloud.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 51de8280..bfd84b40 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -136,9 +136,12 @@ add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM # Tests find_package(Qt5Test QUIET) if(Qt5Test_FOUND) + set(TEST_HEADERS + src/tests/TestQEverCloud.h) set(TEST_SOURCES + src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp) - add_executable(test_${PROJECT_NAME} ${TEST_SOURCES}) + add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) set_target_properties(test_${PROJECT_NAME} PROPERTIES diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 820ce5a6..7c2ed7a1 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -20,7 +20,6 @@ namespace qevercloud { - QVariant AsyncResult::asIs(QByteArray replyData) { return replyData; diff --git a/QEverCloud/src/tests/TestOptional.cpp b/QEverCloud/src/tests/TestOptional.cpp new file mode 100644 index 00000000..518a7a9e --- /dev/null +++ b/QEverCloud/src/tests/TestOptional.cpp @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#include "TestQEverCloud.h" + +#include +#include + +namespace qevercloud { + +void TestEverCloudTest::testOptional() +{ + Optional i; + QVERIFY(!i.isSet()); + + i = 10; + QVERIFY(i.isSet()); + QVERIFY(i == 10); + i.clear(); + QVERIFY(!i.isSet()); + + i.init().ref() = 11; + QVERIFY(i == 11); + static_cast(i) = 12; + QVERIFY(i == 12); + + const Optional ic = ' '; + QVERIFY(ic == 32); + + i.clear(); + i.init(); + QVERIFY2(i.isSet() && i == int(), "i.isSet() && i == int()"); + + i.clear(); + bool exception = false; + try { + qDebug() << i; + } + catch(const EverCloudException &) { + exception = true; + } + QVERIFY(exception); + + Optional y, k = 10; + y = k; + QVERIFY(y == 10); + Optional d; + d = y; + QVERIFY(d == 10); + d = ' '; + QVERIFY(d == 32); + + Optional d2(y), d3(' '), d4(d); + QVERIFY(d2 == 10); + QVERIFY(d3 == 32); + QVERIFY(d4 == d); + + Optional oi; + Optional od; + QVERIFY(oi.isEqual(od)); oi = 1; + QVERIFY(!oi.isEqual(od)); + od = 1; + QVERIFY(oi.isEqual(od)); + oi = 2; + QVERIFY(!oi.isEqual(od)); + + Note n1, n2; + QVERIFY(n1 == n2); + n1.guid = QStringLiteral("12345"); + QVERIFY(n1 != n2); + n2.guid = n1.guid; + QVERIFY(n1 == n2); + +#if defined(Q_COMPILER_RVALUE_REFS) && !defined(_MSC_VER) + Optional oi1, oi2; + oi1 = 10; + oi2 = std::move(oi1); + QVERIFY(oi2 == 10); + QVERIFY(!oi1.isSet()); + + Note note1, note2; + note1.guid = QStringLiteral("12345"); + QVERIFY(note1.guid.isSet()); + QVERIFY(!note2.guid.isSet()); + note2 = std::move(note1); + QVERIFY(note2.guid.isSet()); + QVERIFY(!note1.guid.isSet()); +#endif + + Optional t; + t = 0; + t = Timestamp(0); + QVERIFY(t.ref() == Timestamp(0)); +} + +} // namespace qevercloud diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index b25392d7..9ea172c1 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -1,126 +1,28 @@ -#include -#include -#include +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ -#ifdef QEVERCLOUD_SHARED_LIBRARY -#undef QEVERCLOUD_SHARED_LIBRARY -#endif - -#ifdef QEVERCLOUD_STATIC_LIBRARY -#undef QEVERCLOUD_STATIC_LIBRARY -#endif - -#include -#include - -class TestEverCloudTest: public QObject -{ - Q_OBJECT -public: - TestEverCloudTest(); +#include "TestQEverCloud.h" -private Q_SLOTS: - void testOptional(); -}; +namespace qevercloud { -TestEverCloudTest::TestEverCloudTest() +TestEverCloudTest::TestEverCloudTest(QObject * parent) : + QObject(parent) {} -using namespace qevercloud; - -void TestEverCloudTest::testOptional() -{ - Optional i; - QVERIFY(!i.isSet()); - - i = 10; - QVERIFY(i.isSet()); - QVERIFY(i == 10); - i.clear(); - QVERIFY(!i.isSet()); - - i.init().ref() = 11; - QVERIFY(i == 11); - static_cast(i) = 12; - QVERIFY(i == 12); - - const Optional ic = ' '; - QVERIFY(ic == 32); - - i.clear(); - i.init(); - QVERIFY2(i.isSet() && i == int(), "i.isSet() && i == int()"); - - i.clear(); - bool exception = false; - try { - qDebug() << i; - } - catch(const EverCloudException &) { - exception = true; - } - QVERIFY(exception); - - Optional y, k = 10; - y = k; - QVERIFY(y == 10); - Optional d; - d = y; - QVERIFY(d == 10); - d = ' '; - QVERIFY(d == 32); - - Optional d2(y), d3(' '), d4(d); - QVERIFY(d2 == 10); - QVERIFY(d3 == 32); - QVERIFY(d4 == d); - - Optional oi; - Optional od; - QVERIFY(oi.isEqual(od)); oi = 1; - QVERIFY(!oi.isEqual(od)); - od = 1; - QVERIFY(oi.isEqual(od)); - oi = 2; - QVERIFY(!oi.isEqual(od)); - - Note n1, n2; - QVERIFY(n1 == n2); - n1.guid = QStringLiteral("12345"); - QVERIFY(n1 != n2); - n2.guid = n1.guid; - QVERIFY(n1 == n2); - -#if defined(Q_COMPILER_RVALUE_REFS) && !defined(_MSC_VER) - Optional oi1, oi2; - oi1 = 10; - oi2 = std::move(oi1); - QVERIFY(oi2 == 10); - QVERIFY(!oi1.isSet()); - - Note note1, note2; - note1.guid = QStringLiteral("12345"); - QVERIFY(note1.guid.isSet()); - QVERIFY(!note2.guid.isSet()); - note2 = std::move(note1); - QVERIFY(note2.guid.isSet()); - QVERIFY(!note1.guid.isSet()); -#endif - - Optional t; - t = 0; - t = Timestamp(0); - QVERIFY(t.ref() == Timestamp(0)); -} +} // namespace qevercloud #if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) #ifdef QT_GUI_LIB #undef QT_GUI_LIB -QTEST_MAIN(TestEverCloudTest) +QTEST_MAIN(qevercloud::TestEverCloudTest) #define QT_GUI_LIB #endif // QT_GUI_LIB #else -QTEST_GUILESS_MAIN(TestEverCloudTest) +QTEST_GUILESS_MAIN(qevercloud::TestEverCloudTest) #endif - -#include "TestQEverCloud.moc" diff --git a/QEverCloud/src/tests/TestQEverCloud.h b/QEverCloud/src/tests/TestQEverCloud.h new file mode 100644 index 00000000..9d5e5e49 --- /dev/null +++ b/QEverCloud/src/tests/TestQEverCloud.h @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_TEST_QEVERCLOUD_H +#define QEVERCLOUD_TEST_QEVERCLOUD_H + +#include + +#ifdef QEVERCLOUD_SHARED_LIBRARY +#undef QEVERCLOUD_SHARED_LIBRARY +#endif + +#ifdef QEVERCLOUD_STATIC_LIBRARY +#undef QEVERCLOUD_STATIC_LIBRARY +#endif + +namespace qevercloud { + +class TestEverCloudTest: public QObject +{ + Q_OBJECT +public: + TestEverCloudTest(QObject * parent = nullptr); + +private Q_SLOTS: + void testOptional(); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_TEST_QEVERCLOUD_H From 509fb9cb549e7a8d4675924988ac0ecfb3314cdd Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 12:30:18 +0300 Subject: [PATCH 024/188] Rearrange DurableService, make its interface public for ease of testing --- QEverCloud/CMakeLists.txt | 2 +- QEverCloud/headers/AsyncResult.h | 5 - QEverCloud/{src => headers}/DurableService.h | 47 +- QEverCloud/src/AsyncResult.cpp | 9 +- QEverCloud/src/AsyncResult_p.cpp | 5 - QEverCloud/src/AsyncResult_p.h | 2 - QEverCloud/src/DurableService.cpp | 98 +- QEverCloud/src/generated/Services.cpp | 900 +++++++++---------- 8 files changed, 540 insertions(+), 528 deletions(-) rename QEverCloud/{src => headers}/DurableService.h (60%) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index bfd84b40..4d808c8a 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -15,6 +15,7 @@ endif() set(NON_GENERATED_HEADERS headers/AsyncResult.h + headers/DurableService.h headers/EventLoopFinisher.h headers/EverCloudException.h headers/Export.h @@ -39,7 +40,6 @@ set(GENERATED_HEADERS set(PRIVATE_HEADERS src/AsyncResult_p.h - src/DurableService.h src/Http.h src/Impl.h src/Thrift.h diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 0003a78a..ce3e681e 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -53,11 +53,6 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject private: static QVariant asIs(QByteArray replyData); - /** - * Constructor for use by QEverCloud internals only - */ - AsyncResult(bool autoDelete = true, QObject * parent = nullptr); - public: typedef QVariant (*ReadFunctionType)(QByteArray replyData); diff --git a/QEverCloud/src/DurableService.h b/QEverCloud/headers/DurableService.h similarity index 60% rename from QEverCloud/src/DurableService.h rename to QEverCloud/headers/DurableService.h index a8545eac..51b82705 100644 --- a/QEverCloud/src/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -8,8 +8,9 @@ #ifndef QEVERCLOUD_DURABLE_SERVICE_H #define QEVERCLOUD_DURABLE_SERVICE_H -#include -#include +#include "AsyncResult.h" +#include "Export.h" +#include "RequestContext.h" #include #include @@ -22,15 +23,7 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -struct Q_DECL_HIDDEN RetryState -{ - qint64 m_started = QDateTime::currentMSecsSinceEpoch(); - quint32 m_retryCount = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct Q_DECL_HIDDEN IRetryPolicy +struct QEVERCLOUD_EXPORT IRetryPolicy { virtual bool shouldRetry( QSharedPointer exceptionData) = 0; @@ -40,36 +33,32 @@ using IRetryPolicyPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// -class Q_DECL_HIDDEN DurableService: public QObject +QT_FORWARD_DECLARE_CLASS(DurableServicePrivate) + +class QEVERCLOUD_EXPORT IDurableService { - Q_OBJECT public: using SyncResult = std::pair>; using SyncServiceCall = std::function; using AsyncServiceCall = std::function; public: - DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); + virtual SyncResult executeSyncRequest( + SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) = 0; - SyncResult executeSyncRequest( - SyncServiceCall && syncServiceCall, IRequestContextPtr ctx); - - AsyncResult * executeAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx); - -private: - void doExecuteAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, - RetryState && retryState, AsyncResult * result); - -private: - IRetryPolicyPtr m_retryPolicy; - IRequestContextPtr m_ctx; + virtual AsyncResult * executeAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) = 0; }; +using IDurableServicePtr = std::shared_ptr; + //////////////////////////////////////////////////////////////////////////////// -IRetryPolicyPtr newRetryPolicy(); +QEVERCLOUD_EXPORT IRetryPolicyPtr newRetryPolicy(); + +QEVERCLOUD_EXPORT IDurableServicePtr newDurableService( + IRetryPolicyPtr = {}, + IRequestContextPtr = {}); } // namespace qevercloud diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 7c2ed7a1..56b28234 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -25,18 +25,15 @@ QVariant AsyncResult::asIs(QByteArray replyData) return replyData; } -AsyncResult::AsyncResult(bool autoDelete, QObject * parent) : - QObject(parent), - d_ptr(new AsyncResultPrivate(autoDelete, this)) -{} - AsyncResult::AsyncResult(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate(url, postData, readFunction, autoDelete, this)) { - QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); + if (!url.isEmpty()) { + QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); + } } AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 7d14a415..603b3a0c 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -11,11 +11,6 @@ namespace qevercloud { -AsyncResultPrivate::AsyncResultPrivate(bool autoDelete, AsyncResult * q) : - m_autoDelete(autoDelete), - q_ptr(q) -{} - AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 20ea1f69..b845060f 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -17,8 +17,6 @@ class AsyncResultPrivate: public QObject { Q_OBJECT public: - explicit AsyncResultPrivate(bool autoDelete, AsyncResult * q); - explicit AsyncResultPrivate(QString url, QByteArray postData, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 8342efc8..badfb1b9 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -6,8 +6,8 @@ */ #include "AsyncResult_p.h" -#include "DurableService.h" +#include #include #include @@ -19,6 +19,14 @@ namespace { //////////////////////////////////////////////////////////////////////////////// +struct RetryState +{ + qint64 m_started = QDateTime::currentMSecsSinceEpoch(); + quint32 m_retryCount = 0; +}; + +//////////////////////////////////////////////////////////////////////////////// + quint64 exponentiallyIncreasedTimeoutMsec( quint64 timeout, const quint64 maxTimeout) { @@ -27,11 +35,60 @@ quint64 exponentiallyIncreasedTimeoutMsec( return timeout; } +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy +{ + virtual bool shouldRetry( + QSharedPointer exceptionData) override + { + if (Q_UNLIKELY(exceptionData.isNull())) { + return true; + } + + try { + exceptionData->throwException(); + } + catch(const ThriftException &) { + return true; + } + catch(const EDAMSystemException &) { + return true; + } + catch(...) { + } + + return false; + } +}; + } // namespace //////////////////////////////////////////////////////////////////////////////// -DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) : +class Q_DECL_HIDDEN DurableService: public IDurableService +{ +public: + DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); + + virtual SyncResult executeSyncRequest( + SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) override; + + virtual AsyncResult * executeAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) override; + +private: + void doExecuteAsyncRequest( + AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + RetryState && retryState, AsyncResult * result); + +private: + IRetryPolicyPtr m_retryPolicy; + IRequestContextPtr m_ctx; +}; + +DurableService::DurableService(IRetryPolicyPtr retryPolicy, + IRequestContextPtr ctx) : m_retryPolicy(std::move(retryPolicy)), m_ctx(std::move(ctx)) {} @@ -103,7 +160,7 @@ AsyncResult * DurableService::executeAsyncRequest( RetryState state; state.m_retryCount = ctx->maxRequestRetryCount(); - AsyncResult * result = new AsyncResult; + AsyncResult * result = new AsyncResult(QString(), QByteArray()); doExecuteAsyncRequest(std::move(asyncServiceCall), std::move(ctx), std::move(state), result); @@ -163,36 +220,17 @@ void DurableService::doExecuteAsyncRequest( //////////////////////////////////////////////////////////////////////////////// -struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy -{ - virtual bool shouldRetry( - QSharedPointer exceptionData) override - { - if (Q_UNLIKELY(exceptionData.isNull())) { - return true; - } - - try { - exceptionData->throwException(); - } - catch(const ThriftException &) { - return true; - } - catch(const EDAMSystemException &) { - return true; - } - catch(...) { - } - - return false; - } -}; - -//////////////////////////////////////////////////////////////////////////////// - IRetryPolicyPtr newRetryPolicy() { return std::make_shared(); } +IDurableServicePtr newDurableService( + IRetryPolicyPtr retryPolicy, + IRequestContextPtr ctx) +{ + return std::make_shared( + retryPolicy, ctx); +} + } // namespace qevercloud diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index d6972753..f0b20ec6 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -11,9 +11,9 @@ #include #include "../Impl.h" -#include "../DurableService.h" #include "../Impl.h" #include "Types_io.h" +#include #include #include #include @@ -14551,7 +14551,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore QObject * parent = nullptr) : INoteStore(parent), m_service(std::move(service)), - m_durableService(newRetryPolicy(), ctx), + m_durableService(newDurableService(newRetryPolicy(), ctx)), m_ctx(std::move(ctx)) { if (!m_ctx) { @@ -15221,7 +15221,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore private: INoteStorePtr m_service; - DurableService m_durableService; + IDurableServicePtr m_durableService; IRequestContextPtr m_ctx; }; @@ -15238,7 +15238,7 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore QObject * parent = nullptr) : IUserStore(parent), m_service(std::move(service)), - m_durableService(newRetryPolicy(), ctx), + m_durableService(newDurableService(newRetryPolicy(), ctx)), m_ctx(std::move(ctx)) { if (!m_ctx) { @@ -15381,7 +15381,7 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore private: IUserStorePtr m_service; - DurableService m_durableService; + IDurableServicePtr m_durableService; IRequestContextPtr m_ctx; }; @@ -15394,15 +15394,15 @@ SyncState DurableNoteStore::getSyncState( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getSyncState( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15415,14 +15415,14 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getSyncStateAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15437,7 +15437,7 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getFilteredSyncChunk( @@ -15445,10 +15445,10 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( maxEntries, filter, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15464,7 +15464,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getFilteredSyncChunkAsync( @@ -15474,7 +15474,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15487,16 +15487,16 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getLinkedNotebookSyncState( linkedNotebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15510,7 +15510,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getLinkedNotebookSyncStateAsync( @@ -15518,7 +15518,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15534,7 +15534,7 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getLinkedNotebookSyncChunk( @@ -15543,10 +15543,10 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( maxEntries, fullSyncOnly, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15563,7 +15563,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getLinkedNotebookSyncChunkAsync( @@ -15574,7 +15574,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15586,15 +15586,15 @@ QList DurableNoteStore::listNotebooks( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listNotebooks( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -15607,14 +15607,14 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listNotebooksAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15626,15 +15626,15 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listAccessibleBusinessNotebooks( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -15647,14 +15647,14 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listAccessibleBusinessNotebooksAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15667,16 +15667,16 @@ Notebook DurableNoteStore::getNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNotebook( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15690,7 +15690,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNotebookAsync( @@ -15698,7 +15698,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15710,15 +15710,15 @@ Notebook DurableNoteStore::getDefaultNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getDefaultNotebook( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15731,14 +15731,14 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getDefaultNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15751,16 +15751,16 @@ Notebook DurableNoteStore::createNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createNotebook( notebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15774,7 +15774,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createNotebookAsync( @@ -15782,7 +15782,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15795,16 +15795,16 @@ qint32 DurableNoteStore::updateNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateNotebook( notebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15818,7 +15818,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateNotebookAsync( @@ -15826,7 +15826,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15839,16 +15839,16 @@ qint32 DurableNoteStore::expungeNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->expungeNotebook( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15862,7 +15862,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->expungeNotebookAsync( @@ -15870,7 +15870,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15882,15 +15882,15 @@ QList DurableNoteStore::listTags( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listTags( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -15903,14 +15903,14 @@ AsyncResult * DurableNoteStore::listTagsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listTagsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15923,16 +15923,16 @@ QList DurableNoteStore::listTagsByNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listTagsByNotebook( notebookGuid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -15946,7 +15946,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listTagsByNotebookAsync( @@ -15954,7 +15954,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -15967,16 +15967,16 @@ Tag DurableNoteStore::getTag( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getTag( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -15990,7 +15990,7 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getTagAsync( @@ -15998,7 +15998,7 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16011,16 +16011,16 @@ Tag DurableNoteStore::createTag( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createTag( tag, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16034,7 +16034,7 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createTagAsync( @@ -16042,7 +16042,7 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16055,16 +16055,16 @@ qint32 DurableNoteStore::updateTag( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateTag( tag, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16078,7 +16078,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateTagAsync( @@ -16086,7 +16086,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16099,16 +16099,16 @@ void DurableNoteStore::untagAll( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->untagAll( guid, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -16122,7 +16122,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->untagAllAsync( @@ -16130,7 +16130,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16143,16 +16143,16 @@ qint32 DurableNoteStore::expungeTag( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->expungeTag( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16166,7 +16166,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->expungeTagAsync( @@ -16174,7 +16174,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16186,15 +16186,15 @@ QList DurableNoteStore::listSearches( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listSearches( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -16207,14 +16207,14 @@ AsyncResult * DurableNoteStore::listSearchesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listSearchesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16227,16 +16227,16 @@ SavedSearch DurableNoteStore::getSearch( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getSearch( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16250,7 +16250,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getSearchAsync( @@ -16258,7 +16258,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16271,16 +16271,16 @@ SavedSearch DurableNoteStore::createSearch( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createSearch( search, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16294,7 +16294,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createSearchAsync( @@ -16302,7 +16302,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16315,16 +16315,16 @@ qint32 DurableNoteStore::updateSearch( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateSearch( search, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16338,7 +16338,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateSearchAsync( @@ -16346,7 +16346,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16359,16 +16359,16 @@ qint32 DurableNoteStore::expungeSearch( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->expungeSearch( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16382,7 +16382,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->expungeSearchAsync( @@ -16390,7 +16390,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16404,17 +16404,17 @@ qint32 DurableNoteStore::findNoteOffset( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->findNoteOffset( filter, guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16429,7 +16429,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->findNoteOffsetAsync( @@ -16438,7 +16438,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16454,7 +16454,7 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->findNotesMetadata( @@ -16463,10 +16463,10 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( maxNotes, resultSpec, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16483,7 +16483,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->findNotesMetadataAsync( @@ -16494,7 +16494,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16508,17 +16508,17 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->findNoteCounts( filter, withTrash, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16533,7 +16533,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->findNoteCountsAsync( @@ -16542,7 +16542,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16556,17 +16556,17 @@ Note DurableNoteStore::getNoteWithResultSpec( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteWithResultSpec( guid, resultSpec, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16581,7 +16581,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteWithResultSpecAsync( @@ -16590,7 +16590,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16607,7 +16607,7 @@ Note DurableNoteStore::getNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNote( @@ -16617,10 +16617,10 @@ Note DurableNoteStore::getNote( withResourcesRecognition, withResourcesAlternateData, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16638,7 +16638,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteAsync( @@ -16650,7 +16650,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16663,16 +16663,16 @@ LazyMap DurableNoteStore::getNoteApplicationData( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteApplicationData( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16686,7 +16686,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteApplicationDataAsync( @@ -16694,7 +16694,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16708,17 +16708,17 @@ QString DurableNoteStore::getNoteApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteApplicationDataEntry( guid, key, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -16733,7 +16733,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteApplicationDataEntryAsync( @@ -16742,7 +16742,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16757,7 +16757,7 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->setNoteApplicationDataEntry( @@ -16765,10 +16765,10 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( key, value, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16784,7 +16784,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->setNoteApplicationDataEntryAsync( @@ -16794,7 +16794,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16808,17 +16808,17 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->unsetNoteApplicationDataEntry( guid, key, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -16833,7 +16833,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->unsetNoteApplicationDataEntryAsync( @@ -16842,7 +16842,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16855,16 +16855,16 @@ QString DurableNoteStore::getNoteContent( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteContent( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -16878,7 +16878,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteContentAsync( @@ -16886,7 +16886,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16901,7 +16901,7 @@ QString DurableNoteStore::getNoteSearchText( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteSearchText( @@ -16909,10 +16909,10 @@ QString DurableNoteStore::getNoteSearchText( noteOnly, tokenizeForIndexing, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -16928,7 +16928,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteSearchTextAsync( @@ -16938,7 +16938,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16951,16 +16951,16 @@ QString DurableNoteStore::getResourceSearchText( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceSearchText( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -16974,7 +16974,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceSearchTextAsync( @@ -16982,7 +16982,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -16995,16 +16995,16 @@ QStringList DurableNoteStore::getNoteTagNames( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteTagNames( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toStringList(); @@ -17018,7 +17018,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteTagNamesAsync( @@ -17026,7 +17026,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17039,16 +17039,16 @@ Note DurableNoteStore::createNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createNote( note, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17062,7 +17062,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createNoteAsync( @@ -17070,7 +17070,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17083,16 +17083,16 @@ Note DurableNoteStore::updateNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateNote( note, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17106,7 +17106,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateNoteAsync( @@ -17114,7 +17114,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17127,16 +17127,16 @@ qint32 DurableNoteStore::deleteNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->deleteNote( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17150,7 +17150,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->deleteNoteAsync( @@ -17158,7 +17158,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17171,16 +17171,16 @@ qint32 DurableNoteStore::expungeNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->expungeNote( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17194,7 +17194,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->expungeNoteAsync( @@ -17202,7 +17202,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17216,17 +17216,17 @@ Note DurableNoteStore::copyNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->copyNote( noteGuid, toNotebookGuid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17241,7 +17241,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->copyNoteAsync( @@ -17250,7 +17250,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17263,16 +17263,16 @@ QList DurableNoteStore::listNoteVersions( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listNoteVersions( noteGuid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -17286,7 +17286,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listNoteVersionsAsync( @@ -17294,7 +17294,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17311,7 +17311,7 @@ Note DurableNoteStore::getNoteVersion( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNoteVersion( @@ -17321,10 +17321,10 @@ Note DurableNoteStore::getNoteVersion( withResourcesRecognition, withResourcesAlternateData, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17342,7 +17342,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNoteVersionAsync( @@ -17354,7 +17354,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17371,7 +17371,7 @@ Resource DurableNoteStore::getResource( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResource( @@ -17381,10 +17381,10 @@ Resource DurableNoteStore::getResource( withAttributes, withAlternateData, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17402,7 +17402,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceAsync( @@ -17414,7 +17414,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17427,16 +17427,16 @@ LazyMap DurableNoteStore::getResourceApplicationData( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceApplicationData( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17450,7 +17450,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceApplicationDataAsync( @@ -17458,7 +17458,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17472,17 +17472,17 @@ QString DurableNoteStore::getResourceApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceApplicationDataEntry( guid, key, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -17497,7 +17497,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceApplicationDataEntryAsync( @@ -17506,7 +17506,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17521,7 +17521,7 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->setResourceApplicationDataEntry( @@ -17529,10 +17529,10 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( key, value, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17548,7 +17548,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->setResourceApplicationDataEntryAsync( @@ -17558,7 +17558,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17572,17 +17572,17 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->unsetResourceApplicationDataEntry( guid, key, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17597,7 +17597,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->unsetResourceApplicationDataEntryAsync( @@ -17606,7 +17606,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17619,16 +17619,16 @@ qint32 DurableNoteStore::updateResource( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateResource( resource, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17642,7 +17642,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateResourceAsync( @@ -17650,7 +17650,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17663,16 +17663,16 @@ QByteArray DurableNoteStore::getResourceData( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceData( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toByteArray(); @@ -17686,7 +17686,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceDataAsync( @@ -17694,7 +17694,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17711,7 +17711,7 @@ Resource DurableNoteStore::getResourceByHash( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceByHash( @@ -17721,10 +17721,10 @@ Resource DurableNoteStore::getResourceByHash( withRecognition, withAlternateData, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17742,7 +17742,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceByHashAsync( @@ -17754,7 +17754,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17767,16 +17767,16 @@ QByteArray DurableNoteStore::getResourceRecognition( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceRecognition( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toByteArray(); @@ -17790,7 +17790,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceRecognitionAsync( @@ -17798,7 +17798,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17811,16 +17811,16 @@ QByteArray DurableNoteStore::getResourceAlternateData( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceAlternateData( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toByteArray(); @@ -17834,7 +17834,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceAlternateDataAsync( @@ -17842,7 +17842,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17855,16 +17855,16 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getResourceAttributes( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17878,7 +17878,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getResourceAttributesAsync( @@ -17886,7 +17886,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17900,17 +17900,17 @@ Notebook DurableNoteStore::getPublicNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getPublicNotebook( userId, publicUri, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17925,7 +17925,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getPublicNotebookAsync( @@ -17934,7 +17934,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17948,17 +17948,17 @@ SharedNotebook DurableNoteStore::shareNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->shareNotebook( sharedNotebook, message, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -17973,7 +17973,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->shareNotebookAsync( @@ -17982,7 +17982,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -17995,16 +17995,16 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createOrUpdateNotebookShares( shareTemplate, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18018,7 +18018,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createOrUpdateNotebookSharesAsync( @@ -18026,7 +18026,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18039,16 +18039,16 @@ qint32 DurableNoteStore::updateSharedNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateSharedNotebook( sharedNotebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18062,7 +18062,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateSharedNotebookAsync( @@ -18070,7 +18070,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18084,17 +18084,17 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->setNotebookRecipientSettings( notebookGuid, recipientSettings, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18109,7 +18109,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->setNotebookRecipientSettingsAsync( @@ -18118,7 +18118,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18130,15 +18130,15 @@ QList DurableNoteStore::listSharedNotebooks( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listSharedNotebooks( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -18151,14 +18151,14 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listSharedNotebooksAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18171,16 +18171,16 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->createLinkedNotebook( linkedNotebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18194,7 +18194,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->createLinkedNotebookAsync( @@ -18202,7 +18202,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18215,16 +18215,16 @@ qint32 DurableNoteStore::updateLinkedNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateLinkedNotebook( linkedNotebook, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18238,7 +18238,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateLinkedNotebookAsync( @@ -18246,7 +18246,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18258,15 +18258,15 @@ QList DurableNoteStore::listLinkedNotebooks( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listLinkedNotebooks( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -18279,14 +18279,14 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listLinkedNotebooksAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18299,16 +18299,16 @@ qint32 DurableNoteStore::expungeLinkedNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->expungeLinkedNotebook( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18322,7 +18322,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->expungeLinkedNotebookAsync( @@ -18330,7 +18330,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18343,16 +18343,16 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToSharedNotebook( shareKeyOrGlobalId, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18366,7 +18366,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->authenticateToSharedNotebookAsync( @@ -18374,7 +18374,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18386,15 +18386,15 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getSharedNotebookByAuth( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18407,14 +18407,14 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getSharedNotebookByAuthAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18427,16 +18427,16 @@ void DurableNoteStore::emailNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->emailNote( parameters, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -18450,7 +18450,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->emailNoteAsync( @@ -18458,7 +18458,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18471,16 +18471,16 @@ QString DurableNoteStore::shareNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->shareNote( guid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toString(); @@ -18494,7 +18494,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->shareNoteAsync( @@ -18502,7 +18502,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18515,16 +18515,16 @@ void DurableNoteStore::stopSharingNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->stopSharingNote( guid, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -18538,7 +18538,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->stopSharingNoteAsync( @@ -18546,7 +18546,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18560,17 +18560,17 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToSharedNote( guid, noteKey, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18585,7 +18585,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->authenticateToSharedNoteAsync( @@ -18594,7 +18594,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18608,17 +18608,17 @@ RelatedResult DurableNoteStore::findRelated( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->findRelated( query, resultSpec, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18633,7 +18633,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->findRelatedAsync( @@ -18642,7 +18642,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18655,16 +18655,16 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->updateNoteIfUsnMatches( note, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18678,7 +18678,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateNoteIfUsnMatchesAsync( @@ -18686,7 +18686,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18699,16 +18699,16 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->manageNotebookShares( parameters, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18722,7 +18722,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->manageNotebookSharesAsync( @@ -18730,7 +18730,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18743,16 +18743,16 @@ ShareRelationships DurableNoteStore::getNotebookShares( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getNotebookShares( notebookGuid, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18766,7 +18766,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getNotebookSharesAsync( @@ -18774,7 +18774,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18791,7 +18791,7 @@ bool DurableUserStore::checkVersion( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->checkVersion( @@ -18799,10 +18799,10 @@ bool DurableUserStore::checkVersion( edamVersionMajor, edamVersionMinor, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.toBool(); @@ -18818,7 +18818,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->checkVersionAsync( @@ -18828,7 +18828,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18841,16 +18841,16 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getBootstrapInfo( locale, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18864,7 +18864,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getBootstrapInfoAsync( @@ -18872,7 +18872,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18891,7 +18891,7 @@ AuthenticationResult DurableUserStore::authenticateLongSession( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateLongSession( @@ -18903,10 +18903,10 @@ AuthenticationResult DurableUserStore::authenticateLongSession( deviceDescription, supportsTwoFactor, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18926,7 +18926,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->authenticateLongSessionAsync( @@ -18940,7 +18940,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -18955,7 +18955,7 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->completeTwoFactorAuthentication( @@ -18963,10 +18963,10 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( deviceIdentifier, deviceDescription, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -18982,7 +18982,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->completeTwoFactorAuthenticationAsync( @@ -18992,7 +18992,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19004,15 +19004,15 @@ void DurableUserStore::revokeLongSession( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->revokeLongSession( ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -19025,14 +19025,14 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->revokeLongSessionAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19044,15 +19044,15 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->authenticateToBusiness( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -19065,14 +19065,14 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->authenticateToBusinessAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19084,15 +19084,15 @@ User DurableUserStore::getUser( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getUser( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -19105,14 +19105,14 @@ AsyncResult * DurableUserStore::getUserAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getUserAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19125,16 +19125,16 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getPublicUserInfo( username, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -19148,7 +19148,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getPublicUserInfoAsync( @@ -19156,7 +19156,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19168,15 +19168,15 @@ UserUrls DurableUserStore::getUserUrls( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getUserUrls( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -19189,14 +19189,14 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getUserUrlsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19209,16 +19209,16 @@ void DurableUserStore::inviteToBusiness( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->inviteToBusiness( emailAddress, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -19232,7 +19232,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->inviteToBusinessAsync( @@ -19240,7 +19240,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19253,16 +19253,16 @@ void DurableUserStore::removeFromBusiness( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->removeFromBusiness( emailAddress, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -19276,7 +19276,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->removeFromBusinessAsync( @@ -19284,7 +19284,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19298,17 +19298,17 @@ void DurableUserStore::updateBusinessUserIdentifier( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { m_service->updateBusinessUserIdentifier( oldEmailAddress, newEmailAddress, ctx); - return DurableService::SyncResult(QVariant(), {}); + return IDurableService::SyncResult(QVariant(), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return; @@ -19323,7 +19323,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->updateBusinessUserIdentifierAsync( @@ -19332,7 +19332,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19344,15 +19344,15 @@ QList DurableUserStore::listBusinessUsers( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listBusinessUsers( ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -19365,14 +19365,14 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listBusinessUsersAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19385,16 +19385,16 @@ QList DurableUserStore::listBusinessInvitations( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->listBusinessInvitations( includeRequestedInvitations, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value>(); @@ -19408,7 +19408,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->listBusinessInvitationsAsync( @@ -19416,7 +19416,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } @@ -19429,16 +19429,16 @@ AccountLimits DurableUserStore::getAccountLimits( ctx = m_ctx; } - auto call = DurableService::SyncServiceCall( + auto call = IDurableService::SyncServiceCall( [&] (IRequestContextPtr ctx) { auto res = m_service->getAccountLimits( serviceLevel, ctx); - return DurableService::SyncResult(QVariant::fromValue(res), {}); + return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - auto result = m_durableService.executeSyncRequest( + auto result = m_durableService->executeSyncRequest( std::move(call), ctx); return result.first.value(); @@ -19452,7 +19452,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx = m_ctx; } - auto call = DurableService::AsyncServiceCall( + auto call = IDurableService::AsyncServiceCall( [=, service=m_service] (IRequestContextPtr ctx) { return service->getAccountLimitsAsync( @@ -19460,7 +19460,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx); }); - return m_durableService.executeAsyncRequest( + return m_durableService->executeAsyncRequest( std::move(call), ctx); } From ece03b54a6156cdbcf8a6046028e73a292d32e00 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 13:14:38 +0300 Subject: [PATCH 025/188] Move tests of Optional class into a separate Qt test class --- QEverCloud/CMakeLists.txt | 3 +- QEverCloud/src/tests/Common.h | 20 +++++++++ QEverCloud/src/tests/TestOptional.cpp | 60 ++++++++++++++++++++----- QEverCloud/src/tests/TestOptional.h | 40 +++++++++++++++++ QEverCloud/src/tests/TestQEverCloud.cpp | 33 +++++++------- QEverCloud/src/tests/TestQEverCloud.h | 36 --------------- 6 files changed, 127 insertions(+), 65 deletions(-) create mode 100644 QEverCloud/src/tests/Common.h create mode 100644 QEverCloud/src/tests/TestOptional.h delete mode 100644 QEverCloud/src/tests/TestQEverCloud.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 4d808c8a..af2c589b 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -137,7 +137,8 @@ add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM find_package(Qt5Test QUIET) if(Qt5Test_FOUND) set(TEST_HEADERS - src/tests/TestQEverCloud.h) + src/tests/Common.h + src/tests/TestOptional.h) set(TEST_SOURCES src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp) diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h new file mode 100644 index 00000000..ea5117ae --- /dev/null +++ b/QEverCloud/src/tests/Common.h @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_TEST_COMMON_H +#define QEVERCLOUD_TEST_COMMON_H + +#ifdef QEVERCLOUD_SHARED_LIBRARY +#undef QEVERCLOUD_SHARED_LIBRARY +#endif + +#ifdef QEVERCLOUD_STATIC_LIBRARY +#undef QEVERCLOUD_STATIC_LIBRARY +#endif + +#endif // QEVERCLOUD_TEST_COMMON_H diff --git a/QEverCloud/src/tests/TestOptional.cpp b/QEverCloud/src/tests/TestOptional.cpp index 518a7a9e..8c1c16f4 100644 --- a/QEverCloud/src/tests/TestOptional.cpp +++ b/QEverCloud/src/tests/TestOptional.cpp @@ -6,46 +6,72 @@ * https://opensource.org/licenses/MIT */ -#include "TestQEverCloud.h" +#include "TestOptional.h" #include #include +#include + namespace qevercloud { -void TestEverCloudTest::testOptional() +OptionalTester::OptionalTester(QObject * parent) : + QObject(parent) +{} + +void OptionalTester::shouldDetectValueNotSet() { Optional i; QVERIFY(!i.isSet()); +} +void OptionalTester::shouldClearValue() +{ + Optional i; i = 10; QVERIFY(i.isSet()); QVERIFY(i == 10); i.clear(); QVERIFY(!i.isSet()); +} +void OptionalTester::shouldDetectExternalValueChange() +{ + Optional i; i.init().ref() = 11; QVERIFY(i == 11); static_cast(i) = 12; QVERIFY(i == 12); +} +void OptionalTester::shouldCastToIntFromAscii() +{ const Optional ic = ' '; QVERIFY(ic == 32); +} - i.clear(); +void OptionalTester::shouldInitValue() +{ + Optional i; i.init(); QVERIFY2(i.isSet() && i == int(), "i.isSet() && i == int()"); +} - i.clear(); - bool exception = false; +void OptionalTester::shouldThrowExceptionOnAttemptToReferenceUnsetValue() +{ + Optional i; + bool exceptionThrown = false; try { - qDebug() << i; + int a = i; } catch(const EverCloudException &) { - exception = true; + exceptionThrown = true; } - QVERIFY(exception); + QVERIFY(exceptionThrown); +} +void OptionalTester::shouldAssignFromOtherOptionals() +{ Optional y, k = 10; y = k; QVERIFY(y == 10); @@ -54,6 +80,12 @@ void TestEverCloudTest::testOptional() QVERIFY(d == 10); d = ' '; QVERIFY(d == 32); +} + +void OptionalTester::shouldProcessEqualityChecks() +{ + Optional y = 10; + Optional d = 32; Optional d2(y), d3(' '), d4(d); QVERIFY(d2 == 10); @@ -68,15 +100,20 @@ void TestEverCloudTest::testOptional() QVERIFY(oi.isEqual(od)); oi = 2; QVERIFY(!oi.isEqual(od)); +} +void OptionalTester::shouldProcessStructEqualityChecks() +{ Note n1, n2; QVERIFY(n1 == n2); n1.guid = QStringLiteral("12345"); QVERIFY(n1 != n2); n2.guid = n1.guid; QVERIFY(n1 == n2); +} -#if defined(Q_COMPILER_RVALUE_REFS) && !defined(_MSC_VER) +void OptionalTester::shouldProcessValueMoves() +{ Optional oi1, oi2; oi1 = 10; oi2 = std::move(oi1); @@ -90,10 +127,11 @@ void TestEverCloudTest::testOptional() note2 = std::move(note1); QVERIFY(note2.guid.isSet()); QVERIFY(!note1.guid.isSet()); -#endif +} +void OptionalTester::shouldHandleZeroTimestamp() +{ Optional t; - t = 0; t = Timestamp(0); QVERIFY(t.ref() == Timestamp(0)); } diff --git a/QEverCloud/src/tests/TestOptional.h b/QEverCloud/src/tests/TestOptional.h new file mode 100644 index 00000000..e74c5c40 --- /dev/null +++ b/QEverCloud/src/tests/TestOptional.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_TEST_OPTIONAL_H +#define QEVERCLOUD_TEST_OPTIONAL_H + +#include "Common.h" + +#include + +namespace qevercloud { + +class OptionalTester: public QObject +{ + Q_OBJECT +public: + explicit OptionalTester(QObject * parent = nullptr); + +private Q_SLOTS: + void shouldDetectValueNotSet(); + void shouldClearValue(); + void shouldDetectExternalValueChange(); + void shouldCastToIntFromAscii(); + void shouldInitValue(); + void shouldThrowExceptionOnAttemptToReferenceUnsetValue(); + void shouldAssignFromOtherOptionals(); + void shouldProcessEqualityChecks(); + void shouldProcessStructEqualityChecks(); + void shouldProcessValueMoves(); + void shouldHandleZeroTimestamp(); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_TEST_OPTIONAL_H diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 9ea172c1..59d13871 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -1,28 +1,27 @@ /** - * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * Copyright (c) 2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms * of MIT license: * https://opensource.org/licenses/MIT */ -#include "TestQEverCloud.h" +#include "TestOptional.h" -namespace qevercloud { +#include -TestEverCloudTest::TestEverCloudTest(QObject * parent) : - QObject(parent) -{} +using namespace qevercloud; -} // namespace qevercloud +int main(int argc, char *argv[]) +{ + int res = 0; -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) -#ifdef QT_GUI_LIB -#undef QT_GUI_LIB -QTEST_MAIN(qevercloud::TestEverCloudTest) -#define QT_GUI_LIB -#endif // QT_GUI_LIB -#else -QTEST_GUILESS_MAIN(qevercloud::TestEverCloudTest) -#endif +#define RUN_TESTS(tester) \ + res = QTest::qExec(new tester); \ + if (res != 0) { \ + return res; \ + } \ +// RUN_TESTS + + RUN_TESTS(OptionalTester) +} diff --git a/QEverCloud/src/tests/TestQEverCloud.h b/QEverCloud/src/tests/TestQEverCloud.h deleted file mode 100644 index 9d5e5e49..00000000 --- a/QEverCloud/src/tests/TestQEverCloud.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2019 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms - * of MIT license: - * https://opensource.org/licenses/MIT - */ - -#ifndef QEVERCLOUD_TEST_QEVERCLOUD_H -#define QEVERCLOUD_TEST_QEVERCLOUD_H - -#include - -#ifdef QEVERCLOUD_SHARED_LIBRARY -#undef QEVERCLOUD_SHARED_LIBRARY -#endif - -#ifdef QEVERCLOUD_STATIC_LIBRARY -#undef QEVERCLOUD_STATIC_LIBRARY -#endif - -namespace qevercloud { - -class TestEverCloudTest: public QObject -{ - Q_OBJECT -public: - TestEverCloudTest(QObject * parent = nullptr); - -private Q_SLOTS: - void testOptional(); -}; - -} // namespace qevercloud - -#endif // QEVERCLOUD_TEST_QEVERCLOUD_H From 21db1795694fa3e11b20fd55f6ba99754db85410 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 13:27:21 +0300 Subject: [PATCH 026/188] Add first test for durable service --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/src/tests/TestDurableService.cpp | 41 +++++++++++++++++++++ QEverCloud/src/tests/TestDurableService.h | 30 +++++++++++++++ QEverCloud/src/tests/TestQEverCloud.cpp | 2 + 4 files changed, 75 insertions(+) create mode 100644 QEverCloud/src/tests/TestDurableService.cpp create mode 100644 QEverCloud/src/tests/TestDurableService.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index af2c589b..c015c58a 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -138,8 +138,10 @@ find_package(Qt5Test QUIET) if(Qt5Test_FOUND) set(TEST_HEADERS src/tests/Common.h + src/tests/TestDurableService.h src/tests/TestOptional.h) set(TEST_SOURCES + src/tests/TestDurableService.cpp src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp new file mode 100644 index 00000000..4db39def --- /dev/null +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#include "TestDurableService.h" + +#include + +#include + +namespace qevercloud { + +DurableServiceTester::DurableServiceTester(QObject * parent) : + QObject(parent) +{} + +void DurableServiceTester::shouldExecuteSyncServiceCall() +{ + auto durableService = newDurableService(); + + bool serviceCallDetected = false; + QVariant value = QStringLiteral("value"); + + auto result = durableService->executeSyncRequest( + [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { + Q_ASSERT(ctx); + serviceCallDetected = true; + return {value, {}}; + }, + newRequestContext()); + + QVERIFY(serviceCallDetected); + QVERIFY(result.first == value); + QVERIFY(result.second.isNull()); +} + +} // namespace qevercloud diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h new file mode 100644 index 00000000..79698a4e --- /dev/null +++ b/QEverCloud/src/tests/TestDurableService.h @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_TEST_DURABLE_SERVICE_H +#define QEVERCLOUD_TEST_DURABLE_SERVICE_H + +#include "Common.h" + +#include + +namespace qevercloud { + +class DurableServiceTester: public QObject +{ + Q_OBJECT +public: + explicit DurableServiceTester(QObject * parent = nullptr); + +private Q_SLOTS: + void shouldExecuteSyncServiceCall(); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_TEST_DURABLE_SERVICE_H diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 59d13871..6fab3b4c 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -6,6 +6,7 @@ * https://opensource.org/licenses/MIT */ +#include "TestDurableService.h" #include "TestOptional.h" #include @@ -23,5 +24,6 @@ int main(int argc, char *argv[]) } \ // RUN_TESTS + RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) } From 1d02380324759c4abbed1aeffe6ac38b0520f08d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 13:57:16 +0300 Subject: [PATCH 027/188] Add test for durable service ensuring that async service call is properly executed --- QEverCloud/src/tests/TestDurableService.cpp | 19 +++++++++++++++++++ QEverCloud/src/tests/TestDurableService.h | 1 + 2 files changed, 20 insertions(+) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 4db39def..7b362405 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -38,4 +38,23 @@ void DurableServiceTester::shouldExecuteSyncServiceCall() QVERIFY(result.second.isNull()); } +void DurableServiceTester::shouldExecuteAsyncServiceCall() +{ + auto durableService = newDurableService(); + + bool serviceCallDetected = false; + + AsyncResult * res = new AsyncResult(QString(), QByteArray()); + auto * result = durableService->executeAsyncRequest( + [&] (IRequestContextPtr ctx) -> AsyncResult* { + Q_ASSERT(ctx); + serviceCallDetected = true; + return res; + }, + newRequestContext()); + + QVERIFY(serviceCallDetected); + res->deleteLater(); +} + } // namespace qevercloud diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index 79698a4e..254eff56 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -23,6 +23,7 @@ class DurableServiceTester: public QObject private Q_SLOTS: void shouldExecuteSyncServiceCall(); + void shouldExecuteAsyncServiceCall(); }; } // namespace qevercloud From bf20df2aaf93bf6c574c3f5ceaebe1e82f13aa22 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 14:22:19 +0300 Subject: [PATCH 028/188] Set up default retry policy in DurableService's constructor if none is passed from args --- QEverCloud/src/DurableService.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index badfb1b9..fa6e3f71 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -21,7 +21,6 @@ namespace { struct RetryState { - qint64 m_started = QDateTime::currentMSecsSinceEpoch(); quint32 m_retryCount = 0; }; @@ -91,7 +90,11 @@ DurableService::DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) : m_retryPolicy(std::move(retryPolicy)), m_ctx(std::move(ctx)) -{} +{ + if (!m_retryPolicy) { + m_retryPolicy = newRetryPolicy(); + } +} DurableService::SyncResult DurableService::executeSyncRequest( SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) From 1cddd76bc8dcb22b53cb42c560331de523e42026 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 14:23:06 +0300 Subject: [PATCH 029/188] Add test checking that sync service calls are retried by DurableService --- QEverCloud/src/tests/TestDurableService.cpp | 43 +++++++++++++++++++++ QEverCloud/src/tests/TestDurableService.h | 1 + 2 files changed, 44 insertions(+) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 7b362405..3569d7f0 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -9,6 +9,7 @@ #include "TestDurableService.h" #include +#include #include @@ -57,4 +58,46 @@ void DurableServiceTester::shouldExecuteAsyncServiceCall() res->deleteLater(); } +void DurableServiceTester::shouldRetrySyncServiceCalls() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + QVariant value = QStringLiteral("value"); + + auto result = durableService->executeSyncRequest( + [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { + Q_ASSERT(ctx); + ++serviceCallCounter; + if (serviceCallCounter < maxServiceCallCounter) + { + QSharedPointer data; + try { + throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return {{}, data}; + } + + return {value, {}}; + }, + ctx); + + QVERIFY(serviceCallCounter == maxServiceCallCounter); + QVERIFY(result.first == value); + QVERIFY(result.second.isNull()); +} + } // namespace qevercloud diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index 254eff56..e39d409d 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -24,6 +24,7 @@ class DurableServiceTester: public QObject private Q_SLOTS: void shouldExecuteSyncServiceCall(); void shouldExecuteAsyncServiceCall(); + void shouldRetrySyncServiceCalls(); }; } // namespace qevercloud From 9e165158c727c76d8e50baaa3964d227014ca9c9 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 14:23:34 +0300 Subject: [PATCH 030/188] Prepare some infrastructure for testing of async service calls done via DurableService --- QEverCloud/headers/AsyncResult.h | 7 +++++++ QEverCloud/src/AsyncResult.cpp | 6 ++++++ QEverCloud/src/AsyncResult_p.cpp | 9 +++++++++ QEverCloud/src/AsyncResult_p.h | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index ce3e681e..9f0ea275 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -64,6 +64,13 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); + /** + * Constructor accepting already prepared value and/or exception, + * for use in tests + */ + AsyncResult(QVariant result, QSharedPointer error, + bool autoDelete = true, QObject * parent = nullptr); + ~AsyncResult(); /** diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 56b28234..535d535e 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -45,6 +45,12 @@ AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } +AsyncResult::AsyncResult(QVariant result, QSharedPointer error, + bool autoDelete, QObject * parent) : + QObject(parent), + d_ptr(new AsyncResultPrivate(result, error, autoDelete, this)) +{} + AsyncResult::~AsyncResult() { delete d_ptr; diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 603b3a0c..c9c54c34 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -32,6 +32,15 @@ AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, q_ptr(q) {} +AsyncResultPrivate::AsyncResultPrivate(QVariant result, + QSharedPointer error, + bool autoDelete, AsyncResult * q) : + m_autoDelete(autoDelete), + q_ptr(q) +{ + setValue(result, error); +} + AsyncResultPrivate::~AsyncResultPrivate() {} diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index b845060f..99953e55 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -25,6 +25,10 @@ class AsyncResultPrivate: public QObject AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); + explicit AsyncResultPrivate(QVariant result, + QSharedPointer error, + bool autoDelete, AsyncResult * q); + virtual ~AsyncResultPrivate(); Q_SIGNALS: From 4adce78cc71ad132cbad6c4d657eeb539147069c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 16:57:32 +0300 Subject: [PATCH 031/188] Make asIs static method public because it's impractical to have it private --- QEverCloud/headers/AsyncResult.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 9f0ea275..e8a9f2ad 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -50,10 +50,9 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject { Q_OBJECT Q_DISABLE_COPY(AsyncResult) -private: +public: static QVariant asIs(QByteArray replyData); -public: typedef QVariant (*ReadFunctionType)(QByteArray replyData); AsyncResult(QString url, QByteArray postData, From 9808043a1d07c39343fc25d332c63365dfbf57c4 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 16:58:17 +0300 Subject: [PATCH 032/188] Call setValue method asynchronously in AsyncResultPrivate + add forgotten signal-slot connection with public class --- QEverCloud/src/AsyncResult_p.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index c9c54c34..44b44f5d 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -38,7 +38,9 @@ AsyncResultPrivate::AsyncResultPrivate(QVariant result, m_autoDelete(autoDelete), q_ptr(q) { - setValue(result, error); + QMetaObject::invokeMethod(this, "setValue", Qt::QueuedConnection, + Q_ARG(QVariant, result), + Q_ARG(QSharedPointer, error)); } AsyncResultPrivate::~AsyncResultPrivate() @@ -94,21 +96,19 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) new EverCloudExceptionData(QStringLiteral("Unknown exception"))); } - Q_EMIT finished(result, error); - reply->deleteLater(); - - if (m_autoDelete) { - Q_Q(AsyncResult); - q->deleteLater(); - } + setValue(result, error); } void AsyncResultPrivate::setValue(QVariant result, QSharedPointer error) { + Q_Q(AsyncResult); + QObject::connect(this, &AsyncResultPrivate::finished, + q, &AsyncResult::finished, + Qt::QueuedConnection); + Q_EMIT finished(result, error); if (m_autoDelete) { - Q_Q(AsyncResult); q->deleteLater(); } } From 40f961ac60e7e3caff2a151c92a97a337ed1e6bc Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 12 Oct 2019 16:59:01 +0300 Subject: [PATCH 033/188] Add test checking that async service calls are retried by DurableService --- QEverCloud/src/tests/TestDurableService.cpp | 85 +++++++++++++++++++++ QEverCloud/src/tests/TestDurableService.h | 1 + QEverCloud/src/tests/TestQEverCloud.cpp | 5 ++ 3 files changed, 91 insertions(+) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 3569d7f0..3d88305c 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -11,10 +11,38 @@ #include #include +#include #include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + +class ValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit ValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QVariant m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = value; + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + DurableServiceTester::DurableServiceTester(QObject * parent) : QObject(parent) {} @@ -77,6 +105,8 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() auto result = durableService->executeSyncRequest( [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { @@ -100,4 +130,59 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() QVERIFY(result.second.isNull()); } +void DurableServiceTester::shouldRetryAsyncServiceCalls() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + QVariant value = QStringLiteral("value"); + + AsyncResult * result = durableService->executeAsyncRequest( + [&] (IRequestContextPtr ctx) -> AsyncResult* { + Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + + ++serviceCallCounter; + if (serviceCallCounter < maxServiceCallCounter) + { + QSharedPointer data; + try { + throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return new AsyncResult(QVariant(), data); + } + + return new AsyncResult(value, {}); + }, + ctx); + + ValueFetcher valueFetcher; + QObject::connect(result, &AsyncResult::finished, + &valueFetcher, &ValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect(&valueFetcher, &ValueFetcher::finished, + &loop, &QEventLoop::quit); + loop.exec(); + + QVERIFY(serviceCallCounter == maxServiceCallCounter); + QVERIFY(valueFetcher.m_value == value); + QVERIFY(valueFetcher.m_exceptionData.isNull()); +} + } // namespace qevercloud + +#include diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index e39d409d..3f5960c5 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -25,6 +25,7 @@ private Q_SLOTS: void shouldExecuteSyncServiceCall(); void shouldExecuteAsyncServiceCall(); void shouldRetrySyncServiceCalls(); + void shouldRetryAsyncServiceCalls(); }; } // namespace qevercloud diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 6fab3b4c..052d2767 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -9,6 +9,7 @@ #include "TestDurableService.h" #include "TestOptional.h" +#include #include using namespace qevercloud; @@ -17,6 +18,8 @@ int main(int argc, char *argv[]) { int res = 0; + QCoreApplication app(argc, argv); + #define RUN_TESTS(tester) \ res = QTest::qExec(new tester); \ if (res != 0) { \ @@ -26,4 +29,6 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) + + return 0; } From 5c65f428c98bdd1fe0c8bde2333881150340b8bb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 14 Oct 2019 07:23:56 +0300 Subject: [PATCH 034/188] Add more tests for DurableService --- QEverCloud/src/tests/TestDurableService.cpp | 210 ++++++++++++++++++++ QEverCloud/src/tests/TestDurableService.h | 4 + 2 files changed, 214 insertions(+) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 3d88305c..2cc24508 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -183,6 +183,216 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() QVERIFY(valueFetcher.m_exceptionData.isNull()); } +void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + auto result = durableService->executeSyncRequest( + [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { + Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + + ++serviceCallCounter; + QSharedPointer data; + try { + throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return {{}, data}; + }, + ctx); + + QVERIFY(serviceCallCounter == maxServiceCallCounter); + QVERIFY(!result.first.isValid()); + QVERIFY(!result.second.isNull()); + + bool exceptionCaught = false; + try { + result.second->throwException(); + } + catch(const ThriftException & e) { + exceptionCaught = true; + QVERIFY(e.type() == ThriftException::Type::INTERNAL_ERROR); + } + QVERIFY(exceptionCaught); +} + +void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + AsyncResult * result = durableService->executeAsyncRequest( + [&] (IRequestContextPtr ctx) -> AsyncResult* { + Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + + ++serviceCallCounter; + QSharedPointer data; + try { + throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return new AsyncResult(QVariant(), data); + }, + ctx); + + ValueFetcher valueFetcher; + QObject::connect(result, &AsyncResult::finished, + &valueFetcher, &ValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect(&valueFetcher, &ValueFetcher::finished, + &loop, &QEventLoop::quit); + loop.exec(); + + QVERIFY(serviceCallCounter == maxServiceCallCounter); + QVERIFY(!valueFetcher.m_value.isValid()); + QVERIFY(!valueFetcher.m_exceptionData.isNull()); + + bool exceptionCaught = false; + try { + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) { + exceptionCaught = true; + QVERIFY(e.type() == ThriftException::Type::INTERNAL_ERROR); + } + QVERIFY(exceptionCaught); +} + +void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + auto result = durableService->executeSyncRequest( + [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { + Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + + ++serviceCallCounter; + QSharedPointer data; + try { + EDAMUserException e; + e.errorCode = EDAMErrorCode::AUTH_EXPIRED; + throw e; + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return {{}, data}; + }, + ctx); + + QVERIFY(serviceCallCounter == 1); + QVERIFY(!result.first.isValid()); + QVERIFY(!result.second.isNull()); + + bool exceptionCaught = false; + try { + result.second->throwException(); + } + catch(const EDAMUserException & e) { + exceptionCaught = true; + QVERIFY(e.errorCode == EDAMErrorCode::AUTH_EXPIRED); + } + QVERIFY(exceptionCaught); +} + +void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableError() +{ + auto durableService = newDurableService(); + + int serviceCallCounter = 0; + int maxServiceCallCounter = 3; + + auto ctx = newRequestContext( + QString(), + DEFAULT_REQUEST_TIMEOUT_MSEC, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + maxServiceCallCounter); + + AsyncResult * result = durableService->executeAsyncRequest( + [&] (IRequestContextPtr ctx) -> AsyncResult* { + Q_ASSERT(ctx); + Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); + + ++serviceCallCounter; + QSharedPointer data; + try { + EDAMUserException e; + e.errorCode = EDAMErrorCode::AUTH_EXPIRED; + throw e; + } + catch(const EverCloudException & e) { + data = e.exceptionData(); + } + + return new AsyncResult(QVariant(), data); + }, + ctx); + + ValueFetcher valueFetcher; + QObject::connect(result, &AsyncResult::finished, + &valueFetcher, &ValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect(&valueFetcher, &ValueFetcher::finished, + &loop, &QEventLoop::quit); + loop.exec(); + + QVERIFY(serviceCallCounter == 1); + QVERIFY(!valueFetcher.m_value.isValid()); + QVERIFY(!valueFetcher.m_exceptionData.isNull()); + + bool exceptionCaught = false; + try { + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) { + exceptionCaught = true; + QVERIFY(e.errorCode == EDAMErrorCode::AUTH_EXPIRED); + } + QVERIFY(exceptionCaught); +} + } // namespace qevercloud #include diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index 3f5960c5..219fe25a 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -26,6 +26,10 @@ private Q_SLOTS: void shouldExecuteAsyncServiceCall(); void shouldRetrySyncServiceCalls(); void shouldRetryAsyncServiceCalls(); + void shouldNotRetrySyncServiceCallMoreThanMaxTimes(); + void shouldNotRetryAsyncServiceCallMoreThanMaxTimes(); + void shouldNotRetrySyncServiceCallInCaseOfUnretriableError(); + void shouldNotRetryAsyncServiceCallInCaseOfUnretriableError(); }; } // namespace qevercloud From 919a81b98fabbf905762e263a8d32c126a98cdc6 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 14 Oct 2019 07:51:45 +0300 Subject: [PATCH 035/188] Start implementing logger for QEverCloud --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/headers/Log.h | 59 +++++++++++++++++++++++++ QEverCloud/src/Log.cpp | 91 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 QEverCloud/headers/Log.h create mode 100644 QEverCloud/src/Log.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index c015c58a..f4634955 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -23,6 +23,7 @@ set(NON_GENERATED_HEADERS headers/Globals.h headers/Helpers.h headers/InkNoteImageDownloader.h + headers/Log.h headers/Optional.h headers/RequestContext.h headers/Thumbnail.h) @@ -55,6 +56,7 @@ set(SOURCES src/Globals.cpp src/Http.cpp src/InkNoteImageDownloader.cpp + src/Log.cpp src/RequestContext.cpp src/Thumbnail.cpp src/generated/Constants.cpp diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h new file mode 100644 index 00000000..3347db68 --- /dev/null +++ b/QEverCloud/headers/Log.h @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_LOG_H +#define QEVERCLOUD_LOG_H + +#include "Export.h" + +#include +#include + +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +enum class LogLevel +{ + Trace = 0, + Debug, + Warn, + Error +}; + +QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & out, const LogLevel level); + +QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & out, const LogLevel level); + +//////////////////////////////////////////////////////////////////////////////// + +class QEVERCLOUD_EXPORT ILogger +{ +public: + virtual void writeLog( + const LogLevel level, const char * fileName, + const quint32 lineNumber, const qint64 timestamp, + const QString & message) = 0; + + virtual void setLevel(const LogLevel level) = 0; + + virtual LogLevel level() const = 0; +}; + +using ILoggerPtr = std::shared_ptr; + +//////////////////////////////////////////////////////////////////////////////// + +ILoggerPtr newNullLogger(); + +} // namespace qevercloud + +#endif // QEVERCLOUD_LOG_H diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp new file mode 100644 index 00000000..75908113 --- /dev/null +++ b/QEverCloud/src/Log.cpp @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#include + +namespace qevercloud { + +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +template +void printLogLevel(T & out, const LogLevel level) +{ + switch(level) + { + case LogLevel::Trace: + out << "Trace"; + break; + case LogLevel::Debug: + out << "Debug"; + break; + case LogLevel::Warn: + out << "Warn"; + break; + case LogLevel::Error: + out << "Error"; + break; + default: + out << "Unknown (" << static_cast(level) << ")"; + break; + } +} + +//////////////////////////////////////////////////////////////////////////////// + +class NullLogger final: public ILogger +{ +public: + virtual void writeLog( + const LogLevel level, const char * fileName, + const quint32 lineNumber, const qint64 timestamp, + const QString & message) override + { + Q_UNUSED(level) + Q_UNUSED(fileName) + Q_UNUSED(lineNumber) + Q_UNUSED(timestamp) + Q_UNUSED(message) + } + + virtual void setLevel(const LogLevel level) override + { + m_level = level; + } + + virtual LogLevel level() const override + { + return m_level; + } + +private: + LogLevel m_level; +}; + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + +ILoggerPtr newNullLogger() +{ + return std::make_shared(); +} + +QTextStream & operator<<(QTextStream & out, const LogLevel level) +{ + printLogLevel(out, level); + return out; +} + +QDebug & operator<<(QDebug & out, const LogLevel level) +{ + printLogLevel(out, level); + return out; +} + +} // namespace qevercloud From f003f4041928e1568e01445d0672430c15772fdc Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 15 Oct 2019 07:51:11 +0300 Subject: [PATCH 036/188] Implement stderr logger --- QEverCloud/headers/Log.h | 9 ++- QEverCloud/src/Log.cpp | 120 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 122 insertions(+), 7 deletions(-) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 3347db68..c62e0ddf 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -38,8 +38,11 @@ QEVERCLOUD_EXPORT QDebug & operator<<( class QEVERCLOUD_EXPORT ILogger { public: - virtual void writeLog( - const LogLevel level, const char * fileName, + virtual bool shouldLog( + const LogLevel level, const char * component) const = 0; + + virtual void log( + const LogLevel level, const char * component, const char * fileName, const quint32 lineNumber, const qint64 timestamp, const QString & message) = 0; @@ -54,6 +57,8 @@ using ILoggerPtr = std::shared_ptr; ILoggerPtr newNullLogger(); +ILoggerPtr newStdErrLogger(LogLevel level = LogLevel::Warn); + } // namespace qevercloud #endif // QEVERCLOUD_LOG_H diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 75908113..2af6ee8e 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -7,6 +7,10 @@ #include +#include +#include +#include + namespace qevercloud { namespace { @@ -41,12 +45,21 @@ void printLogLevel(T & out, const LogLevel level) class NullLogger final: public ILogger { public: - virtual void writeLog( - const LogLevel level, const char * fileName, + virtual bool shouldLog( + const LogLevel level, const char * component) const override + { + Q_UNUSED(level) + Q_UNUSED(component) + return false; + } + + virtual void log( + const LogLevel level, const char * component, const char * fileName, const quint32 lineNumber, const qint64 timestamp, const QString & message) override { Q_UNUSED(level) + Q_UNUSED(component) Q_UNUSED(fileName) Q_UNUSED(lineNumber) Q_UNUSED(timestamp) @@ -55,16 +68,108 @@ class NullLogger final: public ILogger virtual void setLevel(const LogLevel level) override { - m_level = level; + m_level.store(static_cast(level)); + } + + virtual LogLevel level() const override + { + return static_cast(m_level.load()); + } + +private: + std::atomic m_level; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class StdErrLogger final: public ILogger +{ +public: + StdErrLogger(LogLevel level) : + m_cerr(stderr), + m_level(static_cast(level)) + {} + + virtual bool shouldLog( + const LogLevel level, const char * component) const override + { + Q_UNUSED(component) + return (static_cast(level) <= m_level); + } + + virtual void log( + const LogLevel level, const char * component, const char * fileName, + const quint32 lineNumber, const qint64 timestamp, + const QString & message) override + { + if (!shouldLog(level, component)) { + return; + } + + printTimestamp(timestamp); + + m_cerr << "\t" << static_cast(m_level.load()) + << "\t[" << component << "] " + << fileName << ":" << lineNumber << " " + << message << "\n"; + } + + virtual void setLevel(const LogLevel level) override + { + m_level.store(static_cast(level)); } virtual LogLevel level() const override { - return m_level; + return static_cast(m_level.load()); } private: - LogLevel m_level; + void printTimestamp(const qint64 timestamp) + { + std::time_t t(timestamp / 1000); + std::tm localTm; + Q_UNUSED(localTm) + std::tm * tm = Q_NULLPTR; + +#ifdef _MSC_VER + // MSVC's localtime is thread-safe since MSVC 2005 + tm = std::localtime(&t); +#else // ifdef _MSC_VER +#ifdef __MINGW32__ + // MinGW lacks localtime_r but uses MS's localtime instead which is told to + // be thread-safe but it's still not re-entrant. + // So, can at best hope it won't cause problems too often + tm = localtime(&t); +#else // POSIX + tm = &localTm; + Q_UNUSED(localtime_r(&t, tm)) +#endif +#endif // ifdef _MSC_VER + + const size_t maxBufSize = 100; + char buffer[maxBufSize]; + const char * format = "%Y-%m-%d %H:%M:%S"; + size_t size = strftime(buffer, maxBufSize, format, tm); + + m_cerr << QString::fromLocal8Bit(buffer, static_cast(size)); + + qint64 msecPart = timestamp - t * 1000; + m_cerr << "."; + m_cerr << QString::fromUtf8("%1").arg(msecPart, 3, 10, QChar::fromLatin1('0')); + +#if !defined(_MSC_VER) && !defined(__MINGW32__) + const char * timezone = tm->tm_zone; + if (timezone) { + m_cerr << " "; + m_cerr << QString::fromLocal8Bit(timezone); + } +#endif + } + +private: + QTextStream m_cerr; + std::atomic m_level; }; } // namespace @@ -76,6 +181,11 @@ ILoggerPtr newNullLogger() return std::make_shared(); } +ILoggerPtr newStdErrLogger(LogLevel level) +{ + return std::make_shared(level); +} + QTextStream & operator<<(QTextStream & out, const LogLevel level) { printLogLevel(out, level); From 6b24005b77092936a62e024c15a43b1f08605f3d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 17 Oct 2019 07:47:30 +0300 Subject: [PATCH 037/188] Add global static logger object + methods to get and set it + add handy macros for logging --- QEverCloud/headers/Log.h | 48 ++++++++++++++++++++++++++++++++++++++-- QEverCloud/src/Log.cpp | 25 +++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index c62e0ddf..8b3fe442 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -10,6 +10,7 @@ #include "Export.h" +#include #include #include @@ -55,9 +56,52 @@ using ILoggerPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// -ILoggerPtr newNullLogger(); +QEVERCLOUD_EXPORT ILoggerPtr logger(); -ILoggerPtr newStdErrLogger(LogLevel level = LogLevel::Warn); +QEVERCLOUD_EXPORT void setLogger(ILoggerPtr logger); + +QEVERCLOUD_EXPORT ILoggerPtr newNullLogger(); + +QEVERCLOUD_EXPORT ILoggerPtr newStdErrLogger(LogLevel level = LogLevel::Warn); + +//////////////////////////////////////////////////////////////////////////////// + +#define __QEVERCLOUD_LOG_BASE(component, level, message) \ + { \ + auto __qevercloudLogger = ::qevercloud::logger(); \ + if (__qevercloudLogger->shouldLog(level, component)) \ + { \ + QString msg; \ + QDebug dbg(&msg); \ + dbg.nospace(); \ + dbg.noquote(); \ + dbg << message; \ + __qevercloudLogger->log( \ + level, \ + component, \ + __FILE__, \ + __LINE__, \ + QDateTime::currentMSecsSinceEpoch(), \ + msg); \ + } \ + } \ +// __QEVERCLOUD_LOG_BASE + +#define QEC_TRACE(component, message) \ + __QEVERCLOUD_LOG_BASE(component, LogLevel::Trace, message) \ +// QEC_TRACE + +#define QEC_DEBUG(component, message) \ + __QEVERCLOUD_LOG_BASE(component, LogLevel::Debug, message) \ +// QEC_DEBUG + +#define QEC_WARNING(component, message) \ + __QEVERCLOUD_LOG_BASE(component, LogLevel::Warn, message) \ +// QEC_WARNING + +#define QEC_ERROR(component, message) \ + __QEVERCLOUD_LOG_BASE(component, LogLevel::Error, message) \ +// QEC_ERROR } // namespace qevercloud diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 2af6ee8e..ba41f164 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -7,6 +7,8 @@ #include +#include + #include #include #include @@ -17,6 +19,10 @@ namespace { //////////////////////////////////////////////////////////////////////////////// +Q_GLOBAL_STATIC(ILoggerPtr, globalLogger) + +//////////////////////////////////////////////////////////////////////////////// + template void printLogLevel(T & out, const LogLevel level) { @@ -176,6 +182,25 @@ class StdErrLogger final: public ILogger //////////////////////////////////////////////////////////////////////////////// +ILoggerPtr logger() +{ + if (globalLogger.exists() && + !globalLogger.isDestroyed() && + (globalLogger->get() != nullptr)) + { + return *globalLogger; + } + + return newNullLogger(); +} + +void setLogger(ILoggerPtr logger) +{ + if (!globalLogger.isDestroyed()) { + *globalLogger = logger; + } +} + ILoggerPtr newNullLogger() { return std::make_shared(); From 63e3f2b219a7a155c45763f4cba7169688243012 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 17 Oct 2019 07:48:11 +0300 Subject: [PATCH 038/188] Add logging for thumbnail downloading --- QEverCloud/src/Thumbnail.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 0cc76eba..27244d81 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -9,6 +9,7 @@ #include "Http.h" +#include #include namespace qevercloud { @@ -79,6 +80,10 @@ Thumbnail & Thumbnail::setImageType(ImageType::type imageType) QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) { + QEC_DEBUG("thumbnail", "Downloading thumbnail: guid = " << guid + << (isPublic ? "public" : "non-public") << ", " + << (isResourceGuid ? "resource guid" : "not a resource guid")); + int httpStatusCode = 0; QPair request = createPostRequest(guid, isPublic, isResourceGuid); @@ -86,6 +91,9 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), request.first, request.second, &httpStatusCode); if (httpStatusCode != 200) { + QEC_WARNING("thumbnail", "Failed to download thumbnail with guid " + << guid << ": http status code = " << httpStatusCode); + throw EverCloudException( QString::fromUtf8("HTTP Status Code = %1").arg(httpStatusCode)); } @@ -95,6 +103,10 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) AsyncResult* Thumbnail::downloadAsync(Guid guid, bool isPublic, bool isResourceGuid) { + QEC_DEBUG("thumbnail", "Starting async thumbnail download: guid = " << guid + << (isPublic ? "public" : "non-public") << ", " + << (isResourceGuid ? "resource guid" : "not a resource guid")); + QPair pair = createPostRequest(guid, isPublic, isResourceGuid); return new AsyncResult(pair.first, pair.second); @@ -140,6 +152,8 @@ QPair Thumbnail::createPostRequest( url += QStringLiteral("?size=%1").arg(d->m_size); } + QEC_TRACE("thumbnail", "Sending thumbnail download request: url = " << url); + request.setUrl(QUrl(url)); request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded")); From 785dba846cb9fdd81d883cdff5f4edb64615de38 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 17 Oct 2019 07:51:45 +0300 Subject: [PATCH 039/188] Add info log level + fix shouldLog method for stderr logger --- QEverCloud/headers/Log.h | 5 +++++ QEverCloud/src/Log.cpp | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 8b3fe442..42c50d0e 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -24,6 +24,7 @@ enum class LogLevel { Trace = 0, Debug, + Info, Warn, Error }; @@ -95,6 +96,10 @@ QEVERCLOUD_EXPORT ILoggerPtr newStdErrLogger(LogLevel level = LogLevel::Warn); __QEVERCLOUD_LOG_BASE(component, LogLevel::Debug, message) \ // QEC_DEBUG +#define QEC_INFO(component, message) \ + __QEVERCLOUD_LOG_BASE(component, LogLevel::Info, message) \ +// QEC_INFO + #define QEC_WARNING(component, message) \ __QEVERCLOUD_LOG_BASE(component, LogLevel::Warn, message) \ // QEC_WARNING diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index ba41f164..408d527f 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -34,6 +34,9 @@ void printLogLevel(T & out, const LogLevel level) case LogLevel::Debug: out << "Debug"; break; + case LogLevel::Info: + out << "Info"; + break; case LogLevel::Warn: out << "Warn"; break; @@ -100,7 +103,7 @@ class StdErrLogger final: public ILogger const LogLevel level, const char * component) const override { Q_UNUSED(component) - return (static_cast(level) <= m_level); + return (static_cast(level) >= m_level); } virtual void log( From 756fa4fa74cac0806a200e1e30b9f4be117a23cb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 18 Oct 2019 07:40:55 +0300 Subject: [PATCH 040/188] More detailed logging for thumbnails downloading --- QEverCloud/src/Thumbnail.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 27244d81..0a67c8e1 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -90,7 +90,8 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), request.first, request.second, &httpStatusCode); - if (httpStatusCode != 200) { + if (httpStatusCode != 200) + { QEC_WARNING("thumbnail", "Failed to download thumbnail with guid " << guid << ": http status code = " << httpStatusCode); @@ -98,6 +99,7 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) QString::fromUtf8("HTTP Status Code = %1").arg(httpStatusCode)); } + QEC_DEBUG("thumbnail", "Finished download for guid " << guid); return reply; } @@ -109,7 +111,24 @@ AsyncResult* Thumbnail::downloadAsync(Guid guid, bool isPublic, bool isResourceG QPair pair = createPostRequest(guid, isPublic, isResourceGuid); - return new AsyncResult(pair.first, pair.second); + auto res = new AsyncResult(pair.first, pair.second); + QObject::connect(res, &AsyncResult::finished, + [=] (const QVariant & value, + const QSharedPointer data) + { + Q_UNUSED(value) + + if (data.isNull()) { + QEC_DEBUG("thumbnail", "Finished async download " + << "for guid " << guid); + return; + } + + QEC_WARNING("thumbnail", "Async download for guid " + << guid << " finished with error: " + << data->errorMessage); + }); + return res; } QPair Thumbnail::createPostRequest( From 62992f0fe79da90801668a70ee251026283d1eab Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 18 Oct 2019 07:42:02 +0300 Subject: [PATCH 041/188] Add logging for ink note images downloading and for OAuth request sequence --- QEverCloud/src/InkNoteImageDownloader.cpp | 19 ++++++++++++++++++- QEverCloud/src/OAuth.cpp | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index aa09f2ed..bb846bb7 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -86,6 +87,9 @@ InkNoteImageDownloader & InkNoteImageDownloader::setHeight(int height) QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) { + QEC_DEBUG("ink_note_image", "Downloading ink note image: guid = " << guid + << (isPublic ? "public" : "non-public")); + Q_D(InkNoteImageDownloader); QSize size(d_ptr->m_width, d_ptr->m_height); @@ -102,10 +106,17 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) QPair postRequest = d->createPostRequest(urlPart, sliceCounter, isPublic); + QEC_DEBUG("ink_note_image", "Sending download request to url: " + << postRequest.first.url()); + QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), postRequest.first, postRequest.second, &httpStatusCode); if (httpStatusCode != 200) { + QEC_WARNING("ink_note_image", "Failed to download slice " + << sliceCounter << " for guid " << guid + << ": http status code = " << httpStatusCode); + throw EverCloudException( QStringLiteral("HTTP Status Code = %1").arg(httpStatusCode)); } @@ -114,7 +125,11 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) Q_UNUSED(replyImagePart.loadFromData(reply, "PNG")) if (replyImagePart.isNull()) { - if (Q_UNLIKELY(inkNoteImage.isNull())) { + if (Q_UNLIKELY(inkNoteImage.isNull())) + { + QEC_WARNING("ink_note_image", "Failed to read downloaded data " + << "as a png image"); + throw EverCloudException( QStringLiteral("Ink note's image part is null before even " "starting to assemble")); @@ -148,6 +163,8 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) QBuffer buffer(&imageData); Q_UNUSED(buffer.open(QIODevice::WriteOnly)) inkNoteImage.save(&buffer, "PNG"); + + QEC_DEBUG("ink_note_image", "Finished download for guid " << guid); return imageData; } diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index b9f20fee..7c3d65a1 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -10,6 +10,7 @@ #include "Http.h" #include +#include #include #include @@ -135,6 +136,8 @@ EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : void EvernoteOAuthWebView::authenticate( QString host, QString consumerKey, QString consumerSecret) { + QEC_DEBUG("oauth", "Sending request to acquire temporary token"); + Q_D(EvernoteOAuthWebView); d->m_host = host; d->m_isSucceeded = false; @@ -198,15 +201,19 @@ void EvernoteOAuthWebViewPrivate::temporaryFinished(QObject * rf) ReplyFetcher * replyFetcher = qobject_cast(rf); if (replyFetcher->isError()) { + QEC_WARNING("oauth", "Failed to acquire temporary token: " + << replyFetcher->errorText()); setError(replyFetcher->errorText()); } else { + QEC_DEBUG("oauth", "Successfully acquired temporary token"); QString reply = QString::fromUtf8(replyFetcher->receivedData().constData()); int index = reply.indexOf(QStringLiteral("&oauth_token_secret")); QString token = reply.left(index); // step 2: directing a user to the login page + QEC_DEBUG("oauth", "Setting up login window"); QObject::connect(this, &EvernoteOAuthWebViewPrivate::urlChanged, this, &EvernoteOAuthWebViewPrivate::onUrlChanged); QUrl loginUrl(QString::fromUtf8("https://%1//OAuth.action?%2") @@ -225,10 +232,13 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) if (s.contains(QStringLiteral("nnoauth?")) && s.contains(oauthMarker)) { if (s.contains(QStringLiteral("&oauth_verifier="))) - { // success + { + QEC_DEBUG("oauth", "Received approval for permanent token receipt"); + QString token = s.mid(s.indexOf(oauthMarker) + oauthMarker.length()); // step 4: acquire permanent token + QEC_DEBUG("oauth", "Sending request to acquire permanent token"); ReplyFetcher * replyFetcher = new ReplyFetcher(); QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &EvernoteOAuthWebViewPrivate::permanentFinished); @@ -241,6 +251,7 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) } else { + QEC_WARNING("oauth", "Authentication failed"); setError(QStringLiteral("Authentification failed.")); } @@ -255,10 +266,13 @@ void EvernoteOAuthWebViewPrivate::permanentFinished(QObject * rf) ReplyFetcher * replyFetcher = qobject_cast(rf); if (replyFetcher->isError()) { + QEC_WARNING("oauth", "Failed to acquire permanent token"); setError(replyFetcher->errorText()); } else { + QEC_DEBUG("oauth", "Successfully acquired permanent token"); + m_isSucceeded = true; QByteArray reply = replyFetcher->receivedData(); From 34e54f16725e4ef08f1e75c79d38629d3739ef69 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 19 Oct 2019 20:26:20 +0300 Subject: [PATCH 042/188] Introduce logging to DurableService calls --- QEverCloud/headers/DurableService.h | 32 +- QEverCloud/src/DurableService.cpp | 62 +- QEverCloud/src/generated/Services.cpp | 1424 ++++++++++++++++--- QEverCloud/src/tests/TestDurableService.cpp | 72 +- 4 files changed, 1376 insertions(+), 214 deletions(-) diff --git a/QEverCloud/headers/DurableService.h b/QEverCloud/headers/DurableService.h index 51b82705..e4227e8c 100644 --- a/QEverCloud/headers/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -42,12 +42,40 @@ class QEVERCLOUD_EXPORT IDurableService using SyncServiceCall = std::function; using AsyncServiceCall = std::function; + struct QEVERCLOUD_EXPORT SyncRequest + { + const char * m_name; + QString m_description; + SyncServiceCall m_call; + + SyncRequest(const char * name, QString description, + SyncServiceCall && call) : + m_name(name), + m_description(std::move(description)), + m_call(std::move(call)) + {} + }; + + struct QEVERCLOUD_EXPORT AsyncRequest + { + const char * m_name; + QString m_description; + AsyncServiceCall m_call; + + AsyncRequest(const char * name, QString description, + AsyncServiceCall && call) : + m_name(name), + m_description(std::move(description)), + m_call(std::move(call)) + {} + }; + public: virtual SyncResult executeSyncRequest( - SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) = 0; + SyncRequest && syncRequest, IRequestContextPtr ctx) = 0; virtual AsyncResult * executeAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) = 0; + AsyncRequest && asyncRequest, IRequestContextPtr ctx) = 0; }; using IDurableServicePtr = std::shared_ptr; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index fa6e3f71..7485702f 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -71,14 +72,14 @@ class Q_DECL_HIDDEN DurableService: public IDurableService DurableService(IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx); virtual SyncResult executeSyncRequest( - SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) override; + SyncRequest && syncRequest, IRequestContextPtr ctx) override; virtual AsyncResult * executeAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) override; + AsyncRequest && asyncRequest, IRequestContextPtr ctx) override; private: void doExecuteAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + AsyncRequest && asyncRequest, IRequestContextPtr ctx, RetryState && retryState, AsyncResult * result); private: @@ -97,7 +98,7 @@ DurableService::DurableService(IRetryPolicyPtr retryPolicy, } DurableService::SyncResult DurableService::executeSyncRequest( - SyncServiceCall && syncServiceCall, IRequestContextPtr ctx) + SyncRequest && syncRequest, IRequestContextPtr ctx) { if (!ctx) { ctx = m_ctx; @@ -110,8 +111,14 @@ DurableService::SyncResult DurableService::executeSyncRequest( while(state.m_retryCount) { + QEC_DEBUG("durable_service", "Executing sync " << syncRequest.m_name + << " request: " << state.m_retryCount << " attempts left, timeout = " + << ctx->requestTimeout()); + QEC_TRACE("durable_service", "Request details: " + << syncRequest.m_description); + try { - result = syncServiceCall(ctx); + result = syncRequest.m_call(ctx); } catch(const EverCloudException & e) { result.second = e.exceptionData(); @@ -124,13 +131,22 @@ DurableService::SyncResult DurableService::executeSyncRequest( if (result.second) { + QEC_WARNING("durable_service", "Sync request " << syncRequest.m_name + << " failed: " << result.second->errorMessage + << "; request details: " << syncRequest.m_description); + if (!m_retryPolicy->shouldRetry(result.second)) { + QEC_WARNING("durable_service", "Error is not retriable"); return result; } --state.m_retryCount; + if (!state.m_retryCount) { + QEC_WARNING("durable_service", "No retry attempts left"); + break; + } - if (state.m_retryCount && ctx->increaseRequestTimeoutExponentially()) + if (ctx->increaseRequestTimeoutExponentially()) { auto timeout = ctx->requestTimeout(); auto maxTimeout = ctx->maxRequestTimeout(); @@ -144,9 +160,16 @@ DurableService::SyncResult DurableService::executeSyncRequest( ctx->maxRequestRetryCount()); } + QEC_INFO("durable_service", "Retrying sync " << syncRequest.m_name + << " request, " << state.m_retryCount << " attempts left"); continue; } + if (!result.second) { + QEC_DEBUG("durable_service", "Successfully executed sync " + << syncRequest.m_name << " request"); + } + break; } @@ -154,7 +177,7 @@ DurableService::SyncResult DurableService::executeSyncRequest( } AsyncResult * DurableService::executeAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx) + AsyncRequest && asyncRequest, IRequestContextPtr ctx) { if (!ctx) { ctx = m_ctx; @@ -164,17 +187,23 @@ AsyncResult * DurableService::executeAsyncRequest( state.m_retryCount = ctx->maxRequestRetryCount(); AsyncResult * result = new AsyncResult(QString(), QByteArray()); - doExecuteAsyncRequest(std::move(asyncServiceCall), std::move(ctx), + doExecuteAsyncRequest(std::move(asyncRequest), std::move(ctx), std::move(state), result); return result; } void DurableService::doExecuteAsyncRequest( - AsyncServiceCall && asyncServiceCall, IRequestContextPtr ctx, + AsyncRequest && asyncRequest, IRequestContextPtr ctx, RetryState && retryState, AsyncResult * result) { - AsyncResult * attemptRes = asyncServiceCall(ctx); + QEC_DEBUG("durable_service", "Executing async " << asyncRequest.m_name + << " request: " << retryState.m_retryCount << " attempts left, timeout = " + << ctx->requestTimeout()); + QEC_TRACE("durable_service", "Request details: " + << asyncRequest.m_description); + + AsyncResult * attemptRes = asyncRequest.m_call(ctx); QObject::connect( attemptRes, &AsyncResult::finished, @@ -184,22 +213,29 @@ void DurableService::doExecuteAsyncRequest( QSharedPointer exceptionData) mutable { if (!exceptionData) { + QEC_DEBUG("durable_service", "Successfully executed async " + << asyncRequest.m_name << " request"); result->d_ptr->setValue(value, {}); return; } + QEC_WARNING("durable_service", "Sync request " << asyncRequest.m_name + << " failed: " << exceptionData->errorMessage + << "; request details: " << asyncRequest.m_description); + if (!retryPolicy->shouldRetry(exceptionData)) { + QEC_WARNING("durable_service", "Error is not retriable"); result->d_ptr->setValue({}, exceptionData); return; } --retryState.m_retryCount; if (!retryState.m_retryCount) { + QEC_WARNING("durable_service", "No retry attempts left"); result->d_ptr->setValue({}, exceptionData); return; } - quint64 requestTimeout = ctx->requestTimeout(); if (ctx->increaseRequestTimeoutExponentially()) { auto timeout = ctx->requestTimeout(); @@ -214,8 +250,10 @@ void DurableService::doExecuteAsyncRequest( ctx->maxRequestRetryCount()); } + QEC_INFO("durable_service", "Retrying async " << asyncRequest.m_name + << " request, " << retryState.m_retryCount << " attempts left"); doExecuteAsyncRequest( - std::move(asyncServiceCall), std::move(ctx), + std::move(asyncRequest), std::move(ctx), std::move(retryState), result); }, Qt::QueuedConnection); diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index f0b20ec6..93c2d632 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15402,8 +15402,14 @@ SyncState DurableNoteStore::getSyncState( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getSyncState", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15422,8 +15428,14 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getSyncState", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15448,8 +15460,14 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getFilteredSyncChunk", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15474,8 +15492,14 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getFilteredSyncChunk", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15496,8 +15520,14 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getLinkedNotebookSyncState", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15518,8 +15548,14 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getLinkedNotebookSyncState", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15546,8 +15582,14 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getLinkedNotebookSyncChunk", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15574,8 +15616,14 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getLinkedNotebookSyncChunk", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15594,8 +15642,14 @@ QList DurableNoteStore::listNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listNotebooks", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -15614,8 +15668,14 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listNotebooks", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15634,8 +15694,14 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listAccessibleBusinessNotebooks", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -15654,8 +15720,14 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listAccessibleBusinessNotebooks", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15676,8 +15748,14 @@ Notebook DurableNoteStore::getNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15698,8 +15776,14 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15718,8 +15802,14 @@ Notebook DurableNoteStore::getDefaultNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getDefaultNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15738,8 +15828,14 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getDefaultNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15760,8 +15856,14 @@ Notebook DurableNoteStore::createNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15782,8 +15884,14 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15804,8 +15912,14 @@ qint32 DurableNoteStore::updateNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15826,8 +15940,14 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15848,8 +15968,14 @@ qint32 DurableNoteStore::expungeNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "expungeNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15870,8 +15996,14 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "expungeNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15890,8 +16022,14 @@ QList DurableNoteStore::listTags( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listTags", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -15910,8 +16048,14 @@ AsyncResult * DurableNoteStore::listTagsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listTags", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15932,8 +16076,14 @@ QList DurableNoteStore::listTagsByNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listTagsByNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -15954,8 +16104,14 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listTagsByNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -15976,8 +16132,14 @@ Tag DurableNoteStore::getTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getTag", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -15998,8 +16160,14 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getTag", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16020,8 +16188,14 @@ Tag DurableNoteStore::createTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createTag", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16042,8 +16216,14 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createTag", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16064,8 +16244,14 @@ qint32 DurableNoteStore::updateTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateTag", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16086,8 +16272,14 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateTag", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16108,8 +16300,14 @@ void DurableNoteStore::untagAll( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "untagAll", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -16130,8 +16328,14 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "untagAll", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16152,8 +16356,14 @@ qint32 DurableNoteStore::expungeTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "expungeTag", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16174,8 +16384,14 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "expungeTag", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16194,8 +16410,14 @@ QList DurableNoteStore::listSearches( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listSearches", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -16214,8 +16436,14 @@ AsyncResult * DurableNoteStore::listSearchesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listSearches", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16236,8 +16464,14 @@ SavedSearch DurableNoteStore::getSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getSearch", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16258,8 +16492,14 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getSearch", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16280,8 +16520,14 @@ SavedSearch DurableNoteStore::createSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createSearch", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16302,8 +16548,14 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createSearch", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16324,8 +16576,14 @@ qint32 DurableNoteStore::updateSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateSearch", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16346,8 +16604,14 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateSearch", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16368,8 +16632,14 @@ qint32 DurableNoteStore::expungeSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "expungeSearch", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16390,8 +16660,14 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "expungeSearch", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16414,8 +16690,14 @@ qint32 DurableNoteStore::findNoteOffset( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "findNoteOffset", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16438,8 +16720,14 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "findNoteOffset", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16466,8 +16754,14 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "findNotesMetadata", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16494,8 +16788,14 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "findNotesMetadata", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16518,8 +16818,14 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "findNoteCounts", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16542,8 +16848,14 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "findNoteCounts", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16566,8 +16878,14 @@ Note DurableNoteStore::getNoteWithResultSpec( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteWithResultSpec", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16590,8 +16908,14 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteWithResultSpec", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16620,8 +16944,14 @@ Note DurableNoteStore::getNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16650,8 +16980,14 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16672,8 +17008,14 @@ LazyMap DurableNoteStore::getNoteApplicationData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteApplicationData", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16694,8 +17036,14 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteApplicationData", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16718,8 +17066,14 @@ QString DurableNoteStore::getNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -16742,8 +17096,14 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16768,8 +17128,14 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "setNoteApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16794,8 +17160,14 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "setNoteApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16818,8 +17190,14 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "unsetNoteApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -16842,8 +17220,14 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "unsetNoteApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16864,8 +17248,14 @@ QString DurableNoteStore::getNoteContent( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteContent", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -16886,8 +17276,14 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteContent", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16912,8 +17308,14 @@ QString DurableNoteStore::getNoteSearchText( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteSearchText", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -16938,8 +17340,14 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteSearchText", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -16960,8 +17368,14 @@ QString DurableNoteStore::getResourceSearchText( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceSearchText", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -16982,8 +17396,14 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceSearchText", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17004,8 +17424,14 @@ QStringList DurableNoteStore::getNoteTagNames( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteTagNames", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toStringList(); } @@ -17026,8 +17452,14 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteTagNames", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17048,8 +17480,14 @@ Note DurableNoteStore::createNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17070,8 +17508,14 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17092,8 +17536,14 @@ Note DurableNoteStore::updateNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17114,8 +17564,14 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17136,8 +17592,14 @@ qint32 DurableNoteStore::deleteNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "deleteNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17158,8 +17620,14 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "deleteNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17180,8 +17648,14 @@ qint32 DurableNoteStore::expungeNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "expungeNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17202,8 +17676,14 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "expungeNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17226,8 +17706,14 @@ Note DurableNoteStore::copyNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "copyNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17250,8 +17736,14 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "copyNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17272,8 +17764,14 @@ QList DurableNoteStore::listNoteVersions( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listNoteVersions", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -17294,8 +17792,14 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listNoteVersions", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17324,8 +17828,14 @@ Note DurableNoteStore::getNoteVersion( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNoteVersion", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17354,8 +17864,14 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNoteVersion", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17384,8 +17900,14 @@ Resource DurableNoteStore::getResource( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResource", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17414,8 +17936,14 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResource", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17436,8 +17964,14 @@ LazyMap DurableNoteStore::getResourceApplicationData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceApplicationData", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17458,8 +17992,14 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceApplicationData", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17482,8 +18022,14 @@ QString DurableNoteStore::getResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -17506,8 +18052,14 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17532,8 +18084,14 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "setResourceApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17558,8 +18116,14 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "setResourceApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17582,8 +18146,14 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "unsetResourceApplicationDataEntry", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17606,8 +18176,14 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "unsetResourceApplicationDataEntry", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17628,8 +18204,14 @@ qint32 DurableNoteStore::updateResource( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateResource", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17650,8 +18232,14 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateResource", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17672,8 +18260,14 @@ QByteArray DurableNoteStore::getResourceData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceData", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toByteArray(); } @@ -17694,8 +18288,14 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceData", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17724,8 +18324,14 @@ Resource DurableNoteStore::getResourceByHash( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceByHash", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17754,8 +18360,14 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceByHash", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17776,8 +18388,14 @@ QByteArray DurableNoteStore::getResourceRecognition( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceRecognition", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toByteArray(); } @@ -17798,8 +18416,14 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceRecognition", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17820,8 +18444,14 @@ QByteArray DurableNoteStore::getResourceAlternateData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceAlternateData", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toByteArray(); } @@ -17842,8 +18472,14 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceAlternateData", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17864,8 +18500,14 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getResourceAttributes", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17886,8 +18528,14 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getResourceAttributes", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17910,8 +18558,14 @@ Notebook DurableNoteStore::getPublicNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getPublicNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17934,8 +18588,14 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getPublicNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -17958,8 +18618,14 @@ SharedNotebook DurableNoteStore::shareNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "shareNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -17982,8 +18648,14 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "shareNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18004,8 +18676,14 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createOrUpdateNotebookShares", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18026,8 +18704,14 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createOrUpdateNotebookShares", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18048,8 +18732,14 @@ qint32 DurableNoteStore::updateSharedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateSharedNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18070,8 +18760,14 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateSharedNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18094,8 +18790,14 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "setNotebookRecipientSettings", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18118,8 +18820,14 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "setNotebookRecipientSettings", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18138,8 +18846,14 @@ QList DurableNoteStore::listSharedNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listSharedNotebooks", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -18158,8 +18872,14 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listSharedNotebooks", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18180,8 +18900,14 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "createLinkedNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18202,8 +18928,14 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "createLinkedNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18224,8 +18956,14 @@ qint32 DurableNoteStore::updateLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateLinkedNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18246,8 +18984,14 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateLinkedNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18266,8 +19010,14 @@ QList DurableNoteStore::listLinkedNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listLinkedNotebooks", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -18286,8 +19036,14 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listLinkedNotebooks", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18308,8 +19064,14 @@ qint32 DurableNoteStore::expungeLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "expungeLinkedNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18330,8 +19092,14 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "expungeLinkedNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18352,8 +19120,14 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "authenticateToSharedNotebook", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18374,8 +19148,14 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "authenticateToSharedNotebook", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18394,8 +19174,14 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getSharedNotebookByAuth", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18414,8 +19200,14 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getSharedNotebookByAuth", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18436,8 +19228,14 @@ void DurableNoteStore::emailNote( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "emailNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -18458,8 +19256,14 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "emailNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18480,8 +19284,14 @@ QString DurableNoteStore::shareNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "shareNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toString(); } @@ -18502,8 +19312,14 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "shareNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18524,8 +19340,14 @@ void DurableNoteStore::stopSharingNote( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "stopSharingNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -18546,8 +19368,14 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "stopSharingNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18570,8 +19398,14 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "authenticateToSharedNote", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18594,8 +19428,14 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "authenticateToSharedNote", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18618,8 +19458,14 @@ RelatedResult DurableNoteStore::findRelated( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "findRelated", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18642,8 +19488,14 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "findRelated", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18664,8 +19516,14 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateNoteIfUsnMatches", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18686,8 +19544,14 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateNoteIfUsnMatches", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18708,8 +19572,14 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "manageNotebookShares", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18730,8 +19600,14 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "manageNotebookShares", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18752,8 +19628,14 @@ ShareRelationships DurableNoteStore::getNotebookShares( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getNotebookShares", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18774,8 +19656,14 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getNotebookShares", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18802,8 +19690,14 @@ bool DurableUserStore::checkVersion( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "checkVersion", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.toBool(); } @@ -18828,8 +19722,14 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "checkVersion", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18850,8 +19750,14 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getBootstrapInfo", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18872,8 +19778,14 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getBootstrapInfo", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18906,8 +19818,14 @@ AuthenticationResult DurableUserStore::authenticateLongSession( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "authenticateLongSession", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18940,8 +19858,14 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "authenticateLongSession", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -18966,8 +19890,14 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "completeTwoFactorAuthentication", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -18992,8 +19922,14 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "completeTwoFactorAuthentication", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19012,8 +19948,14 @@ void DurableUserStore::revokeLongSession( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "revokeLongSession", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -19032,8 +19974,14 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "revokeLongSession", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19052,8 +20000,14 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "authenticateToBusiness", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -19072,8 +20026,14 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "authenticateToBusiness", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19092,8 +20052,14 @@ User DurableUserStore::getUser( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getUser", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -19112,8 +20078,14 @@ AsyncResult * DurableUserStore::getUserAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getUser", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19134,8 +20106,14 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getPublicUserInfo", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -19156,8 +20134,14 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getPublicUserInfo", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19176,8 +20160,14 @@ UserUrls DurableUserStore::getUserUrls( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getUserUrls", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -19196,8 +20186,14 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getUserUrls", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19218,8 +20214,14 @@ void DurableUserStore::inviteToBusiness( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "inviteToBusiness", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -19240,8 +20242,14 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "inviteToBusiness", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19262,8 +20270,14 @@ void DurableUserStore::removeFromBusiness( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "removeFromBusiness", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -19284,8 +20298,14 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "removeFromBusiness", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19308,8 +20328,14 @@ void DurableUserStore::updateBusinessUserIdentifier( return IDurableService::SyncResult(QVariant(), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "updateBusinessUserIdentifier", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return; } @@ -19332,8 +20358,14 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "updateBusinessUserIdentifier", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19352,8 +20384,14 @@ QList DurableUserStore::listBusinessUsers( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listBusinessUsers", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -19372,8 +20410,14 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listBusinessUsers", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19394,8 +20438,14 @@ QList DurableUserStore::listBusinessInvitations( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "listBusinessInvitations", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value>(); } @@ -19416,8 +20466,14 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "listBusinessInvitations", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } @@ -19438,8 +20494,14 @@ AccountLimits DurableUserStore::getAccountLimits( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); + // TODO: compose proper description + IDurableService::SyncRequest request( + "getAccountLimits", + {}, + std::move(call)); + auto result = m_durableService->executeSyncRequest( - std::move(call), ctx); + std::move(request), ctx); return result.first.value(); } @@ -19460,8 +20522,14 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx); }); + // TODO: compose proper description + IDurableService::AsyncRequest request( + "getAccountLimits", + {}, + std::move(call)); + return m_durableService->executeAsyncRequest( - std::move(call), ctx); + std::move(request), ctx); } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 2cc24508..01c8f324 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -54,12 +54,15 @@ void DurableServiceTester::shouldExecuteSyncServiceCall() bool serviceCallDetected = false; QVariant value = QStringLiteral("value"); - auto result = durableService->executeSyncRequest( + IDurableService::SyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { Q_ASSERT(ctx); serviceCallDetected = true; return {value, {}}; - }, + }); + + auto result = durableService->executeSyncRequest( + std::move(request), newRequestContext()); QVERIFY(serviceCallDetected); @@ -72,18 +75,31 @@ void DurableServiceTester::shouldExecuteAsyncServiceCall() auto durableService = newDurableService(); bool serviceCallDetected = false; + QVariant value = QStringLiteral("value"); - AsyncResult * res = new AsyncResult(QString(), QByteArray()); - auto * result = durableService->executeAsyncRequest( + IDurableService::AsyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); serviceCallDetected = true; - return res; - }, + return new AsyncResult(value, {}); + }); + + AsyncResult * result = durableService->executeAsyncRequest( + std::move(request), newRequestContext()); + ValueFetcher valueFetcher; + QObject::connect(result, &AsyncResult::finished, + &valueFetcher, &ValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect(&valueFetcher, &ValueFetcher::finished, + &loop, &QEventLoop::quit); + loop.exec(); + QVERIFY(serviceCallDetected); - res->deleteLater(); + QVERIFY(valueFetcher.m_value == value); + QVERIFY(valueFetcher.m_exceptionData.isNull()); } void DurableServiceTester::shouldRetrySyncServiceCalls() @@ -102,7 +118,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() QVariant value = QStringLiteral("value"); - auto result = durableService->executeSyncRequest( + IDurableService::SyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -122,8 +138,9 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() } return {value, {}}; - }, - ctx); + }); + + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(result.first == value); @@ -146,7 +163,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() QVariant value = QStringLiteral("value"); - AsyncResult * result = durableService->executeAsyncRequest( + IDurableService::AsyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -166,7 +183,10 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() } return new AsyncResult(value, {}); - }, + }); + + AsyncResult * result = durableService->executeAsyncRequest( + std::move(request), ctx); ValueFetcher valueFetcher; @@ -197,7 +217,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); - auto result = durableService->executeSyncRequest( + IDurableService::SyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -212,8 +232,9 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() } return {{}, data}; - }, - ctx); + }); + + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!result.first.isValid()); @@ -244,7 +265,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); - AsyncResult * result = durableService->executeAsyncRequest( + IDurableService::AsyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -259,7 +280,10 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() } return new AsyncResult(QVariant(), data); - }, + }); + + AsyncResult * result = durableService->executeAsyncRequest( + std::move(request), ctx); ValueFetcher valueFetcher; @@ -300,7 +324,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); - auto result = durableService->executeSyncRequest( + IDurableService::SyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> IDurableService::SyncResult { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -317,8 +341,9 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError } return {{}, data}; - }, - ctx); + }); + + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == 1); QVERIFY(!result.first.isValid()); @@ -349,7 +374,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); - AsyncResult * result = durableService->executeAsyncRequest( + IDurableService::AsyncRequest request("request", {}, [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); @@ -366,7 +391,10 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro } return new AsyncResult(QVariant(), data); - }, + }); + + AsyncResult * result = durableService->executeAsyncRequest( + std::move(request), ctx); ValueFetcher valueFetcher; From c7b81ada0885e03701abbd797a124664ec2497ed Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 21 Oct 2019 07:50:05 +0300 Subject: [PATCH 043/188] Update generated code --- QEverCloud/headers/generated/Types.h | 468 + QEverCloud/src/generated/Services.cpp | 1186 ++- QEverCloud/src/generated/Types.cpp | 11856 +++++++++++++++++++++++- 3 files changed, 12900 insertions(+), 610 deletions(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index eaeacfe8..b552a67d 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -171,6 +171,12 @@ struct QEVERCLOUD_EXPORT SyncState { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SyncState & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SyncState & value); + /** * This structure is used with the 'getFilteredSyncChunk' call to provide * fine-grained control over the data that's returned when a client needs @@ -307,6 +313,12 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SyncChunkFilter & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SyncChunkFilter & value); + /** * 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 @@ -418,6 +430,12 @@ struct QEVERCLOUD_EXPORT NoteFilter { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteFilter & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteFilter & value); + /** * This structure is provided to the findNotesMetadata function to specify * the subset of fields that should be included in each NoteMetadata element @@ -478,6 +496,12 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotesMetadataResultSpec & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotesMetadataResultSpec & value); + /** * A data structure representing the number of notes for each notebook * and tag with a non-zero set of applicable notes. @@ -517,6 +541,12 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteCollectionCounts & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteCollectionCounts & value); + /** * 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 @@ -584,6 +614,12 @@ struct QEVERCLOUD_EXPORT NoteResultSpec { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteResultSpec & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteResultSpec & value); + /** * Identifying information about previous versions of a note that are backed up * within Evernote's servers. Used in the return value of the listNoteVersions @@ -638,6 +674,12 @@ struct QEVERCLOUD_EXPORT NoteVersionId { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteVersionId & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteVersionId & value); + /** * A description of the thing for which we are searching for related * entities. @@ -707,6 +749,12 @@ struct QEVERCLOUD_EXPORT RelatedQuery { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const RelatedQuery & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const RelatedQuery & value); + /** * A description of the thing for which the service will find related * entities, via findRelated(), together with a description of what @@ -794,6 +842,12 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const RelatedResultSpec & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const RelatedResultSpec & value); + /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { /** NOT DOCUMENTED */ @@ -821,6 +875,12 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ShareRelationshipRestrictions & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ShareRelationshipRestrictions & value); + /** * Describes the association between a Notebook and an Evernote User who is * a member of that notebook. @@ -887,6 +947,12 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const MemberShareRelationship & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const MemberShareRelationship & value); + /** * This structure is used by the service to communicate to clients, via * getNoteShareRelationships, which privilege levels are assignable to the @@ -925,6 +991,12 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteShareRelationshipRestrictions & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteShareRelationshipRestrictions & value); + /** * Describes the association between a Note and an Evernote User who is * a member of that note. @@ -979,6 +1051,12 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteMemberShareRelationship & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteMemberShareRelationship & value); + /** * Describes an invitation to a person to use their Evernote credentials * to gain access to a note belonging to another user. @@ -1027,6 +1105,12 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteInvitationShareRelationship & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteInvitationShareRelationship & value); + /** * Captures a collection of share relationships for a single note, * for example, as returned by the getNoteShares method. The share @@ -1064,6 +1148,12 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteShareRelationships & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteShareRelationships & value); + /** * Captures parameters used by clients to manage the shares for a given * note via the manageNoteShares function. This is used only to manage @@ -1121,6 +1211,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNoteSharesParameters & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNoteSharesParameters & value); + /** * 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 @@ -1165,6 +1261,12 @@ struct QEVERCLOUD_EXPORT Data { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Data & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Data & value); + /** * A structure holding the optional attributes that can be stored * on a User. These are generally less critical than the core User fields. @@ -1416,6 +1518,12 @@ struct QEVERCLOUD_EXPORT UserAttributes { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const UserAttributes & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const UserAttributes & value); + /** * A structure holding the optional attributes associated with users * in a business. @@ -1471,6 +1579,12 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BusinessUserAttributes & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BusinessUserAttributes & value); + /** * This represents the bookkeeping information for the user's subscription. * @@ -1620,6 +1734,12 @@ struct QEVERCLOUD_EXPORT Accounting { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Accounting & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Accounting & value); + /** * This structure is used to provide information about an Evernote Business * membership, for members who are part of a business. @@ -1670,6 +1790,12 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BusinessUserInfo & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BusinessUserInfo & value); + /** * This structure is used to provide account limits that are in effect for this user. **/ @@ -1752,6 +1878,12 @@ struct QEVERCLOUD_EXPORT AccountLimits { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const AccountLimits & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const AccountLimits & value); + /** * This represents the information about a single user account. **/ @@ -1901,6 +2033,12 @@ struct QEVERCLOUD_EXPORT User { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const User & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const User & value); + /** * A structure that represents contact information. Note this does not necessarily correspond to * an Evernote user. @@ -1966,6 +2104,12 @@ struct QEVERCLOUD_EXPORT Contact { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Contact & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Contact & value); + /** * An object that represents the relationship between a Contact that possibly * belongs to an Evernote User. @@ -2044,6 +2188,12 @@ struct QEVERCLOUD_EXPORT Identity { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Identity & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Identity & value); + /** * A tag within a user's account is a unique name which may be organized * a simple hierarchy. @@ -2107,6 +2257,12 @@ struct QEVERCLOUD_EXPORT Tag { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Tag & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Tag & value); + /** * 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 @@ -2151,6 +2307,12 @@ struct QEVERCLOUD_EXPORT LazyMap { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const LazyMap & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const LazyMap & value); + /** * Structure holding the optional attributes of a Resource * */ @@ -2256,6 +2418,12 @@ struct QEVERCLOUD_EXPORT ResourceAttributes { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ResourceAttributes & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ResourceAttributes & value); + /** * Every media file that is embedded or attached to a note is represented * through a Resource entry. @@ -2362,6 +2530,12 @@ struct QEVERCLOUD_EXPORT Resource { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Resource & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Resource & value); + /** * The list of optional attributes that can be stored on a note. * */ @@ -2607,6 +2781,12 @@ struct QEVERCLOUD_EXPORT NoteAttributes { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteAttributes & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteAttributes & value); + /** * 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 @@ -2660,6 +2840,12 @@ struct QEVERCLOUD_EXPORT SharedNote { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SharedNote & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SharedNote & value); + /** * 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 @@ -2735,6 +2921,12 @@ struct QEVERCLOUD_EXPORT NoteRestrictions { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteRestrictions & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteRestrictions & value); + /** * Represents the owner's account related limits on a Note. * The field uploaded represents the total number of bytes that have been uploaded @@ -2772,6 +2964,12 @@ struct QEVERCLOUD_EXPORT NoteLimits { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteLimits & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteLimits & value); + /** * Represents a single note in the user's account. * @@ -2950,6 +3148,12 @@ struct QEVERCLOUD_EXPORT Note { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Note & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Note & value); + /** * 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 @@ -3007,6 +3211,12 @@ struct QEVERCLOUD_EXPORT Publishing { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Publishing & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Publishing & value); + /** * 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 @@ -3052,6 +3262,12 @@ struct QEVERCLOUD_EXPORT BusinessNotebook { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BusinessNotebook & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BusinessNotebook & value); + /** * A structure defining the scope of a SavedSearch. * @@ -3088,6 +3304,12 @@ struct QEVERCLOUD_EXPORT SavedSearchScope { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SavedSearchScope & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SavedSearchScope & value); + /** * A named search associated with the account that can be quickly re-used. * */ @@ -3162,6 +3384,12 @@ struct QEVERCLOUD_EXPORT SavedSearch { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SavedSearch & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SavedSearch & value); + /** * Settings meant for the recipient of a shared notebook, such as * for indicating which types of notifications the recipient wishes @@ -3206,6 +3434,12 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SharedNotebookRecipientSettings & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SharedNotebookRecipientSettings & value); + /** * Settings meant for the recipient of a notebook share. * @@ -3268,6 +3502,12 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotebookRecipientSettings & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotebookRecipientSettings & value); + /** * Shared notebooks represent a relationship between a notebook and a single * share invitation recipient. @@ -3402,6 +3642,12 @@ struct QEVERCLOUD_EXPORT SharedNotebook { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SharedNotebook & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SharedNotebook & value); + /** * Specifies if the client can move a Notebook to a Workspace. */ @@ -3422,6 +3668,12 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const CanMoveToContainerRestrictions & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const CanMoveToContainerRestrictions & value); + /** * This structure captures information about the types of operations * that cannot be performed on a given notebook with a type of @@ -3620,6 +3872,12 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotebookRestrictions & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotebookRestrictions & value); + /** * A unique container for a set of notes. * */ @@ -3771,6 +4029,12 @@ struct QEVERCLOUD_EXPORT Notebook { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Notebook & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Notebook & value); + /** * A link in a user's account that refers them to a public or * individual shared notebook in another user's account. @@ -3874,6 +4138,12 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const LinkedNotebook & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const LinkedNotebook & value); + /** * A structure that describes a notebook or a user's relationship with * a notebook. NotebookDescriptor is expected to remain a lighter-weight @@ -3920,6 +4190,12 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotebookDescriptor & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotebookDescriptor & value); + /** * This structure represents profile information for a user in a business. * @@ -3989,6 +4265,12 @@ struct QEVERCLOUD_EXPORT UserProfile { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const UserProfile & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const UserProfile & value); + /** * 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, @@ -4034,6 +4316,12 @@ struct QEVERCLOUD_EXPORT RelatedContentImage { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const RelatedContentImage & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const RelatedContentImage & value); + /** * 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). @@ -4140,6 +4428,12 @@ struct QEVERCLOUD_EXPORT RelatedContent { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const RelatedContent & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const RelatedContent & value); + /** * A structure describing an invitation to join a business account. * @@ -4201,6 +4495,12 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BusinessInvitation & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BusinessInvitation & value); + /** * A structure that holds user identifying information such as an * email address, Evernote user ID, or an identifier from a 3rd party @@ -4253,6 +4553,12 @@ struct QEVERCLOUD_EXPORT UserIdentity { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const UserIdentity & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const UserIdentity & value); + /** * This structure is used to provide publicly-available user information * about a particular account. @@ -4303,6 +4609,12 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const PublicUserInfo & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const PublicUserInfo & value); + /** * */ struct QEVERCLOUD_EXPORT UserUrls { @@ -4368,6 +4680,12 @@ struct QEVERCLOUD_EXPORT UserUrls { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const UserUrls & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const UserUrls & value); + /** * When an authentication (or re-authentication) is performed, this structure * provides the result to the client. @@ -4454,6 +4772,12 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const AuthenticationResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const AuthenticationResult & value); + /** * This structure describes a collection of bootstrap settings. **/ @@ -4548,6 +4872,12 @@ struct QEVERCLOUD_EXPORT BootstrapSettings { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BootstrapSettings & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BootstrapSettings & value); + /** * This structure describes a collection of bootstrap settings. **/ @@ -4576,6 +4906,12 @@ struct QEVERCLOUD_EXPORT BootstrapProfile { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BootstrapProfile & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BootstrapProfile & value); + /** * This structure describes a collection of bootstrap profiles. **/ @@ -4599,6 +4935,12 @@ struct QEVERCLOUD_EXPORT BootstrapInfo { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const BootstrapInfo & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const BootstrapInfo & value); + /** * 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 @@ -4644,6 +4986,12 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const EDAMUserException & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const EDAMUserException & value); + /** * 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. @@ -4687,6 +5035,12 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const EDAMSystemException & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const EDAMSystemException & value); + /** * 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 @@ -4727,6 +5081,12 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const EDAMNotFoundException & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const EDAMNotFoundException & value); + /** * An exception thrown when the provided Contacts fail validation. For instance, * email domains could be invalid, phone numbers might not be valid for SMS, @@ -4778,6 +5138,12 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const EDAMInvalidContactsException & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const EDAMInvalidContactsException & value); + /** * 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 @@ -4897,6 +5263,12 @@ struct QEVERCLOUD_EXPORT SyncChunk { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SyncChunk & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SyncChunk & value); + /** * A small structure for returning a list of notes out of a larger set. * @@ -4971,6 +5343,12 @@ struct QEVERCLOUD_EXPORT NoteList { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteList & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteList & value); + /** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about @@ -5039,6 +5417,12 @@ struct QEVERCLOUD_EXPORT NoteMetadata { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteMetadata & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteMetadata & value); + /** * 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 @@ -5117,6 +5501,12 @@ struct QEVERCLOUD_EXPORT NotesMetadataList { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotesMetadataList & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotesMetadataList & value); + /** * Parameters that must be given to the NoteStore emailNote call. These allow * the caller to specify the note to send, the recipient addresses, etc. @@ -5178,6 +5568,12 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NoteEmailParameters & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NoteEmailParameters & value); + /** * The result of calling findRelated(). The contents of the notes, * notebooks, and tags fields will be in decreasing order of expected @@ -5287,6 +5683,12 @@ struct QEVERCLOUD_EXPORT RelatedResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const RelatedResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const RelatedResult & value); + /** * 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. @@ -5321,6 +5723,12 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const UpdateNoteIfUsnMatchesResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const UpdateNoteIfUsnMatchesResult & value); + /** * Describes an invitation to a person to use their Evernote * credentials to become a member of a notebook. @@ -5372,6 +5780,12 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const InvitationShareRelationship & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const InvitationShareRelationship & value); + /** * Captures a collection of share relationships for a notebook, for * example, as returned by the getNotebookShares method. The share @@ -5416,6 +5830,12 @@ struct QEVERCLOUD_EXPORT ShareRelationships { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ShareRelationships & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ShareRelationships & value); + /** * A structure that captures parameters used by clients to manage the * shares for a given notebook via the manageNotebookShares method. @@ -5485,6 +5905,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNotebookSharesParameters & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNotebookSharesParameters & value); + /** * A structure to capture certain errors that occurred during a call * to manageNotebookShares. That method can be run best-effort, @@ -5530,6 +5956,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNotebookSharesError & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNotebookSharesError & value); + /** * The return value of a call to the manageNotebookShares method. * @@ -5555,6 +5987,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNotebookSharesResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNotebookSharesResult & value); + /** * A structure used to share a note with one or more recipients at a given privilege. * @@ -5600,6 +6038,12 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const SharedNoteTemplate & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const SharedNoteTemplate & value); + /** * A structure used to share a notebook with one or more recipients at a given privilege. * @@ -5645,6 +6089,12 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const NotebookShareTemplate & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const NotebookShareTemplate & value); + /** * A structure containing the results of a call to createOrUpdateNotebookShares. * @@ -5676,6 +6126,12 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const CreateOrUpdateNotebookSharesResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const CreateOrUpdateNotebookSharesResult & value); + /** * Captures errors that occur during a call to manageNoteShares. That * function can be run best-effort, meaning that some change requests can @@ -5728,6 +6184,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNoteSharesError & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNoteSharesError & value); + /** * The return value of a call to the manageNoteShares function. * @@ -5753,6 +6215,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { }; +QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const ManageNoteSharesResult & value); + +QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const ManageNoteSharesResult & value); + } // namespace qevercloud Q_DECLARE_METATYPE(qevercloud::SyncState) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 93c2d632..17f9a504 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15402,7 +15402,6 @@ SyncState DurableNoteStore::getSyncState( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "getSyncState", {}, @@ -15428,7 +15427,6 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "getSyncState", {}, @@ -15460,10 +15458,15 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "filter = " << filter << "\n"; + IDurableService::SyncRequest request( "getFilteredSyncChunk", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15492,10 +15495,15 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "filter = " << filter << "\n"; + IDurableService::AsyncRequest request( "getFilteredSyncChunk", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15520,10 +15528,13 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::SyncRequest request( "getLinkedNotebookSyncState", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15548,10 +15559,13 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::AsyncRequest request( "getLinkedNotebookSyncState", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15582,10 +15596,16 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + IDurableService::SyncRequest request( "getLinkedNotebookSyncChunk", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15616,10 +15636,16 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + IDurableService::AsyncRequest request( "getLinkedNotebookSyncChunk", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15642,7 +15668,6 @@ QList DurableNoteStore::listNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listNotebooks", {}, @@ -15668,7 +15693,6 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listNotebooks", {}, @@ -15694,7 +15718,6 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listAccessibleBusinessNotebooks", {}, @@ -15720,7 +15743,6 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listAccessibleBusinessNotebooks", {}, @@ -15748,10 +15770,13 @@ Notebook DurableNoteStore::getNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15776,10 +15801,13 @@ AsyncResult * DurableNoteStore::getNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15802,7 +15830,6 @@ Notebook DurableNoteStore::getDefaultNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "getDefaultNotebook", {}, @@ -15828,7 +15855,6 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "getDefaultNotebook", {}, @@ -15856,10 +15882,13 @@ Notebook DurableNoteStore::createNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebook = " << notebook << "\n"; + IDurableService::SyncRequest request( "createNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15884,10 +15913,13 @@ AsyncResult * DurableNoteStore::createNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebook = " << notebook << "\n"; + IDurableService::AsyncRequest request( "createNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15912,10 +15944,13 @@ qint32 DurableNoteStore::updateNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebook = " << notebook << "\n"; + IDurableService::SyncRequest request( "updateNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15940,10 +15975,13 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebook = " << notebook << "\n"; + IDurableService::AsyncRequest request( "updateNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -15968,10 +16006,13 @@ qint32 DurableNoteStore::expungeNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "expungeNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -15996,10 +16037,13 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "expungeNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16022,7 +16066,6 @@ QList DurableNoteStore::listTags( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listTags", {}, @@ -16048,7 +16091,6 @@ AsyncResult * DurableNoteStore::listTagsAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listTags", {}, @@ -16076,10 +16118,13 @@ QList DurableNoteStore::listTagsByNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + IDurableService::SyncRequest request( "listTagsByNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16104,10 +16149,13 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + IDurableService::AsyncRequest request( "listTagsByNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16132,10 +16180,13 @@ Tag DurableNoteStore::getTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getTag", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16160,10 +16211,13 @@ AsyncResult * DurableNoteStore::getTagAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getTag", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16188,10 +16242,13 @@ Tag DurableNoteStore::createTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "tag = " << tag << "\n"; + IDurableService::SyncRequest request( "createTag", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16216,10 +16273,13 @@ AsyncResult * DurableNoteStore::createTagAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "tag = " << tag << "\n"; + IDurableService::AsyncRequest request( "createTag", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16244,10 +16304,13 @@ qint32 DurableNoteStore::updateTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "tag = " << tag << "\n"; + IDurableService::SyncRequest request( "updateTag", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16272,10 +16335,13 @@ AsyncResult * DurableNoteStore::updateTagAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "tag = " << tag << "\n"; + IDurableService::AsyncRequest request( "updateTag", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16300,10 +16366,13 @@ void DurableNoteStore::untagAll( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "untagAll", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16328,10 +16397,13 @@ AsyncResult * DurableNoteStore::untagAllAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "untagAll", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16356,10 +16428,13 @@ qint32 DurableNoteStore::expungeTag( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "expungeTag", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16384,10 +16459,13 @@ AsyncResult * DurableNoteStore::expungeTagAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "expungeTag", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16410,7 +16488,6 @@ QList DurableNoteStore::listSearches( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listSearches", {}, @@ -16436,7 +16513,6 @@ AsyncResult * DurableNoteStore::listSearchesAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listSearches", {}, @@ -16464,10 +16540,13 @@ SavedSearch DurableNoteStore::getSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getSearch", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16492,10 +16571,13 @@ AsyncResult * DurableNoteStore::getSearchAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getSearch", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16520,10 +16602,13 @@ SavedSearch DurableNoteStore::createSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "search = " << search << "\n"; + IDurableService::SyncRequest request( "createSearch", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16548,10 +16633,13 @@ AsyncResult * DurableNoteStore::createSearchAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "search = " << search << "\n"; + IDurableService::AsyncRequest request( "createSearch", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16576,10 +16664,13 @@ qint32 DurableNoteStore::updateSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "search = " << search << "\n"; + IDurableService::SyncRequest request( "updateSearch", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16604,10 +16695,13 @@ AsyncResult * DurableNoteStore::updateSearchAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "search = " << search << "\n"; + IDurableService::AsyncRequest request( "updateSearch", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16632,10 +16726,13 @@ qint32 DurableNoteStore::expungeSearch( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "expungeSearch", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16660,10 +16757,13 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "expungeSearch", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16690,10 +16790,14 @@ qint32 DurableNoteStore::findNoteOffset( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "findNoteOffset", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16720,10 +16824,14 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "findNoteOffset", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16754,10 +16862,16 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "offset = " << offset << "\n"; + strm << "maxNotes = " << maxNotes << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::SyncRequest request( "findNotesMetadata", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16788,10 +16902,16 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "offset = " << offset << "\n"; + strm << "maxNotes = " << maxNotes << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::AsyncRequest request( "findNotesMetadata", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16818,10 +16938,14 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "withTrash = " << withTrash << "\n"; + IDurableService::SyncRequest request( "findNoteCounts", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16848,10 +16972,14 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "filter = " << filter << "\n"; + strm << "withTrash = " << withTrash << "\n"; + IDurableService::AsyncRequest request( "findNoteCounts", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16878,10 +17006,14 @@ Note DurableNoteStore::getNoteWithResultSpec( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::SyncRequest request( "getNoteWithResultSpec", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16908,10 +17040,14 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::AsyncRequest request( "getNoteWithResultSpec", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -16944,10 +17080,17 @@ Note DurableNoteStore::getNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "withContent = " << withContent << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + IDurableService::SyncRequest request( "getNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -16980,10 +17123,17 @@ AsyncResult * DurableNoteStore::getNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "withContent = " << withContent << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + IDurableService::AsyncRequest request( "getNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17008,10 +17158,13 @@ LazyMap DurableNoteStore::getNoteApplicationData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getNoteApplicationData", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17036,10 +17189,13 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getNoteApplicationData", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17066,10 +17222,14 @@ QString DurableNoteStore::getNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::SyncRequest request( "getNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17096,10 +17256,14 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::AsyncRequest request( "getNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17128,10 +17292,15 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + IDurableService::SyncRequest request( "setNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17160,10 +17329,15 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + IDurableService::AsyncRequest request( "setNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17190,10 +17364,14 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::SyncRequest request( "unsetNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17220,10 +17398,14 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::AsyncRequest request( "unsetNoteApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17248,10 +17430,13 @@ QString DurableNoteStore::getNoteContent( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getNoteContent", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17276,10 +17461,13 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getNoteContent", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17308,10 +17496,15 @@ QString DurableNoteStore::getNoteSearchText( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "noteOnly = " << noteOnly << "\n"; + strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + IDurableService::SyncRequest request( "getNoteSearchText", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17340,10 +17533,15 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "noteOnly = " << noteOnly << "\n"; + strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + IDurableService::AsyncRequest request( "getNoteSearchText", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17368,10 +17566,13 @@ QString DurableNoteStore::getResourceSearchText( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceSearchText", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17396,10 +17597,13 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceSearchText", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17424,10 +17628,13 @@ QStringList DurableNoteStore::getNoteTagNames( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getNoteTagNames", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17452,10 +17659,13 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getNoteTagNames", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17480,10 +17690,13 @@ Note DurableNoteStore::createNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::SyncRequest request( "createNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17508,10 +17721,13 @@ AsyncResult * DurableNoteStore::createNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::AsyncRequest request( "createNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17536,10 +17752,13 @@ Note DurableNoteStore::updateNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::SyncRequest request( "updateNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17564,10 +17783,13 @@ AsyncResult * DurableNoteStore::updateNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::AsyncRequest request( "updateNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17592,10 +17814,13 @@ qint32 DurableNoteStore::deleteNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "deleteNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17620,10 +17845,13 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "deleteNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17648,10 +17876,13 @@ qint32 DurableNoteStore::expungeNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "expungeNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17676,10 +17907,13 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "expungeNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17706,10 +17940,14 @@ Note DurableNoteStore::copyNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + IDurableService::SyncRequest request( "copyNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17736,10 +17974,14 @@ AsyncResult * DurableNoteStore::copyNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + IDurableService::AsyncRequest request( "copyNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17764,10 +18006,13 @@ QList DurableNoteStore::listNoteVersions( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + IDurableService::SyncRequest request( "listNoteVersions", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17792,10 +18037,13 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + IDurableService::AsyncRequest request( "listNoteVersions", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17828,10 +18076,17 @@ Note DurableNoteStore::getNoteVersion( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "updateSequenceNum = " << updateSequenceNum << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + IDurableService::SyncRequest request( "getNoteVersion", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17864,10 +18119,17 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "updateSequenceNum = " << updateSequenceNum << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + IDurableService::AsyncRequest request( "getNoteVersion", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17900,10 +18162,17 @@ Resource DurableNoteStore::getResource( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAttributes = " << withAttributes << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + IDurableService::SyncRequest request( "getResource", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17936,10 +18205,17 @@ AsyncResult * DurableNoteStore::getResourceAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAttributes = " << withAttributes << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + IDurableService::AsyncRequest request( "getResource", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -17964,10 +18240,13 @@ LazyMap DurableNoteStore::getResourceApplicationData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceApplicationData", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -17992,10 +18271,13 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceApplicationData", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18022,10 +18304,14 @@ QString DurableNoteStore::getResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::SyncRequest request( "getResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18052,10 +18338,14 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::AsyncRequest request( "getResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18084,10 +18374,15 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + IDurableService::SyncRequest request( "setResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18116,10 +18411,15 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + IDurableService::AsyncRequest request( "setResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18146,10 +18446,14 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::SyncRequest request( "unsetResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18176,10 +18480,14 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + IDurableService::AsyncRequest request( "unsetResourceApplicationDataEntry", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18204,10 +18512,13 @@ qint32 DurableNoteStore::updateResource( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "resource = " << resource << "\n"; + IDurableService::SyncRequest request( "updateResource", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18232,10 +18543,13 @@ AsyncResult * DurableNoteStore::updateResourceAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "resource = " << resource << "\n"; + IDurableService::AsyncRequest request( "updateResource", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18260,10 +18574,13 @@ QByteArray DurableNoteStore::getResourceData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceData", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18288,10 +18605,13 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceData", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18324,10 +18644,17 @@ Resource DurableNoteStore::getResourceByHash( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "contentHash = " << contentHash << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + IDurableService::SyncRequest request( "getResourceByHash", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18360,10 +18687,17 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "noteGuid = " << noteGuid << "\n"; + strm << "contentHash = " << contentHash << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + IDurableService::AsyncRequest request( "getResourceByHash", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18388,10 +18722,13 @@ QByteArray DurableNoteStore::getResourceRecognition( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceRecognition", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18416,10 +18753,13 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceRecognition", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18444,10 +18784,13 @@ QByteArray DurableNoteStore::getResourceAlternateData( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceAlternateData", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18472,10 +18815,13 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceAlternateData", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18500,10 +18846,13 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "getResourceAttributes", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18528,10 +18877,13 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "getResourceAttributes", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18558,10 +18910,14 @@ Notebook DurableNoteStore::getPublicNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "userId = " << userId << "\n"; + strm << "publicUri = " << publicUri << "\n"; + IDurableService::SyncRequest request( "getPublicNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18588,10 +18944,14 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "userId = " << userId << "\n"; + strm << "publicUri = " << publicUri << "\n"; + IDurableService::AsyncRequest request( "getPublicNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18618,10 +18978,14 @@ SharedNotebook DurableNoteStore::shareNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "sharedNotebook = " << sharedNotebook << "\n"; + strm << "message = " << message << "\n"; + IDurableService::SyncRequest request( "shareNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18648,10 +19012,14 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "sharedNotebook = " << sharedNotebook << "\n"; + strm << "message = " << message << "\n"; + IDurableService::AsyncRequest request( "shareNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18676,10 +19044,13 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "shareTemplate = " << shareTemplate << "\n"; + IDurableService::SyncRequest request( "createOrUpdateNotebookShares", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18704,10 +19075,13 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "shareTemplate = " << shareTemplate << "\n"; + IDurableService::AsyncRequest request( "createOrUpdateNotebookShares", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18732,10 +19106,13 @@ qint32 DurableNoteStore::updateSharedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "sharedNotebook = " << sharedNotebook << "\n"; + IDurableService::SyncRequest request( "updateSharedNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18760,10 +19137,13 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "sharedNotebook = " << sharedNotebook << "\n"; + IDurableService::AsyncRequest request( "updateSharedNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18790,10 +19170,14 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + strm << "recipientSettings = " << recipientSettings << "\n"; + IDurableService::SyncRequest request( "setNotebookRecipientSettings", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18820,10 +19204,14 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + strm << "recipientSettings = " << recipientSettings << "\n"; + IDurableService::AsyncRequest request( "setNotebookRecipientSettings", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18846,7 +19234,6 @@ QList DurableNoteStore::listSharedNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listSharedNotebooks", {}, @@ -18872,7 +19259,6 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listSharedNotebooks", {}, @@ -18900,10 +19286,13 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::SyncRequest request( "createLinkedNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18928,10 +19317,13 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::AsyncRequest request( "createLinkedNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -18956,10 +19348,13 @@ qint32 DurableNoteStore::updateLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::SyncRequest request( "updateLinkedNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -18984,10 +19379,13 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "linkedNotebook = " << linkedNotebook << "\n"; + IDurableService::AsyncRequest request( "updateLinkedNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19010,7 +19408,6 @@ QList DurableNoteStore::listLinkedNotebooks( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listLinkedNotebooks", {}, @@ -19036,7 +19433,6 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listLinkedNotebooks", {}, @@ -19064,10 +19460,13 @@ qint32 DurableNoteStore::expungeLinkedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "expungeLinkedNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19092,10 +19491,13 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "expungeLinkedNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19120,10 +19522,13 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + IDurableService::SyncRequest request( "authenticateToSharedNotebook", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19148,10 +19553,13 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + IDurableService::AsyncRequest request( "authenticateToSharedNotebook", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19174,7 +19582,6 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "getSharedNotebookByAuth", {}, @@ -19200,7 +19607,6 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "getSharedNotebookByAuth", {}, @@ -19228,10 +19634,13 @@ void DurableNoteStore::emailNote( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "parameters = " << parameters << "\n"; + IDurableService::SyncRequest request( "emailNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19256,10 +19665,13 @@ AsyncResult * DurableNoteStore::emailNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "parameters = " << parameters << "\n"; + IDurableService::AsyncRequest request( "emailNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19284,10 +19696,13 @@ QString DurableNoteStore::shareNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "shareNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19312,10 +19727,13 @@ AsyncResult * DurableNoteStore::shareNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "shareNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19340,10 +19758,13 @@ void DurableNoteStore::stopSharingNote( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::SyncRequest request( "stopSharingNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19368,10 +19789,13 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + IDurableService::AsyncRequest request( "stopSharingNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19398,10 +19822,14 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "noteKey = " << noteKey << "\n"; + IDurableService::SyncRequest request( "authenticateToSharedNote", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19428,10 +19856,14 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "guid = " << guid << "\n"; + strm << "noteKey = " << noteKey << "\n"; + IDurableService::AsyncRequest request( "authenticateToSharedNote", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19458,10 +19890,14 @@ RelatedResult DurableNoteStore::findRelated( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "query = " << query << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::SyncRequest request( "findRelated", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19488,10 +19924,14 @@ AsyncResult * DurableNoteStore::findRelatedAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "query = " << query << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + IDurableService::AsyncRequest request( "findRelated", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19516,10 +19956,13 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::SyncRequest request( "updateNoteIfUsnMatches", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19544,10 +19987,13 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "note = " << note << "\n"; + IDurableService::AsyncRequest request( "updateNoteIfUsnMatches", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19572,10 +20018,13 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "parameters = " << parameters << "\n"; + IDurableService::SyncRequest request( "manageNotebookShares", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19600,10 +20049,13 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "parameters = " << parameters << "\n"; + IDurableService::AsyncRequest request( "manageNotebookShares", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19628,10 +20080,13 @@ ShareRelationships DurableNoteStore::getNotebookShares( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + IDurableService::SyncRequest request( "getNotebookShares", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19656,10 +20111,13 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "notebookGuid = " << notebookGuid << "\n"; + IDurableService::AsyncRequest request( "getNotebookShares", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19690,10 +20148,15 @@ bool DurableUserStore::checkVersion( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "clientName = " << clientName << "\n"; + strm << "edamVersionMajor = " << edamVersionMajor << "\n"; + strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + IDurableService::SyncRequest request( "checkVersion", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19722,10 +20185,15 @@ AsyncResult * DurableUserStore::checkVersionAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "clientName = " << clientName << "\n"; + strm << "edamVersionMajor = " << edamVersionMajor << "\n"; + strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + IDurableService::AsyncRequest request( "checkVersion", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19750,10 +20218,13 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "locale = " << locale << "\n"; + IDurableService::SyncRequest request( "getBootstrapInfo", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19778,10 +20249,13 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "locale = " << locale << "\n"; + IDurableService::AsyncRequest request( "getBootstrapInfo", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19818,10 +20292,19 @@ AuthenticationResult DurableUserStore::authenticateLongSession( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "username = " << username << "\n"; + strm << "password = " << password << "\n"; + strm << "consumerKey = " << consumerKey << "\n"; + strm << "consumerSecret = " << consumerSecret << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + IDurableService::SyncRequest request( "authenticateLongSession", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19858,10 +20341,19 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "username = " << username << "\n"; + strm << "password = " << password << "\n"; + strm << "consumerKey = " << consumerKey << "\n"; + strm << "consumerSecret = " << consumerSecret << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + IDurableService::AsyncRequest request( "authenticateLongSession", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19890,10 +20382,15 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "oneTimeCode = " << oneTimeCode << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + IDurableService::SyncRequest request( "completeTwoFactorAuthentication", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -19922,10 +20419,15 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "oneTimeCode = " << oneTimeCode << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + IDurableService::AsyncRequest request( "completeTwoFactorAuthentication", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -19948,7 +20450,6 @@ void DurableUserStore::revokeLongSession( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "revokeLongSession", {}, @@ -19974,7 +20475,6 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "revokeLongSession", {}, @@ -20000,7 +20500,6 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "authenticateToBusiness", {}, @@ -20026,7 +20525,6 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "authenticateToBusiness", {}, @@ -20052,7 +20550,6 @@ User DurableUserStore::getUser( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "getUser", {}, @@ -20078,7 +20575,6 @@ AsyncResult * DurableUserStore::getUserAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "getUser", {}, @@ -20106,10 +20602,13 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "username = " << username << "\n"; + IDurableService::SyncRequest request( "getPublicUserInfo", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20134,10 +20633,13 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "username = " << username << "\n"; + IDurableService::AsyncRequest request( "getPublicUserInfo", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -20160,7 +20662,6 @@ UserUrls DurableUserStore::getUserUrls( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "getUserUrls", {}, @@ -20186,7 +20687,6 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "getUserUrls", {}, @@ -20214,10 +20714,13 @@ void DurableUserStore::inviteToBusiness( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "emailAddress = " << emailAddress << "\n"; + IDurableService::SyncRequest request( "inviteToBusiness", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20242,10 +20745,13 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "emailAddress = " << emailAddress << "\n"; + IDurableService::AsyncRequest request( "inviteToBusiness", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -20270,10 +20776,13 @@ void DurableUserStore::removeFromBusiness( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "emailAddress = " << emailAddress << "\n"; + IDurableService::SyncRequest request( "removeFromBusiness", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20298,10 +20807,13 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "emailAddress = " << emailAddress << "\n"; + IDurableService::AsyncRequest request( "removeFromBusiness", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -20328,10 +20840,14 @@ void DurableUserStore::updateBusinessUserIdentifier( return IDurableService::SyncResult(QVariant(), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "oldEmailAddress = " << oldEmailAddress << "\n"; + strm << "newEmailAddress = " << newEmailAddress << "\n"; + IDurableService::SyncRequest request( "updateBusinessUserIdentifier", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20358,10 +20874,14 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "oldEmailAddress = " << oldEmailAddress << "\n"; + strm << "newEmailAddress = " << newEmailAddress << "\n"; + IDurableService::AsyncRequest request( "updateBusinessUserIdentifier", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -20384,7 +20904,6 @@ QList DurableUserStore::listBusinessUsers( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description IDurableService::SyncRequest request( "listBusinessUsers", {}, @@ -20410,7 +20929,6 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( ctx); }); - // TODO: compose proper description IDurableService::AsyncRequest request( "listBusinessUsers", {}, @@ -20438,10 +20956,13 @@ QList DurableUserStore::listBusinessInvitations( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + IDurableService::SyncRequest request( "listBusinessInvitations", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20466,10 +20987,13 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + IDurableService::AsyncRequest request( "listBusinessInvitations", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( @@ -20494,10 +21018,13 @@ AccountLimits DurableUserStore::getAccountLimits( return IDurableService::SyncResult(QVariant::fromValue(res), {}); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "serviceLevel = " << serviceLevel << "\n"; + IDurableService::SyncRequest request( "getAccountLimits", - {}, + requestDescription, std::move(call)); auto result = m_durableService->executeSyncRequest( @@ -20522,10 +21049,13 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( ctx); }); - // TODO: compose proper description + QString requestDescription; + QTextStream strm(&requestDescription); + strm << "serviceLevel = " << serviceLevel << "\n"; + IDurableService::AsyncRequest request( "getAccountLimits", - {}, + requestDescription, std::move(call)); return m_durableService->executeAsyncRequest( diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index 621cad96..36f5f707 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -440,6 +440,90 @@ void readSyncState(ThriftBinaryBufferReader & r, SyncState & s) { if(!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.updateCount has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SyncState & value) +{ + out << "SyncState: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + out << " fullSyncBefore = " + << "Timestamp" << "\n"; + out << " updateCount = " + << "qint32" << "\n"; + + if (value.uploaded.isSet()) { + out << " uploaded = " + << value.uploaded.ref() << "\n"; + } + else { + out << " uploaded is not set\n"; + } + + if (value.userLastUpdated.isSet()) { + out << " userLastUpdated = " + << value.userLastUpdated.ref() << "\n"; + } + else { + out << " userLastUpdated is not set\n"; + } + + if (value.userMaxMessageEventId.isSet()) { + out << " userMaxMessageEventId = " + << value.userMaxMessageEventId.ref() << "\n"; + } + else { + out << " userMaxMessageEventId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SyncState & value) +{ + out << "SyncState: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + out << " fullSyncBefore = " + << "Timestamp" << "\n"; + out << " updateCount = " + << "qint32" << "\n"; + + if (value.uploaded.isSet()) { + out << " uploaded = " + << value.uploaded.ref() << "\n"; + } + else { + out << " uploaded is not set\n"; + } + + if (value.userLastUpdated.isSet()) { + out << " userLastUpdated = " + << value.userLastUpdated.ref() << "\n"; + } + else { + out << " userLastUpdated is not set\n"; + } + + if (value.userMaxMessageEventId.isSet()) { + out << " userMaxMessageEventId = " + << value.userMaxMessageEventId.ref() << "\n"; + } + else { + out << " userMaxMessageEventId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeStructBegin(QStringLiteral("SyncChunk")); w.writeFieldBegin( @@ -857,6 +941,298 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { if(!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.updateCount has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SyncChunk & value) +{ + out << "SyncChunk: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + + if (value.chunkHighUSN.isSet()) { + out << " chunkHighUSN = " + << value.chunkHighUSN.ref() << "\n"; + } + else { + out << " chunkHighUSN is not set\n"; + } + + out << " updateCount = " + << "qint32" << "\n"; + + if (value.notes.isSet()) { + out << " notes = " + << "QList {"; + for(const auto & v: value.notes.ref()) { + out << v; + } + } + else { + out << " notes is not set\n"; + } + + if (value.notebooks.isSet()) { + out << " notebooks = " + << "QList {"; + for(const auto & v: value.notebooks.ref()) { + out << v; + } + } + else { + out << " notebooks is not set\n"; + } + + if (value.tags.isSet()) { + out << " tags = " + << "QList {"; + for(const auto & v: value.tags.ref()) { + out << v; + } + } + else { + out << " tags is not set\n"; + } + + if (value.searches.isSet()) { + out << " searches = " + << "QList {"; + for(const auto & v: value.searches.ref()) { + out << v; + } + } + else { + out << " searches is not set\n"; + } + + if (value.resources.isSet()) { + out << " resources = " + << "QList {"; + for(const auto & v: value.resources.ref()) { + out << v; + } + } + else { + out << " resources is not set\n"; + } + + if (value.expungedNotes.isSet()) { + out << " expungedNotes = " + << "QList {"; + for(const auto & v: value.expungedNotes.ref()) { + out << v; + } + } + else { + out << " expungedNotes is not set\n"; + } + + if (value.expungedNotebooks.isSet()) { + out << " expungedNotebooks = " + << "QList {"; + for(const auto & v: value.expungedNotebooks.ref()) { + out << v; + } + } + else { + out << " expungedNotebooks is not set\n"; + } + + if (value.expungedTags.isSet()) { + out << " expungedTags = " + << "QList {"; + for(const auto & v: value.expungedTags.ref()) { + out << v; + } + } + else { + out << " expungedTags is not set\n"; + } + + if (value.expungedSearches.isSet()) { + out << " expungedSearches = " + << "QList {"; + for(const auto & v: value.expungedSearches.ref()) { + out << v; + } + } + else { + out << " expungedSearches is not set\n"; + } + + if (value.linkedNotebooks.isSet()) { + out << " linkedNotebooks = " + << "QList {"; + for(const auto & v: value.linkedNotebooks.ref()) { + out << v; + } + } + else { + out << " linkedNotebooks is not set\n"; + } + + if (value.expungedLinkedNotebooks.isSet()) { + out << " expungedLinkedNotebooks = " + << "QList {"; + for(const auto & v: value.expungedLinkedNotebooks.ref()) { + out << v; + } + } + else { + out << " expungedLinkedNotebooks is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SyncChunk & value) +{ + out << "SyncChunk: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + + if (value.chunkHighUSN.isSet()) { + out << " chunkHighUSN = " + << value.chunkHighUSN.ref() << "\n"; + } + else { + out << " chunkHighUSN is not set\n"; + } + + out << " updateCount = " + << "qint32" << "\n"; + + if (value.notes.isSet()) { + out << " notes = " + << "QList {"; + for(const auto & v: value.notes.ref()) { + out << v; + } + } + else { + out << " notes is not set\n"; + } + + if (value.notebooks.isSet()) { + out << " notebooks = " + << "QList {"; + for(const auto & v: value.notebooks.ref()) { + out << v; + } + } + else { + out << " notebooks is not set\n"; + } + + if (value.tags.isSet()) { + out << " tags = " + << "QList {"; + for(const auto & v: value.tags.ref()) { + out << v; + } + } + else { + out << " tags is not set\n"; + } + + if (value.searches.isSet()) { + out << " searches = " + << "QList {"; + for(const auto & v: value.searches.ref()) { + out << v; + } + } + else { + out << " searches is not set\n"; + } + + if (value.resources.isSet()) { + out << " resources = " + << "QList {"; + for(const auto & v: value.resources.ref()) { + out << v; + } + } + else { + out << " resources is not set\n"; + } + + if (value.expungedNotes.isSet()) { + out << " expungedNotes = " + << "QList {"; + for(const auto & v: value.expungedNotes.ref()) { + out << v; + } + } + else { + out << " expungedNotes is not set\n"; + } + + if (value.expungedNotebooks.isSet()) { + out << " expungedNotebooks = " + << "QList {"; + for(const auto & v: value.expungedNotebooks.ref()) { + out << v; + } + } + else { + out << " expungedNotebooks is not set\n"; + } + + if (value.expungedTags.isSet()) { + out << " expungedTags = " + << "QList {"; + for(const auto & v: value.expungedTags.ref()) { + out << v; + } + } + else { + out << " expungedTags is not set\n"; + } + + if (value.expungedSearches.isSet()) { + out << " expungedSearches = " + << "QList {"; + for(const auto & v: value.expungedSearches.ref()) { + out << v; + } + } + else { + out << " expungedSearches is not set\n"; + } + + if (value.linkedNotebooks.isSet()) { + out << " linkedNotebooks = " + << "QList {"; + for(const auto & v: value.linkedNotebooks.ref()) { + out << v; + } + } + else { + out << " linkedNotebooks is not set\n"; + } + + if (value.expungedLinkedNotebooks.isSet()) { + out << " expungedLinkedNotebooks = " + << "QList {"; + for(const auto & v: value.expungedLinkedNotebooks.ref()) { + out << v; + } + } + else { + out << " expungedLinkedNotebooks is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & s) { w.writeStructBegin(QStringLiteral("SyncChunkFilter")); if (s.includeNotes.isSet()) { @@ -1166,6 +1542,292 @@ void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SyncChunkFilter & value) +{ + out << "SyncChunkFilter: {\n"; + + if (value.includeNotes.isSet()) { + out << " includeNotes = " + << value.includeNotes.ref() << "\n"; + } + else { + out << " includeNotes is not set\n"; + } + + if (value.includeNoteResources.isSet()) { + out << " includeNoteResources = " + << value.includeNoteResources.ref() << "\n"; + } + else { + out << " includeNoteResources is not set\n"; + } + + if (value.includeNoteAttributes.isSet()) { + out << " includeNoteAttributes = " + << value.includeNoteAttributes.ref() << "\n"; + } + else { + out << " includeNoteAttributes is not set\n"; + } + + if (value.includeNotebooks.isSet()) { + out << " includeNotebooks = " + << value.includeNotebooks.ref() << "\n"; + } + else { + out << " includeNotebooks is not set\n"; + } + + if (value.includeTags.isSet()) { + out << " includeTags = " + << value.includeTags.ref() << "\n"; + } + else { + out << " includeTags is not set\n"; + } + + if (value.includeSearches.isSet()) { + out << " includeSearches = " + << value.includeSearches.ref() << "\n"; + } + else { + out << " includeSearches is not set\n"; + } + + if (value.includeResources.isSet()) { + out << " includeResources = " + << value.includeResources.ref() << "\n"; + } + else { + out << " includeResources is not set\n"; + } + + if (value.includeLinkedNotebooks.isSet()) { + out << " includeLinkedNotebooks = " + << value.includeLinkedNotebooks.ref() << "\n"; + } + else { + out << " includeLinkedNotebooks is not set\n"; + } + + if (value.includeExpunged.isSet()) { + out << " includeExpunged = " + << value.includeExpunged.ref() << "\n"; + } + else { + out << " includeExpunged is not set\n"; + } + + if (value.includeNoteApplicationDataFullMap.isSet()) { + out << " includeNoteApplicationDataFullMap = " + << value.includeNoteApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeNoteApplicationDataFullMap is not set\n"; + } + + if (value.includeResourceApplicationDataFullMap.isSet()) { + out << " includeResourceApplicationDataFullMap = " + << value.includeResourceApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeResourceApplicationDataFullMap is not set\n"; + } + + if (value.includeNoteResourceApplicationDataFullMap.isSet()) { + out << " includeNoteResourceApplicationDataFullMap = " + << value.includeNoteResourceApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeNoteResourceApplicationDataFullMap is not set\n"; + } + + if (value.includeSharedNotes.isSet()) { + out << " includeSharedNotes = " + << value.includeSharedNotes.ref() << "\n"; + } + else { + out << " includeSharedNotes is not set\n"; + } + + if (value.omitSharedNotebooks.isSet()) { + out << " omitSharedNotebooks = " + << value.omitSharedNotebooks.ref() << "\n"; + } + else { + out << " omitSharedNotebooks is not set\n"; + } + + if (value.requireNoteContentClass.isSet()) { + out << " requireNoteContentClass = " + << value.requireNoteContentClass.ref() << "\n"; + } + else { + out << " requireNoteContentClass is not set\n"; + } + + if (value.notebookGuids.isSet()) { + out << " notebookGuids = " + << "QSet {"; + for(const auto & v: value.notebookGuids.ref()) { + out << v; + } + } + else { + out << " notebookGuids is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SyncChunkFilter & value) +{ + out << "SyncChunkFilter: {\n"; + + if (value.includeNotes.isSet()) { + out << " includeNotes = " + << value.includeNotes.ref() << "\n"; + } + else { + out << " includeNotes is not set\n"; + } + + if (value.includeNoteResources.isSet()) { + out << " includeNoteResources = " + << value.includeNoteResources.ref() << "\n"; + } + else { + out << " includeNoteResources is not set\n"; + } + + if (value.includeNoteAttributes.isSet()) { + out << " includeNoteAttributes = " + << value.includeNoteAttributes.ref() << "\n"; + } + else { + out << " includeNoteAttributes is not set\n"; + } + + if (value.includeNotebooks.isSet()) { + out << " includeNotebooks = " + << value.includeNotebooks.ref() << "\n"; + } + else { + out << " includeNotebooks is not set\n"; + } + + if (value.includeTags.isSet()) { + out << " includeTags = " + << value.includeTags.ref() << "\n"; + } + else { + out << " includeTags is not set\n"; + } + + if (value.includeSearches.isSet()) { + out << " includeSearches = " + << value.includeSearches.ref() << "\n"; + } + else { + out << " includeSearches is not set\n"; + } + + if (value.includeResources.isSet()) { + out << " includeResources = " + << value.includeResources.ref() << "\n"; + } + else { + out << " includeResources is not set\n"; + } + + if (value.includeLinkedNotebooks.isSet()) { + out << " includeLinkedNotebooks = " + << value.includeLinkedNotebooks.ref() << "\n"; + } + else { + out << " includeLinkedNotebooks is not set\n"; + } + + if (value.includeExpunged.isSet()) { + out << " includeExpunged = " + << value.includeExpunged.ref() << "\n"; + } + else { + out << " includeExpunged is not set\n"; + } + + if (value.includeNoteApplicationDataFullMap.isSet()) { + out << " includeNoteApplicationDataFullMap = " + << value.includeNoteApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeNoteApplicationDataFullMap is not set\n"; + } + + if (value.includeResourceApplicationDataFullMap.isSet()) { + out << " includeResourceApplicationDataFullMap = " + << value.includeResourceApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeResourceApplicationDataFullMap is not set\n"; + } + + if (value.includeNoteResourceApplicationDataFullMap.isSet()) { + out << " includeNoteResourceApplicationDataFullMap = " + << value.includeNoteResourceApplicationDataFullMap.ref() << "\n"; + } + else { + out << " includeNoteResourceApplicationDataFullMap is not set\n"; + } + + if (value.includeSharedNotes.isSet()) { + out << " includeSharedNotes = " + << value.includeSharedNotes.ref() << "\n"; + } + else { + out << " includeSharedNotes is not set\n"; + } + + if (value.omitSharedNotebooks.isSet()) { + out << " omitSharedNotebooks = " + << value.omitSharedNotebooks.ref() << "\n"; + } + else { + out << " omitSharedNotebooks is not set\n"; + } + + if (value.requireNoteContentClass.isSet()) { + out << " requireNoteContentClass = " + << value.requireNoteContentClass.ref() << "\n"; + } + else { + out << " requireNoteContentClass is not set\n"; + } + + if (value.notebookGuids.isSet()) { + out << " notebookGuids = " + << "QSet {"; + for(const auto & v: value.notebookGuids.ref()) { + out << v; + } + } + else { + out << " notebookGuids is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeStructBegin(QStringLiteral("NoteFilter")); if (s.order.isSet()) { @@ -1424,8 +2086,246 @@ void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { r.readStructEnd(); } -void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { - w.writeStructBegin(QStringLiteral("NoteList")); +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteFilter & value) +{ + out << "NoteFilter: {\n"; + + if (value.order.isSet()) { + out << " order = " + << value.order.ref() << "\n"; + } + else { + out << " order is not set\n"; + } + + if (value.ascending.isSet()) { + out << " ascending = " + << value.ascending.ref() << "\n"; + } + else { + out << " ascending is not set\n"; + } + + if (value.words.isSet()) { + out << " words = " + << value.words.ref() << "\n"; + } + else { + out << " words is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.timeZone.isSet()) { + out << " timeZone = " + << value.timeZone.ref() << "\n"; + } + else { + out << " timeZone is not set\n"; + } + + if (value.inactive.isSet()) { + out << " inactive = " + << value.inactive.ref() << "\n"; + } + else { + out << " inactive is not set\n"; + } + + if (value.emphasized.isSet()) { + out << " emphasized = " + << value.emphasized.ref() << "\n"; + } + else { + out << " emphasized is not set\n"; + } + + if (value.includeAllReadableNotebooks.isSet()) { + out << " includeAllReadableNotebooks = " + << value.includeAllReadableNotebooks.ref() << "\n"; + } + else { + out << " includeAllReadableNotebooks is not set\n"; + } + + if (value.includeAllReadableWorkspaces.isSet()) { + out << " includeAllReadableWorkspaces = " + << value.includeAllReadableWorkspaces.ref() << "\n"; + } + else { + out << " includeAllReadableWorkspaces is not set\n"; + } + + if (value.context.isSet()) { + out << " context = " + << value.context.ref() << "\n"; + } + else { + out << " context is not set\n"; + } + + if (value.rawWords.isSet()) { + out << " rawWords = " + << value.rawWords.ref() << "\n"; + } + else { + out << " rawWords is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteFilter & value) +{ + out << "NoteFilter: {\n"; + + if (value.order.isSet()) { + out << " order = " + << value.order.ref() << "\n"; + } + else { + out << " order is not set\n"; + } + + if (value.ascending.isSet()) { + out << " ascending = " + << value.ascending.ref() << "\n"; + } + else { + out << " ascending is not set\n"; + } + + if (value.words.isSet()) { + out << " words = " + << value.words.ref() << "\n"; + } + else { + out << " words is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.timeZone.isSet()) { + out << " timeZone = " + << value.timeZone.ref() << "\n"; + } + else { + out << " timeZone is not set\n"; + } + + if (value.inactive.isSet()) { + out << " inactive = " + << value.inactive.ref() << "\n"; + } + else { + out << " inactive is not set\n"; + } + + if (value.emphasized.isSet()) { + out << " emphasized = " + << value.emphasized.ref() << "\n"; + } + else { + out << " emphasized is not set\n"; + } + + if (value.includeAllReadableNotebooks.isSet()) { + out << " includeAllReadableNotebooks = " + << value.includeAllReadableNotebooks.ref() << "\n"; + } + else { + out << " includeAllReadableNotebooks is not set\n"; + } + + if (value.includeAllReadableWorkspaces.isSet()) { + out << " includeAllReadableWorkspaces = " + << value.includeAllReadableWorkspaces.ref() << "\n"; + } + else { + out << " includeAllReadableWorkspaces is not set\n"; + } + + if (value.context.isSet()) { + out << " context = " + << value.context.ref() << "\n"; + } + else { + out << " context is not set\n"; + } + + if (value.rawWords.isSet()) { + out << " rawWords = " + << value.rawWords.ref() << "\n"; + } + else { + out << " rawWords is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { + w.writeStructBegin(QStringLiteral("NoteList")); w.writeFieldBegin( QStringLiteral("startIndex"), ThriftFieldType::T_I32, @@ -1628,6 +2528,134 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { if(!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.notes has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteList & value) +{ + out << "NoteList: {\n"; + out << " startIndex = " + << "qint32" << "\n"; + out << " totalNotes = " + << "qint32" << "\n"; + out << " notes = " + << "QList" << "\n"; + + if (value.stoppedWords.isSet()) { + out << " stoppedWords = " + << "QList {"; + for(const auto & v: value.stoppedWords.ref()) { + out << v; + } + } + else { + out << " stoppedWords is not set\n"; + } + + if (value.searchedWords.isSet()) { + out << " searchedWords = " + << "QList {"; + for(const auto & v: value.searchedWords.ref()) { + out << v; + } + } + else { + out << " searchedWords is not set\n"; + } + + if (value.updateCount.isSet()) { + out << " updateCount = " + << value.updateCount.ref() << "\n"; + } + else { + out << " updateCount is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteList & value) +{ + out << "NoteList: {\n"; + out << " startIndex = " + << "qint32" << "\n"; + out << " totalNotes = " + << "qint32" << "\n"; + out << " notes = " + << "QList" << "\n"; + + if (value.stoppedWords.isSet()) { + out << " stoppedWords = " + << "QList {"; + for(const auto & v: value.stoppedWords.ref()) { + out << v; + } + } + else { + out << " stoppedWords is not set\n"; + } + + if (value.searchedWords.isSet()) { + out << " searchedWords = " + << "QList {"; + for(const auto & v: value.searchedWords.ref()) { + out << v; + } + } + else { + out << " searchedWords is not set\n"; + } + + if (value.updateCount.isSet()) { + out << " updateCount = " + << value.updateCount.ref() << "\n"; + } + else { + out << " updateCount is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeStructBegin(QStringLiteral("NoteMetadata")); w.writeFieldBegin( @@ -1870,6 +2898,216 @@ void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { if(!guid_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteMetadata.guid has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteMetadata & value) +{ + out << "NoteMetadata: {\n"; + out << " guid = " + << "Guid" << "\n"; + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.contentLength.isSet()) { + out << " contentLength = " + << value.contentLength.ref() << "\n"; + } + else { + out << " contentLength is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.largestResourceMime.isSet()) { + out << " largestResourceMime = " + << value.largestResourceMime.ref() << "\n"; + } + else { + out << " largestResourceMime is not set\n"; + } + + if (value.largestResourceSize.isSet()) { + out << " largestResourceSize = " + << value.largestResourceSize.ref() << "\n"; + } + else { + out << " largestResourceSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteMetadata & value) +{ + out << "NoteMetadata: {\n"; + out << " guid = " + << "Guid" << "\n"; + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.contentLength.isSet()) { + out << " contentLength = " + << value.contentLength.ref() << "\n"; + } + else { + out << " contentLength is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.largestResourceMime.isSet()) { + out << " largestResourceMime = " + << value.largestResourceMime.ref() << "\n"; + } + else { + out << " largestResourceMime is not set\n"; + } + + if (value.largestResourceSize.isSet()) { + out << " largestResourceSize = " + << value.largestResourceSize.ref() << "\n"; + } + else { + out << " largestResourceSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataList & s) { w.writeStructBegin(QStringLiteral("NotesMetadataList")); w.writeFieldBegin( @@ -2074,31 +3312,159 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) if(!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.notes has no value")); } -void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s) { - w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); - if (s.includeTitle.isSet()) { - w.writeFieldBegin( - QStringLiteral("includeTitle"), - ThriftFieldType::T_BOOL, - 2); - w.writeBool(s.includeTitle.ref()); - w.writeFieldEnd(); +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotesMetadataList & value) +{ + out << "NotesMetadataList: {\n"; + out << " startIndex = " + << "qint32" << "\n"; + out << " totalNotes = " + << "qint32" << "\n"; + out << " notes = " + << "QList" << "\n"; + + if (value.stoppedWords.isSet()) { + out << " stoppedWords = " + << "QList {"; + for(const auto & v: value.stoppedWords.ref()) { + out << v; + } } - if (s.includeContentLength.isSet()) { - w.writeFieldBegin( - QStringLiteral("includeContentLength"), - ThriftFieldType::T_BOOL, - 5); - w.writeBool(s.includeContentLength.ref()); - w.writeFieldEnd(); + else { + out << " stoppedWords is not set\n"; } - if (s.includeCreated.isSet()) { - w.writeFieldBegin( - QStringLiteral("includeCreated"), - ThriftFieldType::T_BOOL, - 6); - w.writeBool(s.includeCreated.ref()); - w.writeFieldEnd(); + + if (value.searchedWords.isSet()) { + out << " searchedWords = " + << "QList {"; + for(const auto & v: value.searchedWords.ref()) { + out << v; + } + } + else { + out << " searchedWords is not set\n"; + } + + if (value.updateCount.isSet()) { + out << " updateCount = " + << value.updateCount.ref() << "\n"; + } + else { + out << " updateCount is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotesMetadataList & value) +{ + out << "NotesMetadataList: {\n"; + out << " startIndex = " + << "qint32" << "\n"; + out << " totalNotes = " + << "qint32" << "\n"; + out << " notes = " + << "QList" << "\n"; + + if (value.stoppedWords.isSet()) { + out << " stoppedWords = " + << "QList {"; + for(const auto & v: value.stoppedWords.ref()) { + out << v; + } + } + else { + out << " stoppedWords is not set\n"; + } + + if (value.searchedWords.isSet()) { + out << " searchedWords = " + << "QList {"; + for(const auto & v: value.searchedWords.ref()) { + out << v; + } + } + else { + out << " searchedWords is not set\n"; + } + + if (value.updateCount.isSet()) { + out << " updateCount = " + << value.updateCount.ref() << "\n"; + } + else { + out << " updateCount is not set\n"; + } + + if (value.searchContextBytes.isSet()) { + out << " searchContextBytes = " + << value.searchContextBytes.ref() << "\n"; + } + else { + out << " searchContextBytes is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s) { + w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); + if (s.includeTitle.isSet()) { + w.writeFieldBegin( + QStringLiteral("includeTitle"), + ThriftFieldType::T_BOOL, + 2); + w.writeBool(s.includeTitle.ref()); + w.writeFieldEnd(); + } + if (s.includeContentLength.isSet()) { + w.writeFieldBegin( + QStringLiteral("includeContentLength"), + ThriftFieldType::T_BOOL, + 5); + w.writeBool(s.includeContentLength.ref()); + w.writeFieldEnd(); + } + if (s.includeCreated.isSet()) { + w.writeFieldBegin( + QStringLiteral("includeCreated"), + ThriftFieldType::T_BOOL, + 6); + w.writeBool(s.includeCreated.ref()); + w.writeFieldEnd(); } if (s.includeUpdated.isSet()) { w.writeFieldBegin( @@ -2284,6 +3650,206 @@ void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResu r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotesMetadataResultSpec & value) +{ + out << "NotesMetadataResultSpec: {\n"; + + if (value.includeTitle.isSet()) { + out << " includeTitle = " + << value.includeTitle.ref() << "\n"; + } + else { + out << " includeTitle is not set\n"; + } + + if (value.includeContentLength.isSet()) { + out << " includeContentLength = " + << value.includeContentLength.ref() << "\n"; + } + else { + out << " includeContentLength is not set\n"; + } + + if (value.includeCreated.isSet()) { + out << " includeCreated = " + << value.includeCreated.ref() << "\n"; + } + else { + out << " includeCreated is not set\n"; + } + + if (value.includeUpdated.isSet()) { + out << " includeUpdated = " + << value.includeUpdated.ref() << "\n"; + } + else { + out << " includeUpdated is not set\n"; + } + + if (value.includeDeleted.isSet()) { + out << " includeDeleted = " + << value.includeDeleted.ref() << "\n"; + } + else { + out << " includeDeleted is not set\n"; + } + + if (value.includeUpdateSequenceNum.isSet()) { + out << " includeUpdateSequenceNum = " + << value.includeUpdateSequenceNum.ref() << "\n"; + } + else { + out << " includeUpdateSequenceNum is not set\n"; + } + + if (value.includeNotebookGuid.isSet()) { + out << " includeNotebookGuid = " + << value.includeNotebookGuid.ref() << "\n"; + } + else { + out << " includeNotebookGuid is not set\n"; + } + + if (value.includeTagGuids.isSet()) { + out << " includeTagGuids = " + << value.includeTagGuids.ref() << "\n"; + } + else { + out << " includeTagGuids is not set\n"; + } + + if (value.includeAttributes.isSet()) { + out << " includeAttributes = " + << value.includeAttributes.ref() << "\n"; + } + else { + out << " includeAttributes is not set\n"; + } + + if (value.includeLargestResourceMime.isSet()) { + out << " includeLargestResourceMime = " + << value.includeLargestResourceMime.ref() << "\n"; + } + else { + out << " includeLargestResourceMime is not set\n"; + } + + if (value.includeLargestResourceSize.isSet()) { + out << " includeLargestResourceSize = " + << value.includeLargestResourceSize.ref() << "\n"; + } + else { + out << " includeLargestResourceSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotesMetadataResultSpec & value) +{ + out << "NotesMetadataResultSpec: {\n"; + + if (value.includeTitle.isSet()) { + out << " includeTitle = " + << value.includeTitle.ref() << "\n"; + } + else { + out << " includeTitle is not set\n"; + } + + if (value.includeContentLength.isSet()) { + out << " includeContentLength = " + << value.includeContentLength.ref() << "\n"; + } + else { + out << " includeContentLength is not set\n"; + } + + if (value.includeCreated.isSet()) { + out << " includeCreated = " + << value.includeCreated.ref() << "\n"; + } + else { + out << " includeCreated is not set\n"; + } + + if (value.includeUpdated.isSet()) { + out << " includeUpdated = " + << value.includeUpdated.ref() << "\n"; + } + else { + out << " includeUpdated is not set\n"; + } + + if (value.includeDeleted.isSet()) { + out << " includeDeleted = " + << value.includeDeleted.ref() << "\n"; + } + else { + out << " includeDeleted is not set\n"; + } + + if (value.includeUpdateSequenceNum.isSet()) { + out << " includeUpdateSequenceNum = " + << value.includeUpdateSequenceNum.ref() << "\n"; + } + else { + out << " includeUpdateSequenceNum is not set\n"; + } + + if (value.includeNotebookGuid.isSet()) { + out << " includeNotebookGuid = " + << value.includeNotebookGuid.ref() << "\n"; + } + else { + out << " includeNotebookGuid is not set\n"; + } + + if (value.includeTagGuids.isSet()) { + out << " includeTagGuids = " + << value.includeTagGuids.ref() << "\n"; + } + else { + out << " includeTagGuids is not set\n"; + } + + if (value.includeAttributes.isSet()) { + out << " includeAttributes = " + << value.includeAttributes.ref() << "\n"; + } + else { + out << " includeAttributes is not set\n"; + } + + if (value.includeLargestResourceMime.isSet()) { + out << " includeLargestResourceMime = " + << value.includeLargestResourceMime.ref() << "\n"; + } + else { + out << " includeLargestResourceMime is not set\n"; + } + + if (value.includeLargestResourceSize.isSet()) { + out << " includeLargestResourceSize = " + << value.includeLargestResourceSize.ref() << "\n"; + } + else { + out << " includeLargestResourceSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectionCounts & s) { w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); if (s.notebookCounts.isSet()) { @@ -2394,6 +3960,90 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteCollectionCounts & value) +{ + out << "NoteCollectionCounts: {\n"; + + if (value.notebookCounts.isSet()) { + out << " notebookCounts = " + << "QMap {"; + for(const auto & it: toRange(value.notebookCounts.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " notebookCounts is not set\n"; + } + + if (value.tagCounts.isSet()) { + out << " tagCounts = " + << "QMap {"; + for(const auto & it: toRange(value.tagCounts.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " tagCounts is not set\n"; + } + + if (value.trashCount.isSet()) { + out << " trashCount = " + << value.trashCount.ref() << "\n"; + } + else { + out << " trashCount is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteCollectionCounts & value) +{ + out << "NoteCollectionCounts: {\n"; + + if (value.notebookCounts.isSet()) { + out << " notebookCounts = " + << "QMap {"; + for(const auto & it: toRange(value.notebookCounts.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " notebookCounts is not set\n"; + } + + if (value.tagCounts.isSet()) { + out << " tagCounts = " + << "QMap {"; + for(const auto & it: toRange(value.tagCounts.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " tagCounts is not set\n"; + } + + if (value.trashCount.isSet()) { + out << " trashCount = " + << value.trashCount.ref() << "\n"; + } + else { + out << " trashCount is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s) { w.writeStructBegin(QStringLiteral("NoteResultSpec")); if (s.includeContent.isSet()) { @@ -2553,6 +4203,158 @@ void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteResultSpec & value) +{ + out << "NoteResultSpec: {\n"; + + if (value.includeContent.isSet()) { + out << " includeContent = " + << value.includeContent.ref() << "\n"; + } + else { + out << " includeContent is not set\n"; + } + + if (value.includeResourcesData.isSet()) { + out << " includeResourcesData = " + << value.includeResourcesData.ref() << "\n"; + } + else { + out << " includeResourcesData is not set\n"; + } + + if (value.includeResourcesRecognition.isSet()) { + out << " includeResourcesRecognition = " + << value.includeResourcesRecognition.ref() << "\n"; + } + else { + out << " includeResourcesRecognition is not set\n"; + } + + if (value.includeResourcesAlternateData.isSet()) { + out << " includeResourcesAlternateData = " + << value.includeResourcesAlternateData.ref() << "\n"; + } + else { + out << " includeResourcesAlternateData is not set\n"; + } + + if (value.includeSharedNotes.isSet()) { + out << " includeSharedNotes = " + << value.includeSharedNotes.ref() << "\n"; + } + else { + out << " includeSharedNotes is not set\n"; + } + + if (value.includeNoteAppDataValues.isSet()) { + out << " includeNoteAppDataValues = " + << value.includeNoteAppDataValues.ref() << "\n"; + } + else { + out << " includeNoteAppDataValues is not set\n"; + } + + if (value.includeResourceAppDataValues.isSet()) { + out << " includeResourceAppDataValues = " + << value.includeResourceAppDataValues.ref() << "\n"; + } + else { + out << " includeResourceAppDataValues is not set\n"; + } + + if (value.includeAccountLimits.isSet()) { + out << " includeAccountLimits = " + << value.includeAccountLimits.ref() << "\n"; + } + else { + out << " includeAccountLimits is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteResultSpec & value) +{ + out << "NoteResultSpec: {\n"; + + if (value.includeContent.isSet()) { + out << " includeContent = " + << value.includeContent.ref() << "\n"; + } + else { + out << " includeContent is not set\n"; + } + + if (value.includeResourcesData.isSet()) { + out << " includeResourcesData = " + << value.includeResourcesData.ref() << "\n"; + } + else { + out << " includeResourcesData is not set\n"; + } + + if (value.includeResourcesRecognition.isSet()) { + out << " includeResourcesRecognition = " + << value.includeResourcesRecognition.ref() << "\n"; + } + else { + out << " includeResourcesRecognition is not set\n"; + } + + if (value.includeResourcesAlternateData.isSet()) { + out << " includeResourcesAlternateData = " + << value.includeResourcesAlternateData.ref() << "\n"; + } + else { + out << " includeResourcesAlternateData is not set\n"; + } + + if (value.includeSharedNotes.isSet()) { + out << " includeSharedNotes = " + << value.includeSharedNotes.ref() << "\n"; + } + else { + out << " includeSharedNotes is not set\n"; + } + + if (value.includeNoteAppDataValues.isSet()) { + out << " includeNoteAppDataValues = " + << value.includeNoteAppDataValues.ref() << "\n"; + } + else { + out << " includeNoteAppDataValues is not set\n"; + } + + if (value.includeResourceAppDataValues.isSet()) { + out << " includeResourceAppDataValues = " + << value.includeResourceAppDataValues.ref() << "\n"; + } + else { + out << " includeResourceAppDataValues is not set\n"; + } + + if (value.includeAccountLimits.isSet()) { + out << " includeAccountLimits = " + << value.includeAccountLimits.ref() << "\n"; + } + else { + out << " includeAccountLimits is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParameters & s) { w.writeStructBegin(QStringLiteral("NoteEmailParameters")); if (s.guid.isSet()) { @@ -2706,20 +4508,152 @@ void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & r.readStructEnd(); } -void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { - w.writeStructBegin(QStringLiteral("NoteVersionId")); - w.writeFieldBegin( - QStringLiteral("updateSequenceNum"), - ThriftFieldType::T_I32, - 1); - w.writeI32(s.updateSequenceNum); - w.writeFieldEnd(); - w.writeFieldBegin( - QStringLiteral("updated"), - ThriftFieldType::T_I64, - 2); - w.writeI64(s.updated); - w.writeFieldEnd(); +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteEmailParameters & value) +{ + out << "NoteEmailParameters: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.note.isSet()) { + out << " note = " + << value.note.ref() << "\n"; + } + else { + out << " note is not set\n"; + } + + if (value.toAddresses.isSet()) { + out << " toAddresses = " + << "QList {"; + for(const auto & v: value.toAddresses.ref()) { + out << v; + } + } + else { + out << " toAddresses is not set\n"; + } + + if (value.ccAddresses.isSet()) { + out << " ccAddresses = " + << "QList {"; + for(const auto & v: value.ccAddresses.ref()) { + out << v; + } + } + else { + out << " ccAddresses is not set\n"; + } + + if (value.subject.isSet()) { + out << " subject = " + << value.subject.ref() << "\n"; + } + else { + out << " subject is not set\n"; + } + + if (value.message.isSet()) { + out << " message = " + << value.message.ref() << "\n"; + } + else { + out << " message is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteEmailParameters & value) +{ + out << "NoteEmailParameters: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.note.isSet()) { + out << " note = " + << value.note.ref() << "\n"; + } + else { + out << " note is not set\n"; + } + + if (value.toAddresses.isSet()) { + out << " toAddresses = " + << "QList {"; + for(const auto & v: value.toAddresses.ref()) { + out << v; + } + } + else { + out << " toAddresses is not set\n"; + } + + if (value.ccAddresses.isSet()) { + out << " ccAddresses = " + << "QList {"; + for(const auto & v: value.ccAddresses.ref()) { + out << v; + } + } + else { + out << " ccAddresses is not set\n"; + } + + if (value.subject.isSet()) { + out << " subject = " + << value.subject.ref() << "\n"; + } + else { + out << " subject is not set\n"; + } + + if (value.message.isSet()) { + out << " message = " + << value.message.ref() << "\n"; + } + else { + out << " message is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { + w.writeStructBegin(QStringLiteral("NoteVersionId")); + w.writeFieldBegin( + QStringLiteral("updateSequenceNum"), + ThriftFieldType::T_I32, + 1); + w.writeI32(s.updateSequenceNum); + w.writeFieldEnd(); + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_I64, + 2); + w.writeI64(s.updated); + w.writeFieldEnd(); w.writeFieldBegin( QStringLiteral("saved"), ThriftFieldType::T_I64, @@ -2818,6 +4752,62 @@ void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s) { if(!title_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.title has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteVersionId & value) +{ + out << "NoteVersionId: {\n"; + out << " updateSequenceNum = " + << "qint32" << "\n"; + out << " updated = " + << "Timestamp" << "\n"; + out << " saved = " + << "Timestamp" << "\n"; + out << " title = " + << "QString" << "\n"; + + if (value.lastEditorId.isSet()) { + out << " lastEditorId = " + << value.lastEditorId.ref() << "\n"; + } + else { + out << " lastEditorId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteVersionId & value) +{ + out << "NoteVersionId: {\n"; + out << " updateSequenceNum = " + << "qint32" << "\n"; + out << " updated = " + << "Timestamp" << "\n"; + out << " saved = " + << "Timestamp" << "\n"; + out << " title = " + << "QString" << "\n"; + + if (value.lastEditorId.isSet()) { + out << " lastEditorId = " + << value.lastEditorId.ref() << "\n"; + } + else { + out << " lastEditorId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s) { w.writeStructBegin(QStringLiteral("RelatedQuery")); if (s.noteGuid.isSet()) { @@ -2943,6 +4933,126 @@ void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const RelatedQuery & value) +{ + out << "RelatedQuery: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.plainText.isSet()) { + out << " plainText = " + << value.plainText.ref() << "\n"; + } + else { + out << " plainText is not set\n"; + } + + if (value.filter.isSet()) { + out << " filter = " + << value.filter.ref() << "\n"; + } + else { + out << " filter is not set\n"; + } + + if (value.referenceUri.isSet()) { + out << " referenceUri = " + << value.referenceUri.ref() << "\n"; + } + else { + out << " referenceUri is not set\n"; + } + + if (value.context.isSet()) { + out << " context = " + << value.context.ref() << "\n"; + } + else { + out << " context is not set\n"; + } + + if (value.cacheKey.isSet()) { + out << " cacheKey = " + << value.cacheKey.ref() << "\n"; + } + else { + out << " cacheKey is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const RelatedQuery & value) +{ + out << "RelatedQuery: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.plainText.isSet()) { + out << " plainText = " + << value.plainText.ref() << "\n"; + } + else { + out << " plainText is not set\n"; + } + + if (value.filter.isSet()) { + out << " filter = " + << value.filter.ref() << "\n"; + } + else { + out << " filter is not set\n"; + } + + if (value.referenceUri.isSet()) { + out << " referenceUri = " + << value.referenceUri.ref() << "\n"; + } + else { + out << " referenceUri is not set\n"; + } + + if (value.context.isSet()) { + out << " context = " + << value.context.ref() << "\n"; + } + else { + out << " context is not set\n"; + } + + if (value.cacheKey.isSet()) { + out << " cacheKey = " + << value.cacheKey.ref() << "\n"; + } + else { + out << " cacheKey is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeStructBegin(QStringLiteral("RelatedResult")); if (s.notes.isSet()) { @@ -3203,6 +5313,210 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const RelatedResult & value) +{ + out << "RelatedResult: {\n"; + + if (value.notes.isSet()) { + out << " notes = " + << "QList {"; + for(const auto & v: value.notes.ref()) { + out << v; + } + } + else { + out << " notes is not set\n"; + } + + if (value.notebooks.isSet()) { + out << " notebooks = " + << "QList {"; + for(const auto & v: value.notebooks.ref()) { + out << v; + } + } + else { + out << " notebooks is not set\n"; + } + + if (value.tags.isSet()) { + out << " tags = " + << "QList {"; + for(const auto & v: value.tags.ref()) { + out << v; + } + } + else { + out << " tags is not set\n"; + } + + if (value.containingNotebooks.isSet()) { + out << " containingNotebooks = " + << "QList {"; + for(const auto & v: value.containingNotebooks.ref()) { + out << v; + } + } + else { + out << " containingNotebooks is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + if (value.experts.isSet()) { + out << " experts = " + << "QList {"; + for(const auto & v: value.experts.ref()) { + out << v; + } + } + else { + out << " experts is not set\n"; + } + + if (value.relatedContent.isSet()) { + out << " relatedContent = " + << "QList {"; + for(const auto & v: value.relatedContent.ref()) { + out << v; + } + } + else { + out << " relatedContent is not set\n"; + } + + if (value.cacheKey.isSet()) { + out << " cacheKey = " + << value.cacheKey.ref() << "\n"; + } + else { + out << " cacheKey is not set\n"; + } + + if (value.cacheExpires.isSet()) { + out << " cacheExpires = " + << value.cacheExpires.ref() << "\n"; + } + else { + out << " cacheExpires is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const RelatedResult & value) +{ + out << "RelatedResult: {\n"; + + if (value.notes.isSet()) { + out << " notes = " + << "QList {"; + for(const auto & v: value.notes.ref()) { + out << v; + } + } + else { + out << " notes is not set\n"; + } + + if (value.notebooks.isSet()) { + out << " notebooks = " + << "QList {"; + for(const auto & v: value.notebooks.ref()) { + out << v; + } + } + else { + out << " notebooks is not set\n"; + } + + if (value.tags.isSet()) { + out << " tags = " + << "QList {"; + for(const auto & v: value.tags.ref()) { + out << v; + } + } + else { + out << " tags is not set\n"; + } + + if (value.containingNotebooks.isSet()) { + out << " containingNotebooks = " + << "QList {"; + for(const auto & v: value.containingNotebooks.ref()) { + out << v; + } + } + else { + out << " containingNotebooks is not set\n"; + } + + if (value.debugInfo.isSet()) { + out << " debugInfo = " + << value.debugInfo.ref() << "\n"; + } + else { + out << " debugInfo is not set\n"; + } + + if (value.experts.isSet()) { + out << " experts = " + << "QList {"; + for(const auto & v: value.experts.ref()) { + out << v; + } + } + else { + out << " experts is not set\n"; + } + + if (value.relatedContent.isSet()) { + out << " relatedContent = " + << "QList {"; + for(const auto & v: value.relatedContent.ref()) { + out << v; + } + } + else { + out << " relatedContent is not set\n"; + } + + if (value.cacheKey.isSet()) { + out << " cacheKey = " + << value.cacheKey.ref() << "\n"; + } + else { + out << " cacheKey is not set\n"; + } + + if (value.cacheExpires.isSet()) { + out << " cacheExpires = " + << value.cacheExpires.ref() << "\n"; + } + else { + out << " cacheExpires is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpec & s) { w.writeStructBegin(QStringLiteral("RelatedResultSpec")); if (s.maxNotes.isSet()) { @@ -3393,43 +5707,217 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) r.readStructEnd(); } -void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s) { - w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); - if (s.note.isSet()) { - w.writeFieldBegin( - QStringLiteral("note"), - ThriftFieldType::T_STRUCT, - 1); - writeNote(w, s.note.ref()); - w.writeFieldEnd(); +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const RelatedResultSpec & value) +{ + out << "RelatedResultSpec: {\n"; + + if (value.maxNotes.isSet()) { + out << " maxNotes = " + << value.maxNotes.ref() << "\n"; } - if (s.updated.isSet()) { - w.writeFieldBegin( - QStringLiteral("updated"), - ThriftFieldType::T_BOOL, - 2); - w.writeBool(s.updated.ref()); - w.writeFieldEnd(); + else { + out << " maxNotes is not set\n"; } - w.writeFieldStop(); - w.writeStructEnd(); -} -void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIfUsnMatchesResult & s) { - QString fname; - ThriftFieldType::type fieldType; - qint16 fieldId; - r.readStructBegin(fname); - while(true) - { - r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { - if (fieldType == ThriftFieldType::T_STRUCT) { - Note v; - readNote(r, v); - s.note = v; - } else { + if (value.maxNotebooks.isSet()) { + out << " maxNotebooks = " + << value.maxNotebooks.ref() << "\n"; + } + else { + out << " maxNotebooks is not set\n"; + } + + if (value.maxTags.isSet()) { + out << " maxTags = " + << value.maxTags.ref() << "\n"; + } + else { + out << " maxTags is not set\n"; + } + + if (value.writableNotebooksOnly.isSet()) { + out << " writableNotebooksOnly = " + << value.writableNotebooksOnly.ref() << "\n"; + } + else { + out << " writableNotebooksOnly is not set\n"; + } + + if (value.includeContainingNotebooks.isSet()) { + out << " includeContainingNotebooks = " + << value.includeContainingNotebooks.ref() << "\n"; + } + else { + out << " includeContainingNotebooks is not set\n"; + } + + if (value.includeDebugInfo.isSet()) { + out << " includeDebugInfo = " + << value.includeDebugInfo.ref() << "\n"; + } + else { + out << " includeDebugInfo is not set\n"; + } + + if (value.maxExperts.isSet()) { + out << " maxExperts = " + << value.maxExperts.ref() << "\n"; + } + else { + out << " maxExperts is not set\n"; + } + + if (value.maxRelatedContent.isSet()) { + out << " maxRelatedContent = " + << value.maxRelatedContent.ref() << "\n"; + } + else { + out << " maxRelatedContent is not set\n"; + } + + if (value.relatedContentTypes.isSet()) { + out << " relatedContentTypes = " + << "QSet {"; + for(const auto & v: value.relatedContentTypes.ref()) { + out << v; + } + } + else { + out << " relatedContentTypes is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const RelatedResultSpec & value) +{ + out << "RelatedResultSpec: {\n"; + + if (value.maxNotes.isSet()) { + out << " maxNotes = " + << value.maxNotes.ref() << "\n"; + } + else { + out << " maxNotes is not set\n"; + } + + if (value.maxNotebooks.isSet()) { + out << " maxNotebooks = " + << value.maxNotebooks.ref() << "\n"; + } + else { + out << " maxNotebooks is not set\n"; + } + + if (value.maxTags.isSet()) { + out << " maxTags = " + << value.maxTags.ref() << "\n"; + } + else { + out << " maxTags is not set\n"; + } + + if (value.writableNotebooksOnly.isSet()) { + out << " writableNotebooksOnly = " + << value.writableNotebooksOnly.ref() << "\n"; + } + else { + out << " writableNotebooksOnly is not set\n"; + } + + if (value.includeContainingNotebooks.isSet()) { + out << " includeContainingNotebooks = " + << value.includeContainingNotebooks.ref() << "\n"; + } + else { + out << " includeContainingNotebooks is not set\n"; + } + + if (value.includeDebugInfo.isSet()) { + out << " includeDebugInfo = " + << value.includeDebugInfo.ref() << "\n"; + } + else { + out << " includeDebugInfo is not set\n"; + } + + if (value.maxExperts.isSet()) { + out << " maxExperts = " + << value.maxExperts.ref() << "\n"; + } + else { + out << " maxExperts is not set\n"; + } + + if (value.maxRelatedContent.isSet()) { + out << " maxRelatedContent = " + << value.maxRelatedContent.ref() << "\n"; + } + else { + out << " maxRelatedContent is not set\n"; + } + + if (value.relatedContentTypes.isSet()) { + out << " relatedContentTypes = " + << "QSet {"; + for(const auto & v: value.relatedContentTypes.ref()) { + out << v; + } + } + else { + out << " relatedContentTypes is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s) { + w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); + if (s.note.isSet()) { + w.writeFieldBegin( + QStringLiteral("note"), + ThriftFieldType::T_STRUCT, + 1); + writeNote(w, s.note.ref()); + w.writeFieldEnd(); + } + if (s.updated.isSet()) { + w.writeFieldBegin( + QStringLiteral("updated"), + ThriftFieldType::T_BOOL, + 2); + w.writeBool(s.updated.ref()); + w.writeFieldEnd(); + } + w.writeFieldStop(); + w.writeStructEnd(); +} + +void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIfUsnMatchesResult & s) { + QString fname; + ThriftFieldType::type fieldType; + qint16 fieldId; + r.readStructBegin(fname); + while(true) + { + r.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STRUCT) { + Note v; + readNote(r, v); + s.note = v; + } else { r.skip(fieldType); } } else @@ -3450,6 +5938,62 @@ void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIf r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const UpdateNoteIfUsnMatchesResult & value) +{ + out << "UpdateNoteIfUsnMatchesResult: {\n"; + + if (value.note.isSet()) { + out << " note = " + << value.note.ref() << "\n"; + } + else { + out << " note is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const UpdateNoteIfUsnMatchesResult & value) +{ + out << "UpdateNoteIfUsnMatchesResult: {\n"; + + if (value.note.isSet()) { + out << " note = " + << value.note.ref() << "\n"; + } + else { + out << " note is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const ShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); if (s.noSetReadOnly.isSet()) { @@ -3541,6 +6085,94 @@ void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelati r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ShareRelationshipRestrictions & value) +{ + out << "ShareRelationshipRestrictions: {\n"; + + if (value.noSetReadOnly.isSet()) { + out << " noSetReadOnly = " + << value.noSetReadOnly.ref() << "\n"; + } + else { + out << " noSetReadOnly is not set\n"; + } + + if (value.noSetReadPlusActivity.isSet()) { + out << " noSetReadPlusActivity = " + << value.noSetReadPlusActivity.ref() << "\n"; + } + else { + out << " noSetReadPlusActivity is not set\n"; + } + + if (value.noSetModify.isSet()) { + out << " noSetModify = " + << value.noSetModify.ref() << "\n"; + } + else { + out << " noSetModify is not set\n"; + } + + if (value.noSetFullAccess.isSet()) { + out << " noSetFullAccess = " + << value.noSetFullAccess.ref() << "\n"; + } + else { + out << " noSetFullAccess is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ShareRelationshipRestrictions & value) +{ + out << "ShareRelationshipRestrictions: {\n"; + + if (value.noSetReadOnly.isSet()) { + out << " noSetReadOnly = " + << value.noSetReadOnly.ref() << "\n"; + } + else { + out << " noSetReadOnly is not set\n"; + } + + if (value.noSetReadPlusActivity.isSet()) { + out << " noSetReadPlusActivity = " + << value.noSetReadPlusActivity.ref() << "\n"; + } + else { + out << " noSetReadPlusActivity is not set\n"; + } + + if (value.noSetModify.isSet()) { + out << " noSetModify = " + << value.noSetModify.ref() << "\n"; + } + else { + out << " noSetModify is not set\n"; + } + + if (value.noSetFullAccess.isSet()) { + out << " noSetFullAccess = " + << value.noSetFullAccess.ref() << "\n"; + } + else { + out << " noSetFullAccess is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const InvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("InvitationShareRelationship")); if (s.displayName.isSet()) { @@ -3632,6 +6264,94 @@ void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationSha r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const InvitationShareRelationship & value) +{ + out << "InvitationShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserIdentity.isSet()) { + out << " recipientUserIdentity = " + << value.recipientUserIdentity.ref() << "\n"; + } + else { + out << " recipientUserIdentity is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const InvitationShareRelationship & value) +{ + out << "InvitationShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserIdentity.isSet()) { + out << " recipientUserIdentity = " + << value.recipientUserIdentity.ref() << "\n"; + } + else { + out << " recipientUserIdentity is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("MemberShareRelationship")); if (s.displayName.isSet()) { @@ -3757,6 +6477,126 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const MemberShareRelationship & value) +{ + out << "MemberShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.bestPrivilege.isSet()) { + out << " bestPrivilege = " + << value.bestPrivilege.ref() << "\n"; + } + else { + out << " bestPrivilege is not set\n"; + } + + if (value.individualPrivilege.isSet()) { + out << " individualPrivilege = " + << value.individualPrivilege.ref() << "\n"; + } + else { + out << " individualPrivilege is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const MemberShareRelationship & value) +{ + out << "MemberShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.bestPrivilege.isSet()) { + out << " bestPrivilege = " + << value.bestPrivilege.ref() << "\n"; + } + else { + out << " bestPrivilege is not set\n"; + } + + if (value.individualPrivilege.isSet()) { + out << " individualPrivilege = " + << value.individualPrivilege.ref() << "\n"; + } + else { + out << " individualPrivilege is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationships & s) { w.writeStructBegin(QStringLiteral("ShareRelationships")); if (s.invitations.isSet()) { @@ -3859,10 +6699,94 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s r.readStructEnd(); } -void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s) { - w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); - if (s.notebookGuid.isSet()) { - w.writeFieldBegin( +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ShareRelationships & value) +{ + out << "ShareRelationships: {\n"; + + if (value.invitations.isSet()) { + out << " invitations = " + << "QList {"; + for(const auto & v: value.invitations.ref()) { + out << v; + } + } + else { + out << " invitations is not set\n"; + } + + if (value.memberships.isSet()) { + out << " memberships = " + << "QList {"; + for(const auto & v: value.memberships.ref()) { + out << v; + } + } + else { + out << " memberships is not set\n"; + } + + if (value.invitationRestrictions.isSet()) { + out << " invitationRestrictions = " + << value.invitationRestrictions.ref() << "\n"; + } + else { + out << " invitationRestrictions is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ShareRelationships & value) +{ + out << "ShareRelationships: {\n"; + + if (value.invitations.isSet()) { + out << " invitations = " + << "QList {"; + for(const auto & v: value.invitations.ref()) { + out << v; + } + } + else { + out << " invitations is not set\n"; + } + + if (value.memberships.isSet()) { + out << " memberships = " + << "QList {"; + for(const auto & v: value.memberships.ref()) { + out << v; + } + } + else { + out << " memberships is not set\n"; + } + + if (value.invitationRestrictions.isSet()) { + out << " invitationRestrictions = " + << value.invitationRestrictions.ref() << "\n"; + } + else { + out << " invitationRestrictions is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s) { + w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); + if (s.notebookGuid.isSet()) { + w.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); @@ -4009,6 +6933,128 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNotebookSharesParameters & value) +{ + out << "ManageNotebookSharesParameters: {\n"; + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.inviteMessage.isSet()) { + out << " inviteMessage = " + << value.inviteMessage.ref() << "\n"; + } + else { + out << " inviteMessage is not set\n"; + } + + if (value.membershipsToUpdate.isSet()) { + out << " membershipsToUpdate = " + << "QList {"; + for(const auto & v: value.membershipsToUpdate.ref()) { + out << v; + } + } + else { + out << " membershipsToUpdate is not set\n"; + } + + if (value.invitationsToCreateOrUpdate.isSet()) { + out << " invitationsToCreateOrUpdate = " + << "QList {"; + for(const auto & v: value.invitationsToCreateOrUpdate.ref()) { + out << v; + } + } + else { + out << " invitationsToCreateOrUpdate is not set\n"; + } + + if (value.unshares.isSet()) { + out << " unshares = " + << "QList {"; + for(const auto & v: value.unshares.ref()) { + out << v; + } + } + else { + out << " unshares is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNotebookSharesParameters & value) +{ + out << "ManageNotebookSharesParameters: {\n"; + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.inviteMessage.isSet()) { + out << " inviteMessage = " + << value.inviteMessage.ref() << "\n"; + } + else { + out << " inviteMessage is not set\n"; + } + + if (value.membershipsToUpdate.isSet()) { + out << " membershipsToUpdate = " + << "QList {"; + for(const auto & v: value.membershipsToUpdate.ref()) { + out << v; + } + } + else { + out << " membershipsToUpdate is not set\n"; + } + + if (value.invitationsToCreateOrUpdate.isSet()) { + out << " invitationsToCreateOrUpdate = " + << "QList {"; + for(const auto & v: value.invitationsToCreateOrUpdate.ref()) { + out << v; + } + } + else { + out << " invitationsToCreateOrUpdate is not set\n"; + } + + if (value.unshares.isSet()) { + out << " unshares = " + << "QList {"; + for(const auto & v: value.unshares.ref()) { + out << v; + } + } + else { + out << " unshares is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeManageNotebookSharesError(ThriftBinaryBufferWriter & w, const ManageNotebookSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); if (s.userIdentity.isSet()) { @@ -4083,6 +7129,78 @@ void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookS r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNotebookSharesError & value) +{ + out << "ManageNotebookSharesError: {\n"; + + if (value.userIdentity.isSet()) { + out << " userIdentity = " + << value.userIdentity.ref() << "\n"; + } + else { + out << " userIdentity is not set\n"; + } + + if (value.userException.isSet()) { + out << " userException = " + << value.userException.ref() << "\n"; + } + else { + out << " userException is not set\n"; + } + + if (value.notFoundException.isSet()) { + out << " notFoundException = " + << value.notFoundException.ref() << "\n"; + } + else { + out << " notFoundException is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNotebookSharesError & value) +{ + out << "ManageNotebookSharesError: {\n"; + + if (value.userIdentity.isSet()) { + out << " userIdentity = " + << value.userIdentity.ref() << "\n"; + } + else { + out << " userIdentity is not set\n"; + } + + if (value.userException.isSet()) { + out << " userException = " + << value.userException.ref() << "\n"; + } + else { + out << " userException is not set\n"; + } + + if (value.notFoundException.isSet()) { + out << " notFoundException = " + << value.notFoundException.ref() << "\n"; + } + else { + out << " notFoundException is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); if (s.errors.isSet()) { @@ -4137,6 +7255,52 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNotebookSharesResult & value) +{ + out << "ManageNotebookSharesResult: {\n"; + + if (value.errors.isSet()) { + out << " errors = " + << "QList {"; + for(const auto & v: value.errors.ref()) { + out << v; + } + } + else { + out << " errors is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNotebookSharesResult & value) +{ + out << "ManageNotebookSharesResult: {\n"; + + if (value.errors.isSet()) { + out << " errors = " + << "QList {"; + for(const auto & v: value.errors.ref()) { + out << v; + } + } + else { + out << " errors is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTemplate & s) { w.writeStructBegin(QStringLiteral("SharedNoteTemplate")); if (s.noteGuid.isSet()) { @@ -4242,6 +7406,100 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SharedNoteTemplate & value) +{ + out << "SharedNoteTemplate: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.recipientThreadId.isSet()) { + out << " recipientThreadId = " + << value.recipientThreadId.ref() << "\n"; + } + else { + out << " recipientThreadId is not set\n"; + } + + if (value.recipientContacts.isSet()) { + out << " recipientContacts = " + << "QList {"; + for(const auto & v: value.recipientContacts.ref()) { + out << v; + } + } + else { + out << " recipientContacts is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SharedNoteTemplate & value) +{ + out << "SharedNoteTemplate: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.recipientThreadId.isSet()) { + out << " recipientThreadId = " + << value.recipientThreadId.ref() << "\n"; + } + else { + out << " recipientThreadId is not set\n"; + } + + if (value.recipientContacts.isSet()) { + out << " recipientContacts = " + << "QList {"; + for(const auto & v: value.recipientContacts.ref()) { + out << v; + } + } + else { + out << " recipientContacts is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShareTemplate & s) { w.writeStructBegin(QStringLiteral("NotebookShareTemplate")); if (s.notebookGuid.isSet()) { @@ -4347,6 +7605,100 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotebookShareTemplate & value) +{ + out << "NotebookShareTemplate: {\n"; + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.recipientThreadId.isSet()) { + out << " recipientThreadId = " + << value.recipientThreadId.ref() << "\n"; + } + else { + out << " recipientThreadId is not set\n"; + } + + if (value.recipientContacts.isSet()) { + out << " recipientContacts = " + << "QList {"; + for(const auto & v: value.recipientContacts.ref()) { + out << v; + } + } + else { + out << " recipientContacts is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotebookShareTemplate & value) +{ + out << "NotebookShareTemplate: {\n"; + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.recipientThreadId.isSet()) { + out << " recipientThreadId = " + << value.recipientThreadId.ref() << "\n"; + } + else { + out << " recipientThreadId is not set\n"; + } + + if (value.recipientContacts.isSet()) { + out << " recipientContacts = " + << "QList {"; + for(const auto & v: value.recipientContacts.ref()) { + out << v; + } + } + else { + out << " recipientContacts is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const CreateOrUpdateNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); if (s.updateSequenceNum.isSet()) { @@ -4418,6 +7770,68 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const CreateOrUpdateNotebookSharesResult & value) +{ + out << "CreateOrUpdateNotebookSharesResult: {\n"; + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.matchingShares.isSet()) { + out << " matchingShares = " + << "QList {"; + for(const auto & v: value.matchingShares.ref()) { + out << v; + } + } + else { + out << " matchingShares is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const CreateOrUpdateNotebookSharesResult & value) +{ + out << "CreateOrUpdateNotebookSharesResult: {\n"; + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.matchingShares.isSet()) { + out << " matchingShares = " + << "QList {"; + for(const auto & v: value.matchingShares.ref()) { + out << v; + } + } + else { + out << " matchingShares is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const NoteShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); if (s.noSetReadNote.isSet()) { @@ -4492,10 +7906,82 @@ void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteSha r.readStructEnd(); } -void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s) { - w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); - if (s.displayName.isSet()) { - w.writeFieldBegin( +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteShareRelationshipRestrictions & value) +{ + out << "NoteShareRelationshipRestrictions: {\n"; + + if (value.noSetReadNote.isSet()) { + out << " noSetReadNote = " + << value.noSetReadNote.ref() << "\n"; + } + else { + out << " noSetReadNote is not set\n"; + } + + if (value.noSetModifyNote.isSet()) { + out << " noSetModifyNote = " + << value.noSetModifyNote.ref() << "\n"; + } + else { + out << " noSetModifyNote is not set\n"; + } + + if (value.noSetFullAccess.isSet()) { + out << " noSetFullAccess = " + << value.noSetFullAccess.ref() << "\n"; + } + else { + out << " noSetFullAccess is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteShareRelationshipRestrictions & value) +{ + out << "NoteShareRelationshipRestrictions: {\n"; + + if (value.noSetReadNote.isSet()) { + out << " noSetReadNote = " + << value.noSetReadNote.ref() << "\n"; + } + else { + out << " noSetReadNote is not set\n"; + } + + if (value.noSetModifyNote.isSet()) { + out << " noSetModifyNote = " + << value.noSetModifyNote.ref() << "\n"; + } + else { + out << " noSetModifyNote is not set\n"; + } + + if (value.noSetFullAccess.isSet()) { + out << " noSetFullAccess = " + << value.noSetFullAccess.ref() << "\n"; + } + else { + out << " noSetFullAccess is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s) { + w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); + if (s.displayName.isSet()) { + w.writeFieldBegin( QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); @@ -4600,6 +8086,110 @@ void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberSha r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteMemberShareRelationship & value) +{ + out << "NoteMemberShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteMemberShareRelationship & value) +{ + out << "NoteMemberShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const NoteInvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); if (s.displayName.isSet()) { @@ -4691,6 +8281,94 @@ void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvit r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteInvitationShareRelationship & value) +{ + out << "NoteInvitationShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientIdentityId.isSet()) { + out << " recipientIdentityId = " + << value.recipientIdentityId.ref() << "\n"; + } + else { + out << " recipientIdentityId is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteInvitationShareRelationship & value) +{ + out << "NoteInvitationShareRelationship: {\n"; + + if (value.displayName.isSet()) { + out << " displayName = " + << value.displayName.ref() << "\n"; + } + else { + out << " displayName is not set\n"; + } + + if (value.recipientIdentityId.isSet()) { + out << " recipientIdentityId = " + << value.recipientIdentityId.ref() << "\n"; + } + else { + out << " recipientIdentityId is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRelationships & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationships")); if (s.invitations.isSet()) { @@ -4793,6 +8471,90 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteShareRelationships & value) +{ + out << "NoteShareRelationships: {\n"; + + if (value.invitations.isSet()) { + out << " invitations = " + << "QList {"; + for(const auto & v: value.invitations.ref()) { + out << v; + } + } + else { + out << " invitations is not set\n"; + } + + if (value.memberships.isSet()) { + out << " memberships = " + << "QList {"; + for(const auto & v: value.memberships.ref()) { + out << v; + } + } + else { + out << " memberships is not set\n"; + } + + if (value.invitationRestrictions.isSet()) { + out << " invitationRestrictions = " + << value.invitationRestrictions.ref() << "\n"; + } + else { + out << " invitationRestrictions is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteShareRelationships & value) +{ + out << "NoteShareRelationships: {\n"; + + if (value.invitations.isSet()) { + out << " invitations = " + << "QList {"; + for(const auto & v: value.invitations.ref()) { + out << v; + } + } + else { + out << " invitations is not set\n"; + } + + if (value.memberships.isSet()) { + out << " memberships = " + << "QList {"; + for(const auto & v: value.memberships.ref()) { + out << v; + } + } + else { + out << " memberships is not set\n"; + } + + if (value.invitationRestrictions.isSet()) { + out << " invitationRestrictions = " + << value.invitationRestrictions.ref() << "\n"; + } + else { + out << " invitationRestrictions is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageNoteSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); if (s.noteGuid.isSet()) { @@ -4957,6 +8719,134 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNoteSharesParameters & value) +{ + out << "ManageNoteSharesParameters: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.membershipsToUpdate.isSet()) { + out << " membershipsToUpdate = " + << "QList {"; + for(const auto & v: value.membershipsToUpdate.ref()) { + out << v; + } + } + else { + out << " membershipsToUpdate is not set\n"; + } + + if (value.invitationsToUpdate.isSet()) { + out << " invitationsToUpdate = " + << "QList {"; + for(const auto & v: value.invitationsToUpdate.ref()) { + out << v; + } + } + else { + out << " invitationsToUpdate is not set\n"; + } + + if (value.membershipsToUnshare.isSet()) { + out << " membershipsToUnshare = " + << "QList {"; + for(const auto & v: value.membershipsToUnshare.ref()) { + out << v; + } + } + else { + out << " membershipsToUnshare is not set\n"; + } + + if (value.invitationsToUnshare.isSet()) { + out << " invitationsToUnshare = " + << "QList {"; + for(const auto & v: value.invitationsToUnshare.ref()) { + out << v; + } + } + else { + out << " invitationsToUnshare is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNoteSharesParameters & value) +{ + out << "ManageNoteSharesParameters: {\n"; + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.membershipsToUpdate.isSet()) { + out << " membershipsToUpdate = " + << "QList {"; + for(const auto & v: value.membershipsToUpdate.ref()) { + out << v; + } + } + else { + out << " membershipsToUpdate is not set\n"; + } + + if (value.invitationsToUpdate.isSet()) { + out << " invitationsToUpdate = " + << "QList {"; + for(const auto & v: value.invitationsToUpdate.ref()) { + out << v; + } + } + else { + out << " invitationsToUpdate is not set\n"; + } + + if (value.membershipsToUnshare.isSet()) { + out << " membershipsToUnshare = " + << "QList {"; + for(const auto & v: value.membershipsToUnshare.ref()) { + out << v; + } + } + else { + out << " membershipsToUnshare is not set\n"; + } + + if (value.invitationsToUnshare.isSet()) { + out << " invitationsToUnshare = " + << "QList {"; + for(const auto & v: value.invitationsToUnshare.ref()) { + out << v; + } + } + else { + out << " invitationsToUnshare is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesError")); if (s.identityID.isSet()) { @@ -5048,6 +8938,94 @@ void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesErr r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNoteSharesError & value) +{ + out << "ManageNoteSharesError: {\n"; + + if (value.identityID.isSet()) { + out << " identityID = " + << value.identityID.ref() << "\n"; + } + else { + out << " identityID is not set\n"; + } + + if (value.userID.isSet()) { + out << " userID = " + << value.userID.ref() << "\n"; + } + else { + out << " userID is not set\n"; + } + + if (value.userException.isSet()) { + out << " userException = " + << value.userException.ref() << "\n"; + } + else { + out << " userException is not set\n"; + } + + if (value.notFoundException.isSet()) { + out << " notFoundException = " + << value.notFoundException.ref() << "\n"; + } + else { + out << " notFoundException is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNoteSharesError & value) +{ + out << "ManageNoteSharesError: {\n"; + + if (value.identityID.isSet()) { + out << " identityID = " + << value.identityID.ref() << "\n"; + } + else { + out << " identityID is not set\n"; + } + + if (value.userID.isSet()) { + out << " userID = " + << value.userID.ref() << "\n"; + } + else { + out << " userID is not set\n"; + } + + if (value.userException.isSet()) { + out << " userException = " + << value.userException.ref() << "\n"; + } + else { + out << " userException is not set\n"; + } + + if (value.notFoundException.isSet()) { + out << " notFoundException = " + << value.notFoundException.ref() << "\n"; + } + else { + out << " notFoundException is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); if (s.errors.isSet()) { @@ -5102,18 +9080,64 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe r.readStructEnd(); } -void writeData(ThriftBinaryBufferWriter & w, const Data & s) { - w.writeStructBegin(QStringLiteral("Data")); - if (s.bodyHash.isSet()) { - w.writeFieldBegin( - QStringLiteral("bodyHash"), - ThriftFieldType::T_STRING, - 1); - w.writeBinary(s.bodyHash.ref()); - w.writeFieldEnd(); - } - if (s.size.isSet()) { - w.writeFieldBegin( +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ManageNoteSharesResult & value) +{ + out << "ManageNoteSharesResult: {\n"; + + if (value.errors.isSet()) { + out << " errors = " + << "QList {"; + for(const auto & v: value.errors.ref()) { + out << v; + } + } + else { + out << " errors is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ManageNoteSharesResult & value) +{ + out << "ManageNoteSharesResult: {\n"; + + if (value.errors.isSet()) { + out << " errors = " + << "QList {"; + for(const auto & v: value.errors.ref()) { + out << v; + } + } + else { + out << " errors is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeData(ThriftBinaryBufferWriter & w, const Data & s) { + w.writeStructBegin(QStringLiteral("Data")); + if (s.bodyHash.isSet()) { + w.writeFieldBegin( + QStringLiteral("bodyHash"), + ThriftFieldType::T_STRING, + 1); + w.writeBinary(s.bodyHash.ref()); + w.writeFieldEnd(); + } + if (s.size.isSet()) { + w.writeFieldBegin( QStringLiteral("size"), ThriftFieldType::T_I32, 2); @@ -5176,6 +9200,78 @@ void readData(ThriftBinaryBufferReader & r, Data & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Data & value) +{ + out << "Data: {\n"; + + if (value.bodyHash.isSet()) { + out << " bodyHash = " + << value.bodyHash.ref() << "\n"; + } + else { + out << " bodyHash is not set\n"; + } + + if (value.size.isSet()) { + out << " size = " + << value.size.ref() << "\n"; + } + else { + out << " size is not set\n"; + } + + if (value.body.isSet()) { + out << " body = " + << value.body.ref() << "\n"; + } + else { + out << " body is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Data & value) +{ + out << "Data: {\n"; + + if (value.bodyHash.isSet()) { + out << " bodyHash = " + << value.bodyHash.ref() << "\n"; + } + else { + out << " bodyHash is not set\n"; + } + + if (value.size.isSet()) { + out << " size = " + << value.size.ref() << "\n"; + } + else { + out << " size is not set\n"; + } + + if (value.body.isSet()) { + out << " body = " + << value.body.ref() << "\n"; + } + else { + out << " body is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) { w.writeStructBegin(QStringLiteral("UserAttributes")); if (s.defaultLocationName.isSet()) { @@ -5822,201 +9918,933 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { r.readStructEnd(); } -void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s) { - w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); - if (s.title.isSet()) { - w.writeFieldBegin( - QStringLiteral("title"), - ThriftFieldType::T_STRING, - 1); - w.writeString(s.title.ref()); - w.writeFieldEnd(); +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const UserAttributes & value) +{ + out << "UserAttributes: {\n"; + + if (value.defaultLocationName.isSet()) { + out << " defaultLocationName = " + << value.defaultLocationName.ref() << "\n"; } - if (s.location.isSet()) { - w.writeFieldBegin( - QStringLiteral("location"), - ThriftFieldType::T_STRING, - 2); - w.writeString(s.location.ref()); - w.writeFieldEnd(); + else { + out << " defaultLocationName is not set\n"; } - if (s.department.isSet()) { - w.writeFieldBegin( - QStringLiteral("department"), - ThriftFieldType::T_STRING, - 3); - w.writeString(s.department.ref()); - w.writeFieldEnd(); + + if (value.defaultLatitude.isSet()) { + out << " defaultLatitude = " + << value.defaultLatitude.ref() << "\n"; } - if (s.mobilePhone.isSet()) { - w.writeFieldBegin( - QStringLiteral("mobilePhone"), - ThriftFieldType::T_STRING, - 4); - w.writeString(s.mobilePhone.ref()); - w.writeFieldEnd(); + else { + out << " defaultLatitude is not set\n"; } - if (s.linkedInProfileUrl.isSet()) { - w.writeFieldBegin( - QStringLiteral("linkedInProfileUrl"), - ThriftFieldType::T_STRING, - 5); - w.writeString(s.linkedInProfileUrl.ref()); - w.writeFieldEnd(); + + if (value.defaultLongitude.isSet()) { + out << " defaultLongitude = " + << value.defaultLongitude.ref() << "\n"; } - if (s.workPhone.isSet()) { - w.writeFieldBegin( - QStringLiteral("workPhone"), - ThriftFieldType::T_STRING, - 6); - w.writeString(s.workPhone.ref()); - w.writeFieldEnd(); + else { + out << " defaultLongitude is not set\n"; } - if (s.companyStartDate.isSet()) { - w.writeFieldBegin( - QStringLiteral("companyStartDate"), - ThriftFieldType::T_I64, - 7); - w.writeI64(s.companyStartDate.ref()); - w.writeFieldEnd(); + + if (value.preactivation.isSet()) { + out << " preactivation = " + << value.preactivation.ref() << "\n"; + } + else { + out << " preactivation is not set\n"; } - w.writeFieldStop(); - w.writeStructEnd(); -} -void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttributes & s) { - QString fname; - ThriftFieldType::type fieldType; - qint16 fieldId; - r.readStructBegin(fname); - while(true) - { - r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.title = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 2) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.location = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 3) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.department = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 4) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.mobilePhone = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 5) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.linkedInProfileUrl = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 6) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.workPhone = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 7) { - if (fieldType == ThriftFieldType::T_I64) { - qint64 v; - r.readI64(v); - s.companyStartDate = v; - } else { - r.skip(fieldType); - } - } else - { - r.skip(fieldType); + if (value.viewedPromotions.isSet()) { + out << " viewedPromotions = " + << "QList {"; + for(const auto & v: value.viewedPromotions.ref()) { + out << v; } - r.readFieldEnd(); } - r.readStructEnd(); -} + else { + out << " viewedPromotions is not set\n"; + } -void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { - w.writeStructBegin(QStringLiteral("Accounting")); - if (s.uploadLimitEnd.isSet()) { - w.writeFieldBegin( - QStringLiteral("uploadLimitEnd"), - ThriftFieldType::T_I64, - 2); - w.writeI64(s.uploadLimitEnd.ref()); - w.writeFieldEnd(); + if (value.incomingEmailAddress.isSet()) { + out << " incomingEmailAddress = " + << value.incomingEmailAddress.ref() << "\n"; } - if (s.uploadLimitNextMonth.isSet()) { - w.writeFieldBegin( - QStringLiteral("uploadLimitNextMonth"), - ThriftFieldType::T_I64, - 3); - w.writeI64(s.uploadLimitNextMonth.ref()); - w.writeFieldEnd(); + else { + out << " incomingEmailAddress is not set\n"; } - if (s.premiumServiceStatus.isSet()) { - w.writeFieldBegin( - QStringLiteral("premiumServiceStatus"), - ThriftFieldType::T_I32, - 4); - w.writeI32(static_cast(s.premiumServiceStatus.ref())); - w.writeFieldEnd(); + + if (value.recentMailedAddresses.isSet()) { + out << " recentMailedAddresses = " + << "QList {"; + for(const auto & v: value.recentMailedAddresses.ref()) { + out << v; + } } - if (s.premiumOrderNumber.isSet()) { - w.writeFieldBegin( - QStringLiteral("premiumOrderNumber"), - ThriftFieldType::T_STRING, - 5); - w.writeString(s.premiumOrderNumber.ref()); - w.writeFieldEnd(); + else { + out << " recentMailedAddresses is not set\n"; } - if (s.premiumCommerceService.isSet()) { - w.writeFieldBegin( - QStringLiteral("premiumCommerceService"), - ThriftFieldType::T_STRING, - 6); - w.writeString(s.premiumCommerceService.ref()); - w.writeFieldEnd(); + + if (value.comments.isSet()) { + out << " comments = " + << value.comments.ref() << "\n"; } - if (s.premiumServiceStart.isSet()) { - w.writeFieldBegin( - QStringLiteral("premiumServiceStart"), - ThriftFieldType::T_I64, - 7); - w.writeI64(s.premiumServiceStart.ref()); - w.writeFieldEnd(); + else { + out << " comments is not set\n"; } - if (s.premiumServiceSKU.isSet()) { - w.writeFieldBegin( - QStringLiteral("premiumServiceSKU"), + + if (value.dateAgreedToTermsOfService.isSet()) { + out << " dateAgreedToTermsOfService = " + << value.dateAgreedToTermsOfService.ref() << "\n"; + } + else { + out << " dateAgreedToTermsOfService is not set\n"; + } + + if (value.maxReferrals.isSet()) { + out << " maxReferrals = " + << value.maxReferrals.ref() << "\n"; + } + else { + out << " maxReferrals is not set\n"; + } + + if (value.referralCount.isSet()) { + out << " referralCount = " + << value.referralCount.ref() << "\n"; + } + else { + out << " referralCount is not set\n"; + } + + if (value.refererCode.isSet()) { + out << " refererCode = " + << value.refererCode.ref() << "\n"; + } + else { + out << " refererCode is not set\n"; + } + + if (value.sentEmailDate.isSet()) { + out << " sentEmailDate = " + << value.sentEmailDate.ref() << "\n"; + } + else { + out << " sentEmailDate is not set\n"; + } + + if (value.sentEmailCount.isSet()) { + out << " sentEmailCount = " + << value.sentEmailCount.ref() << "\n"; + } + else { + out << " sentEmailCount is not set\n"; + } + + if (value.dailyEmailLimit.isSet()) { + out << " dailyEmailLimit = " + << value.dailyEmailLimit.ref() << "\n"; + } + else { + out << " dailyEmailLimit is not set\n"; + } + + if (value.emailOptOutDate.isSet()) { + out << " emailOptOutDate = " + << value.emailOptOutDate.ref() << "\n"; + } + else { + out << " emailOptOutDate is not set\n"; + } + + if (value.partnerEmailOptInDate.isSet()) { + out << " partnerEmailOptInDate = " + << value.partnerEmailOptInDate.ref() << "\n"; + } + else { + out << " partnerEmailOptInDate is not set\n"; + } + + if (value.preferredLanguage.isSet()) { + out << " preferredLanguage = " + << value.preferredLanguage.ref() << "\n"; + } + else { + out << " preferredLanguage is not set\n"; + } + + if (value.preferredCountry.isSet()) { + out << " preferredCountry = " + << value.preferredCountry.ref() << "\n"; + } + else { + out << " preferredCountry is not set\n"; + } + + if (value.clipFullPage.isSet()) { + out << " clipFullPage = " + << value.clipFullPage.ref() << "\n"; + } + else { + out << " clipFullPage is not set\n"; + } + + if (value.twitterUserName.isSet()) { + out << " twitterUserName = " + << value.twitterUserName.ref() << "\n"; + } + else { + out << " twitterUserName is not set\n"; + } + + if (value.twitterId.isSet()) { + out << " twitterId = " + << value.twitterId.ref() << "\n"; + } + else { + out << " twitterId is not set\n"; + } + + if (value.groupName.isSet()) { + out << " groupName = " + << value.groupName.ref() << "\n"; + } + else { + out << " groupName is not set\n"; + } + + if (value.recognitionLanguage.isSet()) { + out << " recognitionLanguage = " + << value.recognitionLanguage.ref() << "\n"; + } + else { + out << " recognitionLanguage is not set\n"; + } + + if (value.referralProof.isSet()) { + out << " referralProof = " + << value.referralProof.ref() << "\n"; + } + else { + out << " referralProof is not set\n"; + } + + if (value.educationalDiscount.isSet()) { + out << " educationalDiscount = " + << value.educationalDiscount.ref() << "\n"; + } + else { + out << " educationalDiscount is not set\n"; + } + + if (value.businessAddress.isSet()) { + out << " businessAddress = " + << value.businessAddress.ref() << "\n"; + } + else { + out << " businessAddress is not set\n"; + } + + if (value.hideSponsorBilling.isSet()) { + out << " hideSponsorBilling = " + << value.hideSponsorBilling.ref() << "\n"; + } + else { + out << " hideSponsorBilling is not set\n"; + } + + if (value.useEmailAutoFiling.isSet()) { + out << " useEmailAutoFiling = " + << value.useEmailAutoFiling.ref() << "\n"; + } + else { + out << " useEmailAutoFiling is not set\n"; + } + + if (value.reminderEmailConfig.isSet()) { + out << " reminderEmailConfig = " + << value.reminderEmailConfig.ref() << "\n"; + } + else { + out << " reminderEmailConfig is not set\n"; + } + + if (value.emailAddressLastConfirmed.isSet()) { + out << " emailAddressLastConfirmed = " + << value.emailAddressLastConfirmed.ref() << "\n"; + } + else { + out << " emailAddressLastConfirmed is not set\n"; + } + + if (value.passwordUpdated.isSet()) { + out << " passwordUpdated = " + << value.passwordUpdated.ref() << "\n"; + } + else { + out << " passwordUpdated is not set\n"; + } + + if (value.salesforcePushEnabled.isSet()) { + out << " salesforcePushEnabled = " + << value.salesforcePushEnabled.ref() << "\n"; + } + else { + out << " salesforcePushEnabled is not set\n"; + } + + if (value.shouldLogClientEvent.isSet()) { + out << " shouldLogClientEvent = " + << value.shouldLogClientEvent.ref() << "\n"; + } + else { + out << " shouldLogClientEvent is not set\n"; + } + + if (value.optOutMachineLearning.isSet()) { + out << " optOutMachineLearning = " + << value.optOutMachineLearning.ref() << "\n"; + } + else { + out << " optOutMachineLearning is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const UserAttributes & value) +{ + out << "UserAttributes: {\n"; + + if (value.defaultLocationName.isSet()) { + out << " defaultLocationName = " + << value.defaultLocationName.ref() << "\n"; + } + else { + out << " defaultLocationName is not set\n"; + } + + if (value.defaultLatitude.isSet()) { + out << " defaultLatitude = " + << value.defaultLatitude.ref() << "\n"; + } + else { + out << " defaultLatitude is not set\n"; + } + + if (value.defaultLongitude.isSet()) { + out << " defaultLongitude = " + << value.defaultLongitude.ref() << "\n"; + } + else { + out << " defaultLongitude is not set\n"; + } + + if (value.preactivation.isSet()) { + out << " preactivation = " + << value.preactivation.ref() << "\n"; + } + else { + out << " preactivation is not set\n"; + } + + if (value.viewedPromotions.isSet()) { + out << " viewedPromotions = " + << "QList {"; + for(const auto & v: value.viewedPromotions.ref()) { + out << v; + } + } + else { + out << " viewedPromotions is not set\n"; + } + + if (value.incomingEmailAddress.isSet()) { + out << " incomingEmailAddress = " + << value.incomingEmailAddress.ref() << "\n"; + } + else { + out << " incomingEmailAddress is not set\n"; + } + + if (value.recentMailedAddresses.isSet()) { + out << " recentMailedAddresses = " + << "QList {"; + for(const auto & v: value.recentMailedAddresses.ref()) { + out << v; + } + } + else { + out << " recentMailedAddresses is not set\n"; + } + + if (value.comments.isSet()) { + out << " comments = " + << value.comments.ref() << "\n"; + } + else { + out << " comments is not set\n"; + } + + if (value.dateAgreedToTermsOfService.isSet()) { + out << " dateAgreedToTermsOfService = " + << value.dateAgreedToTermsOfService.ref() << "\n"; + } + else { + out << " dateAgreedToTermsOfService is not set\n"; + } + + if (value.maxReferrals.isSet()) { + out << " maxReferrals = " + << value.maxReferrals.ref() << "\n"; + } + else { + out << " maxReferrals is not set\n"; + } + + if (value.referralCount.isSet()) { + out << " referralCount = " + << value.referralCount.ref() << "\n"; + } + else { + out << " referralCount is not set\n"; + } + + if (value.refererCode.isSet()) { + out << " refererCode = " + << value.refererCode.ref() << "\n"; + } + else { + out << " refererCode is not set\n"; + } + + if (value.sentEmailDate.isSet()) { + out << " sentEmailDate = " + << value.sentEmailDate.ref() << "\n"; + } + else { + out << " sentEmailDate is not set\n"; + } + + if (value.sentEmailCount.isSet()) { + out << " sentEmailCount = " + << value.sentEmailCount.ref() << "\n"; + } + else { + out << " sentEmailCount is not set\n"; + } + + if (value.dailyEmailLimit.isSet()) { + out << " dailyEmailLimit = " + << value.dailyEmailLimit.ref() << "\n"; + } + else { + out << " dailyEmailLimit is not set\n"; + } + + if (value.emailOptOutDate.isSet()) { + out << " emailOptOutDate = " + << value.emailOptOutDate.ref() << "\n"; + } + else { + out << " emailOptOutDate is not set\n"; + } + + if (value.partnerEmailOptInDate.isSet()) { + out << " partnerEmailOptInDate = " + << value.partnerEmailOptInDate.ref() << "\n"; + } + else { + out << " partnerEmailOptInDate is not set\n"; + } + + if (value.preferredLanguage.isSet()) { + out << " preferredLanguage = " + << value.preferredLanguage.ref() << "\n"; + } + else { + out << " preferredLanguage is not set\n"; + } + + if (value.preferredCountry.isSet()) { + out << " preferredCountry = " + << value.preferredCountry.ref() << "\n"; + } + else { + out << " preferredCountry is not set\n"; + } + + if (value.clipFullPage.isSet()) { + out << " clipFullPage = " + << value.clipFullPage.ref() << "\n"; + } + else { + out << " clipFullPage is not set\n"; + } + + if (value.twitterUserName.isSet()) { + out << " twitterUserName = " + << value.twitterUserName.ref() << "\n"; + } + else { + out << " twitterUserName is not set\n"; + } + + if (value.twitterId.isSet()) { + out << " twitterId = " + << value.twitterId.ref() << "\n"; + } + else { + out << " twitterId is not set\n"; + } + + if (value.groupName.isSet()) { + out << " groupName = " + << value.groupName.ref() << "\n"; + } + else { + out << " groupName is not set\n"; + } + + if (value.recognitionLanguage.isSet()) { + out << " recognitionLanguage = " + << value.recognitionLanguage.ref() << "\n"; + } + else { + out << " recognitionLanguage is not set\n"; + } + + if (value.referralProof.isSet()) { + out << " referralProof = " + << value.referralProof.ref() << "\n"; + } + else { + out << " referralProof is not set\n"; + } + + if (value.educationalDiscount.isSet()) { + out << " educationalDiscount = " + << value.educationalDiscount.ref() << "\n"; + } + else { + out << " educationalDiscount is not set\n"; + } + + if (value.businessAddress.isSet()) { + out << " businessAddress = " + << value.businessAddress.ref() << "\n"; + } + else { + out << " businessAddress is not set\n"; + } + + if (value.hideSponsorBilling.isSet()) { + out << " hideSponsorBilling = " + << value.hideSponsorBilling.ref() << "\n"; + } + else { + out << " hideSponsorBilling is not set\n"; + } + + if (value.useEmailAutoFiling.isSet()) { + out << " useEmailAutoFiling = " + << value.useEmailAutoFiling.ref() << "\n"; + } + else { + out << " useEmailAutoFiling is not set\n"; + } + + if (value.reminderEmailConfig.isSet()) { + out << " reminderEmailConfig = " + << value.reminderEmailConfig.ref() << "\n"; + } + else { + out << " reminderEmailConfig is not set\n"; + } + + if (value.emailAddressLastConfirmed.isSet()) { + out << " emailAddressLastConfirmed = " + << value.emailAddressLastConfirmed.ref() << "\n"; + } + else { + out << " emailAddressLastConfirmed is not set\n"; + } + + if (value.passwordUpdated.isSet()) { + out << " passwordUpdated = " + << value.passwordUpdated.ref() << "\n"; + } + else { + out << " passwordUpdated is not set\n"; + } + + if (value.salesforcePushEnabled.isSet()) { + out << " salesforcePushEnabled = " + << value.salesforcePushEnabled.ref() << "\n"; + } + else { + out << " salesforcePushEnabled is not set\n"; + } + + if (value.shouldLogClientEvent.isSet()) { + out << " shouldLogClientEvent = " + << value.shouldLogClientEvent.ref() << "\n"; + } + else { + out << " shouldLogClientEvent is not set\n"; + } + + if (value.optOutMachineLearning.isSet()) { + out << " optOutMachineLearning = " + << value.optOutMachineLearning.ref() << "\n"; + } + else { + out << " optOutMachineLearning is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s) { + w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); + if (s.title.isSet()) { + w.writeFieldBegin( + QStringLiteral("title"), + ThriftFieldType::T_STRING, + 1); + w.writeString(s.title.ref()); + w.writeFieldEnd(); + } + if (s.location.isSet()) { + w.writeFieldBegin( + QStringLiteral("location"), + ThriftFieldType::T_STRING, + 2); + w.writeString(s.location.ref()); + w.writeFieldEnd(); + } + if (s.department.isSet()) { + w.writeFieldBegin( + QStringLiteral("department"), + ThriftFieldType::T_STRING, + 3); + w.writeString(s.department.ref()); + w.writeFieldEnd(); + } + if (s.mobilePhone.isSet()) { + w.writeFieldBegin( + QStringLiteral("mobilePhone"), + ThriftFieldType::T_STRING, + 4); + w.writeString(s.mobilePhone.ref()); + w.writeFieldEnd(); + } + if (s.linkedInProfileUrl.isSet()) { + w.writeFieldBegin( + QStringLiteral("linkedInProfileUrl"), + ThriftFieldType::T_STRING, + 5); + w.writeString(s.linkedInProfileUrl.ref()); + w.writeFieldEnd(); + } + if (s.workPhone.isSet()) { + w.writeFieldBegin( + QStringLiteral("workPhone"), + ThriftFieldType::T_STRING, + 6); + w.writeString(s.workPhone.ref()); + w.writeFieldEnd(); + } + if (s.companyStartDate.isSet()) { + w.writeFieldBegin( + QStringLiteral("companyStartDate"), + ThriftFieldType::T_I64, + 7); + w.writeI64(s.companyStartDate.ref()); + w.writeFieldEnd(); + } + w.writeFieldStop(); + w.writeStructEnd(); +} + +void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttributes & s) { + QString fname; + ThriftFieldType::type fieldType; + qint16 fieldId; + r.readStructBegin(fname); + while(true) + { + r.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) break; + if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.title = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 2) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.location = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 3) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.department = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 4) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.mobilePhone = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 5) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.linkedInProfileUrl = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 6) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.workPhone = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 7) { + if (fieldType == ThriftFieldType::T_I64) { + qint64 v; + r.readI64(v); + s.companyStartDate = v; + } else { + r.skip(fieldType); + } + } else + { + r.skip(fieldType); + } + r.readFieldEnd(); + } + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BusinessUserAttributes & value) +{ + out << "BusinessUserAttributes: {\n"; + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.location.isSet()) { + out << " location = " + << value.location.ref() << "\n"; + } + else { + out << " location is not set\n"; + } + + if (value.department.isSet()) { + out << " department = " + << value.department.ref() << "\n"; + } + else { + out << " department is not set\n"; + } + + if (value.mobilePhone.isSet()) { + out << " mobilePhone = " + << value.mobilePhone.ref() << "\n"; + } + else { + out << " mobilePhone is not set\n"; + } + + if (value.linkedInProfileUrl.isSet()) { + out << " linkedInProfileUrl = " + << value.linkedInProfileUrl.ref() << "\n"; + } + else { + out << " linkedInProfileUrl is not set\n"; + } + + if (value.workPhone.isSet()) { + out << " workPhone = " + << value.workPhone.ref() << "\n"; + } + else { + out << " workPhone is not set\n"; + } + + if (value.companyStartDate.isSet()) { + out << " companyStartDate = " + << value.companyStartDate.ref() << "\n"; + } + else { + out << " companyStartDate is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BusinessUserAttributes & value) +{ + out << "BusinessUserAttributes: {\n"; + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.location.isSet()) { + out << " location = " + << value.location.ref() << "\n"; + } + else { + out << " location is not set\n"; + } + + if (value.department.isSet()) { + out << " department = " + << value.department.ref() << "\n"; + } + else { + out << " department is not set\n"; + } + + if (value.mobilePhone.isSet()) { + out << " mobilePhone = " + << value.mobilePhone.ref() << "\n"; + } + else { + out << " mobilePhone is not set\n"; + } + + if (value.linkedInProfileUrl.isSet()) { + out << " linkedInProfileUrl = " + << value.linkedInProfileUrl.ref() << "\n"; + } + else { + out << " linkedInProfileUrl is not set\n"; + } + + if (value.workPhone.isSet()) { + out << " workPhone = " + << value.workPhone.ref() << "\n"; + } + else { + out << " workPhone is not set\n"; + } + + if (value.companyStartDate.isSet()) { + out << " companyStartDate = " + << value.companyStartDate.ref() << "\n"; + } + else { + out << " companyStartDate is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { + w.writeStructBegin(QStringLiteral("Accounting")); + if (s.uploadLimitEnd.isSet()) { + w.writeFieldBegin( + QStringLiteral("uploadLimitEnd"), + ThriftFieldType::T_I64, + 2); + w.writeI64(s.uploadLimitEnd.ref()); + w.writeFieldEnd(); + } + if (s.uploadLimitNextMonth.isSet()) { + w.writeFieldBegin( + QStringLiteral("uploadLimitNextMonth"), + ThriftFieldType::T_I64, + 3); + w.writeI64(s.uploadLimitNextMonth.ref()); + w.writeFieldEnd(); + } + if (s.premiumServiceStatus.isSet()) { + w.writeFieldBegin( + QStringLiteral("premiumServiceStatus"), + ThriftFieldType::T_I32, + 4); + w.writeI32(static_cast(s.premiumServiceStatus.ref())); + w.writeFieldEnd(); + } + if (s.premiumOrderNumber.isSet()) { + w.writeFieldBegin( + QStringLiteral("premiumOrderNumber"), + ThriftFieldType::T_STRING, + 5); + w.writeString(s.premiumOrderNumber.ref()); + w.writeFieldEnd(); + } + if (s.premiumCommerceService.isSet()) { + w.writeFieldBegin( + QStringLiteral("premiumCommerceService"), + ThriftFieldType::T_STRING, + 6); + w.writeString(s.premiumCommerceService.ref()); + w.writeFieldEnd(); + } + if (s.premiumServiceStart.isSet()) { + w.writeFieldBegin( + QStringLiteral("premiumServiceStart"), + ThriftFieldType::T_I64, + 7); + w.writeI64(s.premiumServiceStart.ref()); + w.writeFieldEnd(); + } + if (s.premiumServiceSKU.isSet()) { + w.writeFieldBegin( + QStringLiteral("premiumServiceSKU"), ThriftFieldType::T_STRING, 8); w.writeString(s.premiumServiceSKU.ref()); @@ -6375,9 +11203,401 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { } r.readFieldEnd(); } - r.readStructEnd(); + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Accounting & value) +{ + out << "Accounting: {\n"; + + if (value.uploadLimitEnd.isSet()) { + out << " uploadLimitEnd = " + << value.uploadLimitEnd.ref() << "\n"; + } + else { + out << " uploadLimitEnd is not set\n"; + } + + if (value.uploadLimitNextMonth.isSet()) { + out << " uploadLimitNextMonth = " + << value.uploadLimitNextMonth.ref() << "\n"; + } + else { + out << " uploadLimitNextMonth is not set\n"; + } + + if (value.premiumServiceStatus.isSet()) { + out << " premiumServiceStatus = " + << value.premiumServiceStatus.ref() << "\n"; + } + else { + out << " premiumServiceStatus is not set\n"; + } + + if (value.premiumOrderNumber.isSet()) { + out << " premiumOrderNumber = " + << value.premiumOrderNumber.ref() << "\n"; + } + else { + out << " premiumOrderNumber is not set\n"; + } + + if (value.premiumCommerceService.isSet()) { + out << " premiumCommerceService = " + << value.premiumCommerceService.ref() << "\n"; + } + else { + out << " premiumCommerceService is not set\n"; + } + + if (value.premiumServiceStart.isSet()) { + out << " premiumServiceStart = " + << value.premiumServiceStart.ref() << "\n"; + } + else { + out << " premiumServiceStart is not set\n"; + } + + if (value.premiumServiceSKU.isSet()) { + out << " premiumServiceSKU = " + << value.premiumServiceSKU.ref() << "\n"; + } + else { + out << " premiumServiceSKU is not set\n"; + } + + if (value.lastSuccessfulCharge.isSet()) { + out << " lastSuccessfulCharge = " + << value.lastSuccessfulCharge.ref() << "\n"; + } + else { + out << " lastSuccessfulCharge is not set\n"; + } + + if (value.lastFailedCharge.isSet()) { + out << " lastFailedCharge = " + << value.lastFailedCharge.ref() << "\n"; + } + else { + out << " lastFailedCharge is not set\n"; + } + + if (value.lastFailedChargeReason.isSet()) { + out << " lastFailedChargeReason = " + << value.lastFailedChargeReason.ref() << "\n"; + } + else { + out << " lastFailedChargeReason is not set\n"; + } + + if (value.nextPaymentDue.isSet()) { + out << " nextPaymentDue = " + << value.nextPaymentDue.ref() << "\n"; + } + else { + out << " nextPaymentDue is not set\n"; + } + + if (value.premiumLockUntil.isSet()) { + out << " premiumLockUntil = " + << value.premiumLockUntil.ref() << "\n"; + } + else { + out << " premiumLockUntil is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.premiumSubscriptionNumber.isSet()) { + out << " premiumSubscriptionNumber = " + << value.premiumSubscriptionNumber.ref() << "\n"; + } + else { + out << " premiumSubscriptionNumber is not set\n"; + } + + if (value.lastRequestedCharge.isSet()) { + out << " lastRequestedCharge = " + << value.lastRequestedCharge.ref() << "\n"; + } + else { + out << " lastRequestedCharge is not set\n"; + } + + if (value.currency.isSet()) { + out << " currency = " + << value.currency.ref() << "\n"; + } + else { + out << " currency is not set\n"; + } + + if (value.unitPrice.isSet()) { + out << " unitPrice = " + << value.unitPrice.ref() << "\n"; + } + else { + out << " unitPrice is not set\n"; + } + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.businessName.isSet()) { + out << " businessName = " + << value.businessName.ref() << "\n"; + } + else { + out << " businessName is not set\n"; + } + + if (value.businessRole.isSet()) { + out << " businessRole = " + << value.businessRole.ref() << "\n"; + } + else { + out << " businessRole is not set\n"; + } + + if (value.unitDiscount.isSet()) { + out << " unitDiscount = " + << value.unitDiscount.ref() << "\n"; + } + else { + out << " unitDiscount is not set\n"; + } + + if (value.nextChargeDate.isSet()) { + out << " nextChargeDate = " + << value.nextChargeDate.ref() << "\n"; + } + else { + out << " nextChargeDate is not set\n"; + } + + if (value.availablePoints.isSet()) { + out << " availablePoints = " + << value.availablePoints.ref() << "\n"; + } + else { + out << " availablePoints is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Accounting & value) +{ + out << "Accounting: {\n"; + + if (value.uploadLimitEnd.isSet()) { + out << " uploadLimitEnd = " + << value.uploadLimitEnd.ref() << "\n"; + } + else { + out << " uploadLimitEnd is not set\n"; + } + + if (value.uploadLimitNextMonth.isSet()) { + out << " uploadLimitNextMonth = " + << value.uploadLimitNextMonth.ref() << "\n"; + } + else { + out << " uploadLimitNextMonth is not set\n"; + } + + if (value.premiumServiceStatus.isSet()) { + out << " premiumServiceStatus = " + << value.premiumServiceStatus.ref() << "\n"; + } + else { + out << " premiumServiceStatus is not set\n"; + } + + if (value.premiumOrderNumber.isSet()) { + out << " premiumOrderNumber = " + << value.premiumOrderNumber.ref() << "\n"; + } + else { + out << " premiumOrderNumber is not set\n"; + } + + if (value.premiumCommerceService.isSet()) { + out << " premiumCommerceService = " + << value.premiumCommerceService.ref() << "\n"; + } + else { + out << " premiumCommerceService is not set\n"; + } + + if (value.premiumServiceStart.isSet()) { + out << " premiumServiceStart = " + << value.premiumServiceStart.ref() << "\n"; + } + else { + out << " premiumServiceStart is not set\n"; + } + + if (value.premiumServiceSKU.isSet()) { + out << " premiumServiceSKU = " + << value.premiumServiceSKU.ref() << "\n"; + } + else { + out << " premiumServiceSKU is not set\n"; + } + + if (value.lastSuccessfulCharge.isSet()) { + out << " lastSuccessfulCharge = " + << value.lastSuccessfulCharge.ref() << "\n"; + } + else { + out << " lastSuccessfulCharge is not set\n"; + } + + if (value.lastFailedCharge.isSet()) { + out << " lastFailedCharge = " + << value.lastFailedCharge.ref() << "\n"; + } + else { + out << " lastFailedCharge is not set\n"; + } + + if (value.lastFailedChargeReason.isSet()) { + out << " lastFailedChargeReason = " + << value.lastFailedChargeReason.ref() << "\n"; + } + else { + out << " lastFailedChargeReason is not set\n"; + } + + if (value.nextPaymentDue.isSet()) { + out << " nextPaymentDue = " + << value.nextPaymentDue.ref() << "\n"; + } + else { + out << " nextPaymentDue is not set\n"; + } + + if (value.premiumLockUntil.isSet()) { + out << " premiumLockUntil = " + << value.premiumLockUntil.ref() << "\n"; + } + else { + out << " premiumLockUntil is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.premiumSubscriptionNumber.isSet()) { + out << " premiumSubscriptionNumber = " + << value.premiumSubscriptionNumber.ref() << "\n"; + } + else { + out << " premiumSubscriptionNumber is not set\n"; + } + + if (value.lastRequestedCharge.isSet()) { + out << " lastRequestedCharge = " + << value.lastRequestedCharge.ref() << "\n"; + } + else { + out << " lastRequestedCharge is not set\n"; + } + + if (value.currency.isSet()) { + out << " currency = " + << value.currency.ref() << "\n"; + } + else { + out << " currency is not set\n"; + } + + if (value.unitPrice.isSet()) { + out << " unitPrice = " + << value.unitPrice.ref() << "\n"; + } + else { + out << " unitPrice is not set\n"; + } + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.businessName.isSet()) { + out << " businessName = " + << value.businessName.ref() << "\n"; + } + else { + out << " businessName is not set\n"; + } + + if (value.businessRole.isSet()) { + out << " businessRole = " + << value.businessRole.ref() << "\n"; + } + else { + out << " businessRole is not set\n"; + } + + if (value.unitDiscount.isSet()) { + out << " unitDiscount = " + << value.unitDiscount.ref() << "\n"; + } + else { + out << " unitDiscount is not set\n"; + } + + if (value.nextChargeDate.isSet()) { + out << " nextChargeDate = " + << value.nextChargeDate.ref() << "\n"; + } + else { + out << " nextChargeDate is not set\n"; + } + + if (value.availablePoints.isSet()) { + out << " availablePoints = " + << value.availablePoints.ref() << "\n"; + } + else { + out << " availablePoints is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo & s) { w.writeStructBegin(QStringLiteral("BusinessUserInfo")); if (s.businessId.isSet()) { @@ -6486,6 +11706,110 @@ void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BusinessUserInfo & value) +{ + out << "BusinessUserInfo: {\n"; + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.businessName.isSet()) { + out << " businessName = " + << value.businessName.ref() << "\n"; + } + else { + out << " businessName is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BusinessUserInfo & value) +{ + out << "BusinessUserInfo: {\n"; + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.businessName.isSet()) { + out << " businessName = " + << value.businessName.ref() << "\n"; + } + else { + out << " businessName is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s) { w.writeStructBegin(QStringLiteral("AccountLimits")); if (s.userMailLimitDaily.isSet()) { @@ -6696,6 +12020,206 @@ void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const AccountLimits & value) +{ + out << "AccountLimits: {\n"; + + if (value.userMailLimitDaily.isSet()) { + out << " userMailLimitDaily = " + << value.userMailLimitDaily.ref() << "\n"; + } + else { + out << " userMailLimitDaily is not set\n"; + } + + if (value.noteSizeMax.isSet()) { + out << " noteSizeMax = " + << value.noteSizeMax.ref() << "\n"; + } + else { + out << " noteSizeMax is not set\n"; + } + + if (value.resourceSizeMax.isSet()) { + out << " resourceSizeMax = " + << value.resourceSizeMax.ref() << "\n"; + } + else { + out << " resourceSizeMax is not set\n"; + } + + if (value.userLinkedNotebookMax.isSet()) { + out << " userLinkedNotebookMax = " + << value.userLinkedNotebookMax.ref() << "\n"; + } + else { + out << " userLinkedNotebookMax is not set\n"; + } + + if (value.uploadLimit.isSet()) { + out << " uploadLimit = " + << value.uploadLimit.ref() << "\n"; + } + else { + out << " uploadLimit is not set\n"; + } + + if (value.userNoteCountMax.isSet()) { + out << " userNoteCountMax = " + << value.userNoteCountMax.ref() << "\n"; + } + else { + out << " userNoteCountMax is not set\n"; + } + + if (value.userNotebookCountMax.isSet()) { + out << " userNotebookCountMax = " + << value.userNotebookCountMax.ref() << "\n"; + } + else { + out << " userNotebookCountMax is not set\n"; + } + + if (value.userTagCountMax.isSet()) { + out << " userTagCountMax = " + << value.userTagCountMax.ref() << "\n"; + } + else { + out << " userTagCountMax is not set\n"; + } + + if (value.noteTagCountMax.isSet()) { + out << " noteTagCountMax = " + << value.noteTagCountMax.ref() << "\n"; + } + else { + out << " noteTagCountMax is not set\n"; + } + + if (value.userSavedSearchesMax.isSet()) { + out << " userSavedSearchesMax = " + << value.userSavedSearchesMax.ref() << "\n"; + } + else { + out << " userSavedSearchesMax is not set\n"; + } + + if (value.noteResourceCountMax.isSet()) { + out << " noteResourceCountMax = " + << value.noteResourceCountMax.ref() << "\n"; + } + else { + out << " noteResourceCountMax is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const AccountLimits & value) +{ + out << "AccountLimits: {\n"; + + if (value.userMailLimitDaily.isSet()) { + out << " userMailLimitDaily = " + << value.userMailLimitDaily.ref() << "\n"; + } + else { + out << " userMailLimitDaily is not set\n"; + } + + if (value.noteSizeMax.isSet()) { + out << " noteSizeMax = " + << value.noteSizeMax.ref() << "\n"; + } + else { + out << " noteSizeMax is not set\n"; + } + + if (value.resourceSizeMax.isSet()) { + out << " resourceSizeMax = " + << value.resourceSizeMax.ref() << "\n"; + } + else { + out << " resourceSizeMax is not set\n"; + } + + if (value.userLinkedNotebookMax.isSet()) { + out << " userLinkedNotebookMax = " + << value.userLinkedNotebookMax.ref() << "\n"; + } + else { + out << " userLinkedNotebookMax is not set\n"; + } + + if (value.uploadLimit.isSet()) { + out << " uploadLimit = " + << value.uploadLimit.ref() << "\n"; + } + else { + out << " uploadLimit is not set\n"; + } + + if (value.userNoteCountMax.isSet()) { + out << " userNoteCountMax = " + << value.userNoteCountMax.ref() << "\n"; + } + else { + out << " userNoteCountMax is not set\n"; + } + + if (value.userNotebookCountMax.isSet()) { + out << " userNotebookCountMax = " + << value.userNotebookCountMax.ref() << "\n"; + } + else { + out << " userNotebookCountMax is not set\n"; + } + + if (value.userTagCountMax.isSet()) { + out << " userTagCountMax = " + << value.userTagCountMax.ref() << "\n"; + } + else { + out << " userTagCountMax is not set\n"; + } + + if (value.noteTagCountMax.isSet()) { + out << " noteTagCountMax = " + << value.noteTagCountMax.ref() << "\n"; + } + else { + out << " noteTagCountMax is not set\n"; + } + + if (value.userSavedSearchesMax.isSet()) { + out << " userSavedSearchesMax = " + << value.userSavedSearchesMax.ref() << "\n"; + } + else { + out << " userSavedSearchesMax is not set\n"; + } + + if (value.noteResourceCountMax.isSet()) { + out << " noteResourceCountMax = " + << value.noteResourceCountMax.ref() << "\n"; + } + else { + out << " noteResourceCountMax is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeUser(ThriftBinaryBufferWriter & w, const User & s) { w.writeStructBegin(QStringLiteral("User")); if (s.id.isSet()) { @@ -7022,9 +12546,321 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { } r.readFieldEnd(); } - r.readStructEnd(); + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const User & value) +{ + out << "User: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.timezone.isSet()) { + out << " timezone = " + << value.timezone.ref() << "\n"; + } + else { + out << " timezone is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.serviceLevel.isSet()) { + out << " serviceLevel = " + << value.serviceLevel.ref() << "\n"; + } + else { + out << " serviceLevel is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.shardId.isSet()) { + out << " shardId = " + << value.shardId.ref() << "\n"; + } + else { + out << " shardId is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.accounting.isSet()) { + out << " accounting = " + << value.accounting.ref() << "\n"; + } + else { + out << " accounting is not set\n"; + } + + if (value.businessUserInfo.isSet()) { + out << " businessUserInfo = " + << value.businessUserInfo.ref() << "\n"; + } + else { + out << " businessUserInfo is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.accountLimits.isSet()) { + out << " accountLimits = " + << value.accountLimits.ref() << "\n"; + } + else { + out << " accountLimits is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const User & value) +{ + out << "User: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.timezone.isSet()) { + out << " timezone = " + << value.timezone.ref() << "\n"; + } + else { + out << " timezone is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.serviceLevel.isSet()) { + out << " serviceLevel = " + << value.serviceLevel.ref() << "\n"; + } + else { + out << " serviceLevel is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.shardId.isSet()) { + out << " shardId = " + << value.shardId.ref() << "\n"; + } + else { + out << " shardId is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.accounting.isSet()) { + out << " accounting = " + << value.accounting.ref() << "\n"; + } + else { + out << " accounting is not set\n"; + } + + if (value.businessUserInfo.isSet()) { + out << " businessUserInfo = " + << value.businessUserInfo.ref() << "\n"; + } + else { + out << " businessUserInfo is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.accountLimits.isSet()) { + out << " accountLimits = " + << value.accountLimits.ref() << "\n"; + } + else { + out << " accountLimits is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeContact(ThriftBinaryBufferWriter & w, const Contact & s) { w.writeStructBegin(QStringLiteral("Contact")); if (s.name.isSet()) { @@ -7167,6 +13003,142 @@ void readContact(ThriftBinaryBufferReader & r, Contact & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Contact & value) +{ + out << "Contact: {\n"; + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.type.isSet()) { + out << " type = " + << value.type.ref() << "\n"; + } + else { + out << " type is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.messagingPermit.isSet()) { + out << " messagingPermit = " + << value.messagingPermit.ref() << "\n"; + } + else { + out << " messagingPermit is not set\n"; + } + + if (value.messagingPermitExpires.isSet()) { + out << " messagingPermitExpires = " + << value.messagingPermitExpires.ref() << "\n"; + } + else { + out << " messagingPermitExpires is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Contact & value) +{ + out << "Contact: {\n"; + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.type.isSet()) { + out << " type = " + << value.type.ref() << "\n"; + } + else { + out << " type is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.messagingPermit.isSet()) { + out << " messagingPermit = " + << value.messagingPermit.ref() << "\n"; + } + else { + out << " messagingPermit is not set\n"; + } + + if (value.messagingPermitExpires.isSet()) { + out << " messagingPermitExpires = " + << value.messagingPermitExpires.ref() << "\n"; + } + else { + out << " messagingPermitExpires is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s) { w.writeStructBegin(QStringLiteral("Identity")); w.writeFieldBegin( @@ -7327,6 +13299,146 @@ void readIdentity(ThriftBinaryBufferReader & r, Identity & s) { if(!id_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Identity.id has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Identity & value) +{ + out << "Identity: {\n"; + out << " id = " + << "IdentityID" << "\n"; + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.userId.isSet()) { + out << " userId = " + << value.userId.ref() << "\n"; + } + else { + out << " userId is not set\n"; + } + + if (value.deactivated.isSet()) { + out << " deactivated = " + << value.deactivated.ref() << "\n"; + } + else { + out << " deactivated is not set\n"; + } + + if (value.sameBusiness.isSet()) { + out << " sameBusiness = " + << value.sameBusiness.ref() << "\n"; + } + else { + out << " sameBusiness is not set\n"; + } + + if (value.blocked.isSet()) { + out << " blocked = " + << value.blocked.ref() << "\n"; + } + else { + out << " blocked is not set\n"; + } + + if (value.userConnected.isSet()) { + out << " userConnected = " + << value.userConnected.ref() << "\n"; + } + else { + out << " userConnected is not set\n"; + } + + if (value.eventId.isSet()) { + out << " eventId = " + << value.eventId.ref() << "\n"; + } + else { + out << " eventId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Identity & value) +{ + out << "Identity: {\n"; + out << " id = " + << "IdentityID" << "\n"; + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.userId.isSet()) { + out << " userId = " + << value.userId.ref() << "\n"; + } + else { + out << " userId is not set\n"; + } + + if (value.deactivated.isSet()) { + out << " deactivated = " + << value.deactivated.ref() << "\n"; + } + else { + out << " deactivated is not set\n"; + } + + if (value.sameBusiness.isSet()) { + out << " sameBusiness = " + << value.sameBusiness.ref() << "\n"; + } + else { + out << " sameBusiness is not set\n"; + } + + if (value.blocked.isSet()) { + out << " blocked = " + << value.blocked.ref() << "\n"; + } + else { + out << " blocked is not set\n"; + } + + if (value.userConnected.isSet()) { + out << " userConnected = " + << value.userConnected.ref() << "\n"; + } + else { + out << " userConnected is not set\n"; + } + + if (value.eventId.isSet()) { + out << " eventId = " + << value.eventId.ref() << "\n"; + } + else { + out << " eventId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeTag(ThriftBinaryBufferWriter & w, const Tag & s) { w.writeStructBegin(QStringLiteral("Tag")); if (s.guid.isSet()) { @@ -7418,6 +13530,94 @@ void readTag(ThriftBinaryBufferReader & r, Tag & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Tag & value) +{ + out << "Tag: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.parentGuid.isSet()) { + out << " parentGuid = " + << value.parentGuid.ref() << "\n"; + } + else { + out << " parentGuid is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Tag & value) +{ + out << "Tag: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.parentGuid.isSet()) { + out << " parentGuid = " + << value.parentGuid.ref() << "\n"; + } + else { + out << " parentGuid is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeStructBegin(QStringLiteral("LazyMap")); if (s.keysOnly.isSet()) { @@ -7507,6 +13707,74 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const LazyMap & value) +{ + out << "LazyMap: {\n"; + + if (value.keysOnly.isSet()) { + out << " keysOnly = " + << "QSet {"; + for(const auto & v: value.keysOnly.ref()) { + out << v; + } + } + else { + out << " keysOnly is not set\n"; + } + + if (value.fullMap.isSet()) { + out << " fullMap = " + << "QMap {"; + for(const auto & it: toRange(value.fullMap.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " fullMap is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const LazyMap & value) +{ + out << "LazyMap: {\n"; + + if (value.keysOnly.isSet()) { + out << " keysOnly = " + << "QSet {"; + for(const auto & v: value.keysOnly.ref()) { + out << v; + } + } + else { + out << " keysOnly is not set\n"; + } + + if (value.fullMap.isSet()) { + out << " fullMap = " + << "QMap {"; + for(const auto & it: toRange(value.fullMap.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " fullMap is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttributes & s) { w.writeStructBegin(QStringLiteral("ResourceAttributes")); if (s.sourceURL.isSet()) { @@ -7734,6 +14002,222 @@ void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const ResourceAttributes & value) +{ + out << "ResourceAttributes: {\n"; + + if (value.sourceURL.isSet()) { + out << " sourceURL = " + << value.sourceURL.ref() << "\n"; + } + else { + out << " sourceURL is not set\n"; + } + + if (value.timestamp.isSet()) { + out << " timestamp = " + << value.timestamp.ref() << "\n"; + } + else { + out << " timestamp is not set\n"; + } + + if (value.latitude.isSet()) { + out << " latitude = " + << value.latitude.ref() << "\n"; + } + else { + out << " latitude is not set\n"; + } + + if (value.longitude.isSet()) { + out << " longitude = " + << value.longitude.ref() << "\n"; + } + else { + out << " longitude is not set\n"; + } + + if (value.altitude.isSet()) { + out << " altitude = " + << value.altitude.ref() << "\n"; + } + else { + out << " altitude is not set\n"; + } + + if (value.cameraMake.isSet()) { + out << " cameraMake = " + << value.cameraMake.ref() << "\n"; + } + else { + out << " cameraMake is not set\n"; + } + + if (value.cameraModel.isSet()) { + out << " cameraModel = " + << value.cameraModel.ref() << "\n"; + } + else { + out << " cameraModel is not set\n"; + } + + if (value.clientWillIndex.isSet()) { + out << " clientWillIndex = " + << value.clientWillIndex.ref() << "\n"; + } + else { + out << " clientWillIndex is not set\n"; + } + + if (value.recoType.isSet()) { + out << " recoType = " + << value.recoType.ref() << "\n"; + } + else { + out << " recoType is not set\n"; + } + + if (value.fileName.isSet()) { + out << " fileName = " + << value.fileName.ref() << "\n"; + } + else { + out << " fileName is not set\n"; + } + + if (value.attachment.isSet()) { + out << " attachment = " + << value.attachment.ref() << "\n"; + } + else { + out << " attachment is not set\n"; + } + + if (value.applicationData.isSet()) { + out << " applicationData = " + << value.applicationData.ref() << "\n"; + } + else { + out << " applicationData is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const ResourceAttributes & value) +{ + out << "ResourceAttributes: {\n"; + + if (value.sourceURL.isSet()) { + out << " sourceURL = " + << value.sourceURL.ref() << "\n"; + } + else { + out << " sourceURL is not set\n"; + } + + if (value.timestamp.isSet()) { + out << " timestamp = " + << value.timestamp.ref() << "\n"; + } + else { + out << " timestamp is not set\n"; + } + + if (value.latitude.isSet()) { + out << " latitude = " + << value.latitude.ref() << "\n"; + } + else { + out << " latitude is not set\n"; + } + + if (value.longitude.isSet()) { + out << " longitude = " + << value.longitude.ref() << "\n"; + } + else { + out << " longitude is not set\n"; + } + + if (value.altitude.isSet()) { + out << " altitude = " + << value.altitude.ref() << "\n"; + } + else { + out << " altitude is not set\n"; + } + + if (value.cameraMake.isSet()) { + out << " cameraMake = " + << value.cameraMake.ref() << "\n"; + } + else { + out << " cameraMake is not set\n"; + } + + if (value.cameraModel.isSet()) { + out << " cameraModel = " + << value.cameraModel.ref() << "\n"; + } + else { + out << " cameraModel is not set\n"; + } + + if (value.clientWillIndex.isSet()) { + out << " clientWillIndex = " + << value.clientWillIndex.ref() << "\n"; + } + else { + out << " clientWillIndex is not set\n"; + } + + if (value.recoType.isSet()) { + out << " recoType = " + << value.recoType.ref() << "\n"; + } + else { + out << " recoType is not set\n"; + } + + if (value.fileName.isSet()) { + out << " fileName = " + << value.fileName.ref() << "\n"; + } + else { + out << " fileName is not set\n"; + } + + if (value.attachment.isSet()) { + out << " attachment = " + << value.attachment.ref() << "\n"; + } + else { + out << " attachment is not set\n"; + } + + if (value.applicationData.isSet()) { + out << " applicationData = " + << value.applicationData.ref() << "\n"; + } + else { + out << " applicationData is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeResource(ThriftBinaryBufferWriter & w, const Resource & s) { w.writeStructBegin(QStringLiteral("Resource")); if (s.guid.isSet()) { @@ -7961,6 +14445,222 @@ void readResource(ThriftBinaryBufferReader & r, Resource & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Resource & value) +{ + out << "Resource: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.data.isSet()) { + out << " data = " + << value.data.ref() << "\n"; + } + else { + out << " data is not set\n"; + } + + if (value.mime.isSet()) { + out << " mime = " + << value.mime.ref() << "\n"; + } + else { + out << " mime is not set\n"; + } + + if (value.width.isSet()) { + out << " width = " + << value.width.ref() << "\n"; + } + else { + out << " width is not set\n"; + } + + if (value.height.isSet()) { + out << " height = " + << value.height.ref() << "\n"; + } + else { + out << " height is not set\n"; + } + + if (value.duration.isSet()) { + out << " duration = " + << value.duration.ref() << "\n"; + } + else { + out << " duration is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.recognition.isSet()) { + out << " recognition = " + << value.recognition.ref() << "\n"; + } + else { + out << " recognition is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.alternateData.isSet()) { + out << " alternateData = " + << value.alternateData.ref() << "\n"; + } + else { + out << " alternateData is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Resource & value) +{ + out << "Resource: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.noteGuid.isSet()) { + out << " noteGuid = " + << value.noteGuid.ref() << "\n"; + } + else { + out << " noteGuid is not set\n"; + } + + if (value.data.isSet()) { + out << " data = " + << value.data.ref() << "\n"; + } + else { + out << " data is not set\n"; + } + + if (value.mime.isSet()) { + out << " mime = " + << value.mime.ref() << "\n"; + } + else { + out << " mime is not set\n"; + } + + if (value.width.isSet()) { + out << " width = " + << value.width.ref() << "\n"; + } + else { + out << " width is not set\n"; + } + + if (value.height.isSet()) { + out << " height = " + << value.height.ref() << "\n"; + } + else { + out << " height is not set\n"; + } + + if (value.duration.isSet()) { + out << " duration = " + << value.duration.ref() << "\n"; + } + else { + out << " duration is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.recognition.isSet()) { + out << " recognition = " + << value.recognition.ref() << "\n"; + } + else { + out << " recognition is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.alternateData.isSet()) { + out << " alternateData = " + << value.alternateData.ref() << "\n"; + } + else { + out << " alternateData is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) { w.writeStructBegin(QStringLiteral("NoteAttributes")); if (s.subjectDate.isSet()) { @@ -8371,11 +15071,393 @@ void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { { r.skip(fieldType); } - r.readFieldEnd(); + r.readFieldEnd(); + } + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteAttributes & value) +{ + out << "NoteAttributes: {\n"; + + if (value.subjectDate.isSet()) { + out << " subjectDate = " + << value.subjectDate.ref() << "\n"; + } + else { + out << " subjectDate is not set\n"; + } + + if (value.latitude.isSet()) { + out << " latitude = " + << value.latitude.ref() << "\n"; + } + else { + out << " latitude is not set\n"; + } + + if (value.longitude.isSet()) { + out << " longitude = " + << value.longitude.ref() << "\n"; + } + else { + out << " longitude is not set\n"; + } + + if (value.altitude.isSet()) { + out << " altitude = " + << value.altitude.ref() << "\n"; + } + else { + out << " altitude is not set\n"; + } + + if (value.author.isSet()) { + out << " author = " + << value.author.ref() << "\n"; + } + else { + out << " author is not set\n"; + } + + if (value.source.isSet()) { + out << " source = " + << value.source.ref() << "\n"; + } + else { + out << " source is not set\n"; + } + + if (value.sourceURL.isSet()) { + out << " sourceURL = " + << value.sourceURL.ref() << "\n"; + } + else { + out << " sourceURL is not set\n"; + } + + if (value.sourceApplication.isSet()) { + out << " sourceApplication = " + << value.sourceApplication.ref() << "\n"; + } + else { + out << " sourceApplication is not set\n"; + } + + if (value.shareDate.isSet()) { + out << " shareDate = " + << value.shareDate.ref() << "\n"; + } + else { + out << " shareDate is not set\n"; + } + + if (value.reminderOrder.isSet()) { + out << " reminderOrder = " + << value.reminderOrder.ref() << "\n"; + } + else { + out << " reminderOrder is not set\n"; + } + + if (value.reminderDoneTime.isSet()) { + out << " reminderDoneTime = " + << value.reminderDoneTime.ref() << "\n"; + } + else { + out << " reminderDoneTime is not set\n"; + } + + if (value.reminderTime.isSet()) { + out << " reminderTime = " + << value.reminderTime.ref() << "\n"; + } + else { + out << " reminderTime is not set\n"; + } + + if (value.placeName.isSet()) { + out << " placeName = " + << value.placeName.ref() << "\n"; + } + else { + out << " placeName is not set\n"; + } + + if (value.contentClass.isSet()) { + out << " contentClass = " + << value.contentClass.ref() << "\n"; + } + else { + out << " contentClass is not set\n"; + } + + if (value.applicationData.isSet()) { + out << " applicationData = " + << value.applicationData.ref() << "\n"; + } + else { + out << " applicationData is not set\n"; + } + + if (value.lastEditedBy.isSet()) { + out << " lastEditedBy = " + << value.lastEditedBy.ref() << "\n"; + } + else { + out << " lastEditedBy is not set\n"; + } + + if (value.classifications.isSet()) { + out << " classifications = " + << "QMap {"; + for(const auto & it: toRange(value.classifications.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } + } + else { + out << " classifications is not set\n"; + } + + if (value.creatorId.isSet()) { + out << " creatorId = " + << value.creatorId.ref() << "\n"; + } + else { + out << " creatorId is not set\n"; + } + + if (value.lastEditorId.isSet()) { + out << " lastEditorId = " + << value.lastEditorId.ref() << "\n"; + } + else { + out << " lastEditorId is not set\n"; + } + + if (value.sharedWithBusiness.isSet()) { + out << " sharedWithBusiness = " + << value.sharedWithBusiness.ref() << "\n"; + } + else { + out << " sharedWithBusiness is not set\n"; + } + + if (value.conflictSourceNoteGuid.isSet()) { + out << " conflictSourceNoteGuid = " + << value.conflictSourceNoteGuid.ref() << "\n"; + } + else { + out << " conflictSourceNoteGuid is not set\n"; + } + + if (value.noteTitleQuality.isSet()) { + out << " noteTitleQuality = " + << value.noteTitleQuality.ref() << "\n"; + } + else { + out << " noteTitleQuality is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteAttributes & value) +{ + out << "NoteAttributes: {\n"; + + if (value.subjectDate.isSet()) { + out << " subjectDate = " + << value.subjectDate.ref() << "\n"; + } + else { + out << " subjectDate is not set\n"; + } + + if (value.latitude.isSet()) { + out << " latitude = " + << value.latitude.ref() << "\n"; + } + else { + out << " latitude is not set\n"; + } + + if (value.longitude.isSet()) { + out << " longitude = " + << value.longitude.ref() << "\n"; + } + else { + out << " longitude is not set\n"; + } + + if (value.altitude.isSet()) { + out << " altitude = " + << value.altitude.ref() << "\n"; + } + else { + out << " altitude is not set\n"; + } + + if (value.author.isSet()) { + out << " author = " + << value.author.ref() << "\n"; + } + else { + out << " author is not set\n"; + } + + if (value.source.isSet()) { + out << " source = " + << value.source.ref() << "\n"; + } + else { + out << " source is not set\n"; + } + + if (value.sourceURL.isSet()) { + out << " sourceURL = " + << value.sourceURL.ref() << "\n"; + } + else { + out << " sourceURL is not set\n"; + } + + if (value.sourceApplication.isSet()) { + out << " sourceApplication = " + << value.sourceApplication.ref() << "\n"; + } + else { + out << " sourceApplication is not set\n"; + } + + if (value.shareDate.isSet()) { + out << " shareDate = " + << value.shareDate.ref() << "\n"; + } + else { + out << " shareDate is not set\n"; + } + + if (value.reminderOrder.isSet()) { + out << " reminderOrder = " + << value.reminderOrder.ref() << "\n"; + } + else { + out << " reminderOrder is not set\n"; + } + + if (value.reminderDoneTime.isSet()) { + out << " reminderDoneTime = " + << value.reminderDoneTime.ref() << "\n"; + } + else { + out << " reminderDoneTime is not set\n"; + } + + if (value.reminderTime.isSet()) { + out << " reminderTime = " + << value.reminderTime.ref() << "\n"; + } + else { + out << " reminderTime is not set\n"; + } + + if (value.placeName.isSet()) { + out << " placeName = " + << value.placeName.ref() << "\n"; + } + else { + out << " placeName is not set\n"; + } + + if (value.contentClass.isSet()) { + out << " contentClass = " + << value.contentClass.ref() << "\n"; + } + else { + out << " contentClass is not set\n"; + } + + if (value.applicationData.isSet()) { + out << " applicationData = " + << value.applicationData.ref() << "\n"; + } + else { + out << " applicationData is not set\n"; + } + + if (value.lastEditedBy.isSet()) { + out << " lastEditedBy = " + << value.lastEditedBy.ref() << "\n"; + } + else { + out << " lastEditedBy is not set\n"; + } + + if (value.classifications.isSet()) { + out << " classifications = " + << "QMap {"; + for(const auto & it: toRange(value.classifications.ref())) { + out << "[" << it.key() << "] = " << it.value() << "\n"; + } } - r.readStructEnd(); + else { + out << " classifications is not set\n"; + } + + if (value.creatorId.isSet()) { + out << " creatorId = " + << value.creatorId.ref() << "\n"; + } + else { + out << " creatorId is not set\n"; + } + + if (value.lastEditorId.isSet()) { + out << " lastEditorId = " + << value.lastEditorId.ref() << "\n"; + } + else { + out << " lastEditorId is not set\n"; + } + + if (value.sharedWithBusiness.isSet()) { + out << " sharedWithBusiness = " + << value.sharedWithBusiness.ref() << "\n"; + } + else { + out << " sharedWithBusiness is not set\n"; + } + + if (value.conflictSourceNoteGuid.isSet()) { + out << " conflictSourceNoteGuid = " + << value.conflictSourceNoteGuid.ref() << "\n"; + } + else { + out << " conflictSourceNoteGuid is not set\n"; + } + + if (value.noteTitleQuality.isSet()) { + out << " noteTitleQuality = " + << value.noteTitleQuality.ref() << "\n"; + } + else { + out << " noteTitleQuality is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s) { w.writeStructBegin(QStringLiteral("SharedNote")); if (s.sharerUserID.isSet()) { @@ -8501,6 +15583,126 @@ void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SharedNote & value) +{ + out << "SharedNote: {\n"; + + if (value.sharerUserID.isSet()) { + out << " sharerUserID = " + << value.sharerUserID.ref() << "\n"; + } + else { + out << " sharerUserID is not set\n"; + } + + if (value.recipientIdentity.isSet()) { + out << " recipientIdentity = " + << value.recipientIdentity.ref() << "\n"; + } + else { + out << " recipientIdentity is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.serviceAssigned.isSet()) { + out << " serviceAssigned = " + << value.serviceAssigned.ref() << "\n"; + } + else { + out << " serviceAssigned is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SharedNote & value) +{ + out << "SharedNote: {\n"; + + if (value.sharerUserID.isSet()) { + out << " sharerUserID = " + << value.sharerUserID.ref() << "\n"; + } + else { + out << " sharerUserID is not set\n"; + } + + if (value.recipientIdentity.isSet()) { + out << " recipientIdentity = " + << value.recipientIdentity.ref() << "\n"; + } + else { + out << " recipientIdentity is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.serviceAssigned.isSet()) { + out << " serviceAssigned = " + << value.serviceAssigned.ref() << "\n"; + } + else { + out << " serviceAssigned is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteRestrictions")); if (s.noUpdateTitle.isSet()) { @@ -8609,6 +15811,110 @@ void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteRestrictions & value) +{ + out << "NoteRestrictions: {\n"; + + if (value.noUpdateTitle.isSet()) { + out << " noUpdateTitle = " + << value.noUpdateTitle.ref() << "\n"; + } + else { + out << " noUpdateTitle is not set\n"; + } + + if (value.noUpdateContent.isSet()) { + out << " noUpdateContent = " + << value.noUpdateContent.ref() << "\n"; + } + else { + out << " noUpdateContent is not set\n"; + } + + if (value.noEmail.isSet()) { + out << " noEmail = " + << value.noEmail.ref() << "\n"; + } + else { + out << " noEmail is not set\n"; + } + + if (value.noShare.isSet()) { + out << " noShare = " + << value.noShare.ref() << "\n"; + } + else { + out << " noShare is not set\n"; + } + + if (value.noSharePublicly.isSet()) { + out << " noSharePublicly = " + << value.noSharePublicly.ref() << "\n"; + } + else { + out << " noSharePublicly is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteRestrictions & value) +{ + out << "NoteRestrictions: {\n"; + + if (value.noUpdateTitle.isSet()) { + out << " noUpdateTitle = " + << value.noUpdateTitle.ref() << "\n"; + } + else { + out << " noUpdateTitle is not set\n"; + } + + if (value.noUpdateContent.isSet()) { + out << " noUpdateContent = " + << value.noUpdateContent.ref() << "\n"; + } + else { + out << " noUpdateContent is not set\n"; + } + + if (value.noEmail.isSet()) { + out << " noEmail = " + << value.noEmail.ref() << "\n"; + } + else { + out << " noEmail is not set\n"; + } + + if (value.noShare.isSet()) { + out << " noShare = " + << value.noShare.ref() << "\n"; + } + else { + out << " noShare is not set\n"; + } + + if (value.noSharePublicly.isSet()) { + out << " noSharePublicly = " + << value.noSharePublicly.ref() << "\n"; + } + else { + out << " noSharePublicly is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s) { w.writeStructBegin(QStringLiteral("NoteLimits")); if (s.noteResourceCountMax.isSet()) { @@ -8717,6 +16023,110 @@ void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NoteLimits & value) +{ + out << "NoteLimits: {\n"; + + if (value.noteResourceCountMax.isSet()) { + out << " noteResourceCountMax = " + << value.noteResourceCountMax.ref() << "\n"; + } + else { + out << " noteResourceCountMax is not set\n"; + } + + if (value.uploadLimit.isSet()) { + out << " uploadLimit = " + << value.uploadLimit.ref() << "\n"; + } + else { + out << " uploadLimit is not set\n"; + } + + if (value.resourceSizeMax.isSet()) { + out << " resourceSizeMax = " + << value.resourceSizeMax.ref() << "\n"; + } + else { + out << " resourceSizeMax is not set\n"; + } + + if (value.noteSizeMax.isSet()) { + out << " noteSizeMax = " + << value.noteSizeMax.ref() << "\n"; + } + else { + out << " noteSizeMax is not set\n"; + } + + if (value.uploaded.isSet()) { + out << " uploaded = " + << value.uploaded.ref() << "\n"; + } + else { + out << " uploaded is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NoteLimits & value) +{ + out << "NoteLimits: {\n"; + + if (value.noteResourceCountMax.isSet()) { + out << " noteResourceCountMax = " + << value.noteResourceCountMax.ref() << "\n"; + } + else { + out << " noteResourceCountMax is not set\n"; + } + + if (value.uploadLimit.isSet()) { + out << " uploadLimit = " + << value.uploadLimit.ref() << "\n"; + } + else { + out << " uploadLimit is not set\n"; + } + + if (value.resourceSizeMax.isSet()) { + out << " resourceSizeMax = " + << value.resourceSizeMax.ref() << "\n"; + } + else { + out << " resourceSizeMax is not set\n"; + } + + if (value.noteSizeMax.isSet()) { + out << " noteSizeMax = " + << value.noteSizeMax.ref() << "\n"; + } + else { + out << " noteSizeMax is not set\n"; + } + + if (value.uploaded.isSet()) { + out << " uploaded = " + << value.uploaded.ref() << "\n"; + } + else { + out << " uploaded is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeStructBegin(QStringLiteral("Note")); if (s.guid.isSet()) { @@ -9097,11 +16507,347 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { { r.skip(fieldType); } - r.readFieldEnd(); + r.readFieldEnd(); + } + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Note & value) +{ + out << "Note: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.content.isSet()) { + out << " content = " + << value.content.ref() << "\n"; + } + else { + out << " content is not set\n"; + } + + if (value.contentHash.isSet()) { + out << " contentHash = " + << value.contentHash.ref() << "\n"; + } + else { + out << " contentHash is not set\n"; + } + + if (value.contentLength.isSet()) { + out << " contentLength = " + << value.contentLength.ref() << "\n"; + } + else { + out << " contentLength is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.resources.isSet()) { + out << " resources = " + << "QList {"; + for(const auto & v: value.resources.ref()) { + out << v; + } + } + else { + out << " resources is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.tagNames.isSet()) { + out << " tagNames = " + << "QList {"; + for(const auto & v: value.tagNames.ref()) { + out << v; + } } - r.readStructEnd(); + else { + out << " tagNames is not set\n"; + } + + if (value.sharedNotes.isSet()) { + out << " sharedNotes = " + << "QList {"; + for(const auto & v: value.sharedNotes.ref()) { + out << v; + } + } + else { + out << " sharedNotes is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.limits.isSet()) { + out << " limits = " + << value.limits.ref() << "\n"; + } + else { + out << " limits is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Note & value) +{ + out << "Note: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.content.isSet()) { + out << " content = " + << value.content.ref() << "\n"; + } + else { + out << " content is not set\n"; + } + + if (value.contentHash.isSet()) { + out << " contentHash = " + << value.contentHash.ref() << "\n"; + } + else { + out << " contentHash is not set\n"; + } + + if (value.contentLength.isSet()) { + out << " contentLength = " + << value.contentLength.ref() << "\n"; + } + else { + out << " contentLength is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.updated.isSet()) { + out << " updated = " + << value.updated.ref() << "\n"; + } + else { + out << " updated is not set\n"; + } + + if (value.deleted.isSet()) { + out << " deleted = " + << value.deleted.ref() << "\n"; + } + else { + out << " deleted is not set\n"; + } + + if (value.active.isSet()) { + out << " active = " + << value.active.ref() << "\n"; + } + else { + out << " active is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.tagGuids.isSet()) { + out << " tagGuids = " + << "QList {"; + for(const auto & v: value.tagGuids.ref()) { + out << v; + } + } + else { + out << " tagGuids is not set\n"; + } + + if (value.resources.isSet()) { + out << " resources = " + << "QList {"; + for(const auto & v: value.resources.ref()) { + out << v; + } + } + else { + out << " resources is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.tagNames.isSet()) { + out << " tagNames = " + << "QList {"; + for(const auto & v: value.tagNames.ref()) { + out << v; + } + } + else { + out << " tagNames is not set\n"; + } + + if (value.sharedNotes.isSet()) { + out << " sharedNotes = " + << "QList {"; + for(const auto & v: value.sharedNotes.ref()) { + out << v; + } + } + else { + out << " sharedNotes is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.limits.isSet()) { + out << " limits = " + << value.limits.ref() << "\n"; + } + else { + out << " limits is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s) { w.writeStructBegin(QStringLiteral("Publishing")); if (s.uri.isSet()) { @@ -9193,6 +16939,94 @@ void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Publishing & value) +{ + out << "Publishing: {\n"; + + if (value.uri.isSet()) { + out << " uri = " + << value.uri.ref() << "\n"; + } + else { + out << " uri is not set\n"; + } + + if (value.order.isSet()) { + out << " order = " + << value.order.ref() << "\n"; + } + else { + out << " order is not set\n"; + } + + if (value.ascending.isSet()) { + out << " ascending = " + << value.ascending.ref() << "\n"; + } + else { + out << " ascending is not set\n"; + } + + if (value.publicDescription.isSet()) { + out << " publicDescription = " + << value.publicDescription.ref() << "\n"; + } + else { + out << " publicDescription is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Publishing & value) +{ + out << "Publishing: {\n"; + + if (value.uri.isSet()) { + out << " uri = " + << value.uri.ref() << "\n"; + } + else { + out << " uri is not set\n"; + } + + if (value.order.isSet()) { + out << " order = " + << value.order.ref() << "\n"; + } + else { + out << " order is not set\n"; + } + + if (value.ascending.isSet()) { + out << " ascending = " + << value.ascending.ref() << "\n"; + } + else { + out << " ascending is not set\n"; + } + + if (value.publicDescription.isSet()) { + out << " publicDescription = " + << value.publicDescription.ref() << "\n"; + } + else { + out << " publicDescription is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook & s) { w.writeStructBegin(QStringLiteral("BusinessNotebook")); if (s.notebookDescription.isSet()) { @@ -9267,6 +17101,78 @@ void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BusinessNotebook & value) +{ + out << "BusinessNotebook: {\n"; + + if (value.notebookDescription.isSet()) { + out << " notebookDescription = " + << value.notebookDescription.ref() << "\n"; + } + else { + out << " notebookDescription is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.recommended.isSet()) { + out << " recommended = " + << value.recommended.ref() << "\n"; + } + else { + out << " recommended is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BusinessNotebook & value) +{ + out << "BusinessNotebook: {\n"; + + if (value.notebookDescription.isSet()) { + out << " notebookDescription = " + << value.notebookDescription.ref() << "\n"; + } + else { + out << " notebookDescription is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.recommended.isSet()) { + out << " recommended = " + << value.recommended.ref() << "\n"; + } + else { + out << " recommended is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope & s) { w.writeStructBegin(QStringLiteral("SavedSearchScope")); if (s.includeAccount.isSet()) { @@ -9341,6 +17247,78 @@ void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SavedSearchScope & value) +{ + out << "SavedSearchScope: {\n"; + + if (value.includeAccount.isSet()) { + out << " includeAccount = " + << value.includeAccount.ref() << "\n"; + } + else { + out << " includeAccount is not set\n"; + } + + if (value.includePersonalLinkedNotebooks.isSet()) { + out << " includePersonalLinkedNotebooks = " + << value.includePersonalLinkedNotebooks.ref() << "\n"; + } + else { + out << " includePersonalLinkedNotebooks is not set\n"; + } + + if (value.includeBusinessLinkedNotebooks.isSet()) { + out << " includeBusinessLinkedNotebooks = " + << value.includeBusinessLinkedNotebooks.ref() << "\n"; + } + else { + out << " includeBusinessLinkedNotebooks is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SavedSearchScope & value) +{ + out << "SavedSearchScope: {\n"; + + if (value.includeAccount.isSet()) { + out << " includeAccount = " + << value.includeAccount.ref() << "\n"; + } + else { + out << " includeAccount is not set\n"; + } + + if (value.includePersonalLinkedNotebooks.isSet()) { + out << " includePersonalLinkedNotebooks = " + << value.includePersonalLinkedNotebooks.ref() << "\n"; + } + else { + out << " includePersonalLinkedNotebooks is not set\n"; + } + + if (value.includeBusinessLinkedNotebooks.isSet()) { + out << " includeBusinessLinkedNotebooks = " + << value.includeBusinessLinkedNotebooks.ref() << "\n"; + } + else { + out << " includeBusinessLinkedNotebooks is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s) { w.writeStructBegin(QStringLiteral("SavedSearch")); if (s.guid.isSet()) { @@ -9466,6 +17444,126 @@ void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SavedSearch & value) +{ + out << "SavedSearch: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.query.isSet()) { + out << " query = " + << value.query.ref() << "\n"; + } + else { + out << " query is not set\n"; + } + + if (value.format.isSet()) { + out << " format = " + << value.format.ref() << "\n"; + } + else { + out << " format is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.scope.isSet()) { + out << " scope = " + << value.scope.ref() << "\n"; + } + else { + out << " scope is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SavedSearch & value) +{ + out << "SavedSearch: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.query.isSet()) { + out << " query = " + << value.query.ref() << "\n"; + } + else { + out << " query is not set\n"; + } + + if (value.format.isSet()) { + out << " format = " + << value.format.ref() << "\n"; + } + else { + out << " format is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.scope.isSet()) { + out << " scope = " + << value.scope.ref() << "\n"; + } + else { + out << " scope is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const SharedNotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { @@ -9520,9 +17618,65 @@ void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNot } r.readFieldEnd(); } - r.readStructEnd(); + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SharedNotebookRecipientSettings & value) +{ + out << "SharedNotebookRecipientSettings: {\n"; + + if (value.reminderNotifyEmail.isSet()) { + out << " reminderNotifyEmail = " + << value.reminderNotifyEmail.ref() << "\n"; + } + else { + out << " reminderNotifyEmail is not set\n"; + } + + if (value.reminderNotifyInApp.isSet()) { + out << " reminderNotifyInApp = " + << value.reminderNotifyInApp.ref() << "\n"; + } + else { + out << " reminderNotifyInApp is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SharedNotebookRecipientSettings & value) +{ + out << "SharedNotebookRecipientSettings: {\n"; + + if (value.reminderNotifyEmail.isSet()) { + out << " reminderNotifyEmail = " + << value.reminderNotifyEmail.ref() << "\n"; + } + else { + out << " reminderNotifyEmail is not set\n"; + } + + if (value.reminderNotifyInApp.isSet()) { + out << " reminderNotifyInApp = " + << value.reminderNotifyInApp.ref() << "\n"; + } + else { + out << " reminderNotifyInApp is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const NotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { @@ -9631,6 +17785,110 @@ void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipie r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotebookRecipientSettings & value) +{ + out << "NotebookRecipientSettings: {\n"; + + if (value.reminderNotifyEmail.isSet()) { + out << " reminderNotifyEmail = " + << value.reminderNotifyEmail.ref() << "\n"; + } + else { + out << " reminderNotifyEmail is not set\n"; + } + + if (value.reminderNotifyInApp.isSet()) { + out << " reminderNotifyInApp = " + << value.reminderNotifyInApp.ref() << "\n"; + } + else { + out << " reminderNotifyInApp is not set\n"; + } + + if (value.inMyList.isSet()) { + out << " inMyList = " + << value.inMyList.ref() << "\n"; + } + else { + out << " inMyList is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.recipientStatus.isSet()) { + out << " recipientStatus = " + << value.recipientStatus.ref() << "\n"; + } + else { + out << " recipientStatus is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotebookRecipientSettings & value) +{ + out << "NotebookRecipientSettings: {\n"; + + if (value.reminderNotifyEmail.isSet()) { + out << " reminderNotifyEmail = " + << value.reminderNotifyEmail.ref() << "\n"; + } + else { + out << " reminderNotifyEmail is not set\n"; + } + + if (value.reminderNotifyInApp.isSet()) { + out << " reminderNotifyInApp = " + << value.reminderNotifyInApp.ref() << "\n"; + } + else { + out << " reminderNotifyInApp is not set\n"; + } + + if (value.inMyList.isSet()) { + out << " inMyList = " + << value.inMyList.ref() << "\n"; + } + else { + out << " inMyList is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.recipientStatus.isSet()) { + out << " recipientStatus = " + << value.recipientStatus.ref() << "\n"; + } + else { + out << " recipientStatus is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s) { w.writeStructBegin(QStringLiteral("SharedNotebook")); if (s.id.isSet()) { @@ -9926,6 +18184,286 @@ void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const SharedNotebook & value) +{ + out << "SharedNotebook: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.userId.isSet()) { + out << " userId = " + << value.userId.ref() << "\n"; + } + else { + out << " userId is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.recipientIdentityId.isSet()) { + out << " recipientIdentityId = " + << value.recipientIdentityId.ref() << "\n"; + } + else { + out << " recipientIdentityId is not set\n"; + } + + if (value.notebookModifiable.isSet()) { + out << " notebookModifiable = " + << value.notebookModifiable.ref() << "\n"; + } + else { + out << " notebookModifiable is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.globalId.isSet()) { + out << " globalId = " + << value.globalId.ref() << "\n"; + } + else { + out << " globalId is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.recipientSettings.isSet()) { + out << " recipientSettings = " + << value.recipientSettings.ref() << "\n"; + } + else { + out << " recipientSettings is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + if (value.recipientUsername.isSet()) { + out << " recipientUsername = " + << value.recipientUsername.ref() << "\n"; + } + else { + out << " recipientUsername is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.serviceAssigned.isSet()) { + out << " serviceAssigned = " + << value.serviceAssigned.ref() << "\n"; + } + else { + out << " serviceAssigned is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const SharedNotebook & value) +{ + out << "SharedNotebook: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.userId.isSet()) { + out << " userId = " + << value.userId.ref() << "\n"; + } + else { + out << " userId is not set\n"; + } + + if (value.notebookGuid.isSet()) { + out << " notebookGuid = " + << value.notebookGuid.ref() << "\n"; + } + else { + out << " notebookGuid is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.recipientIdentityId.isSet()) { + out << " recipientIdentityId = " + << value.recipientIdentityId.ref() << "\n"; + } + else { + out << " recipientIdentityId is not set\n"; + } + + if (value.notebookModifiable.isSet()) { + out << " notebookModifiable = " + << value.notebookModifiable.ref() << "\n"; + } + else { + out << " notebookModifiable is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.globalId.isSet()) { + out << " globalId = " + << value.globalId.ref() << "\n"; + } + else { + out << " globalId is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.privilege.isSet()) { + out << " privilege = " + << value.privilege.ref() << "\n"; + } + else { + out << " privilege is not set\n"; + } + + if (value.recipientSettings.isSet()) { + out << " recipientSettings = " + << value.recipientSettings.ref() << "\n"; + } + else { + out << " recipientSettings is not set\n"; + } + + if (value.sharerUserId.isSet()) { + out << " sharerUserId = " + << value.sharerUserId.ref() << "\n"; + } + else { + out << " sharerUserId is not set\n"; + } + + if (value.recipientUsername.isSet()) { + out << " recipientUsername = " + << value.recipientUsername.ref() << "\n"; + } + else { + out << " recipientUsername is not set\n"; + } + + if (value.recipientUserId.isSet()) { + out << " recipientUserId = " + << value.recipientUserId.ref() << "\n"; + } + else { + out << " recipientUserId is not set\n"; + } + + if (value.serviceAssigned.isSet()) { + out << " serviceAssigned = " + << value.serviceAssigned.ref() << "\n"; + } + else { + out << " serviceAssigned is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const CanMoveToContainerRestrictions & s) { w.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); if (s.canMoveToContainer.isSet()) { @@ -9966,6 +18504,46 @@ void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToC r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const CanMoveToContainerRestrictions & value) +{ + out << "CanMoveToContainerRestrictions: {\n"; + + if (value.canMoveToContainer.isSet()) { + out << " canMoveToContainer = " + << value.canMoveToContainer.ref() << "\n"; + } + else { + out << " canMoveToContainer is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const CanMoveToContainerRestrictions & value) +{ + out << "CanMoveToContainerRestrictions: {\n"; + + if (value.canMoveToContainer.isSet()) { + out << " canMoveToContainer = " + << value.canMoveToContainer.ref() << "\n"; + } + else { + out << " canMoveToContainer is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestrictions & s) { w.writeStructBegin(QStringLiteral("NotebookRestrictions")); if (s.noReadNotes.isSet()) { @@ -10479,9 +19057,497 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions } r.readFieldEnd(); } - r.readStructEnd(); + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotebookRestrictions & value) +{ + out << "NotebookRestrictions: {\n"; + + if (value.noReadNotes.isSet()) { + out << " noReadNotes = " + << value.noReadNotes.ref() << "\n"; + } + else { + out << " noReadNotes is not set\n"; + } + + if (value.noCreateNotes.isSet()) { + out << " noCreateNotes = " + << value.noCreateNotes.ref() << "\n"; + } + else { + out << " noCreateNotes is not set\n"; + } + + if (value.noUpdateNotes.isSet()) { + out << " noUpdateNotes = " + << value.noUpdateNotes.ref() << "\n"; + } + else { + out << " noUpdateNotes is not set\n"; + } + + if (value.noExpungeNotes.isSet()) { + out << " noExpungeNotes = " + << value.noExpungeNotes.ref() << "\n"; + } + else { + out << " noExpungeNotes is not set\n"; + } + + if (value.noShareNotes.isSet()) { + out << " noShareNotes = " + << value.noShareNotes.ref() << "\n"; + } + else { + out << " noShareNotes is not set\n"; + } + + if (value.noEmailNotes.isSet()) { + out << " noEmailNotes = " + << value.noEmailNotes.ref() << "\n"; + } + else { + out << " noEmailNotes is not set\n"; + } + + if (value.noSendMessageToRecipients.isSet()) { + out << " noSendMessageToRecipients = " + << value.noSendMessageToRecipients.ref() << "\n"; + } + else { + out << " noSendMessageToRecipients is not set\n"; + } + + if (value.noUpdateNotebook.isSet()) { + out << " noUpdateNotebook = " + << value.noUpdateNotebook.ref() << "\n"; + } + else { + out << " noUpdateNotebook is not set\n"; + } + + if (value.noExpungeNotebook.isSet()) { + out << " noExpungeNotebook = " + << value.noExpungeNotebook.ref() << "\n"; + } + else { + out << " noExpungeNotebook is not set\n"; + } + + if (value.noSetDefaultNotebook.isSet()) { + out << " noSetDefaultNotebook = " + << value.noSetDefaultNotebook.ref() << "\n"; + } + else { + out << " noSetDefaultNotebook is not set\n"; + } + + if (value.noSetNotebookStack.isSet()) { + out << " noSetNotebookStack = " + << value.noSetNotebookStack.ref() << "\n"; + } + else { + out << " noSetNotebookStack is not set\n"; + } + + if (value.noPublishToPublic.isSet()) { + out << " noPublishToPublic = " + << value.noPublishToPublic.ref() << "\n"; + } + else { + out << " noPublishToPublic is not set\n"; + } + + if (value.noPublishToBusinessLibrary.isSet()) { + out << " noPublishToBusinessLibrary = " + << value.noPublishToBusinessLibrary.ref() << "\n"; + } + else { + out << " noPublishToBusinessLibrary is not set\n"; + } + + if (value.noCreateTags.isSet()) { + out << " noCreateTags = " + << value.noCreateTags.ref() << "\n"; + } + else { + out << " noCreateTags is not set\n"; + } + + if (value.noUpdateTags.isSet()) { + out << " noUpdateTags = " + << value.noUpdateTags.ref() << "\n"; + } + else { + out << " noUpdateTags is not set\n"; + } + + if (value.noExpungeTags.isSet()) { + out << " noExpungeTags = " + << value.noExpungeTags.ref() << "\n"; + } + else { + out << " noExpungeTags is not set\n"; + } + + if (value.noSetParentTag.isSet()) { + out << " noSetParentTag = " + << value.noSetParentTag.ref() << "\n"; + } + else { + out << " noSetParentTag is not set\n"; + } + + if (value.noCreateSharedNotebooks.isSet()) { + out << " noCreateSharedNotebooks = " + << value.noCreateSharedNotebooks.ref() << "\n"; + } + else { + out << " noCreateSharedNotebooks is not set\n"; + } + + if (value.updateWhichSharedNotebookRestrictions.isSet()) { + out << " updateWhichSharedNotebookRestrictions = " + << value.updateWhichSharedNotebookRestrictions.ref() << "\n"; + } + else { + out << " updateWhichSharedNotebookRestrictions is not set\n"; + } + + if (value.expungeWhichSharedNotebookRestrictions.isSet()) { + out << " expungeWhichSharedNotebookRestrictions = " + << value.expungeWhichSharedNotebookRestrictions.ref() << "\n"; + } + else { + out << " expungeWhichSharedNotebookRestrictions is not set\n"; + } + + if (value.noShareNotesWithBusiness.isSet()) { + out << " noShareNotesWithBusiness = " + << value.noShareNotesWithBusiness.ref() << "\n"; + } + else { + out << " noShareNotesWithBusiness is not set\n"; + } + + if (value.noRenameNotebook.isSet()) { + out << " noRenameNotebook = " + << value.noRenameNotebook.ref() << "\n"; + } + else { + out << " noRenameNotebook is not set\n"; + } + + if (value.noSetInMyList.isSet()) { + out << " noSetInMyList = " + << value.noSetInMyList.ref() << "\n"; + } + else { + out << " noSetInMyList is not set\n"; + } + + if (value.noChangeContact.isSet()) { + out << " noChangeContact = " + << value.noChangeContact.ref() << "\n"; + } + else { + out << " noChangeContact is not set\n"; + } + + if (value.canMoveToContainerRestrictions.isSet()) { + out << " canMoveToContainerRestrictions = " + << value.canMoveToContainerRestrictions.ref() << "\n"; + } + else { + out << " canMoveToContainerRestrictions is not set\n"; + } + + if (value.noSetReminderNotifyEmail.isSet()) { + out << " noSetReminderNotifyEmail = " + << value.noSetReminderNotifyEmail.ref() << "\n"; + } + else { + out << " noSetReminderNotifyEmail is not set\n"; + } + + if (value.noSetReminderNotifyInApp.isSet()) { + out << " noSetReminderNotifyInApp = " + << value.noSetReminderNotifyInApp.ref() << "\n"; + } + else { + out << " noSetReminderNotifyInApp is not set\n"; + } + + if (value.noSetRecipientSettingsStack.isSet()) { + out << " noSetRecipientSettingsStack = " + << value.noSetRecipientSettingsStack.ref() << "\n"; + } + else { + out << " noSetRecipientSettingsStack is not set\n"; + } + + if (value.noCanMoveNote.isSet()) { + out << " noCanMoveNote = " + << value.noCanMoveNote.ref() << "\n"; + } + else { + out << " noCanMoveNote is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotebookRestrictions & value) +{ + out << "NotebookRestrictions: {\n"; + + if (value.noReadNotes.isSet()) { + out << " noReadNotes = " + << value.noReadNotes.ref() << "\n"; + } + else { + out << " noReadNotes is not set\n"; + } + + if (value.noCreateNotes.isSet()) { + out << " noCreateNotes = " + << value.noCreateNotes.ref() << "\n"; + } + else { + out << " noCreateNotes is not set\n"; + } + + if (value.noUpdateNotes.isSet()) { + out << " noUpdateNotes = " + << value.noUpdateNotes.ref() << "\n"; + } + else { + out << " noUpdateNotes is not set\n"; + } + + if (value.noExpungeNotes.isSet()) { + out << " noExpungeNotes = " + << value.noExpungeNotes.ref() << "\n"; + } + else { + out << " noExpungeNotes is not set\n"; + } + + if (value.noShareNotes.isSet()) { + out << " noShareNotes = " + << value.noShareNotes.ref() << "\n"; + } + else { + out << " noShareNotes is not set\n"; + } + + if (value.noEmailNotes.isSet()) { + out << " noEmailNotes = " + << value.noEmailNotes.ref() << "\n"; + } + else { + out << " noEmailNotes is not set\n"; + } + + if (value.noSendMessageToRecipients.isSet()) { + out << " noSendMessageToRecipients = " + << value.noSendMessageToRecipients.ref() << "\n"; + } + else { + out << " noSendMessageToRecipients is not set\n"; + } + + if (value.noUpdateNotebook.isSet()) { + out << " noUpdateNotebook = " + << value.noUpdateNotebook.ref() << "\n"; + } + else { + out << " noUpdateNotebook is not set\n"; + } + + if (value.noExpungeNotebook.isSet()) { + out << " noExpungeNotebook = " + << value.noExpungeNotebook.ref() << "\n"; + } + else { + out << " noExpungeNotebook is not set\n"; + } + + if (value.noSetDefaultNotebook.isSet()) { + out << " noSetDefaultNotebook = " + << value.noSetDefaultNotebook.ref() << "\n"; + } + else { + out << " noSetDefaultNotebook is not set\n"; + } + + if (value.noSetNotebookStack.isSet()) { + out << " noSetNotebookStack = " + << value.noSetNotebookStack.ref() << "\n"; + } + else { + out << " noSetNotebookStack is not set\n"; + } + + if (value.noPublishToPublic.isSet()) { + out << " noPublishToPublic = " + << value.noPublishToPublic.ref() << "\n"; + } + else { + out << " noPublishToPublic is not set\n"; + } + + if (value.noPublishToBusinessLibrary.isSet()) { + out << " noPublishToBusinessLibrary = " + << value.noPublishToBusinessLibrary.ref() << "\n"; + } + else { + out << " noPublishToBusinessLibrary is not set\n"; + } + + if (value.noCreateTags.isSet()) { + out << " noCreateTags = " + << value.noCreateTags.ref() << "\n"; + } + else { + out << " noCreateTags is not set\n"; + } + + if (value.noUpdateTags.isSet()) { + out << " noUpdateTags = " + << value.noUpdateTags.ref() << "\n"; + } + else { + out << " noUpdateTags is not set\n"; + } + + if (value.noExpungeTags.isSet()) { + out << " noExpungeTags = " + << value.noExpungeTags.ref() << "\n"; + } + else { + out << " noExpungeTags is not set\n"; + } + + if (value.noSetParentTag.isSet()) { + out << " noSetParentTag = " + << value.noSetParentTag.ref() << "\n"; + } + else { + out << " noSetParentTag is not set\n"; + } + + if (value.noCreateSharedNotebooks.isSet()) { + out << " noCreateSharedNotebooks = " + << value.noCreateSharedNotebooks.ref() << "\n"; + } + else { + out << " noCreateSharedNotebooks is not set\n"; + } + + if (value.updateWhichSharedNotebookRestrictions.isSet()) { + out << " updateWhichSharedNotebookRestrictions = " + << value.updateWhichSharedNotebookRestrictions.ref() << "\n"; + } + else { + out << " updateWhichSharedNotebookRestrictions is not set\n"; + } + + if (value.expungeWhichSharedNotebookRestrictions.isSet()) { + out << " expungeWhichSharedNotebookRestrictions = " + << value.expungeWhichSharedNotebookRestrictions.ref() << "\n"; + } + else { + out << " expungeWhichSharedNotebookRestrictions is not set\n"; + } + + if (value.noShareNotesWithBusiness.isSet()) { + out << " noShareNotesWithBusiness = " + << value.noShareNotesWithBusiness.ref() << "\n"; + } + else { + out << " noShareNotesWithBusiness is not set\n"; + } + + if (value.noRenameNotebook.isSet()) { + out << " noRenameNotebook = " + << value.noRenameNotebook.ref() << "\n"; + } + else { + out << " noRenameNotebook is not set\n"; + } + + if (value.noSetInMyList.isSet()) { + out << " noSetInMyList = " + << value.noSetInMyList.ref() << "\n"; + } + else { + out << " noSetInMyList is not set\n"; + } + + if (value.noChangeContact.isSet()) { + out << " noChangeContact = " + << value.noChangeContact.ref() << "\n"; + } + else { + out << " noChangeContact is not set\n"; + } + + if (value.canMoveToContainerRestrictions.isSet()) { + out << " canMoveToContainerRestrictions = " + << value.canMoveToContainerRestrictions.ref() << "\n"; + } + else { + out << " canMoveToContainerRestrictions is not set\n"; + } + + if (value.noSetReminderNotifyEmail.isSet()) { + out << " noSetReminderNotifyEmail = " + << value.noSetReminderNotifyEmail.ref() << "\n"; + } + else { + out << " noSetReminderNotifyEmail is not set\n"; + } + + if (value.noSetReminderNotifyInApp.isSet()) { + out << " noSetReminderNotifyInApp = " + << value.noSetReminderNotifyInApp.ref() << "\n"; + } + else { + out << " noSetReminderNotifyInApp is not set\n"; + } + + if (value.noSetRecipientSettingsStack.isSet()) { + out << " noSetRecipientSettingsStack = " + << value.noSetRecipientSettingsStack.ref() << "\n"; + } + else { + out << " noSetRecipientSettingsStack is not set\n"; + } + + if (value.noCanMoveNote.isSet()) { + out << " noCanMoveNote = " + << value.noCanMoveNote.ref() << "\n"; + } + else { + out << " noCanMoveNote is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeStructBegin(QStringLiteral("Notebook")); if (s.guid.isSet()) { @@ -10788,6 +19854,282 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const Notebook & value) +{ + out << "Notebook: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.defaultNotebook.isSet()) { + out << " defaultNotebook = " + << value.defaultNotebook.ref() << "\n"; + } + else { + out << " defaultNotebook is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.publishing.isSet()) { + out << " publishing = " + << value.publishing.ref() << "\n"; + } + else { + out << " publishing is not set\n"; + } + + if (value.published.isSet()) { + out << " published = " + << value.published.ref() << "\n"; + } + else { + out << " published is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.sharedNotebookIds.isSet()) { + out << " sharedNotebookIds = " + << "QList {"; + for(const auto & v: value.sharedNotebookIds.ref()) { + out << v; + } + } + else { + out << " sharedNotebookIds is not set\n"; + } + + if (value.sharedNotebooks.isSet()) { + out << " sharedNotebooks = " + << "QList {"; + for(const auto & v: value.sharedNotebooks.ref()) { + out << v; + } + } + else { + out << " sharedNotebooks is not set\n"; + } + + if (value.businessNotebook.isSet()) { + out << " businessNotebook = " + << value.businessNotebook.ref() << "\n"; + } + else { + out << " businessNotebook is not set\n"; + } + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.recipientSettings.isSet()) { + out << " recipientSettings = " + << value.recipientSettings.ref() << "\n"; + } + else { + out << " recipientSettings is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const Notebook & value) +{ + out << "Notebook: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.defaultNotebook.isSet()) { + out << " defaultNotebook = " + << value.defaultNotebook.ref() << "\n"; + } + else { + out << " defaultNotebook is not set\n"; + } + + if (value.serviceCreated.isSet()) { + out << " serviceCreated = " + << value.serviceCreated.ref() << "\n"; + } + else { + out << " serviceCreated is not set\n"; + } + + if (value.serviceUpdated.isSet()) { + out << " serviceUpdated = " + << value.serviceUpdated.ref() << "\n"; + } + else { + out << " serviceUpdated is not set\n"; + } + + if (value.publishing.isSet()) { + out << " publishing = " + << value.publishing.ref() << "\n"; + } + else { + out << " publishing is not set\n"; + } + + if (value.published.isSet()) { + out << " published = " + << value.published.ref() << "\n"; + } + else { + out << " published is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.sharedNotebookIds.isSet()) { + out << " sharedNotebookIds = " + << "QList {"; + for(const auto & v: value.sharedNotebookIds.ref()) { + out << v; + } + } + else { + out << " sharedNotebookIds is not set\n"; + } + + if (value.sharedNotebooks.isSet()) { + out << " sharedNotebooks = " + << "QList {"; + for(const auto & v: value.sharedNotebooks.ref()) { + out << v; + } + } + else { + out << " sharedNotebooks is not set\n"; + } + + if (value.businessNotebook.isSet()) { + out << " businessNotebook = " + << value.businessNotebook.ref() << "\n"; + } + else { + out << " businessNotebook is not set\n"; + } + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.restrictions.isSet()) { + out << " restrictions = " + << value.restrictions.ref() << "\n"; + } + else { + out << " restrictions is not set\n"; + } + + if (value.recipientSettings.isSet()) { + out << " recipientSettings = " + << value.recipientSettings.ref() << "\n"; + } + else { + out << " recipientSettings is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s) { w.writeStructBegin(QStringLiteral("LinkedNotebook")); if (s.shareName.isSet()) { @@ -10995,9 +20337,209 @@ void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s) { } r.readFieldEnd(); } - r.readStructEnd(); + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const LinkedNotebook & value) +{ + out << "LinkedNotebook: {\n"; + + if (value.shareName.isSet()) { + out << " shareName = " + << value.shareName.ref() << "\n"; + } + else { + out << " shareName is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.shardId.isSet()) { + out << " shardId = " + << value.shardId.ref() << "\n"; + } + else { + out << " shardId is not set\n"; + } + + if (value.sharedNotebookGlobalId.isSet()) { + out << " sharedNotebookGlobalId = " + << value.sharedNotebookGlobalId.ref() << "\n"; + } + else { + out << " sharedNotebookGlobalId is not set\n"; + } + + if (value.uri.isSet()) { + out << " uri = " + << value.uri.ref() << "\n"; + } + else { + out << " uri is not set\n"; + } + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const LinkedNotebook & value) +{ + out << "LinkedNotebook: {\n"; + + if (value.shareName.isSet()) { + out << " shareName = " + << value.shareName.ref() << "\n"; + } + else { + out << " shareName is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.shardId.isSet()) { + out << " shardId = " + << value.shardId.ref() << "\n"; + } + else { + out << " shardId is not set\n"; + } + + if (value.sharedNotebookGlobalId.isSet()) { + out << " sharedNotebookGlobalId = " + << value.sharedNotebookGlobalId.ref() << "\n"; + } + else { + out << " sharedNotebookGlobalId is not set\n"; + } + + if (value.uri.isSet()) { + out << " uri = " + << value.uri.ref() << "\n"; + } + else { + out << " uri is not set\n"; + } + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.updateSequenceNum.isSet()) { + out << " updateSequenceNum = " + << value.updateSequenceNum.ref() << "\n"; + } + else { + out << " updateSequenceNum is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.stack.isSet()) { + out << " stack = " + << value.stack.ref() << "\n"; + } + else { + out << " stack is not set\n"; + } + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescriptor & s) { w.writeStructBegin(QStringLiteral("NotebookDescriptor")); if (s.guid.isSet()) { @@ -11106,6 +20648,110 @@ void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const NotebookDescriptor & value) +{ + out << "NotebookDescriptor: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.notebookDisplayName.isSet()) { + out << " notebookDisplayName = " + << value.notebookDisplayName.ref() << "\n"; + } + else { + out << " notebookDisplayName is not set\n"; + } + + if (value.contactName.isSet()) { + out << " contactName = " + << value.contactName.ref() << "\n"; + } + else { + out << " contactName is not set\n"; + } + + if (value.hasSharedNotebook.isSet()) { + out << " hasSharedNotebook = " + << value.hasSharedNotebook.ref() << "\n"; + } + else { + out << " hasSharedNotebook is not set\n"; + } + + if (value.joinedUserCount.isSet()) { + out << " joinedUserCount = " + << value.joinedUserCount.ref() << "\n"; + } + else { + out << " joinedUserCount is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const NotebookDescriptor & value) +{ + out << "NotebookDescriptor: {\n"; + + if (value.guid.isSet()) { + out << " guid = " + << value.guid.ref() << "\n"; + } + else { + out << " guid is not set\n"; + } + + if (value.notebookDisplayName.isSet()) { + out << " notebookDisplayName = " + << value.notebookDisplayName.ref() << "\n"; + } + else { + out << " notebookDisplayName is not set\n"; + } + + if (value.contactName.isSet()) { + out << " contactName = " + << value.contactName.ref() << "\n"; + } + else { + out << " contactName is not set\n"; + } + + if (value.hasSharedNotebook.isSet()) { + out << " hasSharedNotebook = " + << value.hasSharedNotebook.ref() << "\n"; + } + else { + out << " hasSharedNotebook is not set\n"; + } + + if (value.joinedUserCount.isSet()) { + out << " joinedUserCount = " + << value.joinedUserCount.ref() << "\n"; + } + else { + out << " joinedUserCount is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s) { w.writeStructBegin(QStringLiteral("UserProfile")); if (s.id.isSet()) { @@ -11299,6 +20945,190 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const UserProfile & value) +{ + out << "UserProfile: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.joined.isSet()) { + out << " joined = " + << value.joined.ref() << "\n"; + } + else { + out << " joined is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.status.isSet()) { + out << " status = " + << value.status.ref() << "\n"; + } + else { + out << " status is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const UserProfile & value) +{ + out << "UserProfile: {\n"; + + if (value.id.isSet()) { + out << " id = " + << value.id.ref() << "\n"; + } + else { + out << " id is not set\n"; + } + + if (value.name.isSet()) { + out << " name = " + << value.name.ref() << "\n"; + } + else { + out << " name is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.attributes.isSet()) { + out << " attributes = " + << value.attributes.ref() << "\n"; + } + else { + out << " attributes is not set\n"; + } + + if (value.joined.isSet()) { + out << " joined = " + << value.joined.ref() << "\n"; + } + else { + out << " joined is not set\n"; + } + + if (value.photoLastUpdated.isSet()) { + out << " photoLastUpdated = " + << value.photoLastUpdated.ref() << "\n"; + } + else { + out << " photoLastUpdated is not set\n"; + } + + if (value.photoUrl.isSet()) { + out << " photoUrl = " + << value.photoUrl.ref() << "\n"; + } + else { + out << " photoUrl is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.status.isSet()) { + out << " status = " + << value.status.ref() << "\n"; + } + else { + out << " status is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContentImage & s) { w.writeStructBegin(QStringLiteral("RelatedContentImage")); if (s.url.isSet()) { @@ -11407,6 +21237,110 @@ void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const RelatedContentImage & value) +{ + out << "RelatedContentImage: {\n"; + + if (value.url.isSet()) { + out << " url = " + << value.url.ref() << "\n"; + } + else { + out << " url is not set\n"; + } + + if (value.width.isSet()) { + out << " width = " + << value.width.ref() << "\n"; + } + else { + out << " width is not set\n"; + } + + if (value.height.isSet()) { + out << " height = " + << value.height.ref() << "\n"; + } + else { + out << " height is not set\n"; + } + + if (value.pixelRatio.isSet()) { + out << " pixelRatio = " + << value.pixelRatio.ref() << "\n"; + } + else { + out << " pixelRatio is not set\n"; + } + + if (value.fileSize.isSet()) { + out << " fileSize = " + << value.fileSize.ref() << "\n"; + } + else { + out << " fileSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const RelatedContentImage & value) +{ + out << "RelatedContentImage: {\n"; + + if (value.url.isSet()) { + out << " url = " + << value.url.ref() << "\n"; + } + else { + out << " url is not set\n"; + } + + if (value.width.isSet()) { + out << " width = " + << value.width.ref() << "\n"; + } + else { + out << " width is not set\n"; + } + + if (value.height.isSet()) { + out << " height = " + << value.height.ref() << "\n"; + } + else { + out << " height is not set\n"; + } + + if (value.pixelRatio.isSet()) { + out << " pixelRatio = " + << value.pixelRatio.ref() << "\n"; + } + else { + out << " pixelRatio is not set\n"; + } + + if (value.fileSize.isSet()) { + out << " fileSize = " + << value.fileSize.ref() << "\n"; + } + else { + out << " fileSize is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) { w.writeStructBegin(QStringLiteral("RelatedContent")); if (s.contentId.isSet()) { @@ -11725,11 +21659,303 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { { r.skip(fieldType); } - r.readFieldEnd(); + r.readFieldEnd(); + } + r.readStructEnd(); +} + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const RelatedContent & value) +{ + out << "RelatedContent: {\n"; + + if (value.contentId.isSet()) { + out << " contentId = " + << value.contentId.ref() << "\n"; + } + else { + out << " contentId is not set\n"; + } + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.url.isSet()) { + out << " url = " + << value.url.ref() << "\n"; + } + else { + out << " url is not set\n"; + } + + if (value.sourceId.isSet()) { + out << " sourceId = " + << value.sourceId.ref() << "\n"; + } + else { + out << " sourceId is not set\n"; + } + + if (value.sourceUrl.isSet()) { + out << " sourceUrl = " + << value.sourceUrl.ref() << "\n"; + } + else { + out << " sourceUrl is not set\n"; + } + + if (value.sourceFaviconUrl.isSet()) { + out << " sourceFaviconUrl = " + << value.sourceFaviconUrl.ref() << "\n"; + } + else { + out << " sourceFaviconUrl is not set\n"; + } + + if (value.sourceName.isSet()) { + out << " sourceName = " + << value.sourceName.ref() << "\n"; + } + else { + out << " sourceName is not set\n"; + } + + if (value.date.isSet()) { + out << " date = " + << value.date.ref() << "\n"; + } + else { + out << " date is not set\n"; + } + + if (value.teaser.isSet()) { + out << " teaser = " + << value.teaser.ref() << "\n"; + } + else { + out << " teaser is not set\n"; + } + + if (value.thumbnails.isSet()) { + out << " thumbnails = " + << "QList {"; + for(const auto & v: value.thumbnails.ref()) { + out << v; + } + } + else { + out << " thumbnails is not set\n"; + } + + if (value.contentType.isSet()) { + out << " contentType = " + << value.contentType.ref() << "\n"; + } + else { + out << " contentType is not set\n"; + } + + if (value.accessType.isSet()) { + out << " accessType = " + << value.accessType.ref() << "\n"; + } + else { + out << " accessType is not set\n"; + } + + if (value.visibleUrl.isSet()) { + out << " visibleUrl = " + << value.visibleUrl.ref() << "\n"; + } + else { + out << " visibleUrl is not set\n"; + } + + if (value.clipUrl.isSet()) { + out << " clipUrl = " + << value.clipUrl.ref() << "\n"; + } + else { + out << " clipUrl is not set\n"; + } + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.authors.isSet()) { + out << " authors = " + << "QList {"; + for(const auto & v: value.authors.ref()) { + out << v; + } } - r.readStructEnd(); + else { + out << " authors is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const RelatedContent & value) +{ + out << "RelatedContent: {\n"; + + if (value.contentId.isSet()) { + out << " contentId = " + << value.contentId.ref() << "\n"; + } + else { + out << " contentId is not set\n"; + } + + if (value.title.isSet()) { + out << " title = " + << value.title.ref() << "\n"; + } + else { + out << " title is not set\n"; + } + + if (value.url.isSet()) { + out << " url = " + << value.url.ref() << "\n"; + } + else { + out << " url is not set\n"; + } + + if (value.sourceId.isSet()) { + out << " sourceId = " + << value.sourceId.ref() << "\n"; + } + else { + out << " sourceId is not set\n"; + } + + if (value.sourceUrl.isSet()) { + out << " sourceUrl = " + << value.sourceUrl.ref() << "\n"; + } + else { + out << " sourceUrl is not set\n"; + } + + if (value.sourceFaviconUrl.isSet()) { + out << " sourceFaviconUrl = " + << value.sourceFaviconUrl.ref() << "\n"; + } + else { + out << " sourceFaviconUrl is not set\n"; + } + + if (value.sourceName.isSet()) { + out << " sourceName = " + << value.sourceName.ref() << "\n"; + } + else { + out << " sourceName is not set\n"; + } + + if (value.date.isSet()) { + out << " date = " + << value.date.ref() << "\n"; + } + else { + out << " date is not set\n"; + } + + if (value.teaser.isSet()) { + out << " teaser = " + << value.teaser.ref() << "\n"; + } + else { + out << " teaser is not set\n"; + } + + if (value.thumbnails.isSet()) { + out << " thumbnails = " + << "QList {"; + for(const auto & v: value.thumbnails.ref()) { + out << v; + } + } + else { + out << " thumbnails is not set\n"; + } + + if (value.contentType.isSet()) { + out << " contentType = " + << value.contentType.ref() << "\n"; + } + else { + out << " contentType is not set\n"; + } + + if (value.accessType.isSet()) { + out << " accessType = " + << value.accessType.ref() << "\n"; + } + else { + out << " accessType is not set\n"; + } + + if (value.visibleUrl.isSet()) { + out << " visibleUrl = " + << value.visibleUrl.ref() << "\n"; + } + else { + out << " visibleUrl is not set\n"; + } + + if (value.clipUrl.isSet()) { + out << " clipUrl = " + << value.clipUrl.ref() << "\n"; + } + else { + out << " clipUrl is not set\n"; + } + + if (value.contact.isSet()) { + out << " contact = " + << value.contact.ref() << "\n"; + } + else { + out << " contact is not set\n"; + } + + if (value.authors.isSet()) { + out << " authors = " + << "QList {"; + for(const auto & v: value.authors.ref()) { + out << v; + } + } + else { + out << " authors is not set\n"; + } + + out << "}\n"; + return out; } +//////////////////////////////////////////////////////////////////////////////// + void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitation & s) { w.writeStructBegin(QStringLiteral("BusinessInvitation")); if (s.businessId.isSet()) { @@ -11889,6 +22115,158 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BusinessInvitation & value) +{ + out << "BusinessInvitation: {\n"; + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.status.isSet()) { + out << " status = " + << value.status.ref() << "\n"; + } + else { + out << " status is not set\n"; + } + + if (value.requesterId.isSet()) { + out << " requesterId = " + << value.requesterId.ref() << "\n"; + } + else { + out << " requesterId is not set\n"; + } + + if (value.fromWorkChat.isSet()) { + out << " fromWorkChat = " + << value.fromWorkChat.ref() << "\n"; + } + else { + out << " fromWorkChat is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.mostRecentReminder.isSet()) { + out << " mostRecentReminder = " + << value.mostRecentReminder.ref() << "\n"; + } + else { + out << " mostRecentReminder is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BusinessInvitation & value) +{ + out << "BusinessInvitation: {\n"; + + if (value.businessId.isSet()) { + out << " businessId = " + << value.businessId.ref() << "\n"; + } + else { + out << " businessId is not set\n"; + } + + if (value.email.isSet()) { + out << " email = " + << value.email.ref() << "\n"; + } + else { + out << " email is not set\n"; + } + + if (value.role.isSet()) { + out << " role = " + << value.role.ref() << "\n"; + } + else { + out << " role is not set\n"; + } + + if (value.status.isSet()) { + out << " status = " + << value.status.ref() << "\n"; + } + else { + out << " status is not set\n"; + } + + if (value.requesterId.isSet()) { + out << " requesterId = " + << value.requesterId.ref() << "\n"; + } + else { + out << " requesterId is not set\n"; + } + + if (value.fromWorkChat.isSet()) { + out << " fromWorkChat = " + << value.fromWorkChat.ref() << "\n"; + } + else { + out << " fromWorkChat is not set\n"; + } + + if (value.created.isSet()) { + out << " created = " + << value.created.ref() << "\n"; + } + else { + out << " created is not set\n"; + } + + if (value.mostRecentReminder.isSet()) { + out << " mostRecentReminder = " + << value.mostRecentReminder.ref() << "\n"; + } + else { + out << " mostRecentReminder is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s) { w.writeStructBegin(QStringLiteral("UserIdentity")); if (s.type.isSet()) { @@ -11963,6 +22341,78 @@ void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const UserIdentity & value) +{ + out << "UserIdentity: {\n"; + + if (value.type.isSet()) { + out << " type = " + << value.type.ref() << "\n"; + } + else { + out << " type is not set\n"; + } + + if (value.stringIdentifier.isSet()) { + out << " stringIdentifier = " + << value.stringIdentifier.ref() << "\n"; + } + else { + out << " stringIdentifier is not set\n"; + } + + if (value.longIdentifier.isSet()) { + out << " longIdentifier = " + << value.longIdentifier.ref() << "\n"; + } + else { + out << " longIdentifier is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const UserIdentity & value) +{ + out << "UserIdentity: {\n"; + + if (value.type.isSet()) { + out << " type = " + << value.type.ref() << "\n"; + } + else { + out << " type is not set\n"; + } + + if (value.stringIdentifier.isSet()) { + out << " stringIdentifier = " + << value.stringIdentifier.ref() << "\n"; + } + else { + out << " stringIdentifier is not set\n"; + } + + if (value.longIdentifier.isSet()) { + out << " longIdentifier = " + << value.longIdentifier.ref() << "\n"; + } + else { + out << " longIdentifier is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s) { w.writeStructBegin(QStringLiteral("PublicUserInfo")); w.writeFieldBegin( @@ -12072,6 +22522,98 @@ void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { if(!userId_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("PublicUserInfo.userId has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const PublicUserInfo & value) +{ + out << "PublicUserInfo: {\n"; + out << " userId = " + << "UserID" << "\n"; + + if (value.serviceLevel.isSet()) { + out << " serviceLevel = " + << value.serviceLevel.ref() << "\n"; + } + else { + out << " serviceLevel is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const PublicUserInfo & value) +{ + out << "PublicUserInfo: {\n"; + out << " userId = " + << "UserID" << "\n"; + + if (value.serviceLevel.isSet()) { + out << " serviceLevel = " + << value.serviceLevel.ref() << "\n"; + } + else { + out << " serviceLevel is not set\n"; + } + + if (value.username.isSet()) { + out << " username = " + << value.username.ref() << "\n"; + } + else { + out << " username is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s) { w.writeStructBegin(QStringLiteral("UserUrls")); if (s.noteStoreUrl.isSet()) { @@ -12197,6 +22739,126 @@ void readUserUrls(ThriftBinaryBufferReader & r, UserUrls & s) { r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const UserUrls & value) +{ + out << "UserUrls: {\n"; + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.userStoreUrl.isSet()) { + out << " userStoreUrl = " + << value.userStoreUrl.ref() << "\n"; + } + else { + out << " userStoreUrl is not set\n"; + } + + if (value.utilityUrl.isSet()) { + out << " utilityUrl = " + << value.utilityUrl.ref() << "\n"; + } + else { + out << " utilityUrl is not set\n"; + } + + if (value.messageStoreUrl.isSet()) { + out << " messageStoreUrl = " + << value.messageStoreUrl.ref() << "\n"; + } + else { + out << " messageStoreUrl is not set\n"; + } + + if (value.userWebSocketUrl.isSet()) { + out << " userWebSocketUrl = " + << value.userWebSocketUrl.ref() << "\n"; + } + else { + out << " userWebSocketUrl is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const UserUrls & value) +{ + out << "UserUrls: {\n"; + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.userStoreUrl.isSet()) { + out << " userStoreUrl = " + << value.userStoreUrl.ref() << "\n"; + } + else { + out << " userStoreUrl is not set\n"; + } + + if (value.utilityUrl.isSet()) { + out << " utilityUrl = " + << value.utilityUrl.ref() << "\n"; + } + else { + out << " utilityUrl is not set\n"; + } + + if (value.messageStoreUrl.isSet()) { + out << " messageStoreUrl = " + << value.messageStoreUrl.ref() << "\n"; + } + else { + out << " messageStoreUrl is not set\n"; + } + + if (value.userWebSocketUrl.isSet()) { + out << " userWebSocketUrl = " + << value.userWebSocketUrl.ref() << "\n"; + } + else { + out << " userWebSocketUrl is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const AuthenticationResult & s) { w.writeStructBegin(QStringLiteral("AuthenticationResult")); w.writeFieldBegin( @@ -12393,6 +23055,154 @@ void readAuthenticationResult(ThriftBinaryBufferReader & r, AuthenticationResult if(!expiration_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.expiration has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const AuthenticationResult & value) +{ + out << "AuthenticationResult: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + out << " authenticationToken = " + << "QString" << "\n"; + out << " expiration = " + << "Timestamp" << "\n"; + + if (value.user.isSet()) { + out << " user = " + << value.user.ref() << "\n"; + } + else { + out << " user is not set\n"; + } + + if (value.publicUserInfo.isSet()) { + out << " publicUserInfo = " + << value.publicUserInfo.ref() << "\n"; + } + else { + out << " publicUserInfo is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.secondFactorRequired.isSet()) { + out << " secondFactorRequired = " + << value.secondFactorRequired.ref() << "\n"; + } + else { + out << " secondFactorRequired is not set\n"; + } + + if (value.secondFactorDeliveryHint.isSet()) { + out << " secondFactorDeliveryHint = " + << value.secondFactorDeliveryHint.ref() << "\n"; + } + else { + out << " secondFactorDeliveryHint is not set\n"; + } + + if (value.urls.isSet()) { + out << " urls = " + << value.urls.ref() << "\n"; + } + else { + out << " urls is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const AuthenticationResult & value) +{ + out << "AuthenticationResult: {\n"; + out << " currentTime = " + << "Timestamp" << "\n"; + out << " authenticationToken = " + << "QString" << "\n"; + out << " expiration = " + << "Timestamp" << "\n"; + + if (value.user.isSet()) { + out << " user = " + << value.user.ref() << "\n"; + } + else { + out << " user is not set\n"; + } + + if (value.publicUserInfo.isSet()) { + out << " publicUserInfo = " + << value.publicUserInfo.ref() << "\n"; + } + else { + out << " publicUserInfo is not set\n"; + } + + if (value.noteStoreUrl.isSet()) { + out << " noteStoreUrl = " + << value.noteStoreUrl.ref() << "\n"; + } + else { + out << " noteStoreUrl is not set\n"; + } + + if (value.webApiUrlPrefix.isSet()) { + out << " webApiUrlPrefix = " + << value.webApiUrlPrefix.ref() << "\n"; + } + else { + out << " webApiUrlPrefix is not set\n"; + } + + if (value.secondFactorRequired.isSet()) { + out << " secondFactorRequired = " + << value.secondFactorRequired.ref() << "\n"; + } + else { + out << " secondFactorRequired is not set\n"; + } + + if (value.secondFactorDeliveryHint.isSet()) { + out << " secondFactorDeliveryHint = " + << value.secondFactorDeliveryHint.ref() << "\n"; + } + else { + out << " secondFactorDeliveryHint is not set\n"; + } + + if (value.urls.isSet()) { + out << " urls = " + << value.urls.ref() << "\n"; + } + else { + out << " urls is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSettings & s) { w.writeStructBegin(QStringLiteral("BootstrapSettings")); w.writeFieldBegin( @@ -12658,6 +23468,206 @@ void readBootstrapSettings(ThriftBinaryBufferReader & r, BootstrapSettings & s) if(!accountEmailDomain_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.accountEmailDomain has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BootstrapSettings & value) +{ + out << "BootstrapSettings: {\n"; + out << " serviceHost = " + << "QString" << "\n"; + out << " marketingUrl = " + << "QString" << "\n"; + out << " supportUrl = " + << "QString" << "\n"; + out << " accountEmailDomain = " + << "QString" << "\n"; + + if (value.enableFacebookSharing.isSet()) { + out << " enableFacebookSharing = " + << value.enableFacebookSharing.ref() << "\n"; + } + else { + out << " enableFacebookSharing is not set\n"; + } + + if (value.enableGiftSubscriptions.isSet()) { + out << " enableGiftSubscriptions = " + << value.enableGiftSubscriptions.ref() << "\n"; + } + else { + out << " enableGiftSubscriptions is not set\n"; + } + + if (value.enableSupportTickets.isSet()) { + out << " enableSupportTickets = " + << value.enableSupportTickets.ref() << "\n"; + } + else { + out << " enableSupportTickets is not set\n"; + } + + if (value.enableSharedNotebooks.isSet()) { + out << " enableSharedNotebooks = " + << value.enableSharedNotebooks.ref() << "\n"; + } + else { + out << " enableSharedNotebooks is not set\n"; + } + + if (value.enableSingleNoteSharing.isSet()) { + out << " enableSingleNoteSharing = " + << value.enableSingleNoteSharing.ref() << "\n"; + } + else { + out << " enableSingleNoteSharing is not set\n"; + } + + if (value.enableSponsoredAccounts.isSet()) { + out << " enableSponsoredAccounts = " + << value.enableSponsoredAccounts.ref() << "\n"; + } + else { + out << " enableSponsoredAccounts is not set\n"; + } + + if (value.enableTwitterSharing.isSet()) { + out << " enableTwitterSharing = " + << value.enableTwitterSharing.ref() << "\n"; + } + else { + out << " enableTwitterSharing is not set\n"; + } + + if (value.enableLinkedInSharing.isSet()) { + out << " enableLinkedInSharing = " + << value.enableLinkedInSharing.ref() << "\n"; + } + else { + out << " enableLinkedInSharing is not set\n"; + } + + if (value.enablePublicNotebooks.isSet()) { + out << " enablePublicNotebooks = " + << value.enablePublicNotebooks.ref() << "\n"; + } + else { + out << " enablePublicNotebooks is not set\n"; + } + + if (value.enableGoogle.isSet()) { + out << " enableGoogle = " + << value.enableGoogle.ref() << "\n"; + } + else { + out << " enableGoogle is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BootstrapSettings & value) +{ + out << "BootstrapSettings: {\n"; + out << " serviceHost = " + << "QString" << "\n"; + out << " marketingUrl = " + << "QString" << "\n"; + out << " supportUrl = " + << "QString" << "\n"; + out << " accountEmailDomain = " + << "QString" << "\n"; + + if (value.enableFacebookSharing.isSet()) { + out << " enableFacebookSharing = " + << value.enableFacebookSharing.ref() << "\n"; + } + else { + out << " enableFacebookSharing is not set\n"; + } + + if (value.enableGiftSubscriptions.isSet()) { + out << " enableGiftSubscriptions = " + << value.enableGiftSubscriptions.ref() << "\n"; + } + else { + out << " enableGiftSubscriptions is not set\n"; + } + + if (value.enableSupportTickets.isSet()) { + out << " enableSupportTickets = " + << value.enableSupportTickets.ref() << "\n"; + } + else { + out << " enableSupportTickets is not set\n"; + } + + if (value.enableSharedNotebooks.isSet()) { + out << " enableSharedNotebooks = " + << value.enableSharedNotebooks.ref() << "\n"; + } + else { + out << " enableSharedNotebooks is not set\n"; + } + + if (value.enableSingleNoteSharing.isSet()) { + out << " enableSingleNoteSharing = " + << value.enableSingleNoteSharing.ref() << "\n"; + } + else { + out << " enableSingleNoteSharing is not set\n"; + } + + if (value.enableSponsoredAccounts.isSet()) { + out << " enableSponsoredAccounts = " + << value.enableSponsoredAccounts.ref() << "\n"; + } + else { + out << " enableSponsoredAccounts is not set\n"; + } + + if (value.enableTwitterSharing.isSet()) { + out << " enableTwitterSharing = " + << value.enableTwitterSharing.ref() << "\n"; + } + else { + out << " enableTwitterSharing is not set\n"; + } + + if (value.enableLinkedInSharing.isSet()) { + out << " enableLinkedInSharing = " + << value.enableLinkedInSharing.ref() << "\n"; + } + else { + out << " enableLinkedInSharing is not set\n"; + } + + if (value.enablePublicNotebooks.isSet()) { + out << " enablePublicNotebooks = " + << value.enablePublicNotebooks.ref() << "\n"; + } + else { + out << " enablePublicNotebooks is not set\n"; + } + + if (value.enableGoogle.isSet()) { + out << " enableGoogle = " + << value.enableGoogle.ref() << "\n"; + } + else { + out << " enableGoogle is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeBootstrapProfile(ThriftBinaryBufferWriter & w, const BootstrapProfile & s) { w.writeStructBegin(QStringLiteral("BootstrapProfile")); w.writeFieldBegin( @@ -12717,6 +23727,36 @@ void readBootstrapProfile(ThriftBinaryBufferReader & r, BootstrapProfile & s) { if(!settings_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.settings has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BootstrapProfile & value) +{ + out << "BootstrapProfile: {\n"; + out << " name = " + << "QString" << "\n"; + out << " settings = " + << "BootstrapSettings" << "\n"; + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BootstrapProfile & value) +{ + out << "BootstrapProfile: {\n"; + out << " name = " + << "QString" << "\n"; + out << " settings = " + << "BootstrapSettings" << "\n"; + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s) { w.writeStructBegin(QStringLiteral("BootstrapInfo")); w.writeFieldBegin( @@ -12772,6 +23812,32 @@ void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s) { if(!profiles_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapInfo.profiles has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const BootstrapInfo & value) +{ + out << "BootstrapInfo: {\n"; + out << " profiles = " + << "QList" << "\n"; + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const BootstrapInfo & value) +{ + out << "BootstrapInfo: {\n"; + out << " profiles = " + << "QList" << "\n"; + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + EDAMUserException::EDAMUserException() {} EDAMUserException::~EDAMUserException() throw() {} EDAMUserException::EDAMUserException(const EDAMUserException& other) : EvernoteException(other) @@ -12837,6 +23903,50 @@ void readEDAMUserException(ThriftBinaryBufferReader & r, EDAMUserException & s) if(!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMUserException.errorCode has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const EDAMUserException & value) +{ + out << "EDAMUserException: {\n"; + out << " errorCode = " + << "EDAMErrorCode" << "\n"; + + if (value.parameter.isSet()) { + out << " parameter = " + << value.parameter.ref() << "\n"; + } + else { + out << " parameter is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const EDAMUserException & value) +{ + out << "EDAMUserException: {\n"; + out << " errorCode = " + << "EDAMErrorCode" << "\n"; + + if (value.parameter.isSet()) { + out << " parameter = " + << value.parameter.ref() << "\n"; + } + else { + out << " parameter is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + EDAMSystemException::EDAMSystemException() {} EDAMSystemException::~EDAMSystemException() throw() {} EDAMSystemException::EDAMSystemException(const EDAMSystemException& other) : EvernoteException(other) @@ -12920,6 +24030,66 @@ void readEDAMSystemException(ThriftBinaryBufferReader & r, EDAMSystemException & if(!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMSystemException.errorCode has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const EDAMSystemException & value) +{ + out << "EDAMSystemException: {\n"; + out << " errorCode = " + << "EDAMErrorCode" << "\n"; + + if (value.message.isSet()) { + out << " message = " + << value.message.ref() << "\n"; + } + else { + out << " message is not set\n"; + } + + if (value.rateLimitDuration.isSet()) { + out << " rateLimitDuration = " + << value.rateLimitDuration.ref() << "\n"; + } + else { + out << " rateLimitDuration is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const EDAMSystemException & value) +{ + out << "EDAMSystemException: {\n"; + out << " errorCode = " + << "EDAMErrorCode" << "\n"; + + if (value.message.isSet()) { + out << " message = " + << value.message.ref() << "\n"; + } + else { + out << " message is not set\n"; + } + + if (value.rateLimitDuration.isSet()) { + out << " rateLimitDuration = " + << value.rateLimitDuration.ref() << "\n"; + } + else { + out << " rateLimitDuration is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + EDAMNotFoundException::EDAMNotFoundException() {} EDAMNotFoundException::~EDAMNotFoundException() throw() {} EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) : EvernoteException(other) @@ -12984,6 +24154,62 @@ void readEDAMNotFoundException(ThriftBinaryBufferReader & r, EDAMNotFoundExcepti r.readStructEnd(); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const EDAMNotFoundException & value) +{ + out << "EDAMNotFoundException: {\n"; + + if (value.identifier.isSet()) { + out << " identifier = " + << value.identifier.ref() << "\n"; + } + else { + out << " identifier is not set\n"; + } + + if (value.key.isSet()) { + out << " key = " + << value.key.ref() << "\n"; + } + else { + out << " key is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const EDAMNotFoundException & value) +{ + out << "EDAMNotFoundException: {\n"; + + if (value.identifier.isSet()) { + out << " identifier = " + << value.identifier.ref() << "\n"; + } + else { + out << " identifier is not set\n"; + } + + if (value.key.isSet()) { + out << " key = " + << value.key.ref() << "\n"; + } + else { + out << " key is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + EDAMInvalidContactsException::EDAMInvalidContactsException() {} EDAMInvalidContactsException::~EDAMInvalidContactsException() throw() {} EDAMInvalidContactsException::EDAMInvalidContactsException(const EDAMInvalidContactsException& other) : EvernoteException(other) @@ -13095,6 +24321,72 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC if(!contacts_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMInvalidContactsException.contacts has no value")); } +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<( + QTextStream & out, const EDAMInvalidContactsException & value) +{ + out << "EDAMInvalidContactsException: {\n"; + out << " contacts = " + << "QList" << "\n"; + + if (value.parameter.isSet()) { + out << " parameter = " + << value.parameter.ref() << "\n"; + } + else { + out << " parameter is not set\n"; + } + + if (value.reasons.isSet()) { + out << " reasons = " + << "QList {"; + for(const auto & v: value.reasons.ref()) { + out << v; + } + } + else { + out << " reasons is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + +QDebug & operator<<( + QDebug & out, const EDAMInvalidContactsException & value) +{ + out << "EDAMInvalidContactsException: {\n"; + out << " contacts = " + << "QList" << "\n"; + + if (value.parameter.isSet()) { + out << " parameter = " + << value.parameter.ref() << "\n"; + } + else { + out << " parameter is not set\n"; + } + + if (value.reasons.isSet()) { + out << " reasons = " + << "QList {"; + for(const auto & v: value.reasons.ref()) { + out << v; + } + } + else { + out << " reasons is not set\n"; + } + + out << "}\n"; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// + /** @endcond */ From 1f663212a90d17a13b2790e61db51baf991164d2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 22 Oct 2019 07:19:37 +0300 Subject: [PATCH 044/188] Add missing QEVERCLOUD_EXPORT statement --- QEverCloud/headers/RequestContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 15e1be59..e52a3dae 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -65,7 +65,7 @@ using IRequestContextPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// -IRequestContextPtr newRequestContext( +QEVERCLOUD_EXPORT IRequestContextPtr newRequestContext( QString authenticationToken = {}, quint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, From 82c09bd9fccc7593db42c8ae69aa7c9de69b33b3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 22 Oct 2019 07:31:18 +0300 Subject: [PATCH 045/188] Update generated code --- QEverCloud/src/generated/Services.cpp | 809 ++++++++++++++++++-------- 1 file changed, 551 insertions(+), 258 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 17f9a504..ecea168c 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15,6 +15,7 @@ #include "Types_io.h" #include #include +#include #include #include @@ -15460,9 +15461,11 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( QString requestDescription; QTextStream strm(&requestDescription); - strm << "afterUSN = " << afterUSN << "\n"; - strm << "maxEntries = " << maxEntries << "\n"; - strm << "filter = " << filter << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "filter = " << filter << "\n"; + } IDurableService::SyncRequest request( "getFilteredSyncChunk", @@ -15497,9 +15500,11 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "afterUSN = " << afterUSN << "\n"; - strm << "maxEntries = " << maxEntries << "\n"; - strm << "filter = " << filter << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "filter = " << filter << "\n"; + } IDurableService::AsyncRequest request( "getFilteredSyncChunk", @@ -15530,7 +15535,9 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::SyncRequest request( "getLinkedNotebookSyncState", @@ -15561,7 +15568,9 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::AsyncRequest request( "getLinkedNotebookSyncState", @@ -15598,10 +15607,12 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; - strm << "afterUSN = " << afterUSN << "\n"; - strm << "maxEntries = " << maxEntries << "\n"; - strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + } IDurableService::SyncRequest request( "getLinkedNotebookSyncChunk", @@ -15638,10 +15649,12 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; - strm << "afterUSN = " << afterUSN << "\n"; - strm << "maxEntries = " << maxEntries << "\n"; - strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + strm << "afterUSN = " << afterUSN << "\n"; + strm << "maxEntries = " << maxEntries << "\n"; + strm << "fullSyncOnly = " << fullSyncOnly << "\n"; + } IDurableService::AsyncRequest request( "getLinkedNotebookSyncChunk", @@ -15772,7 +15785,9 @@ Notebook DurableNoteStore::getNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getNotebook", @@ -15803,7 +15818,9 @@ AsyncResult * DurableNoteStore::getNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getNotebook", @@ -15884,7 +15901,9 @@ Notebook DurableNoteStore::createNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebook = " << notebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebook = " << notebook << "\n"; + } IDurableService::SyncRequest request( "createNotebook", @@ -15915,7 +15934,9 @@ AsyncResult * DurableNoteStore::createNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebook = " << notebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebook = " << notebook << "\n"; + } IDurableService::AsyncRequest request( "createNotebook", @@ -15946,7 +15967,9 @@ qint32 DurableNoteStore::updateNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebook = " << notebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebook = " << notebook << "\n"; + } IDurableService::SyncRequest request( "updateNotebook", @@ -15977,7 +16000,9 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebook = " << notebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebook = " << notebook << "\n"; + } IDurableService::AsyncRequest request( "updateNotebook", @@ -16008,7 +16033,9 @@ qint32 DurableNoteStore::expungeNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "expungeNotebook", @@ -16039,7 +16066,9 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "expungeNotebook", @@ -16120,7 +16149,9 @@ QList DurableNoteStore::listTagsByNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + } IDurableService::SyncRequest request( "listTagsByNotebook", @@ -16151,7 +16182,9 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + } IDurableService::AsyncRequest request( "listTagsByNotebook", @@ -16182,7 +16215,9 @@ Tag DurableNoteStore::getTag( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getTag", @@ -16213,7 +16248,9 @@ AsyncResult * DurableNoteStore::getTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getTag", @@ -16244,7 +16281,9 @@ Tag DurableNoteStore::createTag( QString requestDescription; QTextStream strm(&requestDescription); - strm << "tag = " << tag << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "tag = " << tag << "\n"; + } IDurableService::SyncRequest request( "createTag", @@ -16275,7 +16314,9 @@ AsyncResult * DurableNoteStore::createTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "tag = " << tag << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "tag = " << tag << "\n"; + } IDurableService::AsyncRequest request( "createTag", @@ -16306,7 +16347,9 @@ qint32 DurableNoteStore::updateTag( QString requestDescription; QTextStream strm(&requestDescription); - strm << "tag = " << tag << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "tag = " << tag << "\n"; + } IDurableService::SyncRequest request( "updateTag", @@ -16337,7 +16380,9 @@ AsyncResult * DurableNoteStore::updateTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "tag = " << tag << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "tag = " << tag << "\n"; + } IDurableService::AsyncRequest request( "updateTag", @@ -16368,7 +16413,9 @@ void DurableNoteStore::untagAll( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "untagAll", @@ -16399,7 +16446,9 @@ AsyncResult * DurableNoteStore::untagAllAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "untagAll", @@ -16430,7 +16479,9 @@ qint32 DurableNoteStore::expungeTag( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "expungeTag", @@ -16461,7 +16512,9 @@ AsyncResult * DurableNoteStore::expungeTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "expungeTag", @@ -16542,7 +16595,9 @@ SavedSearch DurableNoteStore::getSearch( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getSearch", @@ -16573,7 +16628,9 @@ AsyncResult * DurableNoteStore::getSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getSearch", @@ -16604,7 +16661,9 @@ SavedSearch DurableNoteStore::createSearch( QString requestDescription; QTextStream strm(&requestDescription); - strm << "search = " << search << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "search = " << search << "\n"; + } IDurableService::SyncRequest request( "createSearch", @@ -16635,7 +16694,9 @@ AsyncResult * DurableNoteStore::createSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "search = " << search << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "search = " << search << "\n"; + } IDurableService::AsyncRequest request( "createSearch", @@ -16666,7 +16727,9 @@ qint32 DurableNoteStore::updateSearch( QString requestDescription; QTextStream strm(&requestDescription); - strm << "search = " << search << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "search = " << search << "\n"; + } IDurableService::SyncRequest request( "updateSearch", @@ -16697,7 +16760,9 @@ AsyncResult * DurableNoteStore::updateSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "search = " << search << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "search = " << search << "\n"; + } IDurableService::AsyncRequest request( "updateSearch", @@ -16728,7 +16793,9 @@ qint32 DurableNoteStore::expungeSearch( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "expungeSearch", @@ -16759,7 +16826,9 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "expungeSearch", @@ -16792,8 +16861,10 @@ qint32 DurableNoteStore::findNoteOffset( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "findNoteOffset", @@ -16826,8 +16897,10 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "findNoteOffset", @@ -16864,10 +16937,12 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "offset = " << offset << "\n"; - strm << "maxNotes = " << maxNotes << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "offset = " << offset << "\n"; + strm << "maxNotes = " << maxNotes << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::SyncRequest request( "findNotesMetadata", @@ -16904,10 +16979,12 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "offset = " << offset << "\n"; - strm << "maxNotes = " << maxNotes << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "offset = " << offset << "\n"; + strm << "maxNotes = " << maxNotes << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::AsyncRequest request( "findNotesMetadata", @@ -16940,8 +17017,10 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "withTrash = " << withTrash << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "withTrash = " << withTrash << "\n"; + } IDurableService::SyncRequest request( "findNoteCounts", @@ -16974,8 +17053,10 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "filter = " << filter << "\n"; - strm << "withTrash = " << withTrash << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "filter = " << filter << "\n"; + strm << "withTrash = " << withTrash << "\n"; + } IDurableService::AsyncRequest request( "findNoteCounts", @@ -17008,8 +17089,10 @@ Note DurableNoteStore::getNoteWithResultSpec( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::SyncRequest request( "getNoteWithResultSpec", @@ -17042,8 +17125,10 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::AsyncRequest request( "getNoteWithResultSpec", @@ -17082,11 +17167,13 @@ Note DurableNoteStore::getNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "withContent = " << withContent << "\n"; - strm << "withResourcesData = " << withResourcesData << "\n"; - strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; - strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "withContent = " << withContent << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + } IDurableService::SyncRequest request( "getNote", @@ -17125,11 +17212,13 @@ AsyncResult * DurableNoteStore::getNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "withContent = " << withContent << "\n"; - strm << "withResourcesData = " << withResourcesData << "\n"; - strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; - strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "withContent = " << withContent << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + } IDurableService::AsyncRequest request( "getNote", @@ -17160,7 +17249,9 @@ LazyMap DurableNoteStore::getNoteApplicationData( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getNoteApplicationData", @@ -17191,7 +17282,9 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getNoteApplicationData", @@ -17224,8 +17317,10 @@ QString DurableNoteStore::getNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::SyncRequest request( "getNoteApplicationDataEntry", @@ -17258,8 +17353,10 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::AsyncRequest request( "getNoteApplicationDataEntry", @@ -17294,9 +17391,11 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; - strm << "value = " << value << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + } IDurableService::SyncRequest request( "setNoteApplicationDataEntry", @@ -17331,9 +17430,11 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; - strm << "value = " << value << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + } IDurableService::AsyncRequest request( "setNoteApplicationDataEntry", @@ -17366,8 +17467,10 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::SyncRequest request( "unsetNoteApplicationDataEntry", @@ -17400,8 +17503,10 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::AsyncRequest request( "unsetNoteApplicationDataEntry", @@ -17432,7 +17537,9 @@ QString DurableNoteStore::getNoteContent( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getNoteContent", @@ -17463,7 +17570,9 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getNoteContent", @@ -17498,9 +17607,11 @@ QString DurableNoteStore::getNoteSearchText( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "noteOnly = " << noteOnly << "\n"; - strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "noteOnly = " << noteOnly << "\n"; + strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + } IDurableService::SyncRequest request( "getNoteSearchText", @@ -17535,9 +17646,11 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "noteOnly = " << noteOnly << "\n"; - strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "noteOnly = " << noteOnly << "\n"; + strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; + } IDurableService::AsyncRequest request( "getNoteSearchText", @@ -17568,7 +17681,9 @@ QString DurableNoteStore::getResourceSearchText( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceSearchText", @@ -17599,7 +17714,9 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceSearchText", @@ -17630,7 +17747,9 @@ QStringList DurableNoteStore::getNoteTagNames( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getNoteTagNames", @@ -17661,7 +17780,9 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getNoteTagNames", @@ -17692,7 +17813,9 @@ Note DurableNoteStore::createNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::SyncRequest request( "createNote", @@ -17723,7 +17846,9 @@ AsyncResult * DurableNoteStore::createNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::AsyncRequest request( "createNote", @@ -17754,7 +17879,9 @@ Note DurableNoteStore::updateNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::SyncRequest request( "updateNote", @@ -17785,7 +17912,9 @@ AsyncResult * DurableNoteStore::updateNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::AsyncRequest request( "updateNote", @@ -17816,7 +17945,9 @@ qint32 DurableNoteStore::deleteNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "deleteNote", @@ -17847,7 +17978,9 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "deleteNote", @@ -17878,7 +18011,9 @@ qint32 DurableNoteStore::expungeNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "expungeNote", @@ -17909,7 +18044,9 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "expungeNote", @@ -17942,8 +18079,10 @@ Note DurableNoteStore::copyNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + } IDurableService::SyncRequest request( "copyNote", @@ -17976,8 +18115,10 @@ AsyncResult * DurableNoteStore::copyNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "toNotebookGuid = " << toNotebookGuid << "\n"; + } IDurableService::AsyncRequest request( "copyNote", @@ -18008,7 +18149,9 @@ QList DurableNoteStore::listNoteVersions( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + } IDurableService::SyncRequest request( "listNoteVersions", @@ -18039,7 +18182,9 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + } IDurableService::AsyncRequest request( "listNoteVersions", @@ -18078,11 +18223,13 @@ Note DurableNoteStore::getNoteVersion( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "updateSequenceNum = " << updateSequenceNum << "\n"; - strm << "withResourcesData = " << withResourcesData << "\n"; - strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; - strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "updateSequenceNum = " << updateSequenceNum << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + } IDurableService::SyncRequest request( "getNoteVersion", @@ -18121,11 +18268,13 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "updateSequenceNum = " << updateSequenceNum << "\n"; - strm << "withResourcesData = " << withResourcesData << "\n"; - strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; - strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "updateSequenceNum = " << updateSequenceNum << "\n"; + strm << "withResourcesData = " << withResourcesData << "\n"; + strm << "withResourcesRecognition = " << withResourcesRecognition << "\n"; + strm << "withResourcesAlternateData = " << withResourcesAlternateData << "\n"; + } IDurableService::AsyncRequest request( "getNoteVersion", @@ -18164,11 +18313,13 @@ Resource DurableNoteStore::getResource( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "withData = " << withData << "\n"; - strm << "withRecognition = " << withRecognition << "\n"; - strm << "withAttributes = " << withAttributes << "\n"; - strm << "withAlternateData = " << withAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAttributes = " << withAttributes << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + } IDurableService::SyncRequest request( "getResource", @@ -18207,11 +18358,13 @@ AsyncResult * DurableNoteStore::getResourceAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "withData = " << withData << "\n"; - strm << "withRecognition = " << withRecognition << "\n"; - strm << "withAttributes = " << withAttributes << "\n"; - strm << "withAlternateData = " << withAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAttributes = " << withAttributes << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + } IDurableService::AsyncRequest request( "getResource", @@ -18242,7 +18395,9 @@ LazyMap DurableNoteStore::getResourceApplicationData( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceApplicationData", @@ -18273,7 +18428,9 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceApplicationData", @@ -18306,8 +18463,10 @@ QString DurableNoteStore::getResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::SyncRequest request( "getResourceApplicationDataEntry", @@ -18340,8 +18499,10 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::AsyncRequest request( "getResourceApplicationDataEntry", @@ -18376,9 +18537,11 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; - strm << "value = " << value << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + } IDurableService::SyncRequest request( "setResourceApplicationDataEntry", @@ -18413,9 +18576,11 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; - strm << "value = " << value << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + strm << "value = " << value << "\n"; + } IDurableService::AsyncRequest request( "setResourceApplicationDataEntry", @@ -18448,8 +18613,10 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::SyncRequest request( "unsetResourceApplicationDataEntry", @@ -18482,8 +18649,10 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "key = " << key << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "key = " << key << "\n"; + } IDurableService::AsyncRequest request( "unsetResourceApplicationDataEntry", @@ -18514,7 +18683,9 @@ qint32 DurableNoteStore::updateResource( QString requestDescription; QTextStream strm(&requestDescription); - strm << "resource = " << resource << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "resource = " << resource << "\n"; + } IDurableService::SyncRequest request( "updateResource", @@ -18545,7 +18716,9 @@ AsyncResult * DurableNoteStore::updateResourceAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "resource = " << resource << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "resource = " << resource << "\n"; + } IDurableService::AsyncRequest request( "updateResource", @@ -18576,7 +18749,9 @@ QByteArray DurableNoteStore::getResourceData( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceData", @@ -18607,7 +18782,9 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceData", @@ -18646,11 +18823,13 @@ Resource DurableNoteStore::getResourceByHash( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "contentHash = " << contentHash << "\n"; - strm << "withData = " << withData << "\n"; - strm << "withRecognition = " << withRecognition << "\n"; - strm << "withAlternateData = " << withAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "contentHash = " << contentHash << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + } IDurableService::SyncRequest request( "getResourceByHash", @@ -18689,11 +18868,13 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "noteGuid = " << noteGuid << "\n"; - strm << "contentHash = " << contentHash << "\n"; - strm << "withData = " << withData << "\n"; - strm << "withRecognition = " << withRecognition << "\n"; - strm << "withAlternateData = " << withAlternateData << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "noteGuid = " << noteGuid << "\n"; + strm << "contentHash = " << contentHash << "\n"; + strm << "withData = " << withData << "\n"; + strm << "withRecognition = " << withRecognition << "\n"; + strm << "withAlternateData = " << withAlternateData << "\n"; + } IDurableService::AsyncRequest request( "getResourceByHash", @@ -18724,7 +18905,9 @@ QByteArray DurableNoteStore::getResourceRecognition( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceRecognition", @@ -18755,7 +18938,9 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceRecognition", @@ -18786,7 +18971,9 @@ QByteArray DurableNoteStore::getResourceAlternateData( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceAlternateData", @@ -18817,7 +19004,9 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceAlternateData", @@ -18848,7 +19037,9 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "getResourceAttributes", @@ -18879,7 +19070,9 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "getResourceAttributes", @@ -18912,8 +19105,10 @@ Notebook DurableNoteStore::getPublicNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "userId = " << userId << "\n"; - strm << "publicUri = " << publicUri << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "userId = " << userId << "\n"; + strm << "publicUri = " << publicUri << "\n"; + } IDurableService::SyncRequest request( "getPublicNotebook", @@ -18946,8 +19141,10 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "userId = " << userId << "\n"; - strm << "publicUri = " << publicUri << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "userId = " << userId << "\n"; + strm << "publicUri = " << publicUri << "\n"; + } IDurableService::AsyncRequest request( "getPublicNotebook", @@ -18980,8 +19177,10 @@ SharedNotebook DurableNoteStore::shareNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "sharedNotebook = " << sharedNotebook << "\n"; - strm << "message = " << message << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "sharedNotebook = " << sharedNotebook << "\n"; + strm << "message = " << message << "\n"; + } IDurableService::SyncRequest request( "shareNotebook", @@ -19014,8 +19213,10 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "sharedNotebook = " << sharedNotebook << "\n"; - strm << "message = " << message << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "sharedNotebook = " << sharedNotebook << "\n"; + strm << "message = " << message << "\n"; + } IDurableService::AsyncRequest request( "shareNotebook", @@ -19046,7 +19247,9 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare QString requestDescription; QTextStream strm(&requestDescription); - strm << "shareTemplate = " << shareTemplate << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "shareTemplate = " << shareTemplate << "\n"; + } IDurableService::SyncRequest request( "createOrUpdateNotebookShares", @@ -19077,7 +19280,9 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "shareTemplate = " << shareTemplate << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "shareTemplate = " << shareTemplate << "\n"; + } IDurableService::AsyncRequest request( "createOrUpdateNotebookShares", @@ -19108,7 +19313,9 @@ qint32 DurableNoteStore::updateSharedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "sharedNotebook = " << sharedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "sharedNotebook = " << sharedNotebook << "\n"; + } IDurableService::SyncRequest request( "updateSharedNotebook", @@ -19139,7 +19346,9 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "sharedNotebook = " << sharedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "sharedNotebook = " << sharedNotebook << "\n"; + } IDurableService::AsyncRequest request( "updateSharedNotebook", @@ -19172,8 +19381,10 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; - strm << "recipientSettings = " << recipientSettings << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + strm << "recipientSettings = " << recipientSettings << "\n"; + } IDurableService::SyncRequest request( "setNotebookRecipientSettings", @@ -19206,8 +19417,10 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; - strm << "recipientSettings = " << recipientSettings << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + strm << "recipientSettings = " << recipientSettings << "\n"; + } IDurableService::AsyncRequest request( "setNotebookRecipientSettings", @@ -19288,7 +19501,9 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::SyncRequest request( "createLinkedNotebook", @@ -19319,7 +19534,9 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::AsyncRequest request( "createLinkedNotebook", @@ -19350,7 +19567,9 @@ qint32 DurableNoteStore::updateLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::SyncRequest request( "updateLinkedNotebook", @@ -19381,7 +19600,9 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "linkedNotebook = " << linkedNotebook << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "linkedNotebook = " << linkedNotebook << "\n"; + } IDurableService::AsyncRequest request( "updateLinkedNotebook", @@ -19462,7 +19683,9 @@ qint32 DurableNoteStore::expungeLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "expungeLinkedNotebook", @@ -19493,7 +19716,9 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "expungeLinkedNotebook", @@ -19524,7 +19749,9 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + } IDurableService::SyncRequest request( "authenticateToSharedNotebook", @@ -19555,7 +19782,9 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; + } IDurableService::AsyncRequest request( "authenticateToSharedNotebook", @@ -19636,7 +19865,9 @@ void DurableNoteStore::emailNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "parameters = " << parameters << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "parameters = " << parameters << "\n"; + } IDurableService::SyncRequest request( "emailNote", @@ -19667,7 +19898,9 @@ AsyncResult * DurableNoteStore::emailNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "parameters = " << parameters << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "parameters = " << parameters << "\n"; + } IDurableService::AsyncRequest request( "emailNote", @@ -19698,7 +19931,9 @@ QString DurableNoteStore::shareNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "shareNote", @@ -19729,7 +19964,9 @@ AsyncResult * DurableNoteStore::shareNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "shareNote", @@ -19760,7 +19997,9 @@ void DurableNoteStore::stopSharingNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::SyncRequest request( "stopSharingNote", @@ -19791,7 +20030,9 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + } IDurableService::AsyncRequest request( "stopSharingNote", @@ -19824,8 +20065,10 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "noteKey = " << noteKey << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "noteKey = " << noteKey << "\n"; + } IDurableService::SyncRequest request( "authenticateToSharedNote", @@ -19858,8 +20101,10 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "guid = " << guid << "\n"; - strm << "noteKey = " << noteKey << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "guid = " << guid << "\n"; + strm << "noteKey = " << noteKey << "\n"; + } IDurableService::AsyncRequest request( "authenticateToSharedNote", @@ -19892,8 +20137,10 @@ RelatedResult DurableNoteStore::findRelated( QString requestDescription; QTextStream strm(&requestDescription); - strm << "query = " << query << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "query = " << query << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::SyncRequest request( "findRelated", @@ -19926,8 +20173,10 @@ AsyncResult * DurableNoteStore::findRelatedAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "query = " << query << "\n"; - strm << "resultSpec = " << resultSpec << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "query = " << query << "\n"; + strm << "resultSpec = " << resultSpec << "\n"; + } IDurableService::AsyncRequest request( "findRelated", @@ -19958,7 +20207,9 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::SyncRequest request( "updateNoteIfUsnMatches", @@ -19989,7 +20240,9 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "note = " << note << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "note = " << note << "\n"; + } IDurableService::AsyncRequest request( "updateNoteIfUsnMatches", @@ -20020,7 +20273,9 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( QString requestDescription; QTextStream strm(&requestDescription); - strm << "parameters = " << parameters << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "parameters = " << parameters << "\n"; + } IDurableService::SyncRequest request( "manageNotebookShares", @@ -20051,7 +20306,9 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "parameters = " << parameters << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "parameters = " << parameters << "\n"; + } IDurableService::AsyncRequest request( "manageNotebookShares", @@ -20082,7 +20339,9 @@ ShareRelationships DurableNoteStore::getNotebookShares( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + } IDurableService::SyncRequest request( "getNotebookShares", @@ -20113,7 +20372,9 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "notebookGuid = " << notebookGuid << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "notebookGuid = " << notebookGuid << "\n"; + } IDurableService::AsyncRequest request( "getNotebookShares", @@ -20150,9 +20411,11 @@ bool DurableUserStore::checkVersion( QString requestDescription; QTextStream strm(&requestDescription); - strm << "clientName = " << clientName << "\n"; - strm << "edamVersionMajor = " << edamVersionMajor << "\n"; - strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "clientName = " << clientName << "\n"; + strm << "edamVersionMajor = " << edamVersionMajor << "\n"; + strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + } IDurableService::SyncRequest request( "checkVersion", @@ -20187,9 +20450,11 @@ AsyncResult * DurableUserStore::checkVersionAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "clientName = " << clientName << "\n"; - strm << "edamVersionMajor = " << edamVersionMajor << "\n"; - strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "clientName = " << clientName << "\n"; + strm << "edamVersionMajor = " << edamVersionMajor << "\n"; + strm << "edamVersionMinor = " << edamVersionMinor << "\n"; + } IDurableService::AsyncRequest request( "checkVersion", @@ -20220,7 +20485,9 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( QString requestDescription; QTextStream strm(&requestDescription); - strm << "locale = " << locale << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "locale = " << locale << "\n"; + } IDurableService::SyncRequest request( "getBootstrapInfo", @@ -20251,7 +20518,9 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "locale = " << locale << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "locale = " << locale << "\n"; + } IDurableService::AsyncRequest request( "getBootstrapInfo", @@ -20294,13 +20563,12 @@ AuthenticationResult DurableUserStore::authenticateLongSession( QString requestDescription; QTextStream strm(&requestDescription); - strm << "username = " << username << "\n"; - strm << "password = " << password << "\n"; - strm << "consumerKey = " << consumerKey << "\n"; - strm << "consumerSecret = " << consumerSecret << "\n"; - strm << "deviceIdentifier = " << deviceIdentifier << "\n"; - strm << "deviceDescription = " << deviceDescription << "\n"; - strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "username = " << username << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + } IDurableService::SyncRequest request( "authenticateLongSession", @@ -20343,13 +20611,12 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "username = " << username << "\n"; - strm << "password = " << password << "\n"; - strm << "consumerKey = " << consumerKey << "\n"; - strm << "consumerSecret = " << consumerSecret << "\n"; - strm << "deviceIdentifier = " << deviceIdentifier << "\n"; - strm << "deviceDescription = " << deviceDescription << "\n"; - strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "username = " << username << "\n"; + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + strm << "supportsTwoFactor = " << supportsTwoFactor << "\n"; + } IDurableService::AsyncRequest request( "authenticateLongSession", @@ -20384,9 +20651,10 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( QString requestDescription; QTextStream strm(&requestDescription); - strm << "oneTimeCode = " << oneTimeCode << "\n"; - strm << "deviceIdentifier = " << deviceIdentifier << "\n"; - strm << "deviceDescription = " << deviceDescription << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + } IDurableService::SyncRequest request( "completeTwoFactorAuthentication", @@ -20421,9 +20689,10 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "oneTimeCode = " << oneTimeCode << "\n"; - strm << "deviceIdentifier = " << deviceIdentifier << "\n"; - strm << "deviceDescription = " << deviceDescription << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "deviceIdentifier = " << deviceIdentifier << "\n"; + strm << "deviceDescription = " << deviceDescription << "\n"; + } IDurableService::AsyncRequest request( "completeTwoFactorAuthentication", @@ -20604,7 +20873,9 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( QString requestDescription; QTextStream strm(&requestDescription); - strm << "username = " << username << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "username = " << username << "\n"; + } IDurableService::SyncRequest request( "getPublicUserInfo", @@ -20635,7 +20906,9 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "username = " << username << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "username = " << username << "\n"; + } IDurableService::AsyncRequest request( "getPublicUserInfo", @@ -20716,7 +20989,9 @@ void DurableUserStore::inviteToBusiness( QString requestDescription; QTextStream strm(&requestDescription); - strm << "emailAddress = " << emailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "emailAddress = " << emailAddress << "\n"; + } IDurableService::SyncRequest request( "inviteToBusiness", @@ -20747,7 +21022,9 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "emailAddress = " << emailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "emailAddress = " << emailAddress << "\n"; + } IDurableService::AsyncRequest request( "inviteToBusiness", @@ -20778,7 +21055,9 @@ void DurableUserStore::removeFromBusiness( QString requestDescription; QTextStream strm(&requestDescription); - strm << "emailAddress = " << emailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "emailAddress = " << emailAddress << "\n"; + } IDurableService::SyncRequest request( "removeFromBusiness", @@ -20809,7 +21088,9 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "emailAddress = " << emailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "emailAddress = " << emailAddress << "\n"; + } IDurableService::AsyncRequest request( "removeFromBusiness", @@ -20842,8 +21123,10 @@ void DurableUserStore::updateBusinessUserIdentifier( QString requestDescription; QTextStream strm(&requestDescription); - strm << "oldEmailAddress = " << oldEmailAddress << "\n"; - strm << "newEmailAddress = " << newEmailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "oldEmailAddress = " << oldEmailAddress << "\n"; + strm << "newEmailAddress = " << newEmailAddress << "\n"; + } IDurableService::SyncRequest request( "updateBusinessUserIdentifier", @@ -20876,8 +21159,10 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "oldEmailAddress = " << oldEmailAddress << "\n"; - strm << "newEmailAddress = " << newEmailAddress << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "oldEmailAddress = " << oldEmailAddress << "\n"; + strm << "newEmailAddress = " << newEmailAddress << "\n"; + } IDurableService::AsyncRequest request( "updateBusinessUserIdentifier", @@ -20958,7 +21243,9 @@ QList DurableUserStore::listBusinessInvitations( QString requestDescription; QTextStream strm(&requestDescription); - strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + } IDurableService::SyncRequest request( "listBusinessInvitations", @@ -20989,7 +21276,9 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; + } IDurableService::AsyncRequest request( "listBusinessInvitations", @@ -21020,7 +21309,9 @@ AccountLimits DurableUserStore::getAccountLimits( QString requestDescription; QTextStream strm(&requestDescription); - strm << "serviceLevel = " << serviceLevel << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "serviceLevel = " << serviceLevel << "\n"; + } IDurableService::SyncRequest request( "getAccountLimits", @@ -21051,7 +21342,9 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( QString requestDescription; QTextStream strm(&requestDescription); - strm << "serviceLevel = " << serviceLevel << "\n"; + if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + strm << "serviceLevel = " << serviceLevel << "\n"; + } IDurableService::AsyncRequest request( "getAccountLimits", From 5ac21bf23d7e69b5f03de70e0700fc843a24a12a Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 23 Oct 2019 07:48:19 +0300 Subject: [PATCH 046/188] Introduce Printable base class for simpler printing of structures and exceptions --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/headers/Printable.h | 37 + QEverCloud/headers/generated/Types.h | 879 +- QEverCloud/src/Printable.cpp | 32 + QEverCloud/src/generated/Services.cpp | 778 +- QEverCloud/src/generated/Types.cpp | 12696 +++++++----------------- 6 files changed, 4629 insertions(+), 9795 deletions(-) create mode 100644 QEverCloud/headers/Printable.h create mode 100644 QEverCloud/src/Printable.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index f4634955..85cb749c 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -25,6 +25,7 @@ set(NON_GENERATED_HEADERS headers/InkNoteImageDownloader.h headers/Log.h headers/Optional.h + headers/Printable.h headers/RequestContext.h headers/Thumbnail.h) @@ -57,6 +58,7 @@ set(SOURCES src/Http.cpp src/InkNoteImageDownloader.cpp src/Log.cpp + src/Printable.cpp src/RequestContext.cpp src/Thumbnail.cpp src/generated/Constants.cpp diff --git a/QEverCloud/headers/Printable.h b/QEverCloud/headers/Printable.h new file mode 100644 index 00000000..e7204421 --- /dev/null +++ b/QEverCloud/headers/Printable.h @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_PRINTABLE_H +#define QEVERCLOUD_PRINTABLE_H + +#include "Export.h" + +#include +#include + +namespace qevercloud { + +class QEVERCLOUD_EXPORT Printable +{ +public: + Printable() = default; + virtual ~Printable() = default; + + virtual void print(QTextStream & strm) const = 0; + + virtual QString toString() const; + + friend QEVERCLOUD_EXPORT QTextStream & operator <<( + QTextStream & strm, const Printable & printable); + + friend QEVERCLOUD_EXPORT QDebug & operator <<( + QDebug & dbg, const Printable & printable); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_PRINTABLE_H diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index b552a67d..7b5f5a68 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -16,6 +16,7 @@ #include "../Optional.h" #include "EDAMErrorCode.h" +#include "Printable.h" #include #include #include @@ -93,7 +94,8 @@ using MessageThreadID = qint64; * This structure encapsulates the information about the state of the * user's account for the purpose of "state based" synchronization. * */ -struct QEVERCLOUD_EXPORT SyncState { +struct QEVERCLOUD_EXPORT SyncState: public Printable +{ /** The server's current date and time. */ @@ -153,6 +155,8 @@ struct QEVERCLOUD_EXPORT SyncState { */ Optional userMaxMessageEventId; + virtual void print(QTextStream & strm) const override; + bool operator==(const SyncState & other) const { return (currentTime == other.currentTime) @@ -171,12 +175,6 @@ struct QEVERCLOUD_EXPORT SyncState { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SyncState & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SyncState & value); - /** * This structure is used with the 'getFilteredSyncChunk' call to provide * fine-grained control over the data that's returned when a client needs @@ -184,7 +182,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * whether to include one class of data in the results of that call. * **/ -struct QEVERCLOUD_EXPORT SyncChunkFilter { +struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable +{ /** If true, then the server will include the SyncChunks.notes field */ @@ -285,6 +284,8 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { */ Optional> notebookGuids; + virtual void print(QTextStream & strm) const override; + bool operator==(const SyncChunkFilter & other) const { return includeNotes.isEqual(other.includeNotes) @@ -313,19 +314,14 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SyncChunkFilter & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SyncChunkFilter & value); - /** * 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. * **/ -struct QEVERCLOUD_EXPORT NoteFilter { +struct QEVERCLOUD_EXPORT NoteFilter: public Printable +{ /** The NoteSortOrder value indicating what criterion should be used to sort the results of the filter. @@ -405,6 +401,8 @@ struct QEVERCLOUD_EXPORT NoteFilter { */ Optional searchContextBytes; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteFilter & other) const { return order.isEqual(other.order) @@ -430,12 +428,6 @@ struct QEVERCLOUD_EXPORT NoteFilter { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteFilter & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteFilter & value); - /** * This structure is provided to the findNotesMetadata function to specify * the subset of fields that should be included in each NoteMetadata element @@ -449,7 +441,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * 'false' by the server, so the default behavior is to include nothing in * replies (but the mandatory GUID) */ -struct QEVERCLOUD_EXPORT NotesMetadataResultSpec { +struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable +{ /** NOT DOCUMENTED */ Optional includeTitle; /** NOT DOCUMENTED */ @@ -473,6 +466,8 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec { /** NOT DOCUMENTED */ Optional includeLargestResourceSize; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotesMetadataResultSpec & other) const { return includeTitle.isEqual(other.includeTitle) @@ -496,18 +491,13 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotesMetadataResultSpec & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotesMetadataResultSpec & value); - /** * A data structure representing the number of notes for each notebook * and tag with a non-zero set of applicable notes. * **/ -struct QEVERCLOUD_EXPORT NoteCollectionCounts { +struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable +{ /** A mapping from the Notebook GUID to the number of notes (from some selection) that are in the corresponding notebook. @@ -526,6 +516,8 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts { */ Optional trashCount; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteCollectionCounts & other) const { return notebookCounts.isEqual(other.notebookCounts) @@ -541,12 +533,6 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteCollectionCounts & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteCollectionCounts & value); - /** * 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 @@ -557,7 +543,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * so that the default behavior is to include none of the fields below in the Note. * * */ -struct QEVERCLOUD_EXPORT NoteResultSpec { +struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable +{ /** If true, the Note.content field will be populated with the note's ENML contents. */ @@ -594,6 +581,8 @@ struct QEVERCLOUD_EXPORT NoteResultSpec { */ Optional includeAccountLimits; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteResultSpec & other) const { return includeContent.isEqual(other.includeContent) @@ -614,19 +603,14 @@ struct QEVERCLOUD_EXPORT NoteResultSpec { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteResultSpec & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteResultSpec & value); - /** * 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. * * */ -struct QEVERCLOUD_EXPORT NoteVersionId { +struct QEVERCLOUD_EXPORT NoteVersionId: public Printable +{ /** 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 @@ -657,6 +641,8 @@ struct QEVERCLOUD_EXPORT NoteVersionId { */ Optional lastEditorId; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteVersionId & other) const { return (updateSequenceNum == other.updateSequenceNum) @@ -674,12 +660,6 @@ struct QEVERCLOUD_EXPORT NoteVersionId { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteVersionId & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteVersionId & value); - /** * A description of the thing for which we are searching for related * entities. @@ -688,7 +668,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * not both. filter and referenceUri are optional. * * */ -struct QEVERCLOUD_EXPORT RelatedQuery { +struct QEVERCLOUD_EXPORT RelatedQuery: public Printable +{ /** The GUID of an existing note in your account for which related entities will be found. @@ -731,6 +712,8 @@ struct QEVERCLOUD_EXPORT RelatedQuery { */ Optional cacheKey; + virtual void print(QTextStream & strm) const override; + bool operator==(const RelatedQuery & other) const { return noteGuid.isEqual(other.noteGuid) @@ -749,12 +732,6 @@ struct QEVERCLOUD_EXPORT RelatedQuery { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const RelatedQuery & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const RelatedQuery & value); - /** * A description of the thing for which the service will find related * entities, via findRelated(), together with a description of what @@ -762,7 +739,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * RelatedResult. * * */ -struct QEVERCLOUD_EXPORT RelatedResultSpec { +struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable +{ /** Return notes that are related to the query, but no more than this many. Any value greater than EDAM_RELATED_MAX_NOTES @@ -821,6 +799,8 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { */ Optional> relatedContentTypes; + virtual void print(QTextStream & strm) const override; + bool operator==(const RelatedResultSpec & other) const { return maxNotes.isEqual(other.maxNotes) @@ -842,14 +822,9 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const RelatedResultSpec & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const RelatedResultSpec & value); - /** NO DOC COMMENT ID FOUND */ -struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { +struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable +{ /** NOT DOCUMENTED */ Optional noSetReadOnly; /** NOT DOCUMENTED */ @@ -859,6 +834,8 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { /** NOT DOCUMENTED */ Optional noSetFullAccess; + virtual void print(QTextStream & strm) const override; + bool operator==(const ShareRelationshipRestrictions & other) const { return noSetReadOnly.isEqual(other.noSetReadOnly) @@ -875,18 +852,13 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ShareRelationshipRestrictions & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ShareRelationshipRestrictions & value); - /** * Describes the association between a Notebook and an Evernote User who is * a member of that notebook. * * */ -struct QEVERCLOUD_EXPORT MemberShareRelationship { +struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable +{ /** The string that clients should show to users to represent this member. @@ -929,6 +901,8 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { */ Optional sharerUserId; + virtual void print(QTextStream & strm) const override; + bool operator==(const MemberShareRelationship & other) const { return displayName.isEqual(other.displayName) @@ -947,19 +921,14 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const MemberShareRelationship & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const MemberShareRelationship & value); - /** * 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. * * */ -struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions { +struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable +{ /** This value is true if the user is not allowed to set the privilege level to SharedNotePrivilegeLevel.READ_NOTE. @@ -976,6 +945,8 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions { */ Optional noSetFullAccess; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteShareRelationshipRestrictions & other) const { return noSetReadNote.isEqual(other.noSetReadNote) @@ -991,18 +962,13 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteShareRelationshipRestrictions & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteShareRelationshipRestrictions & value); - /** * Describes the association between a Note and an Evernote User who is * a member of that note. * * */ -struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { +struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable +{ /** The string that clients should show to users to represent this member. @@ -1034,6 +1000,8 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { */ Optional sharerUserId; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteMemberShareRelationship & other) const { return displayName.isEqual(other.displayName) @@ -1051,18 +1019,13 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteMemberShareRelationship & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteMemberShareRelationship & value); - /** * Describes an invitation to a person to use their Evernote credentials * to gain access to a note belonging to another user. * * */ -struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { +struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable +{ /** The string that clients should show to users to represent this invitation. @@ -1089,6 +1052,8 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { */ Optional sharerUserId; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteInvitationShareRelationship & other) const { return displayName.isEqual(other.displayName) @@ -1105,12 +1070,6 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteInvitationShareRelationship & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteInvitationShareRelationship & value); - /** * Captures a collection of share relationships for a single note, * for example, as returned by the getNoteShares method. The share @@ -1118,7 +1077,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * invitations that can be used to become members. * * */ -struct QEVERCLOUD_EXPORT NoteShareRelationships { +struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable +{ /** A list of open invitations that can be redeemed into memberships to the note. @@ -1133,6 +1093,8 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships { /** NOT DOCUMENTED */ Optional invitationRestrictions; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteShareRelationships & other) const { return invitations.isEqual(other.invitations) @@ -1148,12 +1110,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteShareRelationships & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteShareRelationships & value); - /** * Captures parameters used by clients to manage the shares for a given * note via the manageNoteShares function. This is used only to manage @@ -1164,7 +1120,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * updated by this function is the share privilege. * * */ -struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { +struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable +{ /** The GUID of the note whose shares are being managed. */ @@ -1194,6 +1151,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { */ Optional> invitationsToUnshare; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNoteSharesParameters & other) const { return noteGuid.isEqual(other.noteGuid) @@ -1211,12 +1170,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNoteSharesParameters & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNoteSharesParameters & value); - /** * 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 @@ -1226,7 +1179,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * they are only referenced their metadata. * **/ -struct QEVERCLOUD_EXPORT Data { +struct QEVERCLOUD_EXPORT Data: public Printable +{ /** This field carries a one-way hash of the contents of the data body, in binary form. The hash function is MD5
    @@ -1246,6 +1200,8 @@ struct QEVERCLOUD_EXPORT Data { */ Optional body; + virtual void print(QTextStream & strm) const override; + bool operator==(const Data & other) const { return bodyHash.isEqual(other.bodyHash) @@ -1261,18 +1217,13 @@ struct QEVERCLOUD_EXPORT Data { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Data & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Data & value); - /** * A structure holding the optional attributes that can be stored * on a User. These are generally less critical than the core User fields. * **/ -struct QEVERCLOUD_EXPORT UserAttributes { +struct QEVERCLOUD_EXPORT UserAttributes: public Printable +{ /** the location string that should be associated with the user in order to determine where notes are taken if not otherwise @@ -1471,6 +1422,8 @@ struct QEVERCLOUD_EXPORT UserAttributes { */ Optional optOutMachineLearning; + virtual void print(QTextStream & strm) const override; + bool operator==(const UserAttributes & other) const { return defaultLocationName.isEqual(other.defaultLocationName) @@ -1518,18 +1471,13 @@ struct QEVERCLOUD_EXPORT UserAttributes { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const UserAttributes & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const UserAttributes & value); - /** * A structure holding the optional attributes associated with users * in a business. * * */ -struct QEVERCLOUD_EXPORT BusinessUserAttributes { +struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable +{ /** Free form text of this user's title in the business */ @@ -1560,6 +1508,8 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes { */ Optional companyStartDate; + virtual void print(QTextStream & strm) const override; + bool operator==(const BusinessUserAttributes & other) const { return title.isEqual(other.title) @@ -1579,17 +1529,12 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BusinessUserAttributes & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BusinessUserAttributes & value); - /** * This represents the bookkeeping information for the user's subscription. * **/ -struct QEVERCLOUD_EXPORT Accounting { +struct QEVERCLOUD_EXPORT Accounting: public Printable +{ /** The date and time when the current upload limit expires. At this time, the monthly upload count reverts to 0 and a new @@ -1699,6 +1644,8 @@ struct QEVERCLOUD_EXPORT Accounting { /** NOT DOCUMENTED */ Optional availablePoints; + virtual void print(QTextStream & strm) const override; + bool operator==(const Accounting & other) const { return uploadLimitEnd.isEqual(other.uploadLimitEnd) @@ -1734,18 +1681,13 @@ struct QEVERCLOUD_EXPORT Accounting { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Accounting & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Accounting & value); - /** * This structure is used to provide information about an Evernote Business * membership, for members who are part of a business. * * */ -struct QEVERCLOUD_EXPORT BusinessUserInfo { +struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable +{ /** The ID of the Evernote Business account that the user is a member of.
    businessName @@ -1773,6 +1715,8 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { */ Optional updated; + virtual void print(QTextStream & strm) const override; + bool operator==(const BusinessUserInfo & other) const { return businessId.isEqual(other.businessId) @@ -1790,16 +1734,11 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BusinessUserInfo & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BusinessUserInfo & value); - /** * This structure is used to provide account limits that are in effect for this user. **/ -struct QEVERCLOUD_EXPORT AccountLimits { +struct QEVERCLOUD_EXPORT AccountLimits: public Printable +{ /** 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 @@ -1855,6 +1794,8 @@ struct QEVERCLOUD_EXPORT AccountLimits { */ Optional noteResourceCountMax; + virtual void print(QTextStream & strm) const override; + bool operator==(const AccountLimits & other) const { return userMailLimitDaily.isEqual(other.userMailLimitDaily) @@ -1878,16 +1819,11 @@ struct QEVERCLOUD_EXPORT AccountLimits { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const AccountLimits & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const AccountLimits & value); - /** * This represents the information about a single user account. **/ -struct QEVERCLOUD_EXPORT User { +struct QEVERCLOUD_EXPORT User: public Printable +{ /** The unique numeric identifier for the account, which will not change for the lifetime of the account. @@ -2003,6 +1939,8 @@ struct QEVERCLOUD_EXPORT User { */ Optional accountLimits; + virtual void print(QTextStream & strm) const override; + bool operator==(const User & other) const { return id.isEqual(other.id) @@ -2033,18 +1971,13 @@ struct QEVERCLOUD_EXPORT User { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const User & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const User & value); - /** * A structure that represents contact information. Note this does not necessarily correspond to * an Evernote user. * * */ -struct QEVERCLOUD_EXPORT Contact { +struct QEVERCLOUD_EXPORT Contact: public Printable +{ /** The displayable name of this contact. This field is filled in by the service and is read-only to clients. @@ -2085,6 +2018,8 @@ struct QEVERCLOUD_EXPORT Contact { */ Optional messagingPermitExpires; + virtual void print(QTextStream & strm) const override; + bool operator==(const Contact & other) const { return name.isEqual(other.name) @@ -2104,18 +2039,13 @@ struct QEVERCLOUD_EXPORT Contact { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Contact & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Contact & value); - /** * An object that represents the relationship between a Contact that possibly * belongs to an Evernote User. * * */ -struct QEVERCLOUD_EXPORT Identity { +struct QEVERCLOUD_EXPORT Identity: public Printable +{ /** The unique identifier for this mapping. */ @@ -2168,6 +2098,8 @@ struct QEVERCLOUD_EXPORT Identity { */ Optional eventId; + virtual void print(QTextStream & strm) const override; + bool operator==(const Identity & other) const { return (id == other.id) @@ -2188,17 +2120,12 @@ struct QEVERCLOUD_EXPORT Identity { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Identity & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Identity & value); - /** * A tag within a user's account is a unique name which may be organized * a simple hierarchy. **/ -struct QEVERCLOUD_EXPORT Tag { +struct QEVERCLOUD_EXPORT Tag: public Printable +{ /** The unique identifier of this tag. Will be set by the service, so may be omitted by the client when creating the Tag. @@ -2241,6 +2168,8 @@ struct QEVERCLOUD_EXPORT Tag { */ Optional updateSequenceNum; + virtual void print(QTextStream & strm) const override; + bool operator==(const Tag & other) const { return guid.isEqual(other.guid) @@ -2257,12 +2186,6 @@ struct QEVERCLOUD_EXPORT Tag { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Tag & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Tag & value); - /** * 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 @@ -2282,7 +2205,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * map. * * */ -struct QEVERCLOUD_EXPORT LazyMap { +struct QEVERCLOUD_EXPORT LazyMap: public Printable +{ /** The set of keys for the map. This field is ignored by the server when set. @@ -2293,6 +2217,8 @@ struct QEVERCLOUD_EXPORT LazyMap { */ Optional> fullMap; + virtual void print(QTextStream & strm) const override; + bool operator==(const LazyMap & other) const { return keysOnly.isEqual(other.keysOnly) @@ -2307,16 +2233,11 @@ struct QEVERCLOUD_EXPORT LazyMap { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const LazyMap & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const LazyMap & value); - /** * Structure holding the optional attributes of a Resource * */ -struct QEVERCLOUD_EXPORT ResourceAttributes { +struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable +{ /** the original location where the resource was hosted
    @@ -2394,6 +2315,8 @@ struct QEVERCLOUD_EXPORT ResourceAttributes { */ Optional applicationData; + virtual void print(QTextStream & strm) const override; + bool operator==(const ResourceAttributes & other) const { return sourceURL.isEqual(other.sourceURL) @@ -2418,17 +2341,12 @@ struct QEVERCLOUD_EXPORT ResourceAttributes { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ResourceAttributes & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ResourceAttributes & value); - /** * Every media file that is embedded or attached to a note is represented * through a Resource entry. * */ -struct QEVERCLOUD_EXPORT Resource { +struct QEVERCLOUD_EXPORT Resource: public Printable +{ /** The unique identifier of this resource. Will be set whenever a resource is retrieved from the service, but may be null when a client @@ -2506,6 +2424,8 @@ struct QEVERCLOUD_EXPORT Resource { */ Optional alternateData; + virtual void print(QTextStream & strm) const override; + bool operator==(const Resource & other) const { return guid.isEqual(other.guid) @@ -2530,16 +2450,11 @@ struct QEVERCLOUD_EXPORT Resource { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Resource & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Resource & value); - /** * The list of optional attributes that can be stored on a note. * */ -struct QEVERCLOUD_EXPORT NoteAttributes { +struct QEVERCLOUD_EXPORT NoteAttributes: public Printable +{ /** time that the note refers to */ @@ -2747,6 +2662,8 @@ struct QEVERCLOUD_EXPORT NoteAttributes { */ Optional noteTitleQuality; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteAttributes & other) const { return subjectDate.isEqual(other.subjectDate) @@ -2781,19 +2698,14 @@ struct QEVERCLOUD_EXPORT NoteAttributes { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteAttributes & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteAttributes & value); - /** * 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. * * */ -struct QEVERCLOUD_EXPORT SharedNote { +struct QEVERCLOUD_EXPORT SharedNote: public Printable +{ /** The user ID of the user who shared the note with the recipient. */ @@ -2822,6 +2734,8 @@ struct QEVERCLOUD_EXPORT SharedNote { */ Optional serviceAssigned; + virtual void print(QTextStream & strm) const override; + bool operator==(const SharedNote & other) const { return sharerUserID.isEqual(other.sharerUserID) @@ -2840,12 +2754,6 @@ struct QEVERCLOUD_EXPORT SharedNote { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SharedNote & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SharedNote & value); - /** * 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 @@ -2883,7 +2791,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * restrictions. * * */ -struct QEVERCLOUD_EXPORT NoteRestrictions { +struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable +{ /** The client may not update the note's title (Note.title). */ @@ -2904,6 +2813,8 @@ struct QEVERCLOUD_EXPORT NoteRestrictions { */ Optional noSharePublicly; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteRestrictions & other) const { return noUpdateTitle.isEqual(other.noUpdateTitle) @@ -2921,12 +2832,6 @@ struct QEVERCLOUD_EXPORT NoteRestrictions { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteRestrictions & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteRestrictions & value); - /** * Represents the owner's account related limits on a Note. * The field uploaded represents the total number of bytes that have been uploaded @@ -2935,7 +2840,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( *

    * See SyncState and AccountLimits struct field definitions for more details. */ -struct QEVERCLOUD_EXPORT NoteLimits { +struct QEVERCLOUD_EXPORT NoteLimits: public Printable +{ /** NOT DOCUMENTED */ Optional noteResourceCountMax; /** NOT DOCUMENTED */ @@ -2947,6 +2853,8 @@ struct QEVERCLOUD_EXPORT NoteLimits { /** NOT DOCUMENTED */ Optional uploaded; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteLimits & other) const { return noteResourceCountMax.isEqual(other.noteResourceCountMax) @@ -2964,17 +2872,12 @@ struct QEVERCLOUD_EXPORT NoteLimits { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteLimits & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteLimits & value); - /** * Represents a single note in the user's account. * * */ -struct QEVERCLOUD_EXPORT Note { +struct QEVERCLOUD_EXPORT Note: public Printable +{ /** The unique identifier of this note. Will be set by the server, but will be omitted by clients calling NoteStore.createNote() @@ -3118,6 +3021,8 @@ struct QEVERCLOUD_EXPORT Note { /** NOT DOCUMENTED */ Optional limits; + virtual void print(QTextStream & strm) const override; + bool operator==(const Note & other) const { return guid.isEqual(other.guid) @@ -3148,18 +3053,13 @@ struct QEVERCLOUD_EXPORT Note { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Note & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Note & value); - /** * 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. * */ -struct QEVERCLOUD_EXPORT Publishing { +struct QEVERCLOUD_EXPORT Publishing: public Printable +{ /** If this field is present, then the notebook is published for mass consumption on the Internet under the provided URI, which is @@ -3195,6 +3095,8 @@ struct QEVERCLOUD_EXPORT Publishing { */ Optional publicDescription; + virtual void print(QTextStream & strm) const override; + bool operator==(const Publishing & other) const { return uri.isEqual(other.uri) @@ -3211,12 +3113,6 @@ struct QEVERCLOUD_EXPORT Publishing { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Publishing & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Publishing & value); - /** * 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 @@ -3224,7 +3120,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * library. * * */ -struct QEVERCLOUD_EXPORT BusinessNotebook { +struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable +{ /** A short description of the notebook's content that will be displayed in the business library user interface. The description may not begin @@ -3247,6 +3144,8 @@ struct QEVERCLOUD_EXPORT BusinessNotebook { */ Optional recommended; + virtual void print(QTextStream & strm) const override; + bool operator==(const BusinessNotebook & other) const { return notebookDescription.isEqual(other.notebookDescription) @@ -3262,17 +3161,12 @@ struct QEVERCLOUD_EXPORT BusinessNotebook { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BusinessNotebook & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BusinessNotebook & value); - /** * A structure defining the scope of a SavedSearch. * * */ -struct QEVERCLOUD_EXPORT SavedSearchScope { +struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable +{ /** The search should include notes from the account that contains the SavedSearch. */ @@ -3289,6 +3183,8 @@ struct QEVERCLOUD_EXPORT SavedSearchScope { */ Optional includeBusinessLinkedNotebooks; + virtual void print(QTextStream & strm) const override; + bool operator==(const SavedSearchScope & other) const { return includeAccount.isEqual(other.includeAccount) @@ -3304,16 +3200,11 @@ struct QEVERCLOUD_EXPORT SavedSearchScope { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SavedSearchScope & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SavedSearchScope & value); - /** * A named search associated with the account that can be quickly re-used. * */ -struct QEVERCLOUD_EXPORT SavedSearch { +struct QEVERCLOUD_EXPORT SavedSearch: public Printable +{ /** The unique identifier of this search. Will be set by the service, so may be omitted by the client when creating. @@ -3366,6 +3257,8 @@ struct QEVERCLOUD_EXPORT SavedSearch { */ Optional scope; + virtual void print(QTextStream & strm) const override; + bool operator==(const SavedSearch & other) const { return guid.isEqual(other.guid) @@ -3384,12 +3277,6 @@ struct QEVERCLOUD_EXPORT SavedSearch { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SavedSearch & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SavedSearch & value); - /** * Settings meant for the recipient of a shared notebook, such as * for indicating which types of notifications the recipient wishes @@ -3404,7 +3291,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * value. * * */ -struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings { +struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable +{ /** Indicates that the user wishes to receive daily e-mail notifications for reminders associated with the notebook. This may be true only for @@ -3420,6 +3308,8 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings { */ Optional reminderNotifyInApp; + virtual void print(QTextStream & strm) const override; + bool operator==(const SharedNotebookRecipientSettings & other) const { return reminderNotifyEmail.isEqual(other.reminderNotifyEmail) @@ -3434,12 +3324,6 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SharedNotebookRecipientSettings & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SharedNotebookRecipientSettings & value); - /** * Settings meant for the recipient of a notebook share. * @@ -3450,7 +3334,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * has a true/false value, it will always have a true/false value. * * */ -struct QEVERCLOUD_EXPORT NotebookRecipientSettings { +struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable +{ /** Indicates that the user wishes to receive daily e-mail notifications for reminders associated with the notebook. This may be @@ -3485,6 +3370,8 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings { */ Optional recipientStatus; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotebookRecipientSettings & other) const { return reminderNotifyEmail.isEqual(other.reminderNotifyEmail) @@ -3502,17 +3389,12 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotebookRecipientSettings & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotebookRecipientSettings & value); - /** * Shared notebooks represent a relationship between a notebook and a single * share invitation recipient. * */ -struct QEVERCLOUD_EXPORT SharedNotebook { +struct QEVERCLOUD_EXPORT SharedNotebook: public Printable +{ /** The primary identifier of the share, which is not globally unique. */ @@ -3614,6 +3496,8 @@ struct QEVERCLOUD_EXPORT SharedNotebook { */ Optional serviceAssigned; + virtual void print(QTextStream & strm) const override; + bool operator==(const SharedNotebook & other) const { return id.isEqual(other.id) @@ -3642,19 +3526,16 @@ struct QEVERCLOUD_EXPORT SharedNotebook { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SharedNotebook & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SharedNotebook & value); - /** * Specifies if the client can move a Notebook to a Workspace. */ -struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions { +struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable +{ /** NOT DOCUMENTED */ Optional canMoveToContainer; + virtual void print(QTextStream & strm) const override; + bool operator==(const CanMoveToContainerRestrictions & other) const { return canMoveToContainer.isEqual(other.canMoveToContainer) @@ -3668,12 +3549,6 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const CanMoveToContainerRestrictions & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const CanMoveToContainerRestrictions & value); - /** * This structure captures information about the types of operations * that cannot be performed on a given notebook with a type of @@ -3700,7 +3575,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * the values were obtained. * * */ -struct QEVERCLOUD_EXPORT NotebookRestrictions { +struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable +{ /** The client is not able to read notes from the service and the notebook is write-only. @@ -3831,6 +3707,8 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions { */ Optional noCanMoveNote; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotebookRestrictions & other) const { return noReadNotes.isEqual(other.noReadNotes) @@ -3872,16 +3750,11 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotebookRestrictions & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotebookRestrictions & value); - /** * A unique container for a set of notes. * */ -struct QEVERCLOUD_EXPORT Notebook { +struct QEVERCLOUD_EXPORT Notebook: public Printable +{ /** The unique identifier of this notebook.
    @@ -4002,6 +3875,8 @@ struct QEVERCLOUD_EXPORT Notebook { */ Optional recipientSettings; + virtual void print(QTextStream & strm) const override; + bool operator==(const Notebook & other) const { return guid.isEqual(other.guid) @@ -4029,18 +3904,13 @@ struct QEVERCLOUD_EXPORT Notebook { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const Notebook & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const Notebook & value); - /** * A link in a user's account that refers them to a public or * individual shared notebook in another user's account. * * */ -struct QEVERCLOUD_EXPORT LinkedNotebook { +struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable +{ /** The display name of the shared notebook. The link owner can change this. */ @@ -4115,6 +3985,8 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { */ Optional businessId; + virtual void print(QTextStream & strm) const override; + bool operator==(const LinkedNotebook & other) const { return shareName.isEqual(other.shareName) @@ -4138,18 +4010,13 @@ struct QEVERCLOUD_EXPORT LinkedNotebook { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const LinkedNotebook & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const LinkedNotebook & value); - /** * 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. * */ -struct QEVERCLOUD_EXPORT NotebookDescriptor { +struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable +{ /** The unique identifier of the notebook. */ @@ -4173,6 +4040,8 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor { */ Optional joinedUserCount; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotebookDescriptor & other) const { return guid.isEqual(other.guid) @@ -4190,17 +4059,12 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotebookDescriptor & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotebookDescriptor & value); - /** * This structure represents profile information for a user in a business. * * */ -struct QEVERCLOUD_EXPORT UserProfile { +struct QEVERCLOUD_EXPORT UserProfile: public Printable +{ /** The numeric identifier that uniquely identifies a user. */ @@ -4243,6 +4107,8 @@ struct QEVERCLOUD_EXPORT UserProfile { */ Optional status; + virtual void print(QTextStream & strm) const override; + bool operator==(const UserProfile & other) const { return id.isEqual(other.id) @@ -4265,19 +4131,14 @@ struct QEVERCLOUD_EXPORT UserProfile { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const UserProfile & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const UserProfile & value); - /** * 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. * * */ -struct QEVERCLOUD_EXPORT RelatedContentImage { +struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable +{ /** The external URL of the image */ @@ -4299,6 +4160,8 @@ struct QEVERCLOUD_EXPORT RelatedContentImage { */ Optional fileSize; + virtual void print(QTextStream & strm) const override; + bool operator==(const RelatedContentImage & other) const { return url.isEqual(other.url) @@ -4316,18 +4179,13 @@ struct QEVERCLOUD_EXPORT RelatedContentImage { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const RelatedContentImage & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const RelatedContentImage & value); - /** * 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). * * */ -struct QEVERCLOUD_EXPORT RelatedContent { +struct QEVERCLOUD_EXPORT RelatedContent: public Printable +{ /** An identifier that uniquely identifies the content. */ @@ -4400,6 +4258,8 @@ struct QEVERCLOUD_EXPORT RelatedContent { */ Optional authors; + virtual void print(QTextStream & strm) const override; + bool operator==(const RelatedContent & other) const { return contentId.isEqual(other.contentId) @@ -4428,17 +4288,12 @@ struct QEVERCLOUD_EXPORT RelatedContent { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const RelatedContent & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const RelatedContent & value); - /** * A structure describing an invitation to join a business account. * * */ -struct QEVERCLOUD_EXPORT BusinessInvitation { +struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable +{ /** The ID of the business to which the invitation grants access. */ @@ -4475,6 +4330,8 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { */ Optional mostRecentReminder; + virtual void print(QTextStream & strm) const override; + bool operator==(const BusinessInvitation & other) const { return businessId.isEqual(other.businessId) @@ -4495,12 +4352,6 @@ struct QEVERCLOUD_EXPORT BusinessInvitation { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BusinessInvitation & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BusinessInvitation & value); - /** * A structure that holds user identifying information such as an * email address, Evernote user ID, or an identifier from a 3rd party @@ -4530,7 +4381,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * 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 QEVERCLOUD_EXPORT UserIdentity { +struct QEVERCLOUD_EXPORT UserIdentity: public Printable +{ /** NOT DOCUMENTED */ Optional type; /** NOT DOCUMENTED */ @@ -4538,6 +4390,8 @@ struct QEVERCLOUD_EXPORT UserIdentity { /** NOT DOCUMENTED */ Optional longIdentifier; + virtual void print(QTextStream & strm) const override; + bool operator==(const UserIdentity & other) const { return type.isEqual(other.type) @@ -4553,17 +4407,12 @@ struct QEVERCLOUD_EXPORT UserIdentity { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const UserIdentity & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const UserIdentity & value); - /** * This structure is used to provide publicly-available user information * about a particular account. **/ -struct QEVERCLOUD_EXPORT PublicUserInfo { +struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable +{ /** The unique numeric user identifier for the user account. */ @@ -4592,6 +4441,8 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { */ Optional webApiUrlPrefix; + virtual void print(QTextStream & strm) const override; + bool operator==(const PublicUserInfo & other) const { return (userId == other.userId) @@ -4609,15 +4460,10 @@ struct QEVERCLOUD_EXPORT PublicUserInfo { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const PublicUserInfo & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const PublicUserInfo & value); - /** * */ -struct QEVERCLOUD_EXPORT UserUrls { +struct QEVERCLOUD_EXPORT UserUrls: public Printable +{ /** 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. @@ -4662,6 +4508,8 @@ struct QEVERCLOUD_EXPORT UserUrls { */ Optional userWebSocketUrl; + virtual void print(QTextStream & strm) const override; + bool operator==(const UserUrls & other) const { return noteStoreUrl.isEqual(other.noteStoreUrl) @@ -4680,17 +4528,12 @@ struct QEVERCLOUD_EXPORT UserUrls { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const UserUrls & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const UserUrls & value); - /** * When an authentication (or re-authentication) is performed, this structure * provides the result to the client. **/ -struct QEVERCLOUD_EXPORT AuthenticationResult { +struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable +{ /** The server-side date and time when this result was generated. @@ -4750,6 +4593,8 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { */ Optional urls; + virtual void print(QTextStream & strm) const override; + bool operator==(const AuthenticationResult & other) const { return (currentTime == other.currentTime) @@ -4772,16 +4617,11 @@ struct QEVERCLOUD_EXPORT AuthenticationResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const AuthenticationResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const AuthenticationResult & value); - /** * This structure describes a collection of bootstrap settings. **/ -struct QEVERCLOUD_EXPORT BootstrapSettings { +struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable +{ /** The hostname and optional port for composing Evernote web service URLs. This URL can be used to access the UserStore and related services, @@ -4846,6 +4686,8 @@ struct QEVERCLOUD_EXPORT BootstrapSettings { */ Optional enableGoogle; + virtual void print(QTextStream & strm) const override; + bool operator==(const BootstrapSettings & other) const { return (serviceHost == other.serviceHost) @@ -4872,16 +4714,11 @@ struct QEVERCLOUD_EXPORT BootstrapSettings { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BootstrapSettings & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BootstrapSettings & value); - /** * This structure describes a collection of bootstrap settings. **/ -struct QEVERCLOUD_EXPORT BootstrapProfile { +struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable +{ /** The unique name of the profile, which is guaranteed to remain consistent across calls to getBootstrapInfo. @@ -4892,6 +4729,8 @@ struct QEVERCLOUD_EXPORT BootstrapProfile { */ BootstrapSettings settings; + virtual void print(QTextStream & strm) const override; + bool operator==(const BootstrapProfile & other) const { return (name == other.name) @@ -4906,22 +4745,19 @@ struct QEVERCLOUD_EXPORT BootstrapProfile { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BootstrapProfile & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BootstrapProfile & value); - /** * This structure describes a collection of bootstrap profiles. **/ -struct QEVERCLOUD_EXPORT BootstrapInfo { +struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable +{ /** List of one or more bootstrap profiles, in descending preference order. */ QList profiles; + virtual void print(QTextStream & strm) const override; + bool operator==(const BootstrapInfo & other) const { return (profiles == other.profiles) @@ -4935,12 +4771,6 @@ struct QEVERCLOUD_EXPORT BootstrapInfo { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const BootstrapInfo & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const BootstrapInfo & value); - /** * 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 @@ -4959,18 +4789,20 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * indicate which parameter. For some errors (USER_NOT_ASSOCIATED, USER_NOT_REGISTERED, * SSO_AUTHENTICATION_REQUIRED), this is the user's email. */ -class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException +class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Printable { public: EDAMErrorCode errorCode; Optional parameter; EDAMUserException(); - virtual ~EDAMUserException() throw() Q_DECL_OVERRIDE; + virtual ~EDAMUserException() throw() override; EDAMUserException(const EDAMUserException & other); - const char * what() const throw() Q_DECL_OVERRIDE; - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + const char * what() const throw() override; + virtual QSharedPointer exceptionData() const override; + + virtual void print(QTextStream & strm) const override; bool operator==(const EDAMUserException & other) const { @@ -4986,12 +4818,6 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const EDAMUserException & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const EDAMUserException & value); - /** * 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. @@ -5006,7 +4832,7 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * API requests for the user until at least this many seconds have passed. Present only * when errorCode is RATE_LIMIT_REACHED, */ -class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException +class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Printable { public: EDAMErrorCode errorCode; @@ -5014,11 +4840,13 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException Optional rateLimitDuration; EDAMSystemException(); - virtual ~EDAMSystemException() throw() Q_DECL_OVERRIDE; + virtual ~EDAMSystemException() throw() override; EDAMSystemException(const EDAMSystemException & other); - const char * what() const throw() Q_DECL_OVERRIDE; - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + const char * what() const throw() override; + virtual QSharedPointer exceptionData() const override; + + virtual void print(QTextStream & strm) const override; bool operator==(const EDAMSystemException & other) const { @@ -5035,12 +4863,6 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const EDAMSystemException & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const EDAMSystemException & value); - /** * 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 @@ -5054,18 +4876,20 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * key: The value passed from the client in the identifier, which was not * found. For example, the GUID that was not found. */ -class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException +class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public Printable { public: Optional identifier; Optional key; EDAMNotFoundException(); - virtual ~EDAMNotFoundException() throw() Q_DECL_OVERRIDE; + virtual ~EDAMNotFoundException() throw() override; EDAMNotFoundException(const EDAMNotFoundException & other); - const char * what() const throw() Q_DECL_OVERRIDE; - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + const char * what() const throw() override; + virtual QSharedPointer exceptionData() const override; + + virtual void print(QTextStream & strm) const override; bool operator==(const EDAMNotFoundException & other) const { @@ -5081,12 +4905,6 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const EDAMNotFoundException & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const EDAMNotFoundException & value); - /** * An exception thrown when the provided Contacts fail validation. For instance, * email domains could be invalid, phone numbers might not be valid for SMS, @@ -5109,7 +4927,7 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * matching, in order, the list returned in the contacts field. * */ -class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException +class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, public Printable { public: QList contacts; @@ -5117,11 +4935,13 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException Optional> reasons; EDAMInvalidContactsException(); - virtual ~EDAMInvalidContactsException() throw() Q_DECL_OVERRIDE; + virtual ~EDAMInvalidContactsException() throw() override; EDAMInvalidContactsException(const EDAMInvalidContactsException & other); - const char * what() const throw() Q_DECL_OVERRIDE; - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + const char * what() const throw() override; + virtual QSharedPointer exceptionData() const override; + + virtual void print(QTextStream & strm) const override; bool operator==(const EDAMInvalidContactsException & other) const { @@ -5138,12 +4958,6 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const EDAMInvalidContactsException & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const EDAMInvalidContactsException & value); - /** * 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 @@ -5155,7 +4969,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * Sequence Numbers (USNs). * **/ -struct QEVERCLOUD_EXPORT SyncChunk { +struct QEVERCLOUD_EXPORT SyncChunk: public Printable +{ /** The server's current date and time. */ @@ -5237,6 +5052,8 @@ struct QEVERCLOUD_EXPORT SyncChunk { */ Optional> expungedLinkedNotebooks; + virtual void print(QTextStream & strm) const override; + bool operator==(const SyncChunk & other) const { return (currentTime == other.currentTime) @@ -5263,17 +5080,12 @@ struct QEVERCLOUD_EXPORT SyncChunk { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SyncChunk & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SyncChunk & value); - /** * A small structure for returning a list of notes out of a larger set. * **/ -struct QEVERCLOUD_EXPORT NoteList { +struct QEVERCLOUD_EXPORT NoteList: public Printable +{ /** The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set. @@ -5323,6 +5135,8 @@ struct QEVERCLOUD_EXPORT NoteList { */ Optional debugInfo; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteList & other) const { return (startIndex == other.startIndex) @@ -5343,12 +5157,6 @@ struct QEVERCLOUD_EXPORT NoteList { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteList & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteList & value); - /** * This structure is used in the set of results returned by the * findNotesMetadata function. It represents the high-level information about @@ -5359,7 +5167,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * the Note structure, with the exception of: * * */ -struct QEVERCLOUD_EXPORT NoteMetadata { +struct QEVERCLOUD_EXPORT NoteMetadata: public Printable +{ /** NOT DOCUMENTED */ Guid guid; /** NOT DOCUMENTED */ @@ -5393,6 +5202,8 @@ struct QEVERCLOUD_EXPORT NoteMetadata { */ Optional largestResourceSize; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteMetadata & other) const { return (guid == other.guid) @@ -5417,19 +5228,14 @@ struct QEVERCLOUD_EXPORT NoteMetadata { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteMetadata & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteMetadata & value); - /** * 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. * **/ -struct QEVERCLOUD_EXPORT NotesMetadataList { +struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable +{ /** The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set. @@ -5481,6 +5287,8 @@ struct QEVERCLOUD_EXPORT NotesMetadataList { */ Optional debugInfo; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotesMetadataList & other) const { return (startIndex == other.startIndex) @@ -5501,18 +5309,13 @@ struct QEVERCLOUD_EXPORT NotesMetadataList { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotesMetadataList & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotesMetadataList & value); - /** * Parameters that must be given to the NoteStore emailNote call. These allow * the caller to specify the note to send, the recipient addresses, etc. * * */ -struct QEVERCLOUD_EXPORT NoteEmailParameters { +struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable +{ /** 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, @@ -5550,6 +5353,8 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters { */ Optional message; + virtual void print(QTextStream & strm) const override; + bool operator==(const NoteEmailParameters & other) const { return guid.isEqual(other.guid) @@ -5568,12 +5373,6 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NoteEmailParameters & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NoteEmailParameters & value); - /** * The result of calling findRelated(). The contents of the notes, * notebooks, and tags fields will be in decreasing order of expected @@ -5582,7 +5381,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * in cases where the relevance is estimated to be low. * * */ -struct QEVERCLOUD_EXPORT RelatedResult { +struct QEVERCLOUD_EXPORT RelatedResult: public Printable +{ /** If notes have been requested to be included, this will be the list of notes. @@ -5662,6 +5462,8 @@ struct QEVERCLOUD_EXPORT RelatedResult { */ Optional cacheExpires; + virtual void print(QTextStream & strm) const override; + bool operator==(const RelatedResult & other) const { return notes.isEqual(other.notes) @@ -5683,18 +5485,13 @@ struct QEVERCLOUD_EXPORT RelatedResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const RelatedResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const RelatedResult & value); - /** * 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. * * */ -struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult { +struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable +{ /** 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. @@ -5709,6 +5506,8 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult { */ Optional updated; + virtual void print(QTextStream & strm) const override; + bool operator==(const UpdateNoteIfUsnMatchesResult & other) const { return note.isEqual(other.note) @@ -5723,18 +5522,13 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const UpdateNoteIfUsnMatchesResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const UpdateNoteIfUsnMatchesResult & value); - /** * Describes an invitation to a person to use their Evernote * credentials to become a member of a notebook. * * */ -struct QEVERCLOUD_EXPORT InvitationShareRelationship { +struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable +{ /** The string that clients should show to users to represent this invitation. @@ -5764,6 +5558,8 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { */ Optional sharerUserId; + virtual void print(QTextStream & strm) const override; + bool operator==(const InvitationShareRelationship & other) const { return displayName.isEqual(other.displayName) @@ -5780,12 +5576,6 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const InvitationShareRelationship & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const InvitationShareRelationship & value); - /** * Captures a collection of share relationships for a notebook, for * example, as returned by the getNotebookShares method. The share @@ -5793,7 +5583,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * invitations that can be used to become members. * * */ -struct QEVERCLOUD_EXPORT ShareRelationships { +struct QEVERCLOUD_EXPORT ShareRelationships: public Printable +{ /** A list of open invitations that can be redeemed into memberships to the notebook. @@ -5815,6 +5606,8 @@ struct QEVERCLOUD_EXPORT ShareRelationships { */ Optional invitationRestrictions; + virtual void print(QTextStream & strm) const override; + bool operator==(const ShareRelationships & other) const { return invitations.isEqual(other.invitations) @@ -5830,18 +5623,13 @@ struct QEVERCLOUD_EXPORT ShareRelationships { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ShareRelationships & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ShareRelationships & value); - /** * A structure that captures parameters used by clients to manage the * shares for a given notebook via the manageNotebookShares method. * * */ -struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { +struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable +{ /** The GUID of the notebook whose shares are being managed. */ @@ -5888,6 +5676,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { */ Optional> unshares; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNotebookSharesParameters & other) const { return notebookGuid.isEqual(other.notebookGuid) @@ -5905,12 +5695,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNotebookSharesParameters & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNotebookSharesParameters & value); - /** * A structure to capture certain errors that occurred during a call * to manageNotebookShares. That method can be run best-effort, @@ -5922,7 +5706,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * relationship and one of the exception fields. * * */ -struct QEVERCLOUD_EXPORT ManageNotebookSharesError { +struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable +{ /** The identity of the share relationship whose update encountered an error. @@ -5941,6 +5726,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError { */ Optional notFoundException; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNotebookSharesError & other) const { return userIdentity.isEqual(other.userIdentity) @@ -5956,17 +5743,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNotebookSharesError & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNotebookSharesError & value); - /** * The return value of a call to the manageNotebookShares method. * * */ -struct QEVERCLOUD_EXPORT ManageNotebookSharesResult { +struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable +{ /** If the method completed without throwing exceptions, some errors might still have occurred, and in that case, this field will contain @@ -5974,6 +5756,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult { */ Optional> errors; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNotebookSharesResult & other) const { return errors.isEqual(other.errors) @@ -5987,17 +5771,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNotebookSharesResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNotebookSharesResult & value); - /** * A structure used to share a note with one or more recipients at a given privilege. * * */ -struct QEVERCLOUD_EXPORT SharedNoteTemplate { +struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable +{ /** The GUID of the note. */ @@ -6022,6 +5801,8 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { */ Optional privilege; + virtual void print(QTextStream & strm) const override; + bool operator==(const SharedNoteTemplate & other) const { return noteGuid.isEqual(other.noteGuid) @@ -6038,17 +5819,12 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const SharedNoteTemplate & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const SharedNoteTemplate & value); - /** * A structure used to share a notebook with one or more recipients at a given privilege. * * */ -struct QEVERCLOUD_EXPORT NotebookShareTemplate { +struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable +{ /** The GUID of the notebook. */ @@ -6073,6 +5849,8 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { */ Optional privilege; + virtual void print(QTextStream & strm) const override; + bool operator==(const NotebookShareTemplate & other) const { return notebookGuid.isEqual(other.notebookGuid) @@ -6089,17 +5867,12 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const NotebookShareTemplate & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const NotebookShareTemplate & value); - /** * A structure containing the results of a call to createOrUpdateNotebookShares. * * */ -struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult { +struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable +{ /** The USN of the notebook after the call. */ @@ -6112,6 +5885,8 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult { */ Optional> matchingShares; + virtual void print(QTextStream & strm) const override; + bool operator==(const CreateOrUpdateNotebookSharesResult & other) const { return updateSequenceNum.isEqual(other.updateSequenceNum) @@ -6126,12 +5901,6 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const CreateOrUpdateNotebookSharesResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const CreateOrUpdateNotebookSharesResult & value); - /** * Captures errors that occur during a call to manageNoteShares. That * function can be run best-effort, meaning that some change requests can @@ -6143,7 +5912,8 @@ QEVERCLOUD_EXPORT QDebug & operator <<( * Only one of the two exception fields will be set on a given error. * * */ -struct QEVERCLOUD_EXPORT ManageNoteSharesError { +struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable +{ /** The identity ID of an outstanding invitation that was not updated due to the error. @@ -6168,6 +5938,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError { */ Optional notFoundException; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNoteSharesError & other) const { return identityID.isEqual(other.identityID) @@ -6184,17 +5956,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNoteSharesError & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNoteSharesError & value); - /** * The return value of a call to the manageNoteShares function. * * */ -struct QEVERCLOUD_EXPORT ManageNoteSharesResult { +struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable +{ /** If the call succeeded without throwing an exception, some errors might still have occurred. In that case, this field will contain the @@ -6202,6 +5969,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { */ Optional> errors; + virtual void print(QTextStream & strm) const override; + bool operator==(const ManageNoteSharesResult & other) const { return errors.isEqual(other.errors) @@ -6215,12 +5984,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult { }; -QEVERCLOUD_EXPORT QTextStream & operator <<( - QTextStream & strm, const ManageNoteSharesResult & value); - -QEVERCLOUD_EXPORT QDebug & operator <<( - QDebug & dbg, const ManageNoteSharesResult & value); - } // namespace qevercloud Q_DECLARE_METATYPE(qevercloud::SyncState) diff --git a/QEverCloud/src/Printable.cpp b/QEverCloud/src/Printable.cpp new file mode 100644 index 00000000..964add2c --- /dev/null +++ b/QEverCloud/src/Printable.cpp @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + +#include + +namespace qevercloud { + +QString Printable::toString() const +{ + QString str; + QTextStream strm(&str, QIODevice::WriteOnly); + strm << *this; + return str; +} + +QTextStream & operator<<(QTextStream & strm, const Printable & printable) +{ + strm << printable.toString(); + return strm; +} + +QDebug & operator<<(QDebug & dbg, const Printable & printable) +{ + dbg << printable.toString(); + return dbg; +} + +} // namespace qevercloud diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index ecea168c..e95a7769 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -58,230 +58,230 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore } virtual SyncState getSyncState( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSyncStateAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncChunk getFilteredSyncChunk( qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getFilteredSyncChunkAsync( qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncState getLinkedNotebookSyncState( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getLinkedNotebookSyncStateAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncChunk getLinkedNotebookSyncChunk( const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getLinkedNotebookSyncChunkAsync( const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listAccessibleBusinessNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listAccessibleBusinessNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getDefaultNotebook( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getDefaultNotebookAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook createNotebook( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createNotebookAsync( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateNotebook( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNotebookAsync( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listTags( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listTagsAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listTagsByNotebook( Guid notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listTagsByNotebookAsync( Guid notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Tag getTag( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getTagAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Tag createTag( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createTagAsync( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateTag( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateTagAsync( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void untagAll( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * untagAllAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeTag( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeTagAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listSearches( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listSearchesAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SavedSearch getSearch( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSearchAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SavedSearch createSearch( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createSearchAsync( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateSearch( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateSearchAsync( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeSearch( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeSearchAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 findNoteOffset( const NoteFilter & filter, Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNoteOffsetAsync( const NoteFilter & filter, Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual NotesMetadataList findNotesMetadata( const NoteFilter & filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNotesMetadataAsync( const NoteFilter & filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual NoteCollectionCounts findNoteCounts( const NoteFilter & filter, bool withTrash, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNoteCountsAsync( const NoteFilter & filter, bool withTrash, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNoteWithResultSpec( Guid guid, const NoteResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteWithResultSpecAsync( Guid guid, const NoteResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNote( Guid guid, @@ -289,7 +289,7 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteAsync( Guid guid, @@ -297,133 +297,133 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LazyMap getNoteApplicationData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteApplicationDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 setNoteApplicationDataEntry( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setNoteApplicationDataEntryAsync( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 unsetNoteApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * unsetNoteApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteContent( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteContentAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteSearchText( Guid guid, bool noteOnly, bool tokenizeForIndexing, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteSearchTextAsync( Guid guid, bool noteOnly, bool tokenizeForIndexing, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getResourceSearchText( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceSearchTextAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QStringList getNoteTagNames( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteTagNamesAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note createNote( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createNoteAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note updateNote( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNoteAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 deleteNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * deleteNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note copyNote( Guid noteGuid, Guid toNotebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * copyNoteAsync( Guid noteGuid, Guid toNotebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listNoteVersions( Guid noteGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listNoteVersionsAsync( Guid noteGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNoteVersion( Guid noteGuid, @@ -431,7 +431,7 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteVersionAsync( Guid noteGuid, @@ -439,7 +439,7 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Resource getResource( Guid guid, @@ -447,7 +447,7 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withRecognition, bool withAttributes, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAsync( Guid guid, @@ -455,63 +455,63 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withRecognition, bool withAttributes, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LazyMap getResourceApplicationData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceApplicationDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getResourceApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 setResourceApplicationDataEntry( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setResourceApplicationDataEntryAsync( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 unsetResourceApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * unsetResourceApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateResource( const Resource & resource, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateResourceAsync( const Resource & resource, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Resource getResourceByHash( Guid noteGuid, @@ -519,7 +519,7 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withData, bool withRecognition, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceByHashAsync( Guid noteGuid, @@ -527,195 +527,195 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore bool withData, bool withRecognition, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceRecognition( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceRecognitionAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceAlternateData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAlternateDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ResourceAttributes getResourceAttributes( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAttributesAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getPublicNotebook( UserID userId, QString publicUri, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getPublicNotebookAsync( UserID userId, QString publicUri, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SharedNotebook shareNotebook( const SharedNotebook & sharedNotebook, QString message, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * shareNotebookAsync( const SharedNotebook & sharedNotebook, QString message, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( const NotebookShareTemplate & shareTemplate, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createOrUpdateNotebookSharesAsync( const NotebookShareTemplate & shareTemplate, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateSharedNotebook( const SharedNotebook & sharedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateSharedNotebookAsync( const SharedNotebook & sharedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook setNotebookRecipientSettings( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setNotebookRecipientSettingsAsync( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listSharedNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listSharedNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LinkedNotebook createLinkedNotebook( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateLinkedNotebook( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listLinkedNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listLinkedNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeLinkedNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeLinkedNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToSharedNotebook( QString shareKeyOrGlobalId, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SharedNotebook getSharedNotebookByAuth( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSharedNotebookByAuthAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void emailNote( const NoteEmailParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * emailNoteAsync( const NoteEmailParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString shareNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * shareNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void stopSharingNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * stopSharingNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToSharedNote( QString guid, QString noteKey, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToSharedNoteAsync( QString guid, QString noteKey, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual RelatedResult findRelated( const RelatedQuery & query, const RelatedResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findRelatedAsync( const RelatedQuery & query, const RelatedResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNoteIfUsnMatchesAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ManageNotebookSharesResult manageNotebookShares( const ManageNotebookSharesParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * manageNotebookSharesAsync( const ManageNotebookSharesParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ShareRelationships getNotebookShares( QString notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNotebookSharesAsync( QString notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; private: QString m_url; @@ -1418,7 +1418,11 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listNotebooks.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listNotebooks.result)")); + } for(qint32 i = 0; i < size; i++) { Notebook elem; readNotebook(r, elem); @@ -1559,7 +1563,11 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listAccessibleBusinessNotebooks.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listAccessibleBusinessNotebooks.result)")); + } for(qint32 i = 0; i < size; i++) { Notebook elem; readNotebook(r, elem); @@ -2439,7 +2447,11 @@ QList NoteStore_listTags_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listTags.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listTags.result)")); + } for(qint32 i = 0; i < size; i++) { Tag elem; readTag(r, elem); @@ -2587,7 +2599,11 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listTagsByNotebook.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listTagsByNotebook.result)")); + } for(qint32 i = 0; i < size; i++) { Tag elem; readTag(r, elem); @@ -3485,7 +3501,11 @@ QList NoteStore_listSearches_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listSearches.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listSearches.result)")); + } for(qint32 i = 0; i < size; i++) { SavedSearch elem; readSavedSearch(r, elem); @@ -6231,7 +6251,11 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (getNoteTagNames.result)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (getNoteTagNames.result)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -7164,7 +7188,11 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listNoteVersions.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listNoteVersions.result)")); + } for(qint32 i = 0; i < size; i++) { NoteVersionId elem; readNoteVersionId(r, elem); @@ -10103,7 +10131,11 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listSharedNotebooks.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listSharedNotebooks.result)")); + } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; readSharedNotebook(r, elem); @@ -10558,7 +10590,11 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listLinkedNotebooks.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listLinkedNotebooks.result)")); + } for(qint32 i = 0; i < size; i++) { LinkedNotebook elem; readLinkedNotebook(r, elem); @@ -12323,21 +12359,21 @@ class Q_DECL_HIDDEN UserStore: public IUserStore QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * checkVersionAsync( QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual BootstrapInfo getBootstrapInfo( QString locale, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getBootstrapInfoAsync( QString locale, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateLongSession( QString username, @@ -12347,7 +12383,7 @@ class Q_DECL_HIDDEN UserStore: public IUserStore QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateLongSessionAsync( QString username, @@ -12357,99 +12393,99 @@ class Q_DECL_HIDDEN UserStore: public IUserStore QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult completeTwoFactorAuthentication( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * completeTwoFactorAuthenticationAsync( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void revokeLongSession( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * revokeLongSessionAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToBusiness( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToBusinessAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual User getUser( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getUserAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual PublicUserInfo getPublicUserInfo( QString username, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getPublicUserInfoAsync( QString username, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual UserUrls getUserUrls( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getUserUrlsAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void inviteToBusiness( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * inviteToBusinessAsync( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void removeFromBusiness( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * removeFromBusinessAsync( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void updateBusinessUserIdentifier( QString oldEmailAddress, QString newEmailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateBusinessUserIdentifierAsync( QString oldEmailAddress, QString newEmailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listBusinessUsers( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listBusinessUsersAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listBusinessInvitations( bool includeRequestedInvitations, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listBusinessInvitationsAsync( bool includeRequestedInvitations, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AccountLimits getAccountLimits( ServiceLevel serviceLevel, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getAccountLimitsAsync( ServiceLevel serviceLevel, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; private: QString m_url; @@ -14187,7 +14223,11 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listBusinessUsers.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listBusinessUsers.result)")); + } for(qint32 i = 0; i < size; i++) { UserProfile elem; readUserProfile(r, elem); @@ -14335,7 +14375,11 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (listBusinessInvitations.result)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (listBusinessInvitations.result)")); + } for(qint32 i = 0; i < size; i++) { BusinessInvitation elem; readBusinessInvitation(r, elem); @@ -14561,230 +14605,230 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore } virtual SyncState getSyncState( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSyncStateAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncChunk getFilteredSyncChunk( qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getFilteredSyncChunkAsync( qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncState getLinkedNotebookSyncState( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getLinkedNotebookSyncStateAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SyncChunk getLinkedNotebookSyncChunk( const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getLinkedNotebookSyncChunkAsync( const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listAccessibleBusinessNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listAccessibleBusinessNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getDefaultNotebook( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getDefaultNotebookAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook createNotebook( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createNotebookAsync( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateNotebook( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNotebookAsync( const Notebook & notebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listTags( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listTagsAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listTagsByNotebook( Guid notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listTagsByNotebookAsync( Guid notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Tag getTag( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getTagAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Tag createTag( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createTagAsync( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateTag( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateTagAsync( const Tag & tag, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void untagAll( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * untagAllAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeTag( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeTagAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listSearches( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listSearchesAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SavedSearch getSearch( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSearchAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SavedSearch createSearch( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createSearchAsync( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateSearch( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateSearchAsync( const SavedSearch & search, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeSearch( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeSearchAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 findNoteOffset( const NoteFilter & filter, Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNoteOffsetAsync( const NoteFilter & filter, Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual NotesMetadataList findNotesMetadata( const NoteFilter & filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNotesMetadataAsync( const NoteFilter & filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual NoteCollectionCounts findNoteCounts( const NoteFilter & filter, bool withTrash, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findNoteCountsAsync( const NoteFilter & filter, bool withTrash, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNoteWithResultSpec( Guid guid, const NoteResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteWithResultSpecAsync( Guid guid, const NoteResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNote( Guid guid, @@ -14792,7 +14836,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteAsync( Guid guid, @@ -14800,133 +14844,133 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LazyMap getNoteApplicationData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteApplicationDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 setNoteApplicationDataEntry( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setNoteApplicationDataEntryAsync( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 unsetNoteApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * unsetNoteApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteContent( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteContentAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getNoteSearchText( Guid guid, bool noteOnly, bool tokenizeForIndexing, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteSearchTextAsync( Guid guid, bool noteOnly, bool tokenizeForIndexing, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getResourceSearchText( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceSearchTextAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QStringList getNoteTagNames( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteTagNamesAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note createNote( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createNoteAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note updateNote( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNoteAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 deleteNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * deleteNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note copyNote( Guid noteGuid, Guid toNotebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * copyNoteAsync( Guid noteGuid, Guid toNotebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listNoteVersions( Guid noteGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listNoteVersionsAsync( Guid noteGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Note getNoteVersion( Guid noteGuid, @@ -14934,7 +14978,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNoteVersionAsync( Guid noteGuid, @@ -14942,7 +14986,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withResourcesData, bool withResourcesRecognition, bool withResourcesAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Resource getResource( Guid guid, @@ -14950,7 +14994,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withRecognition, bool withAttributes, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAsync( Guid guid, @@ -14958,63 +15002,63 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withRecognition, bool withAttributes, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LazyMap getResourceApplicationData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceApplicationDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString getResourceApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 setResourceApplicationDataEntry( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setResourceApplicationDataEntryAsync( Guid guid, QString key, QString value, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 unsetResourceApplicationDataEntry( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * unsetResourceApplicationDataEntryAsync( Guid guid, QString key, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateResource( const Resource & resource, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateResourceAsync( const Resource & resource, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Resource getResourceByHash( Guid noteGuid, @@ -15022,7 +15066,7 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withData, bool withRecognition, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceByHashAsync( Guid noteGuid, @@ -15030,195 +15074,195 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore bool withData, bool withRecognition, bool withAlternateData, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceRecognition( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceRecognitionAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QByteArray getResourceAlternateData( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAlternateDataAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ResourceAttributes getResourceAttributes( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getResourceAttributesAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook getPublicNotebook( UserID userId, QString publicUri, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getPublicNotebookAsync( UserID userId, QString publicUri, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SharedNotebook shareNotebook( const SharedNotebook & sharedNotebook, QString message, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * shareNotebookAsync( const SharedNotebook & sharedNotebook, QString message, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual CreateOrUpdateNotebookSharesResult createOrUpdateNotebookShares( const NotebookShareTemplate & shareTemplate, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createOrUpdateNotebookSharesAsync( const NotebookShareTemplate & shareTemplate, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateSharedNotebook( const SharedNotebook & sharedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateSharedNotebookAsync( const SharedNotebook & sharedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual Notebook setNotebookRecipientSettings( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * setNotebookRecipientSettingsAsync( QString notebookGuid, const NotebookRecipientSettings & recipientSettings, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listSharedNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listSharedNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual LinkedNotebook createLinkedNotebook( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * createLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 updateLinkedNotebook( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listLinkedNotebooks( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listLinkedNotebooksAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual qint32 expungeLinkedNotebook( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * expungeLinkedNotebookAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToSharedNotebook( QString shareKeyOrGlobalId, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual SharedNotebook getSharedNotebookByAuth( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getSharedNotebookByAuthAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void emailNote( const NoteEmailParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * emailNoteAsync( const NoteEmailParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QString shareNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * shareNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void stopSharingNote( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * stopSharingNoteAsync( Guid guid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToSharedNote( QString guid, QString noteKey, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToSharedNoteAsync( QString guid, QString noteKey, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual RelatedResult findRelated( const RelatedQuery & query, const RelatedResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * findRelatedAsync( const RelatedQuery & query, const RelatedResultSpec & resultSpec, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual UpdateNoteIfUsnMatchesResult updateNoteIfUsnMatches( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateNoteIfUsnMatchesAsync( const Note & note, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ManageNotebookSharesResult manageNotebookShares( const ManageNotebookSharesParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * manageNotebookSharesAsync( const ManageNotebookSharesParameters & parameters, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual ShareRelationships getNotebookShares( QString notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getNotebookSharesAsync( QString notebookGuid, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; private: INoteStorePtr m_service; @@ -15252,21 +15296,21 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * checkVersionAsync( QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, qint16 edamVersionMinor = EDAM_VERSION_MINOR, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual BootstrapInfo getBootstrapInfo( QString locale, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getBootstrapInfoAsync( QString locale, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateLongSession( QString username, @@ -15276,7 +15320,7 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateLongSessionAsync( QString username, @@ -15286,99 +15330,99 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore QString deviceIdentifier, QString deviceDescription, bool supportsTwoFactor, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult completeTwoFactorAuthentication( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * completeTwoFactorAuthenticationAsync( QString oneTimeCode, QString deviceIdentifier, QString deviceDescription, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void revokeLongSession( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * revokeLongSessionAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AuthenticationResult authenticateToBusiness( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * authenticateToBusinessAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual User getUser( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getUserAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual PublicUserInfo getPublicUserInfo( QString username, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getPublicUserInfoAsync( QString username, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual UserUrls getUserUrls( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getUserUrlsAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void inviteToBusiness( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * inviteToBusinessAsync( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void removeFromBusiness( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * removeFromBusinessAsync( QString emailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual void updateBusinessUserIdentifier( QString oldEmailAddress, QString newEmailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * updateBusinessUserIdentifierAsync( QString oldEmailAddress, QString newEmailAddress, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listBusinessUsers( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listBusinessUsersAsync( - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual QList listBusinessInvitations( bool includeRequestedInvitations, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * listBusinessInvitationsAsync( bool includeRequestedInvitations, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AccountLimits getAccountLimits( ServiceLevel serviceLevel, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; virtual AsyncResult * getAccountLimitsAsync( ServiceLevel serviceLevel, - IRequestContextPtr ctx = {}) Q_DECL_OVERRIDE; + IRequestContextPtr ctx = {}) override; private: IUserStorePtr m_service; diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index 36f5f707..6041309c 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -21,7 +21,10 @@ namespace qevercloud { /** @cond HIDDEN_SYMBOLS */ -void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode & e) { +void readEnumEDAMErrorCode( + ThriftBinaryBufferReader & r, + EDAMErrorCode & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -57,7 +60,10 @@ void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode & e) { } } -void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason & e) { +void readEnumEDAMInvalidContactReason( + ThriftBinaryBufferReader & r, + EDAMInvalidContactReason & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -68,7 +74,10 @@ void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidC } } -void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel & e) { +void readEnumShareRelationshipPrivilegeLevel( + ThriftBinaryBufferReader & r, + ShareRelationshipPrivilegeLevel & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -80,7 +89,10 @@ void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, Share } } -void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel & e) { +void readEnumPrivilegeLevel( + ThriftBinaryBufferReader & r, + PrivilegeLevel & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -94,7 +106,10 @@ void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel & e) { } } -void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel & e) { +void readEnumServiceLevel( + ThriftBinaryBufferReader & r, + ServiceLevel & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -106,7 +121,10 @@ void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel & e) { } } -void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat & e) { +void readEnumQueryFormat( + ThriftBinaryBufferReader & r, + QueryFormat & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -116,7 +134,10 @@ void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat & e) { } } -void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder & e) { +void readEnumNoteSortOrder( + ThriftBinaryBufferReader & r, + NoteSortOrder & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -129,7 +150,10 @@ void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder & e) { } } -void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus & e) { +void readEnumPremiumOrderStatus( + ThriftBinaryBufferReader & r, + PremiumOrderStatus & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -143,7 +167,10 @@ void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus } } -void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel & e) { +void readEnumSharedNotebookPrivilegeLevel( + ThriftBinaryBufferReader & r, + SharedNotebookPrivilegeLevel & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -157,7 +184,10 @@ void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNo } } -void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel & e) { +void readEnumSharedNotePrivilegeLevel( + ThriftBinaryBufferReader & r, + SharedNotePrivilegeLevel & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -168,7 +198,10 @@ void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePr } } -void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole & e) { +void readEnumSponsoredGroupRole( + ThriftBinaryBufferReader & r, + SponsoredGroupRole & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -179,7 +212,10 @@ void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole } } -void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole & e) { +void readEnumBusinessUserRole( + ThriftBinaryBufferReader & r, + BusinessUserRole & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -189,7 +225,10 @@ void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole & e } } -void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus & e) { +void readEnumBusinessUserStatus( + ThriftBinaryBufferReader & r, + BusinessUserStatus & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -199,7 +238,10 @@ void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus } } -void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions & e) { +void readEnumSharedNotebookInstanceRestrictions( + ThriftBinaryBufferReader & r, + SharedNotebookInstanceRestrictions & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -209,7 +251,10 @@ void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, Sh } } -void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig & e) { +void readEnumReminderEmailConfig( + ThriftBinaryBufferReader & r, + ReminderEmailConfig & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -219,7 +264,10 @@ void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConf } } -void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus & e) { +void readEnumBusinessInvitationStatus( + ThriftBinaryBufferReader & r, + BusinessInvitationStatus & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -230,7 +278,10 @@ void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvi } } -void readEnumContactType(ThriftBinaryBufferReader & r, ContactType & e) { +void readEnumContactType( + ThriftBinaryBufferReader & r, + ContactType & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -244,7 +295,10 @@ void readEnumContactType(ThriftBinaryBufferReader & r, ContactType & e) { } } -void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType & e) { +void readEnumEntityType( + ThriftBinaryBufferReader & r, + EntityType & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -255,7 +309,10 @@ void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType & e) { } } -void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus & e) { +void readEnumRecipientStatus( + ThriftBinaryBufferReader & r, + RecipientStatus & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -266,7 +323,10 @@ void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus & e) } } -void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus & e) { +void readEnumCanMoveToContainerStatus( + ThriftBinaryBufferReader & r, + CanMoveToContainerStatus & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -277,7 +337,10 @@ void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToCon } } -void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType & e) { +void readEnumRelatedContentType( + ThriftBinaryBufferReader & r, + RelatedContentType & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -289,7 +352,10 @@ void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType } } -void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess & e) { +void readEnumRelatedContentAccess( + ThriftBinaryBufferReader & r, + RelatedContentAccess & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -301,7 +367,10 @@ void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAc } } -void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e) { +void readEnumUserIdentityType( + ThriftBinaryBufferReader & r, + UserIdentityType & e) +{ qint32 i; r.readI32(i); switch(i) { @@ -312,7 +381,10 @@ void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e } } -void writeSyncState(ThriftBinaryBufferWriter & w, const SyncState & s) { +void writeSyncState( + ThriftBinaryBufferWriter & w, + const SyncState & s) +{ w.writeStructBegin(QStringLiteral("SyncState")); w.writeFieldBegin( QStringLiteral("currentTime"), @@ -360,7 +432,10 @@ void writeSyncState(ThriftBinaryBufferWriter & w, const SyncState & s) { w.writeStructEnd(); } -void readSyncState(ThriftBinaryBufferReader & r, SyncState & s) { +void readSyncState( + ThriftBinaryBufferReader & r, + SyncState & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -435,96 +510,54 @@ void readSyncState(ThriftBinaryBufferReader & r, SyncState & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.currentTime has no value")); - if(!fullSyncBefore_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.fullSyncBefore has no value")); - if(!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.updateCount has no value")); + if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.currentTime has no value")); + if (!fullSyncBefore_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.fullSyncBefore has no value")); + if (!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.updateCount has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SyncState & value) +void SyncState::print(QTextStream & strm) const { - out << "SyncState: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; - out << " fullSyncBefore = " - << "Timestamp" << "\n"; - out << " updateCount = " - << "qint32" << "\n"; + strm << "SyncState: {\n"; + strm << " currentTime = " + << currentTime << "\n"; + strm << " fullSyncBefore = " + << fullSyncBefore << "\n"; + strm << " updateCount = " + << updateCount << "\n"; - if (value.uploaded.isSet()) { - out << " uploaded = " - << value.uploaded.ref() << "\n"; + if (uploaded.isSet()) { + strm << " uploaded = " + << uploaded.ref() << "\n"; } else { - out << " uploaded is not set\n"; + strm << " uploaded is not set\n"; } - if (value.userLastUpdated.isSet()) { - out << " userLastUpdated = " - << value.userLastUpdated.ref() << "\n"; + if (userLastUpdated.isSet()) { + strm << " userLastUpdated = " + << userLastUpdated.ref() << "\n"; } else { - out << " userLastUpdated is not set\n"; + strm << " userLastUpdated is not set\n"; } - if (value.userMaxMessageEventId.isSet()) { - out << " userMaxMessageEventId = " - << value.userMaxMessageEventId.ref() << "\n"; + if (userMaxMessageEventId.isSet()) { + strm << " userMaxMessageEventId = " + << userMaxMessageEventId.ref() << "\n"; } else { - out << " userMaxMessageEventId is not set\n"; + strm << " userMaxMessageEventId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SyncState & value) +void writeSyncChunk( + ThriftBinaryBufferWriter & w, + const SyncChunk & s) { - out << "SyncState: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; - out << " fullSyncBefore = " - << "Timestamp" << "\n"; - out << " updateCount = " - << "qint32" << "\n"; - - if (value.uploaded.isSet()) { - out << " uploaded = " - << value.uploaded.ref() << "\n"; - } - else { - out << " uploaded is not set\n"; - } - - if (value.userLastUpdated.isSet()) { - out << " userLastUpdated = " - << value.userLastUpdated.ref() << "\n"; - } - else { - out << " userLastUpdated is not set\n"; - } - - if (value.userMaxMessageEventId.isSet()) { - out << " userMaxMessageEventId = " - << value.userMaxMessageEventId.ref() << "\n"; - } - else { - out << " userMaxMessageEventId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeStructBegin(QStringLiteral("SyncChunk")); w.writeFieldBegin( QStringLiteral("currentTime"), @@ -682,7 +715,10 @@ void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s) { w.writeStructEnd(); } -void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { +void readSyncChunk( + ThriftBinaryBufferReader & r, + SyncChunk & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -729,7 +765,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.notes)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.notes)")); + } for(qint32 i = 0; i < size; i++) { Note elem; readNote(r, elem); @@ -748,7 +788,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.notebooks)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.notebooks)")); + } for(qint32 i = 0; i < size; i++) { Notebook elem; readNotebook(r, elem); @@ -767,7 +811,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.tags)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.tags)")); + } for(qint32 i = 0; i < size; i++) { Tag elem; readTag(r, elem); @@ -786,7 +834,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.searches)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.searches)")); + } for(qint32 i = 0; i < size; i++) { SavedSearch elem; readSavedSearch(r, elem); @@ -805,7 +857,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.resources)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.resources)")); + } for(qint32 i = 0; i < size; i++) { Resource elem; readResource(r, elem); @@ -824,7 +880,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.expungedNotes)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.expungedNotes)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -843,7 +903,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.expungedNotebooks)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.expungedNotebooks)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -862,7 +926,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.expungedTags)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.expungedTags)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -881,7 +949,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.expungedSearches)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.expungedSearches)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -900,7 +972,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.linkedNotebooks)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.linkedNotebooks)")); + } for(qint32 i = 0; i < size; i++) { LinkedNotebook elem; readLinkedNotebook(r, elem); @@ -919,7 +995,11 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SyncChunk.expungedLinkedNotebooks)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SyncChunk.expungedLinkedNotebooks)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -937,303 +1017,168 @@ void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.currentTime has no value")); - if(!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.updateCount has no value")); + if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.currentTime has no value")); + if (!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.updateCount has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SyncChunk & value) +void SyncChunk::print(QTextStream & strm) const { - out << "SyncChunk: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; + strm << "SyncChunk: {\n"; + strm << " currentTime = " + << currentTime << "\n"; - if (value.chunkHighUSN.isSet()) { - out << " chunkHighUSN = " - << value.chunkHighUSN.ref() << "\n"; + if (chunkHighUSN.isSet()) { + strm << " chunkHighUSN = " + << chunkHighUSN.ref() << "\n"; } else { - out << " chunkHighUSN is not set\n"; + strm << " chunkHighUSN is not set\n"; } - out << " updateCount = " - << "qint32" << "\n"; + strm << " updateCount = " + << updateCount << "\n"; - if (value.notes.isSet()) { - out << " notes = " + if (notes.isSet()) { + strm << " notes = " << "QList {"; - for(const auto & v: value.notes.ref()) { - out << v; + for(const auto & v: notes.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " notes is not set\n"; + strm << " notes is not set\n"; } - if (value.notebooks.isSet()) { - out << " notebooks = " + if (notebooks.isSet()) { + strm << " notebooks = " << "QList {"; - for(const auto & v: value.notebooks.ref()) { - out << v; + for(const auto & v: notebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " notebooks is not set\n"; + strm << " notebooks is not set\n"; } - if (value.tags.isSet()) { - out << " tags = " + if (tags.isSet()) { + strm << " tags = " << "QList {"; - for(const auto & v: value.tags.ref()) { - out << v; + for(const auto & v: tags.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tags is not set\n"; + strm << " tags is not set\n"; } - if (value.searches.isSet()) { - out << " searches = " + if (searches.isSet()) { + strm << " searches = " << "QList {"; - for(const auto & v: value.searches.ref()) { - out << v; + for(const auto & v: searches.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " searches is not set\n"; + strm << " searches is not set\n"; } - if (value.resources.isSet()) { - out << " resources = " + if (resources.isSet()) { + strm << " resources = " << "QList {"; - for(const auto & v: value.resources.ref()) { - out << v; + for(const auto & v: resources.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " resources is not set\n"; + strm << " resources is not set\n"; } - if (value.expungedNotes.isSet()) { - out << " expungedNotes = " + if (expungedNotes.isSet()) { + strm << " expungedNotes = " << "QList {"; - for(const auto & v: value.expungedNotes.ref()) { - out << v; + for(const auto & v: expungedNotes.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " expungedNotes is not set\n"; + strm << " expungedNotes is not set\n"; } - if (value.expungedNotebooks.isSet()) { - out << " expungedNotebooks = " + if (expungedNotebooks.isSet()) { + strm << " expungedNotebooks = " << "QList {"; - for(const auto & v: value.expungedNotebooks.ref()) { - out << v; + for(const auto & v: expungedNotebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " expungedNotebooks is not set\n"; + strm << " expungedNotebooks is not set\n"; } - if (value.expungedTags.isSet()) { - out << " expungedTags = " + if (expungedTags.isSet()) { + strm << " expungedTags = " << "QList {"; - for(const auto & v: value.expungedTags.ref()) { - out << v; + for(const auto & v: expungedTags.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " expungedTags is not set\n"; + strm << " expungedTags is not set\n"; } - if (value.expungedSearches.isSet()) { - out << " expungedSearches = " + if (expungedSearches.isSet()) { + strm << " expungedSearches = " << "QList {"; - for(const auto & v: value.expungedSearches.ref()) { - out << v; + for(const auto & v: expungedSearches.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " expungedSearches is not set\n"; + strm << " expungedSearches is not set\n"; } - if (value.linkedNotebooks.isSet()) { - out << " linkedNotebooks = " + if (linkedNotebooks.isSet()) { + strm << " linkedNotebooks = " << "QList {"; - for(const auto & v: value.linkedNotebooks.ref()) { - out << v; + for(const auto & v: linkedNotebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " linkedNotebooks is not set\n"; + strm << " linkedNotebooks is not set\n"; } - if (value.expungedLinkedNotebooks.isSet()) { - out << " expungedLinkedNotebooks = " + if (expungedLinkedNotebooks.isSet()) { + strm << " expungedLinkedNotebooks = " << "QList {"; - for(const auto & v: value.expungedLinkedNotebooks.ref()) { - out << v; + for(const auto & v: expungedLinkedNotebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " expungedLinkedNotebooks is not set\n"; + strm << " expungedLinkedNotebooks is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SyncChunk & value) +void writeSyncChunkFilter( + ThriftBinaryBufferWriter & w, + const SyncChunkFilter & s) { - out << "SyncChunk: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; - - if (value.chunkHighUSN.isSet()) { - out << " chunkHighUSN = " - << value.chunkHighUSN.ref() << "\n"; - } - else { - out << " chunkHighUSN is not set\n"; - } - - out << " updateCount = " - << "qint32" << "\n"; - - if (value.notes.isSet()) { - out << " notes = " - << "QList {"; - for(const auto & v: value.notes.ref()) { - out << v; - } - } - else { - out << " notes is not set\n"; - } - - if (value.notebooks.isSet()) { - out << " notebooks = " - << "QList {"; - for(const auto & v: value.notebooks.ref()) { - out << v; - } - } - else { - out << " notebooks is not set\n"; - } - - if (value.tags.isSet()) { - out << " tags = " - << "QList {"; - for(const auto & v: value.tags.ref()) { - out << v; - } - } - else { - out << " tags is not set\n"; - } - - if (value.searches.isSet()) { - out << " searches = " - << "QList {"; - for(const auto & v: value.searches.ref()) { - out << v; - } - } - else { - out << " searches is not set\n"; - } - - if (value.resources.isSet()) { - out << " resources = " - << "QList {"; - for(const auto & v: value.resources.ref()) { - out << v; - } - } - else { - out << " resources is not set\n"; - } - - if (value.expungedNotes.isSet()) { - out << " expungedNotes = " - << "QList {"; - for(const auto & v: value.expungedNotes.ref()) { - out << v; - } - } - else { - out << " expungedNotes is not set\n"; - } - - if (value.expungedNotebooks.isSet()) { - out << " expungedNotebooks = " - << "QList {"; - for(const auto & v: value.expungedNotebooks.ref()) { - out << v; - } - } - else { - out << " expungedNotebooks is not set\n"; - } - - if (value.expungedTags.isSet()) { - out << " expungedTags = " - << "QList {"; - for(const auto & v: value.expungedTags.ref()) { - out << v; - } - } - else { - out << " expungedTags is not set\n"; - } - - if (value.expungedSearches.isSet()) { - out << " expungedSearches = " - << "QList {"; - for(const auto & v: value.expungedSearches.ref()) { - out << v; - } - } - else { - out << " expungedSearches is not set\n"; - } - - if (value.linkedNotebooks.isSet()) { - out << " linkedNotebooks = " - << "QList {"; - for(const auto & v: value.linkedNotebooks.ref()) { - out << v; - } - } - else { - out << " linkedNotebooks is not set\n"; - } - - if (value.expungedLinkedNotebooks.isSet()) { - out << " expungedLinkedNotebooks = " - << "QList {"; - for(const auto & v: value.expungedLinkedNotebooks.ref()) { - out << v; - } - } - else { - out << " expungedLinkedNotebooks is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & s) { w.writeStructBegin(QStringLiteral("SyncChunkFilter")); if (s.includeNotes.isSet()) { w.writeFieldBegin( @@ -1371,7 +1316,10 @@ void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & w.writeStructEnd(); } -void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { +void readSyncChunkFilter( + ThriftBinaryBufferReader & r, + SyncChunkFilter & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -1542,293 +1490,151 @@ void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SyncChunkFilter & value) +void SyncChunkFilter::print(QTextStream & strm) const { - out << "SyncChunkFilter: {\n"; + strm << "SyncChunkFilter: {\n"; - if (value.includeNotes.isSet()) { - out << " includeNotes = " - << value.includeNotes.ref() << "\n"; + if (includeNotes.isSet()) { + strm << " includeNotes = " + << includeNotes.ref() << "\n"; } else { - out << " includeNotes is not set\n"; + strm << " includeNotes is not set\n"; } - if (value.includeNoteResources.isSet()) { - out << " includeNoteResources = " - << value.includeNoteResources.ref() << "\n"; + if (includeNoteResources.isSet()) { + strm << " includeNoteResources = " + << includeNoteResources.ref() << "\n"; } else { - out << " includeNoteResources is not set\n"; + strm << " includeNoteResources is not set\n"; } - if (value.includeNoteAttributes.isSet()) { - out << " includeNoteAttributes = " - << value.includeNoteAttributes.ref() << "\n"; + if (includeNoteAttributes.isSet()) { + strm << " includeNoteAttributes = " + << includeNoteAttributes.ref() << "\n"; } else { - out << " includeNoteAttributes is not set\n"; + strm << " includeNoteAttributes is not set\n"; } - if (value.includeNotebooks.isSet()) { - out << " includeNotebooks = " - << value.includeNotebooks.ref() << "\n"; + if (includeNotebooks.isSet()) { + strm << " includeNotebooks = " + << includeNotebooks.ref() << "\n"; } else { - out << " includeNotebooks is not set\n"; + strm << " includeNotebooks is not set\n"; } - if (value.includeTags.isSet()) { - out << " includeTags = " - << value.includeTags.ref() << "\n"; + if (includeTags.isSet()) { + strm << " includeTags = " + << includeTags.ref() << "\n"; } else { - out << " includeTags is not set\n"; + strm << " includeTags is not set\n"; } - if (value.includeSearches.isSet()) { - out << " includeSearches = " - << value.includeSearches.ref() << "\n"; + if (includeSearches.isSet()) { + strm << " includeSearches = " + << includeSearches.ref() << "\n"; } else { - out << " includeSearches is not set\n"; + strm << " includeSearches is not set\n"; } - if (value.includeResources.isSet()) { - out << " includeResources = " - << value.includeResources.ref() << "\n"; + if (includeResources.isSet()) { + strm << " includeResources = " + << includeResources.ref() << "\n"; } else { - out << " includeResources is not set\n"; + strm << " includeResources is not set\n"; } - if (value.includeLinkedNotebooks.isSet()) { - out << " includeLinkedNotebooks = " - << value.includeLinkedNotebooks.ref() << "\n"; + if (includeLinkedNotebooks.isSet()) { + strm << " includeLinkedNotebooks = " + << includeLinkedNotebooks.ref() << "\n"; } else { - out << " includeLinkedNotebooks is not set\n"; + strm << " includeLinkedNotebooks is not set\n"; } - if (value.includeExpunged.isSet()) { - out << " includeExpunged = " - << value.includeExpunged.ref() << "\n"; + if (includeExpunged.isSet()) { + strm << " includeExpunged = " + << includeExpunged.ref() << "\n"; } else { - out << " includeExpunged is not set\n"; + strm << " includeExpunged is not set\n"; } - if (value.includeNoteApplicationDataFullMap.isSet()) { - out << " includeNoteApplicationDataFullMap = " - << value.includeNoteApplicationDataFullMap.ref() << "\n"; + if (includeNoteApplicationDataFullMap.isSet()) { + strm << " includeNoteApplicationDataFullMap = " + << includeNoteApplicationDataFullMap.ref() << "\n"; } else { - out << " includeNoteApplicationDataFullMap is not set\n"; + strm << " includeNoteApplicationDataFullMap is not set\n"; } - if (value.includeResourceApplicationDataFullMap.isSet()) { - out << " includeResourceApplicationDataFullMap = " - << value.includeResourceApplicationDataFullMap.ref() << "\n"; + if (includeResourceApplicationDataFullMap.isSet()) { + strm << " includeResourceApplicationDataFullMap = " + << includeResourceApplicationDataFullMap.ref() << "\n"; } else { - out << " includeResourceApplicationDataFullMap is not set\n"; + strm << " includeResourceApplicationDataFullMap is not set\n"; } - if (value.includeNoteResourceApplicationDataFullMap.isSet()) { - out << " includeNoteResourceApplicationDataFullMap = " - << value.includeNoteResourceApplicationDataFullMap.ref() << "\n"; + if (includeNoteResourceApplicationDataFullMap.isSet()) { + strm << " includeNoteResourceApplicationDataFullMap = " + << includeNoteResourceApplicationDataFullMap.ref() << "\n"; } else { - out << " includeNoteResourceApplicationDataFullMap is not set\n"; + strm << " includeNoteResourceApplicationDataFullMap is not set\n"; } - if (value.includeSharedNotes.isSet()) { - out << " includeSharedNotes = " - << value.includeSharedNotes.ref() << "\n"; + if (includeSharedNotes.isSet()) { + strm << " includeSharedNotes = " + << includeSharedNotes.ref() << "\n"; } else { - out << " includeSharedNotes is not set\n"; + strm << " includeSharedNotes is not set\n"; } - if (value.omitSharedNotebooks.isSet()) { - out << " omitSharedNotebooks = " - << value.omitSharedNotebooks.ref() << "\n"; + if (omitSharedNotebooks.isSet()) { + strm << " omitSharedNotebooks = " + << omitSharedNotebooks.ref() << "\n"; } else { - out << " omitSharedNotebooks is not set\n"; + strm << " omitSharedNotebooks is not set\n"; } - if (value.requireNoteContentClass.isSet()) { - out << " requireNoteContentClass = " - << value.requireNoteContentClass.ref() << "\n"; + if (requireNoteContentClass.isSet()) { + strm << " requireNoteContentClass = " + << requireNoteContentClass.ref() << "\n"; } else { - out << " requireNoteContentClass is not set\n"; + strm << " requireNoteContentClass is not set\n"; } - if (value.notebookGuids.isSet()) { - out << " notebookGuids = " + if (notebookGuids.isSet()) { + strm << " notebookGuids = " << "QSet {"; - for(const auto & v: value.notebookGuids.ref()) { - out << v; + for(const auto & v: notebookGuids.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " notebookGuids is not set\n"; + strm << " notebookGuids is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SyncChunkFilter & value) +void writeNoteFilter( + ThriftBinaryBufferWriter & w, + const NoteFilter & s) { - out << "SyncChunkFilter: {\n"; - - if (value.includeNotes.isSet()) { - out << " includeNotes = " - << value.includeNotes.ref() << "\n"; - } - else { - out << " includeNotes is not set\n"; - } - - if (value.includeNoteResources.isSet()) { - out << " includeNoteResources = " - << value.includeNoteResources.ref() << "\n"; - } - else { - out << " includeNoteResources is not set\n"; - } - - if (value.includeNoteAttributes.isSet()) { - out << " includeNoteAttributes = " - << value.includeNoteAttributes.ref() << "\n"; - } - else { - out << " includeNoteAttributes is not set\n"; - } - - if (value.includeNotebooks.isSet()) { - out << " includeNotebooks = " - << value.includeNotebooks.ref() << "\n"; - } - else { - out << " includeNotebooks is not set\n"; - } - - if (value.includeTags.isSet()) { - out << " includeTags = " - << value.includeTags.ref() << "\n"; - } - else { - out << " includeTags is not set\n"; - } - - if (value.includeSearches.isSet()) { - out << " includeSearches = " - << value.includeSearches.ref() << "\n"; - } - else { - out << " includeSearches is not set\n"; - } - - if (value.includeResources.isSet()) { - out << " includeResources = " - << value.includeResources.ref() << "\n"; - } - else { - out << " includeResources is not set\n"; - } - - if (value.includeLinkedNotebooks.isSet()) { - out << " includeLinkedNotebooks = " - << value.includeLinkedNotebooks.ref() << "\n"; - } - else { - out << " includeLinkedNotebooks is not set\n"; - } - - if (value.includeExpunged.isSet()) { - out << " includeExpunged = " - << value.includeExpunged.ref() << "\n"; - } - else { - out << " includeExpunged is not set\n"; - } - - if (value.includeNoteApplicationDataFullMap.isSet()) { - out << " includeNoteApplicationDataFullMap = " - << value.includeNoteApplicationDataFullMap.ref() << "\n"; - } - else { - out << " includeNoteApplicationDataFullMap is not set\n"; - } - - if (value.includeResourceApplicationDataFullMap.isSet()) { - out << " includeResourceApplicationDataFullMap = " - << value.includeResourceApplicationDataFullMap.ref() << "\n"; - } - else { - out << " includeResourceApplicationDataFullMap is not set\n"; - } - - if (value.includeNoteResourceApplicationDataFullMap.isSet()) { - out << " includeNoteResourceApplicationDataFullMap = " - << value.includeNoteResourceApplicationDataFullMap.ref() << "\n"; - } - else { - out << " includeNoteResourceApplicationDataFullMap is not set\n"; - } - - if (value.includeSharedNotes.isSet()) { - out << " includeSharedNotes = " - << value.includeSharedNotes.ref() << "\n"; - } - else { - out << " includeSharedNotes is not set\n"; - } - - if (value.omitSharedNotebooks.isSet()) { - out << " omitSharedNotebooks = " - << value.omitSharedNotebooks.ref() << "\n"; - } - else { - out << " omitSharedNotebooks is not set\n"; - } - - if (value.requireNoteContentClass.isSet()) { - out << " requireNoteContentClass = " - << value.requireNoteContentClass.ref() << "\n"; - } - else { - out << " requireNoteContentClass is not set\n"; - } - - if (value.notebookGuids.isSet()) { - out << " notebookGuids = " - << "QSet {"; - for(const auto & v: value.notebookGuids.ref()) { - out << v; - } - } - else { - out << " notebookGuids is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeStructBegin(QStringLiteral("NoteFilter")); if (s.order.isSet()) { w.writeFieldBegin( @@ -1942,7 +1748,10 @@ void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s) { w.writeStructEnd(); } -void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { +void readNoteFilter( + ThriftBinaryBufferReader & r, + NoteFilter & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -1994,7 +1803,11 @@ void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteFilter.tagGuids)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteFilter.tagGuids)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -2086,279 +1899,161 @@ void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteFilter & value) +void NoteFilter::print(QTextStream & strm) const { - out << "NoteFilter: {\n"; + strm << "NoteFilter: {\n"; - if (value.order.isSet()) { - out << " order = " - << value.order.ref() << "\n"; + if (order.isSet()) { + strm << " order = " + << order.ref() << "\n"; } else { - out << " order is not set\n"; + strm << " order is not set\n"; } - if (value.ascending.isSet()) { - out << " ascending = " - << value.ascending.ref() << "\n"; + if (ascending.isSet()) { + strm << " ascending = " + << ascending.ref() << "\n"; } else { - out << " ascending is not set\n"; + strm << " ascending is not set\n"; } - if (value.words.isSet()) { - out << " words = " - << value.words.ref() << "\n"; + if (words.isSet()) { + strm << " words = " + << words.ref() << "\n"; } else { - out << " words is not set\n"; + strm << " words is not set\n"; } - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.tagGuids.isSet()) { - out << " tagGuids = " + if (tagGuids.isSet()) { + strm << " tagGuids = " << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; + for(const auto & v: tagGuids.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tagGuids is not set\n"; + strm << " tagGuids is not set\n"; } - if (value.timeZone.isSet()) { - out << " timeZone = " - << value.timeZone.ref() << "\n"; + if (timeZone.isSet()) { + strm << " timeZone = " + << timeZone.ref() << "\n"; } else { - out << " timeZone is not set\n"; + strm << " timeZone is not set\n"; } - if (value.inactive.isSet()) { - out << " inactive = " - << value.inactive.ref() << "\n"; + if (inactive.isSet()) { + strm << " inactive = " + << inactive.ref() << "\n"; } else { - out << " inactive is not set\n"; + strm << " inactive is not set\n"; } - if (value.emphasized.isSet()) { - out << " emphasized = " - << value.emphasized.ref() << "\n"; + if (emphasized.isSet()) { + strm << " emphasized = " + << emphasized.ref() << "\n"; } else { - out << " emphasized is not set\n"; + strm << " emphasized is not set\n"; } - if (value.includeAllReadableNotebooks.isSet()) { - out << " includeAllReadableNotebooks = " - << value.includeAllReadableNotebooks.ref() << "\n"; + if (includeAllReadableNotebooks.isSet()) { + strm << " includeAllReadableNotebooks = " + << includeAllReadableNotebooks.ref() << "\n"; } else { - out << " includeAllReadableNotebooks is not set\n"; + strm << " includeAllReadableNotebooks is not set\n"; } - if (value.includeAllReadableWorkspaces.isSet()) { - out << " includeAllReadableWorkspaces = " - << value.includeAllReadableWorkspaces.ref() << "\n"; + if (includeAllReadableWorkspaces.isSet()) { + strm << " includeAllReadableWorkspaces = " + << includeAllReadableWorkspaces.ref() << "\n"; } else { - out << " includeAllReadableWorkspaces is not set\n"; + strm << " includeAllReadableWorkspaces is not set\n"; } - if (value.context.isSet()) { - out << " context = " - << value.context.ref() << "\n"; + if (context.isSet()) { + strm << " context = " + << context.ref() << "\n"; } else { - out << " context is not set\n"; + strm << " context is not set\n"; } - if (value.rawWords.isSet()) { - out << " rawWords = " - << value.rawWords.ref() << "\n"; + if (rawWords.isSet()) { + strm << " rawWords = " + << rawWords.ref() << "\n"; } else { - out << " rawWords is not set\n"; + strm << " rawWords is not set\n"; } - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; + if (searchContextBytes.isSet()) { + strm << " searchContextBytes = " + << searchContextBytes.ref() << "\n"; } else { - out << " searchContextBytes is not set\n"; + strm << " searchContextBytes is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteFilter & value) +void writeNoteList( + ThriftBinaryBufferWriter & w, + const NoteList & s) { - out << "NoteFilter: {\n"; - - if (value.order.isSet()) { - out << " order = " - << value.order.ref() << "\n"; - } - else { - out << " order is not set\n"; - } - - if (value.ascending.isSet()) { - out << " ascending = " - << value.ascending.ref() << "\n"; - } - else { - out << " ascending is not set\n"; - } - - if (value.words.isSet()) { - out << " words = " - << value.words.ref() << "\n"; + w.writeStructBegin(QStringLiteral("NoteList")); + w.writeFieldBegin( + QStringLiteral("startIndex"), + ThriftFieldType::T_I32, + 1); + w.writeI32(s.startIndex); + w.writeFieldEnd(); + w.writeFieldBegin( + QStringLiteral("totalNotes"), + ThriftFieldType::T_I32, + 2); + w.writeI32(s.totalNotes); + w.writeFieldEnd(); + w.writeFieldBegin( + QStringLiteral("notes"), + ThriftFieldType::T_LIST, + 3); + w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); + for(const auto & value: qAsConst(s.notes)) { + writeNote(w, value); } - else { - out << " words is not set\n"; - } - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; - } - else { - out << " notebookGuid is not set\n"; - } - - if (value.tagGuids.isSet()) { - out << " tagGuids = " - << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; - } - } - else { - out << " tagGuids is not set\n"; - } - - if (value.timeZone.isSet()) { - out << " timeZone = " - << value.timeZone.ref() << "\n"; - } - else { - out << " timeZone is not set\n"; - } - - if (value.inactive.isSet()) { - out << " inactive = " - << value.inactive.ref() << "\n"; - } - else { - out << " inactive is not set\n"; - } - - if (value.emphasized.isSet()) { - out << " emphasized = " - << value.emphasized.ref() << "\n"; - } - else { - out << " emphasized is not set\n"; - } - - if (value.includeAllReadableNotebooks.isSet()) { - out << " includeAllReadableNotebooks = " - << value.includeAllReadableNotebooks.ref() << "\n"; - } - else { - out << " includeAllReadableNotebooks is not set\n"; - } - - if (value.includeAllReadableWorkspaces.isSet()) { - out << " includeAllReadableWorkspaces = " - << value.includeAllReadableWorkspaces.ref() << "\n"; - } - else { - out << " includeAllReadableWorkspaces is not set\n"; - } - - if (value.context.isSet()) { - out << " context = " - << value.context.ref() << "\n"; - } - else { - out << " context is not set\n"; - } - - if (value.rawWords.isSet()) { - out << " rawWords = " - << value.rawWords.ref() << "\n"; - } - else { - out << " rawWords is not set\n"; - } - - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; - } - else { - out << " searchContextBytes is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { - w.writeStructBegin(QStringLiteral("NoteList")); - w.writeFieldBegin( - QStringLiteral("startIndex"), - ThriftFieldType::T_I32, - 1); - w.writeI32(s.startIndex); - w.writeFieldEnd(); - w.writeFieldBegin( - QStringLiteral("totalNotes"), - ThriftFieldType::T_I32, - 2); - w.writeI32(s.totalNotes); - w.writeFieldEnd(); - w.writeFieldBegin( - QStringLiteral("notes"), - ThriftFieldType::T_LIST, - 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); - for(const auto & value: qAsConst(s.notes)) { - writeNote(w, value); - } - w.writeListEnd(); - w.writeFieldEnd(); - if (s.stoppedWords.isSet()) { - w.writeFieldBegin( - QStringLiteral("stoppedWords"), - ThriftFieldType::T_LIST, - 4); - w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); - for(const auto & value: qAsConst(s.stoppedWords.ref())) { - w.writeString(value); - } - w.writeListEnd(); - w.writeFieldEnd(); + w.writeListEnd(); + w.writeFieldEnd(); + if (s.stoppedWords.isSet()) { + w.writeFieldBegin( + QStringLiteral("stoppedWords"), + ThriftFieldType::T_LIST, + 4); + w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); + for(const auto & value: qAsConst(s.stoppedWords.ref())) { + w.writeString(value); + } + w.writeListEnd(); + w.writeFieldEnd(); } if (s.searchedWords.isSet()) { w.writeFieldBegin( @@ -2400,7 +2095,10 @@ void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s) { w.writeStructEnd(); } -void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { +void readNoteList( + ThriftBinaryBufferReader & r, + NoteList & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -2440,7 +2138,11 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteList.notes)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteList.notes)")); + } for(qint32 i = 0; i < size; i++) { Note elem; readNote(r, elem); @@ -2459,7 +2161,11 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteList.stoppedWords)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteList.stoppedWords)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -2478,7 +2184,11 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteList.searchedWords)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteList.searchedWords)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -2523,140 +2233,82 @@ void readNoteList(ThriftBinaryBufferReader & r, NoteList & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.startIndex has no value")); - if(!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.totalNotes has no value")); - if(!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.notes has no value")); + if (!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.startIndex has no value")); + if (!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.totalNotes has no value")); + if (!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.notes has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteList & value) +void NoteList::print(QTextStream & strm) const { - out << "NoteList: {\n"; - out << " startIndex = " - << "qint32" << "\n"; - out << " totalNotes = " - << "qint32" << "\n"; - out << " notes = " - << "QList" << "\n"; - - if (value.stoppedWords.isSet()) { - out << " stoppedWords = " + strm << "NoteList: {\n"; + strm << " startIndex = " + << startIndex << "\n"; + strm << " totalNotes = " + << totalNotes << "\n"; + strm << " notes = " + << "QList {"; + for(const auto & v: notes) { + strm << " " << v << "\n"; + } + strm << "}\n"; + + if (stoppedWords.isSet()) { + strm << " stoppedWords = " << "QList {"; - for(const auto & v: value.stoppedWords.ref()) { - out << v; + for(const auto & v: stoppedWords.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " stoppedWords is not set\n"; + strm << " stoppedWords is not set\n"; } - if (value.searchedWords.isSet()) { - out << " searchedWords = " + if (searchedWords.isSet()) { + strm << " searchedWords = " << "QList {"; - for(const auto & v: value.searchedWords.ref()) { - out << v; + for(const auto & v: searchedWords.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " searchedWords is not set\n"; + strm << " searchedWords is not set\n"; } - if (value.updateCount.isSet()) { - out << " updateCount = " - << value.updateCount.ref() << "\n"; + if (updateCount.isSet()) { + strm << " updateCount = " + << updateCount.ref() << "\n"; } else { - out << " updateCount is not set\n"; + strm << " updateCount is not set\n"; } - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; + if (searchContextBytes.isSet()) { + strm << " searchContextBytes = " + << searchContextBytes.ref() << "\n"; } else { - out << " searchContextBytes is not set\n"; + strm << " searchContextBytes is not set\n"; } - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; + if (debugInfo.isSet()) { + strm << " debugInfo = " + << debugInfo.ref() << "\n"; } else { - out << " debugInfo is not set\n"; + strm << " debugInfo is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteList & value) +void writeNoteMetadata( + ThriftBinaryBufferWriter & w, + const NoteMetadata & s) { - out << "NoteList: {\n"; - out << " startIndex = " - << "qint32" << "\n"; - out << " totalNotes = " - << "qint32" << "\n"; - out << " notes = " - << "QList" << "\n"; - - if (value.stoppedWords.isSet()) { - out << " stoppedWords = " - << "QList {"; - for(const auto & v: value.stoppedWords.ref()) { - out << v; - } - } - else { - out << " stoppedWords is not set\n"; - } - - if (value.searchedWords.isSet()) { - out << " searchedWords = " - << "QList {"; - for(const auto & v: value.searchedWords.ref()) { - out << v; - } - } - else { - out << " searchedWords is not set\n"; - } - - if (value.updateCount.isSet()) { - out << " updateCount = " - << value.updateCount.ref() << "\n"; - } - else { - out << " updateCount is not set\n"; - } - - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; - } - else { - out << " searchContextBytes is not set\n"; - } - - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; - } - else { - out << " debugInfo is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeStructBegin(QStringLiteral("NoteMetadata")); w.writeFieldBegin( QStringLiteral("guid"), @@ -2760,7 +2412,10 @@ void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s) { w.writeStructEnd(); } -void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { +void readNoteMetadata( + ThriftBinaryBufferReader & r, + NoteMetadata & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -2850,7 +2505,11 @@ void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteMetadata.tagGuids)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteMetadata.tagGuids)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -2895,220 +2554,116 @@ void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!guid_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteMetadata.guid has no value")); + if (!guid_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteMetadata.guid has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteMetadata & value) +void NoteMetadata::print(QTextStream & strm) const { - out << "NoteMetadata: {\n"; - out << " guid = " - << "Guid" << "\n"; + strm << "NoteMetadata: {\n"; + strm << " guid = " + << guid << "\n"; - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; + if (title.isSet()) { + strm << " title = " + << title.ref() << "\n"; } else { - out << " title is not set\n"; + strm << " title is not set\n"; } - if (value.contentLength.isSet()) { - out << " contentLength = " - << value.contentLength.ref() << "\n"; + if (contentLength.isSet()) { + strm << " contentLength = " + << contentLength.ref() << "\n"; } else { - out << " contentLength is not set\n"; + strm << " contentLength is not set\n"; } - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; + if (created.isSet()) { + strm << " created = " + << created.ref() << "\n"; } else { - out << " created is not set\n"; + strm << " created is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; + if (deleted.isSet()) { + strm << " deleted = " + << deleted.ref() << "\n"; } else { - out << " deleted is not set\n"; + strm << " deleted is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.tagGuids.isSet()) { - out << " tagGuids = " + if (tagGuids.isSet()) { + strm << " tagGuids = " << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; + for(const auto & v: tagGuids.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tagGuids is not set\n"; + strm << " tagGuids is not set\n"; } - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; + if (attributes.isSet()) { + strm << " attributes = " + << attributes.ref() << "\n"; } else { - out << " attributes is not set\n"; + strm << " attributes is not set\n"; } - if (value.largestResourceMime.isSet()) { - out << " largestResourceMime = " - << value.largestResourceMime.ref() << "\n"; + if (largestResourceMime.isSet()) { + strm << " largestResourceMime = " + << largestResourceMime.ref() << "\n"; } else { - out << " largestResourceMime is not set\n"; + strm << " largestResourceMime is not set\n"; } - if (value.largestResourceSize.isSet()) { - out << " largestResourceSize = " - << value.largestResourceSize.ref() << "\n"; + if (largestResourceSize.isSet()) { + strm << " largestResourceSize = " + << largestResourceSize.ref() << "\n"; } else { - out << " largestResourceSize is not set\n"; + strm << " largestResourceSize is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteMetadata & value) +void writeNotesMetadataList( + ThriftBinaryBufferWriter & w, + const NotesMetadataList & s) { - out << "NoteMetadata: {\n"; - out << " guid = " - << "Guid" << "\n"; - - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; - } - else { - out << " title is not set\n"; - } - - if (value.contentLength.isSet()) { - out << " contentLength = " - << value.contentLength.ref() << "\n"; - } - else { - out << " contentLength is not set\n"; - } - - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; - } - else { - out << " created is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; - } - else { - out << " deleted is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; - } - else { - out << " notebookGuid is not set\n"; - } - - if (value.tagGuids.isSet()) { - out << " tagGuids = " - << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; - } - } - else { - out << " tagGuids is not set\n"; - } - - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; - } - else { - out << " attributes is not set\n"; - } - - if (value.largestResourceMime.isSet()) { - out << " largestResourceMime = " - << value.largestResourceMime.ref() << "\n"; - } - else { - out << " largestResourceMime is not set\n"; - } - - if (value.largestResourceSize.isSet()) { - out << " largestResourceSize = " - << value.largestResourceSize.ref() << "\n"; - } - else { - out << " largestResourceSize is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataList & s) { w.writeStructBegin(QStringLiteral("NotesMetadataList")); w.writeFieldBegin( QStringLiteral("startIndex"), @@ -3184,7 +2739,10 @@ void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataLis w.writeStructEnd(); } -void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) { +void readNotesMetadataList( + ThriftBinaryBufferReader & r, + NotesMetadataList & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -3224,7 +2782,11 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NotesMetadataList.notes)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NotesMetadataList.notes)")); + } for(qint32 i = 0; i < size; i++) { NoteMetadata elem; readNoteMetadata(r, elem); @@ -3243,7 +2805,11 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NotesMetadataList.stoppedWords)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NotesMetadataList.stoppedWords)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -3262,7 +2828,11 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NotesMetadataList.searchedWords)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NotesMetadataList.searchedWords)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -3307,140 +2877,82 @@ void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s) r.readFieldEnd(); } r.readStructEnd(); - if(!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.startIndex has no value")); - if(!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.totalNotes has no value")); - if(!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.notes has no value")); + if (!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.startIndex has no value")); + if (!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.totalNotes has no value")); + if (!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.notes has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotesMetadataList & value) +void NotesMetadataList::print(QTextStream & strm) const { - out << "NotesMetadataList: {\n"; - out << " startIndex = " - << "qint32" << "\n"; - out << " totalNotes = " - << "qint32" << "\n"; - out << " notes = " - << "QList" << "\n"; - - if (value.stoppedWords.isSet()) { - out << " stoppedWords = " + strm << "NotesMetadataList: {\n"; + strm << " startIndex = " + << startIndex << "\n"; + strm << " totalNotes = " + << totalNotes << "\n"; + strm << " notes = " + << "QList {"; + for(const auto & v: notes) { + strm << " " << v << "\n"; + } + strm << "}\n"; + + if (stoppedWords.isSet()) { + strm << " stoppedWords = " << "QList {"; - for(const auto & v: value.stoppedWords.ref()) { - out << v; + for(const auto & v: stoppedWords.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " stoppedWords is not set\n"; + strm << " stoppedWords is not set\n"; } - if (value.searchedWords.isSet()) { - out << " searchedWords = " + if (searchedWords.isSet()) { + strm << " searchedWords = " << "QList {"; - for(const auto & v: value.searchedWords.ref()) { - out << v; + for(const auto & v: searchedWords.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " searchedWords is not set\n"; + strm << " searchedWords is not set\n"; } - if (value.updateCount.isSet()) { - out << " updateCount = " - << value.updateCount.ref() << "\n"; + if (updateCount.isSet()) { + strm << " updateCount = " + << updateCount.ref() << "\n"; } else { - out << " updateCount is not set\n"; + strm << " updateCount is not set\n"; } - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; + if (searchContextBytes.isSet()) { + strm << " searchContextBytes = " + << searchContextBytes.ref() << "\n"; } else { - out << " searchContextBytes is not set\n"; + strm << " searchContextBytes is not set\n"; } - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; + if (debugInfo.isSet()) { + strm << " debugInfo = " + << debugInfo.ref() << "\n"; } else { - out << " debugInfo is not set\n"; + strm << " debugInfo is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotesMetadataList & value) +void writeNotesMetadataResultSpec( + ThriftBinaryBufferWriter & w, + const NotesMetadataResultSpec & s) { - out << "NotesMetadataList: {\n"; - out << " startIndex = " - << "qint32" << "\n"; - out << " totalNotes = " - << "qint32" << "\n"; - out << " notes = " - << "QList" << "\n"; - - if (value.stoppedWords.isSet()) { - out << " stoppedWords = " - << "QList {"; - for(const auto & v: value.stoppedWords.ref()) { - out << v; - } - } - else { - out << " stoppedWords is not set\n"; - } - - if (value.searchedWords.isSet()) { - out << " searchedWords = " - << "QList {"; - for(const auto & v: value.searchedWords.ref()) { - out << v; - } - } - else { - out << " searchedWords is not set\n"; - } - - if (value.updateCount.isSet()) { - out << " updateCount = " - << value.updateCount.ref() << "\n"; - } - else { - out << " updateCount is not set\n"; - } - - if (value.searchContextBytes.isSet()) { - out << " searchContextBytes = " - << value.searchContextBytes.ref() << "\n"; - } - else { - out << " searchContextBytes is not set\n"; - } - - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; - } - else { - out << " debugInfo is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s) { w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); if (s.includeTitle.isSet()) { w.writeFieldBegin( @@ -3534,7 +3046,10 @@ void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetad w.writeStructEnd(); } -void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResultSpec & s) { +void readNotesMetadataResultSpec( + ThriftBinaryBufferReader & r, + NotesMetadataResultSpec & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -3650,247 +3165,150 @@ void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResu r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotesMetadataResultSpec & value) +void NotesMetadataResultSpec::print(QTextStream & strm) const { - out << "NotesMetadataResultSpec: {\n"; + strm << "NotesMetadataResultSpec: {\n"; - if (value.includeTitle.isSet()) { - out << " includeTitle = " - << value.includeTitle.ref() << "\n"; + if (includeTitle.isSet()) { + strm << " includeTitle = " + << includeTitle.ref() << "\n"; } else { - out << " includeTitle is not set\n"; + strm << " includeTitle is not set\n"; } - if (value.includeContentLength.isSet()) { - out << " includeContentLength = " - << value.includeContentLength.ref() << "\n"; + if (includeContentLength.isSet()) { + strm << " includeContentLength = " + << includeContentLength.ref() << "\n"; } else { - out << " includeContentLength is not set\n"; + strm << " includeContentLength is not set\n"; } - if (value.includeCreated.isSet()) { - out << " includeCreated = " - << value.includeCreated.ref() << "\n"; + if (includeCreated.isSet()) { + strm << " includeCreated = " + << includeCreated.ref() << "\n"; } else { - out << " includeCreated is not set\n"; + strm << " includeCreated is not set\n"; } - if (value.includeUpdated.isSet()) { - out << " includeUpdated = " - << value.includeUpdated.ref() << "\n"; + if (includeUpdated.isSet()) { + strm << " includeUpdated = " + << includeUpdated.ref() << "\n"; } else { - out << " includeUpdated is not set\n"; + strm << " includeUpdated is not set\n"; } - if (value.includeDeleted.isSet()) { - out << " includeDeleted = " - << value.includeDeleted.ref() << "\n"; + if (includeDeleted.isSet()) { + strm << " includeDeleted = " + << includeDeleted.ref() << "\n"; } else { - out << " includeDeleted is not set\n"; + strm << " includeDeleted is not set\n"; } - if (value.includeUpdateSequenceNum.isSet()) { - out << " includeUpdateSequenceNum = " - << value.includeUpdateSequenceNum.ref() << "\n"; + if (includeUpdateSequenceNum.isSet()) { + strm << " includeUpdateSequenceNum = " + << includeUpdateSequenceNum.ref() << "\n"; } else { - out << " includeUpdateSequenceNum is not set\n"; + strm << " includeUpdateSequenceNum is not set\n"; } - if (value.includeNotebookGuid.isSet()) { - out << " includeNotebookGuid = " - << value.includeNotebookGuid.ref() << "\n"; + if (includeNotebookGuid.isSet()) { + strm << " includeNotebookGuid = " + << includeNotebookGuid.ref() << "\n"; } else { - out << " includeNotebookGuid is not set\n"; + strm << " includeNotebookGuid is not set\n"; } - if (value.includeTagGuids.isSet()) { - out << " includeTagGuids = " - << value.includeTagGuids.ref() << "\n"; + if (includeTagGuids.isSet()) { + strm << " includeTagGuids = " + << includeTagGuids.ref() << "\n"; } else { - out << " includeTagGuids is not set\n"; + strm << " includeTagGuids is not set\n"; } - if (value.includeAttributes.isSet()) { - out << " includeAttributes = " - << value.includeAttributes.ref() << "\n"; + if (includeAttributes.isSet()) { + strm << " includeAttributes = " + << includeAttributes.ref() << "\n"; } else { - out << " includeAttributes is not set\n"; + strm << " includeAttributes is not set\n"; } - if (value.includeLargestResourceMime.isSet()) { - out << " includeLargestResourceMime = " - << value.includeLargestResourceMime.ref() << "\n"; + if (includeLargestResourceMime.isSet()) { + strm << " includeLargestResourceMime = " + << includeLargestResourceMime.ref() << "\n"; } else { - out << " includeLargestResourceMime is not set\n"; + strm << " includeLargestResourceMime is not set\n"; } - if (value.includeLargestResourceSize.isSet()) { - out << " includeLargestResourceSize = " - << value.includeLargestResourceSize.ref() << "\n"; + if (includeLargestResourceSize.isSet()) { + strm << " includeLargestResourceSize = " + << includeLargestResourceSize.ref() << "\n"; } else { - out << " includeLargestResourceSize is not set\n"; + strm << " includeLargestResourceSize is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotesMetadataResultSpec & value) +void writeNoteCollectionCounts( + ThriftBinaryBufferWriter & w, + const NoteCollectionCounts & s) { - out << "NotesMetadataResultSpec: {\n"; - - if (value.includeTitle.isSet()) { - out << " includeTitle = " - << value.includeTitle.ref() << "\n"; - } - else { - out << " includeTitle is not set\n"; - } - - if (value.includeContentLength.isSet()) { - out << " includeContentLength = " - << value.includeContentLength.ref() << "\n"; - } - else { - out << " includeContentLength is not set\n"; + w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); + if (s.notebookCounts.isSet()) { + w.writeFieldBegin( + QStringLiteral("notebookCounts"), + ThriftFieldType::T_MAP, + 1); + w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); + for(const auto & it: toRange(s.notebookCounts.ref())) { + w.writeString(it.key()); + w.writeI32(it.value()); + } + w.writeMapEnd(); + w.writeFieldEnd(); } - - if (value.includeCreated.isSet()) { - out << " includeCreated = " - << value.includeCreated.ref() << "\n"; + if (s.tagCounts.isSet()) { + w.writeFieldBegin( + QStringLiteral("tagCounts"), + ThriftFieldType::T_MAP, + 2); + w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); + for(const auto & it: toRange(s.tagCounts.ref())) { + w.writeString(it.key()); + w.writeI32(it.value()); + } + w.writeMapEnd(); + w.writeFieldEnd(); } - else { - out << " includeCreated is not set\n"; + if (s.trashCount.isSet()) { + w.writeFieldBegin( + QStringLiteral("trashCount"), + ThriftFieldType::T_I32, + 3); + w.writeI32(s.trashCount.ref()); + w.writeFieldEnd(); } + w.writeFieldStop(); + w.writeStructEnd(); +} - if (value.includeUpdated.isSet()) { - out << " includeUpdated = " - << value.includeUpdated.ref() << "\n"; - } - else { - out << " includeUpdated is not set\n"; - } - - if (value.includeDeleted.isSet()) { - out << " includeDeleted = " - << value.includeDeleted.ref() << "\n"; - } - else { - out << " includeDeleted is not set\n"; - } - - if (value.includeUpdateSequenceNum.isSet()) { - out << " includeUpdateSequenceNum = " - << value.includeUpdateSequenceNum.ref() << "\n"; - } - else { - out << " includeUpdateSequenceNum is not set\n"; - } - - if (value.includeNotebookGuid.isSet()) { - out << " includeNotebookGuid = " - << value.includeNotebookGuid.ref() << "\n"; - } - else { - out << " includeNotebookGuid is not set\n"; - } - - if (value.includeTagGuids.isSet()) { - out << " includeTagGuids = " - << value.includeTagGuids.ref() << "\n"; - } - else { - out << " includeTagGuids is not set\n"; - } - - if (value.includeAttributes.isSet()) { - out << " includeAttributes = " - << value.includeAttributes.ref() << "\n"; - } - else { - out << " includeAttributes is not set\n"; - } - - if (value.includeLargestResourceMime.isSet()) { - out << " includeLargestResourceMime = " - << value.includeLargestResourceMime.ref() << "\n"; - } - else { - out << " includeLargestResourceMime is not set\n"; - } - - if (value.includeLargestResourceSize.isSet()) { - out << " includeLargestResourceSize = " - << value.includeLargestResourceSize.ref() << "\n"; - } - else { - out << " includeLargestResourceSize is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectionCounts & s) { - w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); - if (s.notebookCounts.isSet()) { - w.writeFieldBegin( - QStringLiteral("notebookCounts"), - ThriftFieldType::T_MAP, - 1); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); - for(const auto & it: toRange(s.notebookCounts.ref())) { - w.writeString(it.key()); - w.writeI32(it.value()); - } - w.writeMapEnd(); - w.writeFieldEnd(); - } - if (s.tagCounts.isSet()) { - w.writeFieldBegin( - QStringLiteral("tagCounts"), - ThriftFieldType::T_MAP, - 2); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); - for(const auto & it: toRange(s.tagCounts.ref())) { - w.writeString(it.key()); - w.writeI32(it.value()); - } - w.writeMapEnd(); - w.writeFieldEnd(); - } - if (s.trashCount.isSet()) { - w.writeFieldBegin( - QStringLiteral("trashCount"), - ThriftFieldType::T_I32, - 3); - w.writeI32(s.trashCount.ref()); - w.writeFieldEnd(); - } - w.writeFieldStop(); - w.writeStructEnd(); -} - -void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts & s) { +void readNoteCollectionCounts( + ThriftBinaryBufferReader & r, + NoteCollectionCounts & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -3960,91 +3378,51 @@ void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteCollectionCounts & value) +void NoteCollectionCounts::print(QTextStream & strm) const { - out << "NoteCollectionCounts: {\n"; + strm << "NoteCollectionCounts: {\n"; - if (value.notebookCounts.isSet()) { - out << " notebookCounts = " + if (notebookCounts.isSet()) { + strm << " notebookCounts = " << "QMap {"; - for(const auto & it: toRange(value.notebookCounts.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; + for(const auto & it: toRange(notebookCounts.ref())) { + strm << " [" << it.key() << "] = " << it.value() << "\n"; } + strm << " }\n"; } else { - out << " notebookCounts is not set\n"; + strm << " notebookCounts is not set\n"; } - if (value.tagCounts.isSet()) { - out << " tagCounts = " + if (tagCounts.isSet()) { + strm << " tagCounts = " << "QMap {"; - for(const auto & it: toRange(value.tagCounts.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; + for(const auto & it: toRange(tagCounts.ref())) { + strm << " [" << it.key() << "] = " << it.value() << "\n"; } + strm << " }\n"; } else { - out << " tagCounts is not set\n"; + strm << " tagCounts is not set\n"; } - if (value.trashCount.isSet()) { - out << " trashCount = " - << value.trashCount.ref() << "\n"; + if (trashCount.isSet()) { + strm << " trashCount = " + << trashCount.ref() << "\n"; } else { - out << " trashCount is not set\n"; + strm << " trashCount is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteCollectionCounts & value) +void writeNoteResultSpec( + ThriftBinaryBufferWriter & w, + const NoteResultSpec & s) { - out << "NoteCollectionCounts: {\n"; - - if (value.notebookCounts.isSet()) { - out << " notebookCounts = " - << "QMap {"; - for(const auto & it: toRange(value.notebookCounts.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; - } - } - else { - out << " notebookCounts is not set\n"; - } - - if (value.tagCounts.isSet()) { - out << " tagCounts = " - << "QMap {"; - for(const auto & it: toRange(value.tagCounts.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; - } - } - else { - out << " tagCounts is not set\n"; - } - - if (value.trashCount.isSet()) { - out << " trashCount = " - << value.trashCount.ref() << "\n"; - } - else { - out << " trashCount is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s) { w.writeStructBegin(QStringLiteral("NoteResultSpec")); if (s.includeContent.isSet()) { w.writeFieldBegin( @@ -4114,7 +3492,10 @@ void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s) w.writeStructEnd(); } -void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s) { +void readNoteResultSpec( + ThriftBinaryBufferReader & r, + NoteResultSpec & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -4203,159 +3584,83 @@ void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteResultSpec & value) +void NoteResultSpec::print(QTextStream & strm) const { - out << "NoteResultSpec: {\n"; + strm << "NoteResultSpec: {\n"; - if (value.includeContent.isSet()) { - out << " includeContent = " - << value.includeContent.ref() << "\n"; + if (includeContent.isSet()) { + strm << " includeContent = " + << includeContent.ref() << "\n"; } else { - out << " includeContent is not set\n"; + strm << " includeContent is not set\n"; } - if (value.includeResourcesData.isSet()) { - out << " includeResourcesData = " - << value.includeResourcesData.ref() << "\n"; + if (includeResourcesData.isSet()) { + strm << " includeResourcesData = " + << includeResourcesData.ref() << "\n"; } else { - out << " includeResourcesData is not set\n"; + strm << " includeResourcesData is not set\n"; } - if (value.includeResourcesRecognition.isSet()) { - out << " includeResourcesRecognition = " - << value.includeResourcesRecognition.ref() << "\n"; + if (includeResourcesRecognition.isSet()) { + strm << " includeResourcesRecognition = " + << includeResourcesRecognition.ref() << "\n"; } else { - out << " includeResourcesRecognition is not set\n"; + strm << " includeResourcesRecognition is not set\n"; } - if (value.includeResourcesAlternateData.isSet()) { - out << " includeResourcesAlternateData = " - << value.includeResourcesAlternateData.ref() << "\n"; + if (includeResourcesAlternateData.isSet()) { + strm << " includeResourcesAlternateData = " + << includeResourcesAlternateData.ref() << "\n"; } else { - out << " includeResourcesAlternateData is not set\n"; + strm << " includeResourcesAlternateData is not set\n"; } - if (value.includeSharedNotes.isSet()) { - out << " includeSharedNotes = " - << value.includeSharedNotes.ref() << "\n"; + if (includeSharedNotes.isSet()) { + strm << " includeSharedNotes = " + << includeSharedNotes.ref() << "\n"; } else { - out << " includeSharedNotes is not set\n"; + strm << " includeSharedNotes is not set\n"; } - if (value.includeNoteAppDataValues.isSet()) { - out << " includeNoteAppDataValues = " - << value.includeNoteAppDataValues.ref() << "\n"; + if (includeNoteAppDataValues.isSet()) { + strm << " includeNoteAppDataValues = " + << includeNoteAppDataValues.ref() << "\n"; } else { - out << " includeNoteAppDataValues is not set\n"; + strm << " includeNoteAppDataValues is not set\n"; } - if (value.includeResourceAppDataValues.isSet()) { - out << " includeResourceAppDataValues = " - << value.includeResourceAppDataValues.ref() << "\n"; + if (includeResourceAppDataValues.isSet()) { + strm << " includeResourceAppDataValues = " + << includeResourceAppDataValues.ref() << "\n"; } else { - out << " includeResourceAppDataValues is not set\n"; + strm << " includeResourceAppDataValues is not set\n"; } - if (value.includeAccountLimits.isSet()) { - out << " includeAccountLimits = " - << value.includeAccountLimits.ref() << "\n"; + if (includeAccountLimits.isSet()) { + strm << " includeAccountLimits = " + << includeAccountLimits.ref() << "\n"; } else { - out << " includeAccountLimits is not set\n"; + strm << " includeAccountLimits is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteResultSpec & value) +void writeNoteEmailParameters( + ThriftBinaryBufferWriter & w, + const NoteEmailParameters & s) { - out << "NoteResultSpec: {\n"; - - if (value.includeContent.isSet()) { - out << " includeContent = " - << value.includeContent.ref() << "\n"; - } - else { - out << " includeContent is not set\n"; - } - - if (value.includeResourcesData.isSet()) { - out << " includeResourcesData = " - << value.includeResourcesData.ref() << "\n"; - } - else { - out << " includeResourcesData is not set\n"; - } - - if (value.includeResourcesRecognition.isSet()) { - out << " includeResourcesRecognition = " - << value.includeResourcesRecognition.ref() << "\n"; - } - else { - out << " includeResourcesRecognition is not set\n"; - } - - if (value.includeResourcesAlternateData.isSet()) { - out << " includeResourcesAlternateData = " - << value.includeResourcesAlternateData.ref() << "\n"; - } - else { - out << " includeResourcesAlternateData is not set\n"; - } - - if (value.includeSharedNotes.isSet()) { - out << " includeSharedNotes = " - << value.includeSharedNotes.ref() << "\n"; - } - else { - out << " includeSharedNotes is not set\n"; - } - - if (value.includeNoteAppDataValues.isSet()) { - out << " includeNoteAppDataValues = " - << value.includeNoteAppDataValues.ref() << "\n"; - } - else { - out << " includeNoteAppDataValues is not set\n"; - } - - if (value.includeResourceAppDataValues.isSet()) { - out << " includeResourceAppDataValues = " - << value.includeResourceAppDataValues.ref() << "\n"; - } - else { - out << " includeResourceAppDataValues is not set\n"; - } - - if (value.includeAccountLimits.isSet()) { - out << " includeAccountLimits = " - << value.includeAccountLimits.ref() << "\n"; - } - else { - out << " includeAccountLimits is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParameters & s) { w.writeStructBegin(QStringLiteral("NoteEmailParameters")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -4417,7 +3722,10 @@ void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParam w.writeStructEnd(); } -void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & s) { +void readNoteEmailParameters( + ThriftBinaryBufferReader & r, + NoteEmailParameters & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -4451,7 +3759,11 @@ void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteEmailParameters.toAddresses)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteEmailParameters.toAddresses)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -4470,7 +3782,11 @@ void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteEmailParameters.ccAddresses)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteEmailParameters.ccAddresses)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -4508,139 +3824,75 @@ void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteEmailParameters & value) +void NoteEmailParameters::print(QTextStream & strm) const { - out << "NoteEmailParameters: {\n"; + strm << "NoteEmailParameters: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.note.isSet()) { - out << " note = " - << value.note.ref() << "\n"; + if (note.isSet()) { + strm << " note = " + << note.ref() << "\n"; } else { - out << " note is not set\n"; + strm << " note is not set\n"; } - if (value.toAddresses.isSet()) { - out << " toAddresses = " + if (toAddresses.isSet()) { + strm << " toAddresses = " << "QList {"; - for(const auto & v: value.toAddresses.ref()) { - out << v; + for(const auto & v: toAddresses.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " toAddresses is not set\n"; + strm << " toAddresses is not set\n"; } - if (value.ccAddresses.isSet()) { - out << " ccAddresses = " + if (ccAddresses.isSet()) { + strm << " ccAddresses = " << "QList {"; - for(const auto & v: value.ccAddresses.ref()) { - out << v; + for(const auto & v: ccAddresses.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " ccAddresses is not set\n"; + strm << " ccAddresses is not set\n"; } - if (value.subject.isSet()) { - out << " subject = " - << value.subject.ref() << "\n"; + if (subject.isSet()) { + strm << " subject = " + << subject.ref() << "\n"; } else { - out << " subject is not set\n"; + strm << " subject is not set\n"; } - if (value.message.isSet()) { - out << " message = " - << value.message.ref() << "\n"; + if (message.isSet()) { + strm << " message = " + << message.ref() << "\n"; } else { - out << " message is not set\n"; + strm << " message is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteEmailParameters & value) +void writeNoteVersionId( + ThriftBinaryBufferWriter & w, + const NoteVersionId & s) { - out << "NoteEmailParameters: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.note.isSet()) { - out << " note = " - << value.note.ref() << "\n"; - } - else { - out << " note is not set\n"; - } - - if (value.toAddresses.isSet()) { - out << " toAddresses = " - << "QList {"; - for(const auto & v: value.toAddresses.ref()) { - out << v; - } - } - else { - out << " toAddresses is not set\n"; - } - - if (value.ccAddresses.isSet()) { - out << " ccAddresses = " - << "QList {"; - for(const auto & v: value.ccAddresses.ref()) { - out << v; - } - } - else { - out << " ccAddresses is not set\n"; - } - - if (value.subject.isSet()) { - out << " subject = " - << value.subject.ref() << "\n"; - } - else { - out << " subject is not set\n"; - } - - if (value.message.isSet()) { - out << " message = " - << value.message.ref() << "\n"; - } - else { - out << " message is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { w.writeStructBegin(QStringLiteral("NoteVersionId")); w.writeFieldBegin( QStringLiteral("updateSequenceNum"), @@ -4678,7 +3930,10 @@ void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s) { w.writeStructEnd(); } -void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s) { +void readNoteVersionId( + ThriftBinaryBufferReader & r, + NoteVersionId & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -4746,69 +4001,41 @@ void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!updateSequenceNum_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updateSequenceNum has no value")); - if(!updated_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updated has no value")); - if(!saved_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.saved has no value")); - if(!title_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.title has no value")); + if (!updateSequenceNum_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updateSequenceNum has no value")); + if (!updated_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updated has no value")); + if (!saved_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.saved has no value")); + if (!title_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.title has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteVersionId & value) +void NoteVersionId::print(QTextStream & strm) const { - out << "NoteVersionId: {\n"; - out << " updateSequenceNum = " - << "qint32" << "\n"; - out << " updated = " - << "Timestamp" << "\n"; - out << " saved = " - << "Timestamp" << "\n"; - out << " title = " - << "QString" << "\n"; + strm << "NoteVersionId: {\n"; + strm << " updateSequenceNum = " + << updateSequenceNum << "\n"; + strm << " updated = " + << updated << "\n"; + strm << " saved = " + << saved << "\n"; + strm << " title = " + << title << "\n"; - if (value.lastEditorId.isSet()) { - out << " lastEditorId = " - << value.lastEditorId.ref() << "\n"; + if (lastEditorId.isSet()) { + strm << " lastEditorId = " + << lastEditorId.ref() << "\n"; } else { - out << " lastEditorId is not set\n"; + strm << " lastEditorId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteVersionId & value) +void writeRelatedQuery( + ThriftBinaryBufferWriter & w, + const RelatedQuery & s) { - out << "NoteVersionId: {\n"; - out << " updateSequenceNum = " - << "qint32" << "\n"; - out << " updated = " - << "Timestamp" << "\n"; - out << " saved = " - << "Timestamp" << "\n"; - out << " title = " - << "QString" << "\n"; - - if (value.lastEditorId.isSet()) { - out << " lastEditorId = " - << value.lastEditorId.ref() << "\n"; - } - else { - out << " lastEditorId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s) { w.writeStructBegin(QStringLiteral("RelatedQuery")); if (s.noteGuid.isSet()) { w.writeFieldBegin( @@ -4862,7 +4089,10 @@ void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s) { w.writeStructEnd(); } -void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s) { +void readRelatedQuery( + ThriftBinaryBufferReader & r, + RelatedQuery & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -4933,127 +4163,67 @@ void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const RelatedQuery & value) +void RelatedQuery::print(QTextStream & strm) const { - out << "RelatedQuery: {\n"; + strm << "RelatedQuery: {\n"; - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; + if (noteGuid.isSet()) { + strm << " noteGuid = " + << noteGuid.ref() << "\n"; } else { - out << " noteGuid is not set\n"; + strm << " noteGuid is not set\n"; } - if (value.plainText.isSet()) { - out << " plainText = " - << value.plainText.ref() << "\n"; + if (plainText.isSet()) { + strm << " plainText = " + << plainText.ref() << "\n"; } else { - out << " plainText is not set\n"; + strm << " plainText is not set\n"; } - if (value.filter.isSet()) { - out << " filter = " - << value.filter.ref() << "\n"; + if (filter.isSet()) { + strm << " filter = " + << filter.ref() << "\n"; } else { - out << " filter is not set\n"; + strm << " filter is not set\n"; } - if (value.referenceUri.isSet()) { - out << " referenceUri = " - << value.referenceUri.ref() << "\n"; + if (referenceUri.isSet()) { + strm << " referenceUri = " + << referenceUri.ref() << "\n"; } else { - out << " referenceUri is not set\n"; + strm << " referenceUri is not set\n"; } - if (value.context.isSet()) { - out << " context = " - << value.context.ref() << "\n"; + if (context.isSet()) { + strm << " context = " + << context.ref() << "\n"; } else { - out << " context is not set\n"; + strm << " context is not set\n"; } - if (value.cacheKey.isSet()) { - out << " cacheKey = " - << value.cacheKey.ref() << "\n"; + if (cacheKey.isSet()) { + strm << " cacheKey = " + << cacheKey.ref() << "\n"; } else { - out << " cacheKey is not set\n"; + strm << " cacheKey is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const RelatedQuery & value) +void writeRelatedResult( + ThriftBinaryBufferWriter & w, + const RelatedResult & s) { - out << "RelatedQuery: {\n"; - - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; - } - else { - out << " noteGuid is not set\n"; - } - - if (value.plainText.isSet()) { - out << " plainText = " - << value.plainText.ref() << "\n"; - } - else { - out << " plainText is not set\n"; - } - - if (value.filter.isSet()) { - out << " filter = " - << value.filter.ref() << "\n"; - } - else { - out << " filter is not set\n"; - } - - if (value.referenceUri.isSet()) { - out << " referenceUri = " - << value.referenceUri.ref() << "\n"; - } - else { - out << " referenceUri is not set\n"; - } - - if (value.context.isSet()) { - out << " context = " - << value.context.ref() << "\n"; - } - else { - out << " context is not set\n"; - } - - if (value.cacheKey.isSet()) { - out << " cacheKey = " - << value.cacheKey.ref() << "\n"; - } - else { - out << " cacheKey is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeStructBegin(QStringLiteral("RelatedResult")); if (s.notes.isSet()) { w.writeFieldBegin( @@ -5155,7 +4325,10 @@ void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s) { w.writeStructEnd(); } -void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { +void readRelatedResult( + ThriftBinaryBufferReader & r, + RelatedResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -5171,7 +4344,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.notes)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.notes)")); + } for(qint32 i = 0; i < size; i++) { Note elem; readNote(r, elem); @@ -5190,7 +4367,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.notebooks)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.notebooks)")); + } for(qint32 i = 0; i < size; i++) { Notebook elem; readNotebook(r, elem); @@ -5209,7 +4390,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.tags)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.tags)")); + } for(qint32 i = 0; i < size; i++) { Tag elem; readTag(r, elem); @@ -5228,7 +4413,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.containingNotebooks)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.containingNotebooks)")); + } for(qint32 i = 0; i < size; i++) { NotebookDescriptor elem; readNotebookDescriptor(r, elem); @@ -5256,7 +4445,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.experts)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.experts)")); + } for(qint32 i = 0; i < size; i++) { UserProfile elem; readUserProfile(r, elem); @@ -5275,7 +4468,11 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedResult.relatedContent)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedResult.relatedContent)")); + } for(qint32 i = 0; i < size; i++) { RelatedContent elem; readRelatedContent(r, elem); @@ -5313,227 +4510,131 @@ void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const RelatedResult & value) +void RelatedResult::print(QTextStream & strm) const { - out << "RelatedResult: {\n"; + strm << "RelatedResult: {\n"; - if (value.notes.isSet()) { - out << " notes = " + if (notes.isSet()) { + strm << " notes = " << "QList {"; - for(const auto & v: value.notes.ref()) { - out << v; + for(const auto & v: notes.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " notes is not set\n"; + strm << " notes is not set\n"; } - if (value.notebooks.isSet()) { - out << " notebooks = " + if (notebooks.isSet()) { + strm << " notebooks = " << "QList {"; - for(const auto & v: value.notebooks.ref()) { - out << v; + for(const auto & v: notebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " notebooks is not set\n"; + strm << " notebooks is not set\n"; } - if (value.tags.isSet()) { - out << " tags = " + if (tags.isSet()) { + strm << " tags = " << "QList {"; - for(const auto & v: value.tags.ref()) { - out << v; + for(const auto & v: tags.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tags is not set\n"; + strm << " tags is not set\n"; } - if (value.containingNotebooks.isSet()) { - out << " containingNotebooks = " + if (containingNotebooks.isSet()) { + strm << " containingNotebooks = " << "QList {"; - for(const auto & v: value.containingNotebooks.ref()) { - out << v; + for(const auto & v: containingNotebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " containingNotebooks is not set\n"; + strm << " containingNotebooks is not set\n"; } - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; + if (debugInfo.isSet()) { + strm << " debugInfo = " + << debugInfo.ref() << "\n"; } else { - out << " debugInfo is not set\n"; + strm << " debugInfo is not set\n"; } - if (value.experts.isSet()) { - out << " experts = " + if (experts.isSet()) { + strm << " experts = " << "QList {"; - for(const auto & v: value.experts.ref()) { - out << v; + for(const auto & v: experts.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " experts is not set\n"; + strm << " experts is not set\n"; } - if (value.relatedContent.isSet()) { - out << " relatedContent = " + if (relatedContent.isSet()) { + strm << " relatedContent = " << "QList {"; - for(const auto & v: value.relatedContent.ref()) { - out << v; + for(const auto & v: relatedContent.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " relatedContent is not set\n"; + strm << " relatedContent is not set\n"; } - if (value.cacheKey.isSet()) { - out << " cacheKey = " - << value.cacheKey.ref() << "\n"; + if (cacheKey.isSet()) { + strm << " cacheKey = " + << cacheKey.ref() << "\n"; } else { - out << " cacheKey is not set\n"; + strm << " cacheKey is not set\n"; } - if (value.cacheExpires.isSet()) { - out << " cacheExpires = " - << value.cacheExpires.ref() << "\n"; + if (cacheExpires.isSet()) { + strm << " cacheExpires = " + << cacheExpires.ref() << "\n"; } else { - out << " cacheExpires is not set\n"; + strm << " cacheExpires is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const RelatedResult & value) +void writeRelatedResultSpec( + ThriftBinaryBufferWriter & w, + const RelatedResultSpec & s) { - out << "RelatedResult: {\n"; - - if (value.notes.isSet()) { - out << " notes = " - << "QList {"; - for(const auto & v: value.notes.ref()) { - out << v; - } - } - else { - out << " notes is not set\n"; - } - - if (value.notebooks.isSet()) { - out << " notebooks = " - << "QList {"; - for(const auto & v: value.notebooks.ref()) { - out << v; - } + w.writeStructBegin(QStringLiteral("RelatedResultSpec")); + if (s.maxNotes.isSet()) { + w.writeFieldBegin( + QStringLiteral("maxNotes"), + ThriftFieldType::T_I32, + 1); + w.writeI32(s.maxNotes.ref()); + w.writeFieldEnd(); } - else { - out << " notebooks is not set\n"; - } - - if (value.tags.isSet()) { - out << " tags = " - << "QList {"; - for(const auto & v: value.tags.ref()) { - out << v; - } - } - else { - out << " tags is not set\n"; - } - - if (value.containingNotebooks.isSet()) { - out << " containingNotebooks = " - << "QList {"; - for(const auto & v: value.containingNotebooks.ref()) { - out << v; - } - } - else { - out << " containingNotebooks is not set\n"; - } - - if (value.debugInfo.isSet()) { - out << " debugInfo = " - << value.debugInfo.ref() << "\n"; - } - else { - out << " debugInfo is not set\n"; - } - - if (value.experts.isSet()) { - out << " experts = " - << "QList {"; - for(const auto & v: value.experts.ref()) { - out << v; - } - } - else { - out << " experts is not set\n"; - } - - if (value.relatedContent.isSet()) { - out << " relatedContent = " - << "QList {"; - for(const auto & v: value.relatedContent.ref()) { - out << v; - } - } - else { - out << " relatedContent is not set\n"; - } - - if (value.cacheKey.isSet()) { - out << " cacheKey = " - << value.cacheKey.ref() << "\n"; - } - else { - out << " cacheKey is not set\n"; - } - - if (value.cacheExpires.isSet()) { - out << " cacheExpires = " - << value.cacheExpires.ref() << "\n"; - } - else { - out << " cacheExpires is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpec & s) { - w.writeStructBegin(QStringLiteral("RelatedResultSpec")); - if (s.maxNotes.isSet()) { - w.writeFieldBegin( - QStringLiteral("maxNotes"), - ThriftFieldType::T_I32, - 1); - w.writeI32(s.maxNotes.ref()); - w.writeFieldEnd(); - } - if (s.maxNotebooks.isSet()) { - w.writeFieldBegin( - QStringLiteral("maxNotebooks"), - ThriftFieldType::T_I32, - 2); - w.writeI32(s.maxNotebooks.ref()); - w.writeFieldEnd(); + if (s.maxNotebooks.isSet()) { + w.writeFieldBegin( + QStringLiteral("maxNotebooks"), + ThriftFieldType::T_I32, + 2); + w.writeI32(s.maxNotebooks.ref()); + w.writeFieldEnd(); } if (s.maxTags.isSet()) { w.writeFieldBegin( @@ -5599,7 +4700,10 @@ void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpe w.writeStructEnd(); } -void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) { +void readRelatedResultSpec( + ThriftBinaryBufferReader & r, + RelatedResultSpec & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -5707,181 +4811,95 @@ void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s) r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const RelatedResultSpec & value) +void RelatedResultSpec::print(QTextStream & strm) const { - out << "RelatedResultSpec: {\n"; + strm << "RelatedResultSpec: {\n"; - if (value.maxNotes.isSet()) { - out << " maxNotes = " - << value.maxNotes.ref() << "\n"; + if (maxNotes.isSet()) { + strm << " maxNotes = " + << maxNotes.ref() << "\n"; } else { - out << " maxNotes is not set\n"; + strm << " maxNotes is not set\n"; } - if (value.maxNotebooks.isSet()) { - out << " maxNotebooks = " - << value.maxNotebooks.ref() << "\n"; + if (maxNotebooks.isSet()) { + strm << " maxNotebooks = " + << maxNotebooks.ref() << "\n"; } else { - out << " maxNotebooks is not set\n"; + strm << " maxNotebooks is not set\n"; } - if (value.maxTags.isSet()) { - out << " maxTags = " - << value.maxTags.ref() << "\n"; + if (maxTags.isSet()) { + strm << " maxTags = " + << maxTags.ref() << "\n"; } else { - out << " maxTags is not set\n"; + strm << " maxTags is not set\n"; } - if (value.writableNotebooksOnly.isSet()) { - out << " writableNotebooksOnly = " - << value.writableNotebooksOnly.ref() << "\n"; + if (writableNotebooksOnly.isSet()) { + strm << " writableNotebooksOnly = " + << writableNotebooksOnly.ref() << "\n"; } else { - out << " writableNotebooksOnly is not set\n"; + strm << " writableNotebooksOnly is not set\n"; } - if (value.includeContainingNotebooks.isSet()) { - out << " includeContainingNotebooks = " - << value.includeContainingNotebooks.ref() << "\n"; + if (includeContainingNotebooks.isSet()) { + strm << " includeContainingNotebooks = " + << includeContainingNotebooks.ref() << "\n"; } else { - out << " includeContainingNotebooks is not set\n"; + strm << " includeContainingNotebooks is not set\n"; } - if (value.includeDebugInfo.isSet()) { - out << " includeDebugInfo = " - << value.includeDebugInfo.ref() << "\n"; + if (includeDebugInfo.isSet()) { + strm << " includeDebugInfo = " + << includeDebugInfo.ref() << "\n"; } else { - out << " includeDebugInfo is not set\n"; + strm << " includeDebugInfo is not set\n"; } - if (value.maxExperts.isSet()) { - out << " maxExperts = " - << value.maxExperts.ref() << "\n"; + if (maxExperts.isSet()) { + strm << " maxExperts = " + << maxExperts.ref() << "\n"; } else { - out << " maxExperts is not set\n"; + strm << " maxExperts is not set\n"; } - if (value.maxRelatedContent.isSet()) { - out << " maxRelatedContent = " - << value.maxRelatedContent.ref() << "\n"; + if (maxRelatedContent.isSet()) { + strm << " maxRelatedContent = " + << maxRelatedContent.ref() << "\n"; } else { - out << " maxRelatedContent is not set\n"; + strm << " maxRelatedContent is not set\n"; } - if (value.relatedContentTypes.isSet()) { - out << " relatedContentTypes = " + if (relatedContentTypes.isSet()) { + strm << " relatedContentTypes = " << "QSet {"; - for(const auto & v: value.relatedContentTypes.ref()) { - out << v; + for(const auto & v: relatedContentTypes.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " relatedContentTypes is not set\n"; + strm << " relatedContentTypes is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const RelatedResultSpec & value) +void writeUpdateNoteIfUsnMatchesResult( + ThriftBinaryBufferWriter & w, + const UpdateNoteIfUsnMatchesResult & s) { - out << "RelatedResultSpec: {\n"; - - if (value.maxNotes.isSet()) { - out << " maxNotes = " - << value.maxNotes.ref() << "\n"; - } - else { - out << " maxNotes is not set\n"; - } - - if (value.maxNotebooks.isSet()) { - out << " maxNotebooks = " - << value.maxNotebooks.ref() << "\n"; - } - else { - out << " maxNotebooks is not set\n"; - } - - if (value.maxTags.isSet()) { - out << " maxTags = " - << value.maxTags.ref() << "\n"; - } - else { - out << " maxTags is not set\n"; - } - - if (value.writableNotebooksOnly.isSet()) { - out << " writableNotebooksOnly = " - << value.writableNotebooksOnly.ref() << "\n"; - } - else { - out << " writableNotebooksOnly is not set\n"; - } - - if (value.includeContainingNotebooks.isSet()) { - out << " includeContainingNotebooks = " - << value.includeContainingNotebooks.ref() << "\n"; - } - else { - out << " includeContainingNotebooks is not set\n"; - } - - if (value.includeDebugInfo.isSet()) { - out << " includeDebugInfo = " - << value.includeDebugInfo.ref() << "\n"; - } - else { - out << " includeDebugInfo is not set\n"; - } - - if (value.maxExperts.isSet()) { - out << " maxExperts = " - << value.maxExperts.ref() << "\n"; - } - else { - out << " maxExperts is not set\n"; - } - - if (value.maxRelatedContent.isSet()) { - out << " maxRelatedContent = " - << value.maxRelatedContent.ref() << "\n"; - } - else { - out << " maxRelatedContent is not set\n"; - } - - if (value.relatedContentTypes.isSet()) { - out << " relatedContentTypes = " - << "QSet {"; - for(const auto & v: value.relatedContentTypes.ref()) { - out << v; - } - } - else { - out << " relatedContentTypes is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s) { w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); if (s.note.isSet()) { w.writeFieldBegin( @@ -5903,7 +4921,10 @@ void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const Updat w.writeStructEnd(); } -void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIfUsnMatchesResult & s) { +void readUpdateNoteIfUsnMatchesResult( + ThriftBinaryBufferReader & r, + UpdateNoteIfUsnMatchesResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -5938,63 +4959,35 @@ void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIf r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const UpdateNoteIfUsnMatchesResult & value) +void UpdateNoteIfUsnMatchesResult::print(QTextStream & strm) const { - out << "UpdateNoteIfUsnMatchesResult: {\n"; + strm << "UpdateNoteIfUsnMatchesResult: {\n"; - if (value.note.isSet()) { - out << " note = " - << value.note.ref() << "\n"; + if (note.isSet()) { + strm << " note = " + << note.ref() << "\n"; } else { - out << " note is not set\n"; + strm << " note is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const UpdateNoteIfUsnMatchesResult & value) +void writeShareRelationshipRestrictions( + ThriftBinaryBufferWriter & w, + const ShareRelationshipRestrictions & s) { - out << "UpdateNoteIfUsnMatchesResult: {\n"; - - if (value.note.isSet()) { - out << " note = " - << value.note.ref() << "\n"; - } - else { - out << " note is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const ShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); if (s.noSetReadOnly.isSet()) { w.writeFieldBegin( @@ -6032,7 +5025,10 @@ void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const Shar w.writeStructEnd(); } -void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelationshipRestrictions & s) { +void readShareRelationshipRestrictions( + ThriftBinaryBufferReader & r, + ShareRelationshipRestrictions & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -6085,95 +5081,51 @@ void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelati r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ShareRelationshipRestrictions & value) +void ShareRelationshipRestrictions::print(QTextStream & strm) const { - out << "ShareRelationshipRestrictions: {\n"; + strm << "ShareRelationshipRestrictions: {\n"; - if (value.noSetReadOnly.isSet()) { - out << " noSetReadOnly = " - << value.noSetReadOnly.ref() << "\n"; + if (noSetReadOnly.isSet()) { + strm << " noSetReadOnly = " + << noSetReadOnly.ref() << "\n"; } else { - out << " noSetReadOnly is not set\n"; + strm << " noSetReadOnly is not set\n"; } - if (value.noSetReadPlusActivity.isSet()) { - out << " noSetReadPlusActivity = " - << value.noSetReadPlusActivity.ref() << "\n"; + if (noSetReadPlusActivity.isSet()) { + strm << " noSetReadPlusActivity = " + << noSetReadPlusActivity.ref() << "\n"; } else { - out << " noSetReadPlusActivity is not set\n"; + strm << " noSetReadPlusActivity is not set\n"; } - if (value.noSetModify.isSet()) { - out << " noSetModify = " - << value.noSetModify.ref() << "\n"; + if (noSetModify.isSet()) { + strm << " noSetModify = " + << noSetModify.ref() << "\n"; } else { - out << " noSetModify is not set\n"; + strm << " noSetModify is not set\n"; } - if (value.noSetFullAccess.isSet()) { - out << " noSetFullAccess = " - << value.noSetFullAccess.ref() << "\n"; + if (noSetFullAccess.isSet()) { + strm << " noSetFullAccess = " + << noSetFullAccess.ref() << "\n"; } else { - out << " noSetFullAccess is not set\n"; + strm << " noSetFullAccess is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ShareRelationshipRestrictions & value) +void writeInvitationShareRelationship( + ThriftBinaryBufferWriter & w, + const InvitationShareRelationship & s) { - out << "ShareRelationshipRestrictions: {\n"; - - if (value.noSetReadOnly.isSet()) { - out << " noSetReadOnly = " - << value.noSetReadOnly.ref() << "\n"; - } - else { - out << " noSetReadOnly is not set\n"; - } - - if (value.noSetReadPlusActivity.isSet()) { - out << " noSetReadPlusActivity = " - << value.noSetReadPlusActivity.ref() << "\n"; - } - else { - out << " noSetReadPlusActivity is not set\n"; - } - - if (value.noSetModify.isSet()) { - out << " noSetModify = " - << value.noSetModify.ref() << "\n"; - } - else { - out << " noSetModify is not set\n"; - } - - if (value.noSetFullAccess.isSet()) { - out << " noSetFullAccess = " - << value.noSetFullAccess.ref() << "\n"; - } - else { - out << " noSetFullAccess is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const InvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("InvitationShareRelationship")); if (s.displayName.isSet()) { w.writeFieldBegin( @@ -6211,7 +5163,10 @@ void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const Invita w.writeStructEnd(); } -void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationShareRelationship & s) { +void readInvitationShareRelationship( + ThriftBinaryBufferReader & r, + InvitationShareRelationship & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -6264,95 +5219,51 @@ void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationSha r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const InvitationShareRelationship & value) +void InvitationShareRelationship::print(QTextStream & strm) const { - out << "InvitationShareRelationship: {\n"; + strm << "InvitationShareRelationship: {\n"; - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; + if (displayName.isSet()) { + strm << " displayName = " + << displayName.ref() << "\n"; } else { - out << " displayName is not set\n"; + strm << " displayName is not set\n"; } - if (value.recipientUserIdentity.isSet()) { - out << " recipientUserIdentity = " - << value.recipientUserIdentity.ref() << "\n"; + if (recipientUserIdentity.isSet()) { + strm << " recipientUserIdentity = " + << recipientUserIdentity.ref() << "\n"; } else { - out << " recipientUserIdentity is not set\n"; + strm << " recipientUserIdentity is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; + if (sharerUserId.isSet()) { + strm << " sharerUserId = " + << sharerUserId.ref() << "\n"; } else { - out << " sharerUserId is not set\n"; + strm << " sharerUserId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const InvitationShareRelationship & value) +void writeMemberShareRelationship( + ThriftBinaryBufferWriter & w, + const MemberShareRelationship & s) { - out << "InvitationShareRelationship: {\n"; - - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; - } - else { - out << " displayName is not set\n"; - } - - if (value.recipientUserIdentity.isSet()) { - out << " recipientUserIdentity = " - << value.recipientUserIdentity.ref() << "\n"; - } - else { - out << " recipientUserIdentity is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; - } - else { - out << " sharerUserId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("MemberShareRelationship")); if (s.displayName.isSet()) { w.writeFieldBegin( @@ -6406,7 +5317,10 @@ void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShar w.writeStructEnd(); } -void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelationship & s) { +void readMemberShareRelationship( + ThriftBinaryBufferReader & r, + MemberShareRelationship & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -6477,127 +5391,67 @@ void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelati r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const MemberShareRelationship & value) +void MemberShareRelationship::print(QTextStream & strm) const { - out << "MemberShareRelationship: {\n"; + strm << "MemberShareRelationship: {\n"; - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; + if (displayName.isSet()) { + strm << " displayName = " + << displayName.ref() << "\n"; } else { - out << " displayName is not set\n"; + strm << " displayName is not set\n"; } - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; + if (recipientUserId.isSet()) { + strm << " recipientUserId = " + << recipientUserId.ref() << "\n"; } else { - out << " recipientUserId is not set\n"; + strm << " recipientUserId is not set\n"; } - if (value.bestPrivilege.isSet()) { - out << " bestPrivilege = " - << value.bestPrivilege.ref() << "\n"; + if (bestPrivilege.isSet()) { + strm << " bestPrivilege = " + << bestPrivilege.ref() << "\n"; } else { - out << " bestPrivilege is not set\n"; + strm << " bestPrivilege is not set\n"; } - if (value.individualPrivilege.isSet()) { - out << " individualPrivilege = " - << value.individualPrivilege.ref() << "\n"; + if (individualPrivilege.isSet()) { + strm << " individualPrivilege = " + << individualPrivilege.ref() << "\n"; } else { - out << " individualPrivilege is not set\n"; + strm << " individualPrivilege is not set\n"; } - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; + if (restrictions.isSet()) { + strm << " restrictions = " + << restrictions.ref() << "\n"; } else { - out << " restrictions is not set\n"; + strm << " restrictions is not set\n"; } - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; + if (sharerUserId.isSet()) { + strm << " sharerUserId = " + << sharerUserId.ref() << "\n"; } else { - out << " sharerUserId is not set\n"; + strm << " sharerUserId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const MemberShareRelationship & value) +void writeShareRelationships( + ThriftBinaryBufferWriter & w, + const ShareRelationships & s) { - out << "MemberShareRelationship: {\n"; - - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; - } - else { - out << " displayName is not set\n"; - } - - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; - } - else { - out << " recipientUserId is not set\n"; - } - - if (value.bestPrivilege.isSet()) { - out << " bestPrivilege = " - << value.bestPrivilege.ref() << "\n"; - } - else { - out << " bestPrivilege is not set\n"; - } - - if (value.individualPrivilege.isSet()) { - out << " individualPrivilege = " - << value.individualPrivilege.ref() << "\n"; - } - else { - out << " individualPrivilege is not set\n"; - } - - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; - } - else { - out << " restrictions is not set\n"; - } - - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; - } - else { - out << " sharerUserId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationships & s) { w.writeStructBegin(QStringLiteral("ShareRelationships")); if (s.invitations.isSet()) { w.writeFieldBegin( @@ -6635,7 +5489,10 @@ void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationsh w.writeStructEnd(); } -void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s) { +void readShareRelationships( + ThriftBinaryBufferReader & r, + ShareRelationships & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -6651,7 +5508,11 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ShareRelationships.invitations)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ShareRelationships.invitations)")); + } for(qint32 i = 0; i < size; i++) { InvitationShareRelationship elem; readInvitationShareRelationship(r, elem); @@ -6670,7 +5531,11 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ShareRelationships.memberships)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ShareRelationships.memberships)")); + } for(qint32 i = 0; i < size; i++) { MemberShareRelationship elem; readMemberShareRelationship(r, elem); @@ -6699,91 +5564,51 @@ void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ShareRelationships & value) +void ShareRelationships::print(QTextStream & strm) const { - out << "ShareRelationships: {\n"; + strm << "ShareRelationships: {\n"; - if (value.invitations.isSet()) { - out << " invitations = " + if (invitations.isSet()) { + strm << " invitations = " << "QList {"; - for(const auto & v: value.invitations.ref()) { - out << v; + for(const auto & v: invitations.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " invitations is not set\n"; + strm << " invitations is not set\n"; } - if (value.memberships.isSet()) { - out << " memberships = " + if (memberships.isSet()) { + strm << " memberships = " << "QList {"; - for(const auto & v: value.memberships.ref()) { - out << v; + for(const auto & v: memberships.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " memberships is not set\n"; + strm << " memberships is not set\n"; } - if (value.invitationRestrictions.isSet()) { - out << " invitationRestrictions = " - << value.invitationRestrictions.ref() << "\n"; + if (invitationRestrictions.isSet()) { + strm << " invitationRestrictions = " + << invitationRestrictions.ref() << "\n"; } else { - out << " invitationRestrictions is not set\n"; + strm << " invitationRestrictions is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ShareRelationships & value) +void writeManageNotebookSharesParameters( + ThriftBinaryBufferWriter & w, + const ManageNotebookSharesParameters & s) { - out << "ShareRelationships: {\n"; - - if (value.invitations.isSet()) { - out << " invitations = " - << "QList {"; - for(const auto & v: value.invitations.ref()) { - out << v; - } - } - else { - out << " invitations is not set\n"; - } - - if (value.memberships.isSet()) { - out << " memberships = " - << "QList {"; - for(const auto & v: value.memberships.ref()) { - out << v; - } - } - else { - out << " memberships is not set\n"; - } - - if (value.invitationRestrictions.isSet()) { - out << " invitationRestrictions = " - << value.invitationRestrictions.ref() << "\n"; - } - else { - out << " invitationRestrictions is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); if (s.notebookGuid.isSet()) { w.writeFieldBegin( @@ -6841,7 +5666,10 @@ void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const Man w.writeStructEnd(); } -void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNotebookSharesParameters & s) { +void readManageNotebookSharesParameters( + ThriftBinaryBufferReader & r, + ManageNotebookSharesParameters & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -6875,7 +5703,11 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.membershipsToUpdate)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.membershipsToUpdate)")); + } for(qint32 i = 0; i < size; i++) { MemberShareRelationship elem; readMemberShareRelationship(r, elem); @@ -6894,7 +5726,11 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.invitationsToCreateOrUpdate)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.invitationsToCreateOrUpdate)")); + } for(qint32 i = 0; i < size; i++) { InvitationShareRelationship elem; readInvitationShareRelationship(r, elem); @@ -6913,7 +5749,11 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.unshares)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNotebookSharesParameters.unshares)")); + } for(qint32 i = 0; i < size; i++) { UserIdentity elem; readUserIdentity(r, elem); @@ -6933,159 +5773,104 @@ void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNote r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNotebookSharesParameters & value) +void ManageNotebookSharesParameters::print(QTextStream & strm) const { - out << "ManageNotebookSharesParameters: {\n"; + strm << "ManageNotebookSharesParameters: {\n"; - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.inviteMessage.isSet()) { - out << " inviteMessage = " - << value.inviteMessage.ref() << "\n"; + if (inviteMessage.isSet()) { + strm << " inviteMessage = " + << inviteMessage.ref() << "\n"; } else { - out << " inviteMessage is not set\n"; + strm << " inviteMessage is not set\n"; } - if (value.membershipsToUpdate.isSet()) { - out << " membershipsToUpdate = " + if (membershipsToUpdate.isSet()) { + strm << " membershipsToUpdate = " << "QList {"; - for(const auto & v: value.membershipsToUpdate.ref()) { - out << v; + for(const auto & v: membershipsToUpdate.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " membershipsToUpdate is not set\n"; + strm << " membershipsToUpdate is not set\n"; } - if (value.invitationsToCreateOrUpdate.isSet()) { - out << " invitationsToCreateOrUpdate = " + if (invitationsToCreateOrUpdate.isSet()) { + strm << " invitationsToCreateOrUpdate = " << "QList {"; - for(const auto & v: value.invitationsToCreateOrUpdate.ref()) { - out << v; + for(const auto & v: invitationsToCreateOrUpdate.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " invitationsToCreateOrUpdate is not set\n"; + strm << " invitationsToCreateOrUpdate is not set\n"; } - if (value.unshares.isSet()) { - out << " unshares = " + if (unshares.isSet()) { + strm << " unshares = " << "QList {"; - for(const auto & v: value.unshares.ref()) { - out << v; + for(const auto & v: unshares.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " unshares is not set\n"; + strm << " unshares is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNotebookSharesParameters & value) +void writeManageNotebookSharesError( + ThriftBinaryBufferWriter & w, + const ManageNotebookSharesError & s) { - out << "ManageNotebookSharesParameters: {\n"; - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); + if (s.userIdentity.isSet()) { + w.writeFieldBegin( + QStringLiteral("userIdentity"), + ThriftFieldType::T_STRUCT, + 1); + writeUserIdentity(w, s.userIdentity.ref()); + w.writeFieldEnd(); } - else { - out << " notebookGuid is not set\n"; + if (s.userException.isSet()) { + w.writeFieldBegin( + QStringLiteral("userException"), + ThriftFieldType::T_STRUCT, + 2); + writeEDAMUserException(w, s.userException.ref()); + w.writeFieldEnd(); } - - if (value.inviteMessage.isSet()) { - out << " inviteMessage = " - << value.inviteMessage.ref() << "\n"; - } - else { - out << " inviteMessage is not set\n"; - } - - if (value.membershipsToUpdate.isSet()) { - out << " membershipsToUpdate = " - << "QList {"; - for(const auto & v: value.membershipsToUpdate.ref()) { - out << v; - } - } - else { - out << " membershipsToUpdate is not set\n"; - } - - if (value.invitationsToCreateOrUpdate.isSet()) { - out << " invitationsToCreateOrUpdate = " - << "QList {"; - for(const auto & v: value.invitationsToCreateOrUpdate.ref()) { - out << v; - } - } - else { - out << " invitationsToCreateOrUpdate is not set\n"; - } - - if (value.unshares.isSet()) { - out << " unshares = " - << "QList {"; - for(const auto & v: value.unshares.ref()) { - out << v; - } - } - else { - out << " unshares is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNotebookSharesError(ThriftBinaryBufferWriter & w, const ManageNotebookSharesError & s) { - w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); - if (s.userIdentity.isSet()) { - w.writeFieldBegin( - QStringLiteral("userIdentity"), - ThriftFieldType::T_STRUCT, - 1); - writeUserIdentity(w, s.userIdentity.ref()); - w.writeFieldEnd(); - } - if (s.userException.isSet()) { - w.writeFieldBegin( - QStringLiteral("userException"), - ThriftFieldType::T_STRUCT, - 2); - writeEDAMUserException(w, s.userException.ref()); - w.writeFieldEnd(); - } - if (s.notFoundException.isSet()) { - w.writeFieldBegin( - QStringLiteral("notFoundException"), - ThriftFieldType::T_STRUCT, - 3); - writeEDAMNotFoundException(w, s.notFoundException.ref()); - w.writeFieldEnd(); + if (s.notFoundException.isSet()) { + w.writeFieldBegin( + QStringLiteral("notFoundException"), + ThriftFieldType::T_STRUCT, + 3); + writeEDAMNotFoundException(w, s.notFoundException.ref()); + w.writeFieldEnd(); } w.writeFieldStop(); w.writeStructEnd(); } -void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookSharesError & s) { +void readManageNotebookSharesError( + ThriftBinaryBufferReader & r, + ManageNotebookSharesError & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7129,79 +5914,43 @@ void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookS r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNotebookSharesError & value) +void ManageNotebookSharesError::print(QTextStream & strm) const { - out << "ManageNotebookSharesError: {\n"; + strm << "ManageNotebookSharesError: {\n"; - if (value.userIdentity.isSet()) { - out << " userIdentity = " - << value.userIdentity.ref() << "\n"; + if (userIdentity.isSet()) { + strm << " userIdentity = " + << userIdentity.ref() << "\n"; } else { - out << " userIdentity is not set\n"; + strm << " userIdentity is not set\n"; } - if (value.userException.isSet()) { - out << " userException = " - << value.userException.ref() << "\n"; + if (userException.isSet()) { + strm << " userException = " + << userException.ref() << "\n"; } else { - out << " userException is not set\n"; + strm << " userException is not set\n"; } - if (value.notFoundException.isSet()) { - out << " notFoundException = " - << value.notFoundException.ref() << "\n"; + if (notFoundException.isSet()) { + strm << " notFoundException = " + << notFoundException.ref() << "\n"; } else { - out << " notFoundException is not set\n"; + strm << " notFoundException is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNotebookSharesError & value) +void writeManageNotebookSharesResult( + ThriftBinaryBufferWriter & w, + const ManageNotebookSharesResult & s) { - out << "ManageNotebookSharesError: {\n"; - - if (value.userIdentity.isSet()) { - out << " userIdentity = " - << value.userIdentity.ref() << "\n"; - } - else { - out << " userIdentity is not set\n"; - } - - if (value.userException.isSet()) { - out << " userException = " - << value.userException.ref() << "\n"; - } - else { - out << " userException is not set\n"; - } - - if (value.notFoundException.isSet()) { - out << " notFoundException = " - << value.notFoundException.ref() << "\n"; - } - else { - out << " notFoundException is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); if (s.errors.isSet()) { w.writeFieldBegin( @@ -7219,7 +5968,10 @@ void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageN w.writeStructEnd(); } -void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebookSharesResult & s) { +void readManageNotebookSharesResult( + ThriftBinaryBufferReader & r, + ManageNotebookSharesResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7235,7 +5987,11 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNotebookSharesResult.errors)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNotebookSharesResult.errors)")); + } for(qint32 i = 0; i < size; i++) { ManageNotebookSharesError elem; readManageNotebookSharesError(r, elem); @@ -7255,53 +6011,31 @@ void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebook r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNotebookSharesResult & value) +void ManageNotebookSharesResult::print(QTextStream & strm) const { - out << "ManageNotebookSharesResult: {\n"; + strm << "ManageNotebookSharesResult: {\n"; - if (value.errors.isSet()) { - out << " errors = " + if (errors.isSet()) { + strm << " errors = " << "QList {"; - for(const auto & v: value.errors.ref()) { - out << v; + for(const auto & v: errors.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " errors is not set\n"; + strm << " errors is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNotebookSharesResult & value) +void writeSharedNoteTemplate( + ThriftBinaryBufferWriter & w, + const SharedNoteTemplate & s) { - out << "ManageNotebookSharesResult: {\n"; - - if (value.errors.isSet()) { - out << " errors = " - << "QList {"; - for(const auto & v: value.errors.ref()) { - out << v; - } - } - else { - out << " errors is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTemplate & s) { w.writeStructBegin(QStringLiteral("SharedNoteTemplate")); if (s.noteGuid.isSet()) { w.writeFieldBegin( @@ -7343,7 +6077,10 @@ void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTempl w.writeStructEnd(); } -void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s) { +void readSharedNoteTemplate( + ThriftBinaryBufferReader & r, + SharedNoteTemplate & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7377,7 +6114,11 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (SharedNoteTemplate.recipientContacts)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (SharedNoteTemplate.recipientContacts)")); + } for(qint32 i = 0; i < size; i++) { Contact elem; readContact(r, elem); @@ -7406,101 +6147,55 @@ void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SharedNoteTemplate & value) +void SharedNoteTemplate::print(QTextStream & strm) const { - out << "SharedNoteTemplate: {\n"; + strm << "SharedNoteTemplate: {\n"; - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; + if (noteGuid.isSet()) { + strm << " noteGuid = " + << noteGuid.ref() << "\n"; } else { - out << " noteGuid is not set\n"; + strm << " noteGuid is not set\n"; } - if (value.recipientThreadId.isSet()) { - out << " recipientThreadId = " - << value.recipientThreadId.ref() << "\n"; + if (recipientThreadId.isSet()) { + strm << " recipientThreadId = " + << recipientThreadId.ref() << "\n"; } else { - out << " recipientThreadId is not set\n"; + strm << " recipientThreadId is not set\n"; } - if (value.recipientContacts.isSet()) { - out << " recipientContacts = " + if (recipientContacts.isSet()) { + strm << " recipientContacts = " << "QList {"; - for(const auto & v: value.recipientContacts.ref()) { - out << v; + for(const auto & v: recipientContacts.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " recipientContacts is not set\n"; + strm << " recipientContacts is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SharedNoteTemplate & value) +void writeNotebookShareTemplate( + ThriftBinaryBufferWriter & w, + const NotebookShareTemplate & s) { - out << "SharedNoteTemplate: {\n"; - - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; - } - else { - out << " noteGuid is not set\n"; - } - - if (value.recipientThreadId.isSet()) { - out << " recipientThreadId = " - << value.recipientThreadId.ref() << "\n"; - } - else { - out << " recipientThreadId is not set\n"; - } - - if (value.recipientContacts.isSet()) { - out << " recipientContacts = " - << "QList {"; - for(const auto & v: value.recipientContacts.ref()) { - out << v; - } - } - else { - out << " recipientContacts is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShareTemplate & s) { w.writeStructBegin(QStringLiteral("NotebookShareTemplate")); if (s.notebookGuid.isSet()) { w.writeFieldBegin( @@ -7542,7 +6237,10 @@ void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShar w.writeStructEnd(); } -void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTemplate & s) { +void readNotebookShareTemplate( + ThriftBinaryBufferReader & r, + NotebookShareTemplate & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7576,7 +6274,11 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NotebookShareTemplate.recipientContacts)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NotebookShareTemplate.recipientContacts)")); + } for(qint32 i = 0; i < size; i++) { Contact elem; readContact(r, elem); @@ -7605,101 +6307,55 @@ void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTempla r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotebookShareTemplate & value) +void NotebookShareTemplate::print(QTextStream & strm) const { - out << "NotebookShareTemplate: {\n"; + strm << "NotebookShareTemplate: {\n"; - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.recipientThreadId.isSet()) { - out << " recipientThreadId = " - << value.recipientThreadId.ref() << "\n"; + if (recipientThreadId.isSet()) { + strm << " recipientThreadId = " + << recipientThreadId.ref() << "\n"; } else { - out << " recipientThreadId is not set\n"; + strm << " recipientThreadId is not set\n"; } - if (value.recipientContacts.isSet()) { - out << " recipientContacts = " + if (recipientContacts.isSet()) { + strm << " recipientContacts = " << "QList {"; - for(const auto & v: value.recipientContacts.ref()) { - out << v; + for(const auto & v: recipientContacts.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " recipientContacts is not set\n"; + strm << " recipientContacts is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotebookShareTemplate & value) +void writeCreateOrUpdateNotebookSharesResult( + ThriftBinaryBufferWriter & w, + const CreateOrUpdateNotebookSharesResult & s) { - out << "NotebookShareTemplate: {\n"; - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; - } - else { - out << " notebookGuid is not set\n"; - } - - if (value.recipientThreadId.isSet()) { - out << " recipientThreadId = " - << value.recipientThreadId.ref() << "\n"; - } - else { - out << " recipientThreadId is not set\n"; - } - - if (value.recipientContacts.isSet()) { - out << " recipientContacts = " - << "QList {"; - for(const auto & v: value.recipientContacts.ref()) { - out << v; - } - } - else { - out << " recipientContacts is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const CreateOrUpdateNotebookSharesResult & s) { w.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); if (s.updateSequenceNum.isSet()) { w.writeFieldBegin( @@ -7725,7 +6381,10 @@ void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const w.writeStructEnd(); } -void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, CreateOrUpdateNotebookSharesResult & s) { +void readCreateOrUpdateNotebookSharesResult( + ThriftBinaryBufferReader & r, + CreateOrUpdateNotebookSharesResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7750,7 +6409,11 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (CreateOrUpdateNotebookSharesResult.matchingShares)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (CreateOrUpdateNotebookSharesResult.matchingShares)")); + } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; readSharedNotebook(r, elem); @@ -7770,69 +6433,39 @@ void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, Create r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const CreateOrUpdateNotebookSharesResult & value) +void CreateOrUpdateNotebookSharesResult::print(QTextStream & strm) const { - out << "CreateOrUpdateNotebookSharesResult: {\n"; + strm << "CreateOrUpdateNotebookSharesResult: {\n"; - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.matchingShares.isSet()) { - out << " matchingShares = " + if (matchingShares.isSet()) { + strm << " matchingShares = " << "QList {"; - for(const auto & v: value.matchingShares.ref()) { - out << v; + for(const auto & v: matchingShares.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " matchingShares is not set\n"; + strm << " matchingShares is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const CreateOrUpdateNotebookSharesResult & value) +void writeNoteShareRelationshipRestrictions( + ThriftBinaryBufferWriter & w, + const NoteShareRelationshipRestrictions & s) { - out << "CreateOrUpdateNotebookSharesResult: {\n"; - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.matchingShares.isSet()) { - out << " matchingShares = " - << "QList {"; - for(const auto & v: value.matchingShares.ref()) { - out << v; - } - } - else { - out << " matchingShares is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const NoteShareRelationshipRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); if (s.noSetReadNote.isSet()) { w.writeFieldBegin( @@ -7862,7 +6495,10 @@ void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const w.writeStructEnd(); } -void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteShareRelationshipRestrictions & s) { +void readNoteShareRelationshipRestrictions( + ThriftBinaryBufferReader & r, + NoteShareRelationshipRestrictions & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -7906,79 +6542,43 @@ void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteSha r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteShareRelationshipRestrictions & value) +void NoteShareRelationshipRestrictions::print(QTextStream & strm) const { - out << "NoteShareRelationshipRestrictions: {\n"; + strm << "NoteShareRelationshipRestrictions: {\n"; - if (value.noSetReadNote.isSet()) { - out << " noSetReadNote = " - << value.noSetReadNote.ref() << "\n"; + if (noSetReadNote.isSet()) { + strm << " noSetReadNote = " + << noSetReadNote.ref() << "\n"; } else { - out << " noSetReadNote is not set\n"; + strm << " noSetReadNote is not set\n"; } - if (value.noSetModifyNote.isSet()) { - out << " noSetModifyNote = " - << value.noSetModifyNote.ref() << "\n"; + if (noSetModifyNote.isSet()) { + strm << " noSetModifyNote = " + << noSetModifyNote.ref() << "\n"; } else { - out << " noSetModifyNote is not set\n"; + strm << " noSetModifyNote is not set\n"; } - if (value.noSetFullAccess.isSet()) { - out << " noSetFullAccess = " - << value.noSetFullAccess.ref() << "\n"; + if (noSetFullAccess.isSet()) { + strm << " noSetFullAccess = " + << noSetFullAccess.ref() << "\n"; } else { - out << " noSetFullAccess is not set\n"; + strm << " noSetFullAccess is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteShareRelationshipRestrictions & value) +void writeNoteMemberShareRelationship( + ThriftBinaryBufferWriter & w, + const NoteMemberShareRelationship & s) { - out << "NoteShareRelationshipRestrictions: {\n"; - - if (value.noSetReadNote.isSet()) { - out << " noSetReadNote = " - << value.noSetReadNote.ref() << "\n"; - } - else { - out << " noSetReadNote is not set\n"; - } - - if (value.noSetModifyNote.isSet()) { - out << " noSetModifyNote = " - << value.noSetModifyNote.ref() << "\n"; - } - else { - out << " noSetModifyNote is not set\n"; - } - - if (value.noSetFullAccess.isSet()) { - out << " noSetFullAccess = " - << value.noSetFullAccess.ref() << "\n"; - } - else { - out << " noSetFullAccess is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); if (s.displayName.isSet()) { w.writeFieldBegin( @@ -8024,7 +6624,10 @@ void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMe w.writeStructEnd(); } -void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberShareRelationship & s) { +void readNoteMemberShareRelationship( + ThriftBinaryBufferReader & r, + NoteMemberShareRelationship & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -8086,111 +6689,59 @@ void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberSha r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteMemberShareRelationship & value) +void NoteMemberShareRelationship::print(QTextStream & strm) const { - out << "NoteMemberShareRelationship: {\n"; + strm << "NoteMemberShareRelationship: {\n"; - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; + if (displayName.isSet()) { + strm << " displayName = " + << displayName.ref() << "\n"; } else { - out << " displayName is not set\n"; + strm << " displayName is not set\n"; } - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; + if (recipientUserId.isSet()) { + strm << " recipientUserId = " + << recipientUserId.ref() << "\n"; } else { - out << " recipientUserId is not set\n"; + strm << " recipientUserId is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; + if (restrictions.isSet()) { + strm << " restrictions = " + << restrictions.ref() << "\n"; } else { - out << " restrictions is not set\n"; + strm << " restrictions is not set\n"; } - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; + if (sharerUserId.isSet()) { + strm << " sharerUserId = " + << sharerUserId.ref() << "\n"; } else { - out << " sharerUserId is not set\n"; + strm << " sharerUserId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteMemberShareRelationship & value) +void writeNoteInvitationShareRelationship( + ThriftBinaryBufferWriter & w, + const NoteInvitationShareRelationship & s) { - out << "NoteMemberShareRelationship: {\n"; - - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; - } - else { - out << " displayName is not set\n"; - } - - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; - } - else { - out << " recipientUserId is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; - } - else { - out << " restrictions is not set\n"; - } - - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; - } - else { - out << " sharerUserId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const NoteInvitationShareRelationship & s) { w.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); if (s.displayName.isSet()) { w.writeFieldBegin( @@ -8228,7 +6779,10 @@ void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const No w.writeStructEnd(); } -void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvitationShareRelationship & s) { +void readNoteInvitationShareRelationship( + ThriftBinaryBufferReader & r, + NoteInvitationShareRelationship & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -8281,95 +6835,51 @@ void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvit r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteInvitationShareRelationship & value) +void NoteInvitationShareRelationship::print(QTextStream & strm) const { - out << "NoteInvitationShareRelationship: {\n"; + strm << "NoteInvitationShareRelationship: {\n"; - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; + if (displayName.isSet()) { + strm << " displayName = " + << displayName.ref() << "\n"; } else { - out << " displayName is not set\n"; + strm << " displayName is not set\n"; } - if (value.recipientIdentityId.isSet()) { - out << " recipientIdentityId = " - << value.recipientIdentityId.ref() << "\n"; + if (recipientIdentityId.isSet()) { + strm << " recipientIdentityId = " + << recipientIdentityId.ref() << "\n"; } else { - out << " recipientIdentityId is not set\n"; + strm << " recipientIdentityId is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; + if (sharerUserId.isSet()) { + strm << " sharerUserId = " + << sharerUserId.ref() << "\n"; } else { - out << " sharerUserId is not set\n"; + strm << " sharerUserId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteInvitationShareRelationship & value) +void writeNoteShareRelationships( + ThriftBinaryBufferWriter & w, + const NoteShareRelationships & s) { - out << "NoteInvitationShareRelationship: {\n"; - - if (value.displayName.isSet()) { - out << " displayName = " - << value.displayName.ref() << "\n"; - } - else { - out << " displayName is not set\n"; - } - - if (value.recipientIdentityId.isSet()) { - out << " recipientIdentityId = " - << value.recipientIdentityId.ref() << "\n"; - } - else { - out << " recipientIdentityId is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; - } - else { - out << " sharerUserId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRelationships & s) { w.writeStructBegin(QStringLiteral("NoteShareRelationships")); if (s.invitations.isSet()) { w.writeFieldBegin( @@ -8407,7 +6917,10 @@ void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRe w.writeStructEnd(); } -void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelationships & s) { +void readNoteShareRelationships( + ThriftBinaryBufferReader & r, + NoteShareRelationships & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -8423,7 +6936,11 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteShareRelationships.invitations)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteShareRelationships.invitations)")); + } for(qint32 i = 0; i < size; i++) { NoteInvitationShareRelationship elem; readNoteInvitationShareRelationship(r, elem); @@ -8442,7 +6959,11 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (NoteShareRelationships.memberships)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (NoteShareRelationships.memberships)")); + } for(qint32 i = 0; i < size; i++) { NoteMemberShareRelationship elem; readNoteMemberShareRelationship(r, elem); @@ -8471,91 +6992,51 @@ void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelations r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteShareRelationships & value) +void NoteShareRelationships::print(QTextStream & strm) const { - out << "NoteShareRelationships: {\n"; + strm << "NoteShareRelationships: {\n"; - if (value.invitations.isSet()) { - out << " invitations = " + if (invitations.isSet()) { + strm << " invitations = " << "QList {"; - for(const auto & v: value.invitations.ref()) { - out << v; + for(const auto & v: invitations.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " invitations is not set\n"; + strm << " invitations is not set\n"; } - if (value.memberships.isSet()) { - out << " memberships = " + if (memberships.isSet()) { + strm << " memberships = " << "QList {"; - for(const auto & v: value.memberships.ref()) { - out << v; + for(const auto & v: memberships.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " memberships is not set\n"; + strm << " memberships is not set\n"; } - if (value.invitationRestrictions.isSet()) { - out << " invitationRestrictions = " - << value.invitationRestrictions.ref() << "\n"; + if (invitationRestrictions.isSet()) { + strm << " invitationRestrictions = " + << invitationRestrictions.ref() << "\n"; } else { - out << " invitationRestrictions is not set\n"; + strm << " invitationRestrictions is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteShareRelationships & value) +void writeManageNoteSharesParameters( + ThriftBinaryBufferWriter & w, + const ManageNoteSharesParameters & s) { - out << "NoteShareRelationships: {\n"; - - if (value.invitations.isSet()) { - out << " invitations = " - << "QList {"; - for(const auto & v: value.invitations.ref()) { - out << v; - } - } - else { - out << " invitations is not set\n"; - } - - if (value.memberships.isSet()) { - out << " memberships = " - << "QList {"; - for(const auto & v: value.memberships.ref()) { - out << v; - } - } - else { - out << " memberships is not set\n"; - } - - if (value.invitationRestrictions.isSet()) { - out << " invitationRestrictions = " - << value.invitationRestrictions.ref() << "\n"; - } - else { - out << " invitationRestrictions is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageNoteSharesParameters & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); if (s.noteGuid.isSet()) { w.writeFieldBegin( @@ -8617,7 +7098,10 @@ void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageN w.writeStructEnd(); } -void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteSharesParameters & s) { +void readManageNoteSharesParameters( + ThriftBinaryBufferReader & r, + ManageNoteSharesParameters & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -8642,7 +7126,11 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNoteSharesParameters.membershipsToUpdate)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNoteSharesParameters.membershipsToUpdate)")); + } for(qint32 i = 0; i < size; i++) { NoteMemberShareRelationship elem; readNoteMemberShareRelationship(r, elem); @@ -8661,7 +7149,11 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNoteSharesParameters.invitationsToUpdate)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNoteSharesParameters.invitationsToUpdate)")); + } for(qint32 i = 0; i < size; i++) { NoteInvitationShareRelationship elem; readNoteInvitationShareRelationship(r, elem); @@ -8680,7 +7172,11 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNoteSharesParameters.membershipsToUnshare)")); + if (elemType != ThriftFieldType::T_I32) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNoteSharesParameters.membershipsToUnshare)")); + } for(qint32 i = 0; i < size; i++) { UserID elem; r.readI32(elem); @@ -8699,7 +7195,11 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_I64) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNoteSharesParameters.invitationsToUnshare)")); + if (elemType != ThriftFieldType::T_I64) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNoteSharesParameters.invitationsToUnshare)")); + } for(qint32 i = 0; i < size; i++) { IdentityID elem; r.readI64(elem); @@ -8719,135 +7219,75 @@ void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteShar r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNoteSharesParameters & value) +void ManageNoteSharesParameters::print(QTextStream & strm) const { - out << "ManageNoteSharesParameters: {\n"; + strm << "ManageNoteSharesParameters: {\n"; - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; + if (noteGuid.isSet()) { + strm << " noteGuid = " + << noteGuid.ref() << "\n"; } else { - out << " noteGuid is not set\n"; + strm << " noteGuid is not set\n"; } - if (value.membershipsToUpdate.isSet()) { - out << " membershipsToUpdate = " + if (membershipsToUpdate.isSet()) { + strm << " membershipsToUpdate = " << "QList {"; - for(const auto & v: value.membershipsToUpdate.ref()) { - out << v; + for(const auto & v: membershipsToUpdate.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " membershipsToUpdate is not set\n"; + strm << " membershipsToUpdate is not set\n"; } - if (value.invitationsToUpdate.isSet()) { - out << " invitationsToUpdate = " + if (invitationsToUpdate.isSet()) { + strm << " invitationsToUpdate = " << "QList {"; - for(const auto & v: value.invitationsToUpdate.ref()) { - out << v; + for(const auto & v: invitationsToUpdate.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " invitationsToUpdate is not set\n"; + strm << " invitationsToUpdate is not set\n"; } - if (value.membershipsToUnshare.isSet()) { - out << " membershipsToUnshare = " + if (membershipsToUnshare.isSet()) { + strm << " membershipsToUnshare = " << "QList {"; - for(const auto & v: value.membershipsToUnshare.ref()) { - out << v; + for(const auto & v: membershipsToUnshare.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " membershipsToUnshare is not set\n"; + strm << " membershipsToUnshare is not set\n"; } - if (value.invitationsToUnshare.isSet()) { - out << " invitationsToUnshare = " + if (invitationsToUnshare.isSet()) { + strm << " invitationsToUnshare = " << "QList {"; - for(const auto & v: value.invitationsToUnshare.ref()) { - out << v; + for(const auto & v: invitationsToUnshare.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " invitationsToUnshare is not set\n"; + strm << " invitationsToUnshare is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNoteSharesParameters & value) +void writeManageNoteSharesError( + ThriftBinaryBufferWriter & w, + const ManageNoteSharesError & s) { - out << "ManageNoteSharesParameters: {\n"; - - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; - } - else { - out << " noteGuid is not set\n"; - } - - if (value.membershipsToUpdate.isSet()) { - out << " membershipsToUpdate = " - << "QList {"; - for(const auto & v: value.membershipsToUpdate.ref()) { - out << v; - } - } - else { - out << " membershipsToUpdate is not set\n"; - } - - if (value.invitationsToUpdate.isSet()) { - out << " invitationsToUpdate = " - << "QList {"; - for(const auto & v: value.invitationsToUpdate.ref()) { - out << v; - } - } - else { - out << " invitationsToUpdate is not set\n"; - } - - if (value.membershipsToUnshare.isSet()) { - out << " membershipsToUnshare = " - << "QList {"; - for(const auto & v: value.membershipsToUnshare.ref()) { - out << v; - } - } - else { - out << " membershipsToUnshare is not set\n"; - } - - if (value.invitationsToUnshare.isSet()) { - out << " invitationsToUnshare = " - << "QList {"; - for(const auto & v: value.invitationsToUnshare.ref()) { - out << v; - } - } - else { - out << " invitationsToUnshare is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSharesError & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesError")); if (s.identityID.isSet()) { w.writeFieldBegin( @@ -8885,7 +7325,10 @@ void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSh w.writeStructEnd(); } -void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesError & s) { +void readManageNoteSharesError( + ThriftBinaryBufferReader & r, + ManageNoteSharesError & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -8938,95 +7381,51 @@ void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesErr r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNoteSharesError & value) +void ManageNoteSharesError::print(QTextStream & strm) const { - out << "ManageNoteSharesError: {\n"; + strm << "ManageNoteSharesError: {\n"; - if (value.identityID.isSet()) { - out << " identityID = " - << value.identityID.ref() << "\n"; + if (identityID.isSet()) { + strm << " identityID = " + << identityID.ref() << "\n"; } else { - out << " identityID is not set\n"; + strm << " identityID is not set\n"; } - if (value.userID.isSet()) { - out << " userID = " - << value.userID.ref() << "\n"; + if (userID.isSet()) { + strm << " userID = " + << userID.ref() << "\n"; } else { - out << " userID is not set\n"; + strm << " userID is not set\n"; } - if (value.userException.isSet()) { - out << " userException = " - << value.userException.ref() << "\n"; + if (userException.isSet()) { + strm << " userException = " + << userException.ref() << "\n"; } else { - out << " userException is not set\n"; + strm << " userException is not set\n"; } - if (value.notFoundException.isSet()) { - out << " notFoundException = " - << value.notFoundException.ref() << "\n"; + if (notFoundException.isSet()) { + strm << " notFoundException = " + << notFoundException.ref() << "\n"; } else { - out << " notFoundException is not set\n"; + strm << " notFoundException is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNoteSharesError & value) +void writeManageNoteSharesResult( + ThriftBinaryBufferWriter & w, + const ManageNoteSharesResult & s) { - out << "ManageNoteSharesError: {\n"; - - if (value.identityID.isSet()) { - out << " identityID = " - << value.identityID.ref() << "\n"; - } - else { - out << " identityID is not set\n"; - } - - if (value.userID.isSet()) { - out << " userID = " - << value.userID.ref() << "\n"; - } - else { - out << " userID is not set\n"; - } - - if (value.userException.isSet()) { - out << " userException = " - << value.userException.ref() << "\n"; - } - else { - out << " userException is not set\n"; - } - - if (value.notFoundException.isSet()) { - out << " notFoundException = " - << value.notFoundException.ref() << "\n"; - } - else { - out << " notFoundException is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteSharesResult & s) { w.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); if (s.errors.isSet()) { w.writeFieldBegin( @@ -9044,7 +7443,10 @@ void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteS w.writeStructEnd(); } -void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesResult & s) { +void readManageNoteSharesResult( + ThriftBinaryBufferReader & r, + ManageNoteSharesResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -9060,7 +7462,11 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (ManageNoteSharesResult.errors)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (ManageNoteSharesResult.errors)")); + } for(qint32 i = 0; i < size; i++) { ManageNoteSharesError elem; readManageNoteSharesError(r, elem); @@ -9080,53 +7486,31 @@ void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesRe r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ManageNoteSharesResult & value) +void ManageNoteSharesResult::print(QTextStream & strm) const { - out << "ManageNoteSharesResult: {\n"; + strm << "ManageNoteSharesResult: {\n"; - if (value.errors.isSet()) { - out << " errors = " + if (errors.isSet()) { + strm << " errors = " << "QList {"; - for(const auto & v: value.errors.ref()) { - out << v; + for(const auto & v: errors.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " errors is not set\n"; + strm << " errors is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ManageNoteSharesResult & value) +void writeData( + ThriftBinaryBufferWriter & w, + const Data & s) { - out << "ManageNoteSharesResult: {\n"; - - if (value.errors.isSet()) { - out << " errors = " - << "QList {"; - for(const auto & v: value.errors.ref()) { - out << v; - } - } - else { - out << " errors is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeData(ThriftBinaryBufferWriter & w, const Data & s) { w.writeStructBegin(QStringLiteral("Data")); if (s.bodyHash.isSet()) { w.writeFieldBegin( @@ -9156,7 +7540,10 @@ void writeData(ThriftBinaryBufferWriter & w, const Data & s) { w.writeStructEnd(); } -void readData(ThriftBinaryBufferReader & r, Data & s) { +void readData( + ThriftBinaryBufferReader & r, + Data & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -9200,79 +7587,43 @@ void readData(ThriftBinaryBufferReader & r, Data & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Data & value) +void Data::print(QTextStream & strm) const { - out << "Data: {\n"; + strm << "Data: {\n"; - if (value.bodyHash.isSet()) { - out << " bodyHash = " - << value.bodyHash.ref() << "\n"; + if (bodyHash.isSet()) { + strm << " bodyHash = " + << bodyHash.ref() << "\n"; } else { - out << " bodyHash is not set\n"; + strm << " bodyHash is not set\n"; } - if (value.size.isSet()) { - out << " size = " - << value.size.ref() << "\n"; + if (size.isSet()) { + strm << " size = " + << size.ref() << "\n"; } else { - out << " size is not set\n"; + strm << " size is not set\n"; } - if (value.body.isSet()) { - out << " body = " - << value.body.ref() << "\n"; + if (body.isSet()) { + strm << " body = " + << body.ref() << "\n"; } else { - out << " body is not set\n"; + strm << " body is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Data & value) +void writeUserAttributes( + ThriftBinaryBufferWriter & w, + const UserAttributes & s) { - out << "Data: {\n"; - - if (value.bodyHash.isSet()) { - out << " bodyHash = " - << value.bodyHash.ref() << "\n"; - } - else { - out << " bodyHash is not set\n"; - } - - if (value.size.isSet()) { - out << " size = " - << value.size.ref() << "\n"; - } - else { - out << " size is not set\n"; - } - - if (value.body.isSet()) { - out << " body = " - << value.body.ref() << "\n"; - } - else { - out << " body is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) { w.writeStructBegin(QStringLiteral("UserAttributes")); if (s.defaultLocationName.isSet()) { w.writeFieldBegin( @@ -9566,7 +7917,10 @@ void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s) w.writeStructEnd(); } -void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { +void readUserAttributes( + ThriftBinaryBufferReader & r, + UserAttributes & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -9618,7 +7972,11 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (UserAttributes.viewedPromotions)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (UserAttributes.viewedPromotions)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -9646,7 +8004,11 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (UserAttributes.recentMailedAddresses)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (UserAttributes.recentMailedAddresses)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -9918,603 +8280,307 @@ void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const UserAttributes & value) +void UserAttributes::print(QTextStream & strm) const { - out << "UserAttributes: {\n"; + strm << "UserAttributes: {\n"; - if (value.defaultLocationName.isSet()) { - out << " defaultLocationName = " - << value.defaultLocationName.ref() << "\n"; + if (defaultLocationName.isSet()) { + strm << " defaultLocationName = " + << defaultLocationName.ref() << "\n"; } else { - out << " defaultLocationName is not set\n"; + strm << " defaultLocationName is not set\n"; } - if (value.defaultLatitude.isSet()) { - out << " defaultLatitude = " - << value.defaultLatitude.ref() << "\n"; + if (defaultLatitude.isSet()) { + strm << " defaultLatitude = " + << defaultLatitude.ref() << "\n"; } else { - out << " defaultLatitude is not set\n"; + strm << " defaultLatitude is not set\n"; } - if (value.defaultLongitude.isSet()) { - out << " defaultLongitude = " - << value.defaultLongitude.ref() << "\n"; + if (defaultLongitude.isSet()) { + strm << " defaultLongitude = " + << defaultLongitude.ref() << "\n"; } else { - out << " defaultLongitude is not set\n"; + strm << " defaultLongitude is not set\n"; } - if (value.preactivation.isSet()) { - out << " preactivation = " - << value.preactivation.ref() << "\n"; + if (preactivation.isSet()) { + strm << " preactivation = " + << preactivation.ref() << "\n"; } else { - out << " preactivation is not set\n"; + strm << " preactivation is not set\n"; } - if (value.viewedPromotions.isSet()) { - out << " viewedPromotions = " + if (viewedPromotions.isSet()) { + strm << " viewedPromotions = " << "QList {"; - for(const auto & v: value.viewedPromotions.ref()) { - out << v; + for(const auto & v: viewedPromotions.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " viewedPromotions is not set\n"; + strm << " viewedPromotions is not set\n"; } - if (value.incomingEmailAddress.isSet()) { - out << " incomingEmailAddress = " - << value.incomingEmailAddress.ref() << "\n"; + if (incomingEmailAddress.isSet()) { + strm << " incomingEmailAddress = " + << incomingEmailAddress.ref() << "\n"; } else { - out << " incomingEmailAddress is not set\n"; + strm << " incomingEmailAddress is not set\n"; } - if (value.recentMailedAddresses.isSet()) { - out << " recentMailedAddresses = " + if (recentMailedAddresses.isSet()) { + strm << " recentMailedAddresses = " << "QList {"; - for(const auto & v: value.recentMailedAddresses.ref()) { - out << v; + for(const auto & v: recentMailedAddresses.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " recentMailedAddresses is not set\n"; + strm << " recentMailedAddresses is not set\n"; } - if (value.comments.isSet()) { - out << " comments = " - << value.comments.ref() << "\n"; + if (comments.isSet()) { + strm << " comments = " + << comments.ref() << "\n"; } else { - out << " comments is not set\n"; + strm << " comments is not set\n"; } - if (value.dateAgreedToTermsOfService.isSet()) { - out << " dateAgreedToTermsOfService = " - << value.dateAgreedToTermsOfService.ref() << "\n"; + if (dateAgreedToTermsOfService.isSet()) { + strm << " dateAgreedToTermsOfService = " + << dateAgreedToTermsOfService.ref() << "\n"; } else { - out << " dateAgreedToTermsOfService is not set\n"; + strm << " dateAgreedToTermsOfService is not set\n"; } - if (value.maxReferrals.isSet()) { - out << " maxReferrals = " - << value.maxReferrals.ref() << "\n"; + if (maxReferrals.isSet()) { + strm << " maxReferrals = " + << maxReferrals.ref() << "\n"; } else { - out << " maxReferrals is not set\n"; + strm << " maxReferrals is not set\n"; } - if (value.referralCount.isSet()) { - out << " referralCount = " - << value.referralCount.ref() << "\n"; + if (referralCount.isSet()) { + strm << " referralCount = " + << referralCount.ref() << "\n"; } else { - out << " referralCount is not set\n"; + strm << " referralCount is not set\n"; } - if (value.refererCode.isSet()) { - out << " refererCode = " - << value.refererCode.ref() << "\n"; + if (refererCode.isSet()) { + strm << " refererCode = " + << refererCode.ref() << "\n"; } else { - out << " refererCode is not set\n"; + strm << " refererCode is not set\n"; } - if (value.sentEmailDate.isSet()) { - out << " sentEmailDate = " - << value.sentEmailDate.ref() << "\n"; + if (sentEmailDate.isSet()) { + strm << " sentEmailDate = " + << sentEmailDate.ref() << "\n"; } else { - out << " sentEmailDate is not set\n"; + strm << " sentEmailDate is not set\n"; } - if (value.sentEmailCount.isSet()) { - out << " sentEmailCount = " - << value.sentEmailCount.ref() << "\n"; + if (sentEmailCount.isSet()) { + strm << " sentEmailCount = " + << sentEmailCount.ref() << "\n"; } else { - out << " sentEmailCount is not set\n"; + strm << " sentEmailCount is not set\n"; } - if (value.dailyEmailLimit.isSet()) { - out << " dailyEmailLimit = " - << value.dailyEmailLimit.ref() << "\n"; + if (dailyEmailLimit.isSet()) { + strm << " dailyEmailLimit = " + << dailyEmailLimit.ref() << "\n"; } else { - out << " dailyEmailLimit is not set\n"; + strm << " dailyEmailLimit is not set\n"; } - if (value.emailOptOutDate.isSet()) { - out << " emailOptOutDate = " - << value.emailOptOutDate.ref() << "\n"; + if (emailOptOutDate.isSet()) { + strm << " emailOptOutDate = " + << emailOptOutDate.ref() << "\n"; } else { - out << " emailOptOutDate is not set\n"; + strm << " emailOptOutDate is not set\n"; } - if (value.partnerEmailOptInDate.isSet()) { - out << " partnerEmailOptInDate = " - << value.partnerEmailOptInDate.ref() << "\n"; + if (partnerEmailOptInDate.isSet()) { + strm << " partnerEmailOptInDate = " + << partnerEmailOptInDate.ref() << "\n"; } else { - out << " partnerEmailOptInDate is not set\n"; + strm << " partnerEmailOptInDate is not set\n"; } - if (value.preferredLanguage.isSet()) { - out << " preferredLanguage = " - << value.preferredLanguage.ref() << "\n"; + if (preferredLanguage.isSet()) { + strm << " preferredLanguage = " + << preferredLanguage.ref() << "\n"; } else { - out << " preferredLanguage is not set\n"; + strm << " preferredLanguage is not set\n"; } - if (value.preferredCountry.isSet()) { - out << " preferredCountry = " - << value.preferredCountry.ref() << "\n"; + if (preferredCountry.isSet()) { + strm << " preferredCountry = " + << preferredCountry.ref() << "\n"; } else { - out << " preferredCountry is not set\n"; + strm << " preferredCountry is not set\n"; } - if (value.clipFullPage.isSet()) { - out << " clipFullPage = " - << value.clipFullPage.ref() << "\n"; + if (clipFullPage.isSet()) { + strm << " clipFullPage = " + << clipFullPage.ref() << "\n"; } else { - out << " clipFullPage is not set\n"; + strm << " clipFullPage is not set\n"; } - if (value.twitterUserName.isSet()) { - out << " twitterUserName = " - << value.twitterUserName.ref() << "\n"; + if (twitterUserName.isSet()) { + strm << " twitterUserName = " + << twitterUserName.ref() << "\n"; } else { - out << " twitterUserName is not set\n"; + strm << " twitterUserName is not set\n"; } - if (value.twitterId.isSet()) { - out << " twitterId = " - << value.twitterId.ref() << "\n"; + if (twitterId.isSet()) { + strm << " twitterId = " + << twitterId.ref() << "\n"; } else { - out << " twitterId is not set\n"; + strm << " twitterId is not set\n"; } - if (value.groupName.isSet()) { - out << " groupName = " - << value.groupName.ref() << "\n"; + if (groupName.isSet()) { + strm << " groupName = " + << groupName.ref() << "\n"; } else { - out << " groupName is not set\n"; + strm << " groupName is not set\n"; } - if (value.recognitionLanguage.isSet()) { - out << " recognitionLanguage = " - << value.recognitionLanguage.ref() << "\n"; + if (recognitionLanguage.isSet()) { + strm << " recognitionLanguage = " + << recognitionLanguage.ref() << "\n"; } else { - out << " recognitionLanguage is not set\n"; + strm << " recognitionLanguage is not set\n"; } - if (value.referralProof.isSet()) { - out << " referralProof = " - << value.referralProof.ref() << "\n"; + if (referralProof.isSet()) { + strm << " referralProof = " + << referralProof.ref() << "\n"; } else { - out << " referralProof is not set\n"; + strm << " referralProof is not set\n"; } - if (value.educationalDiscount.isSet()) { - out << " educationalDiscount = " - << value.educationalDiscount.ref() << "\n"; + if (educationalDiscount.isSet()) { + strm << " educationalDiscount = " + << educationalDiscount.ref() << "\n"; } else { - out << " educationalDiscount is not set\n"; + strm << " educationalDiscount is not set\n"; } - if (value.businessAddress.isSet()) { - out << " businessAddress = " - << value.businessAddress.ref() << "\n"; + if (businessAddress.isSet()) { + strm << " businessAddress = " + << businessAddress.ref() << "\n"; } else { - out << " businessAddress is not set\n"; + strm << " businessAddress is not set\n"; } - if (value.hideSponsorBilling.isSet()) { - out << " hideSponsorBilling = " - << value.hideSponsorBilling.ref() << "\n"; + if (hideSponsorBilling.isSet()) { + strm << " hideSponsorBilling = " + << hideSponsorBilling.ref() << "\n"; } else { - out << " hideSponsorBilling is not set\n"; + strm << " hideSponsorBilling is not set\n"; } - if (value.useEmailAutoFiling.isSet()) { - out << " useEmailAutoFiling = " - << value.useEmailAutoFiling.ref() << "\n"; + if (useEmailAutoFiling.isSet()) { + strm << " useEmailAutoFiling = " + << useEmailAutoFiling.ref() << "\n"; } else { - out << " useEmailAutoFiling is not set\n"; + strm << " useEmailAutoFiling is not set\n"; } - if (value.reminderEmailConfig.isSet()) { - out << " reminderEmailConfig = " - << value.reminderEmailConfig.ref() << "\n"; + if (reminderEmailConfig.isSet()) { + strm << " reminderEmailConfig = " + << reminderEmailConfig.ref() << "\n"; } else { - out << " reminderEmailConfig is not set\n"; + strm << " reminderEmailConfig is not set\n"; } - if (value.emailAddressLastConfirmed.isSet()) { - out << " emailAddressLastConfirmed = " - << value.emailAddressLastConfirmed.ref() << "\n"; + if (emailAddressLastConfirmed.isSet()) { + strm << " emailAddressLastConfirmed = " + << emailAddressLastConfirmed.ref() << "\n"; } else { - out << " emailAddressLastConfirmed is not set\n"; + strm << " emailAddressLastConfirmed is not set\n"; } - if (value.passwordUpdated.isSet()) { - out << " passwordUpdated = " - << value.passwordUpdated.ref() << "\n"; + if (passwordUpdated.isSet()) { + strm << " passwordUpdated = " + << passwordUpdated.ref() << "\n"; } else { - out << " passwordUpdated is not set\n"; + strm << " passwordUpdated is not set\n"; } - if (value.salesforcePushEnabled.isSet()) { - out << " salesforcePushEnabled = " - << value.salesforcePushEnabled.ref() << "\n"; + if (salesforcePushEnabled.isSet()) { + strm << " salesforcePushEnabled = " + << salesforcePushEnabled.ref() << "\n"; } else { - out << " salesforcePushEnabled is not set\n"; + strm << " salesforcePushEnabled is not set\n"; } - if (value.shouldLogClientEvent.isSet()) { - out << " shouldLogClientEvent = " - << value.shouldLogClientEvent.ref() << "\n"; + if (shouldLogClientEvent.isSet()) { + strm << " shouldLogClientEvent = " + << shouldLogClientEvent.ref() << "\n"; } else { - out << " shouldLogClientEvent is not set\n"; + strm << " shouldLogClientEvent is not set\n"; } - if (value.optOutMachineLearning.isSet()) { - out << " optOutMachineLearning = " - << value.optOutMachineLearning.ref() << "\n"; + if (optOutMachineLearning.isSet()) { + strm << " optOutMachineLearning = " + << optOutMachineLearning.ref() << "\n"; } else { - out << " optOutMachineLearning is not set\n"; + strm << " optOutMachineLearning is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const UserAttributes & value) +void writeBusinessUserAttributes( + ThriftBinaryBufferWriter & w, + const BusinessUserAttributes & s) { - out << "UserAttributes: {\n"; - - if (value.defaultLocationName.isSet()) { - out << " defaultLocationName = " - << value.defaultLocationName.ref() << "\n"; - } - else { - out << " defaultLocationName is not set\n"; - } - - if (value.defaultLatitude.isSet()) { - out << " defaultLatitude = " - << value.defaultLatitude.ref() << "\n"; - } - else { - out << " defaultLatitude is not set\n"; - } - - if (value.defaultLongitude.isSet()) { - out << " defaultLongitude = " - << value.defaultLongitude.ref() << "\n"; - } - else { - out << " defaultLongitude is not set\n"; - } - - if (value.preactivation.isSet()) { - out << " preactivation = " - << value.preactivation.ref() << "\n"; - } - else { - out << " preactivation is not set\n"; - } - - if (value.viewedPromotions.isSet()) { - out << " viewedPromotions = " - << "QList {"; - for(const auto & v: value.viewedPromotions.ref()) { - out << v; - } - } - else { - out << " viewedPromotions is not set\n"; - } - - if (value.incomingEmailAddress.isSet()) { - out << " incomingEmailAddress = " - << value.incomingEmailAddress.ref() << "\n"; - } - else { - out << " incomingEmailAddress is not set\n"; - } - - if (value.recentMailedAddresses.isSet()) { - out << " recentMailedAddresses = " - << "QList {"; - for(const auto & v: value.recentMailedAddresses.ref()) { - out << v; - } - } - else { - out << " recentMailedAddresses is not set\n"; - } - - if (value.comments.isSet()) { - out << " comments = " - << value.comments.ref() << "\n"; - } - else { - out << " comments is not set\n"; - } - - if (value.dateAgreedToTermsOfService.isSet()) { - out << " dateAgreedToTermsOfService = " - << value.dateAgreedToTermsOfService.ref() << "\n"; - } - else { - out << " dateAgreedToTermsOfService is not set\n"; - } - - if (value.maxReferrals.isSet()) { - out << " maxReferrals = " - << value.maxReferrals.ref() << "\n"; - } - else { - out << " maxReferrals is not set\n"; - } - - if (value.referralCount.isSet()) { - out << " referralCount = " - << value.referralCount.ref() << "\n"; - } - else { - out << " referralCount is not set\n"; - } - - if (value.refererCode.isSet()) { - out << " refererCode = " - << value.refererCode.ref() << "\n"; - } - else { - out << " refererCode is not set\n"; - } - - if (value.sentEmailDate.isSet()) { - out << " sentEmailDate = " - << value.sentEmailDate.ref() << "\n"; - } - else { - out << " sentEmailDate is not set\n"; - } - - if (value.sentEmailCount.isSet()) { - out << " sentEmailCount = " - << value.sentEmailCount.ref() << "\n"; - } - else { - out << " sentEmailCount is not set\n"; - } - - if (value.dailyEmailLimit.isSet()) { - out << " dailyEmailLimit = " - << value.dailyEmailLimit.ref() << "\n"; - } - else { - out << " dailyEmailLimit is not set\n"; - } - - if (value.emailOptOutDate.isSet()) { - out << " emailOptOutDate = " - << value.emailOptOutDate.ref() << "\n"; - } - else { - out << " emailOptOutDate is not set\n"; - } - - if (value.partnerEmailOptInDate.isSet()) { - out << " partnerEmailOptInDate = " - << value.partnerEmailOptInDate.ref() << "\n"; - } - else { - out << " partnerEmailOptInDate is not set\n"; - } - - if (value.preferredLanguage.isSet()) { - out << " preferredLanguage = " - << value.preferredLanguage.ref() << "\n"; - } - else { - out << " preferredLanguage is not set\n"; - } - - if (value.preferredCountry.isSet()) { - out << " preferredCountry = " - << value.preferredCountry.ref() << "\n"; - } - else { - out << " preferredCountry is not set\n"; - } - - if (value.clipFullPage.isSet()) { - out << " clipFullPage = " - << value.clipFullPage.ref() << "\n"; - } - else { - out << " clipFullPage is not set\n"; - } - - if (value.twitterUserName.isSet()) { - out << " twitterUserName = " - << value.twitterUserName.ref() << "\n"; - } - else { - out << " twitterUserName is not set\n"; - } - - if (value.twitterId.isSet()) { - out << " twitterId = " - << value.twitterId.ref() << "\n"; - } - else { - out << " twitterId is not set\n"; - } - - if (value.groupName.isSet()) { - out << " groupName = " - << value.groupName.ref() << "\n"; - } - else { - out << " groupName is not set\n"; - } - - if (value.recognitionLanguage.isSet()) { - out << " recognitionLanguage = " - << value.recognitionLanguage.ref() << "\n"; - } - else { - out << " recognitionLanguage is not set\n"; - } - - if (value.referralProof.isSet()) { - out << " referralProof = " - << value.referralProof.ref() << "\n"; - } - else { - out << " referralProof is not set\n"; - } - - if (value.educationalDiscount.isSet()) { - out << " educationalDiscount = " - << value.educationalDiscount.ref() << "\n"; - } - else { - out << " educationalDiscount is not set\n"; - } - - if (value.businessAddress.isSet()) { - out << " businessAddress = " - << value.businessAddress.ref() << "\n"; - } - else { - out << " businessAddress is not set\n"; - } - - if (value.hideSponsorBilling.isSet()) { - out << " hideSponsorBilling = " - << value.hideSponsorBilling.ref() << "\n"; - } - else { - out << " hideSponsorBilling is not set\n"; - } - - if (value.useEmailAutoFiling.isSet()) { - out << " useEmailAutoFiling = " - << value.useEmailAutoFiling.ref() << "\n"; - } - else { - out << " useEmailAutoFiling is not set\n"; - } - - if (value.reminderEmailConfig.isSet()) { - out << " reminderEmailConfig = " - << value.reminderEmailConfig.ref() << "\n"; - } - else { - out << " reminderEmailConfig is not set\n"; - } - - if (value.emailAddressLastConfirmed.isSet()) { - out << " emailAddressLastConfirmed = " - << value.emailAddressLastConfirmed.ref() << "\n"; - } - else { - out << " emailAddressLastConfirmed is not set\n"; - } - - if (value.passwordUpdated.isSet()) { - out << " passwordUpdated = " - << value.passwordUpdated.ref() << "\n"; - } - else { - out << " passwordUpdated is not set\n"; - } - - if (value.salesforcePushEnabled.isSet()) { - out << " salesforcePushEnabled = " - << value.salesforcePushEnabled.ref() << "\n"; - } - else { - out << " salesforcePushEnabled is not set\n"; - } - - if (value.shouldLogClientEvent.isSet()) { - out << " shouldLogClientEvent = " - << value.shouldLogClientEvent.ref() << "\n"; - } - else { - out << " shouldLogClientEvent is not set\n"; - } - - if (value.optOutMachineLearning.isSet()) { - out << " optOutMachineLearning = " - << value.optOutMachineLearning.ref() << "\n"; - } - else { - out << " optOutMachineLearning is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s) { w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); if (s.title.isSet()) { w.writeFieldBegin( @@ -10576,7 +8642,10 @@ void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUse w.writeStructEnd(); } -void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttributes & s) { +void readBusinessUserAttributes( + ThriftBinaryBufferReader & r, + BusinessUserAttributes & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -10656,143 +8725,75 @@ void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttrib r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BusinessUserAttributes & value) +void BusinessUserAttributes::print(QTextStream & strm) const { - out << "BusinessUserAttributes: {\n"; + strm << "BusinessUserAttributes: {\n"; - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; + if (title.isSet()) { + strm << " title = " + << title.ref() << "\n"; } else { - out << " title is not set\n"; + strm << " title is not set\n"; } - if (value.location.isSet()) { - out << " location = " - << value.location.ref() << "\n"; + if (location.isSet()) { + strm << " location = " + << location.ref() << "\n"; } else { - out << " location is not set\n"; + strm << " location is not set\n"; } - if (value.department.isSet()) { - out << " department = " - << value.department.ref() << "\n"; + if (department.isSet()) { + strm << " department = " + << department.ref() << "\n"; } else { - out << " department is not set\n"; + strm << " department is not set\n"; } - if (value.mobilePhone.isSet()) { - out << " mobilePhone = " - << value.mobilePhone.ref() << "\n"; + if (mobilePhone.isSet()) { + strm << " mobilePhone = " + << mobilePhone.ref() << "\n"; } else { - out << " mobilePhone is not set\n"; + strm << " mobilePhone is not set\n"; } - if (value.linkedInProfileUrl.isSet()) { - out << " linkedInProfileUrl = " - << value.linkedInProfileUrl.ref() << "\n"; + if (linkedInProfileUrl.isSet()) { + strm << " linkedInProfileUrl = " + << linkedInProfileUrl.ref() << "\n"; } else { - out << " linkedInProfileUrl is not set\n"; + strm << " linkedInProfileUrl is not set\n"; } - if (value.workPhone.isSet()) { - out << " workPhone = " - << value.workPhone.ref() << "\n"; + if (workPhone.isSet()) { + strm << " workPhone = " + << workPhone.ref() << "\n"; } else { - out << " workPhone is not set\n"; + strm << " workPhone is not set\n"; } - if (value.companyStartDate.isSet()) { - out << " companyStartDate = " - << value.companyStartDate.ref() << "\n"; + if (companyStartDate.isSet()) { + strm << " companyStartDate = " + << companyStartDate.ref() << "\n"; } else { - out << " companyStartDate is not set\n"; + strm << " companyStartDate is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const BusinessUserAttributes & value) +void writeAccounting( + ThriftBinaryBufferWriter & w, + const Accounting & s) { - out << "BusinessUserAttributes: {\n"; - - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; - } - else { - out << " title is not set\n"; - } - - if (value.location.isSet()) { - out << " location = " - << value.location.ref() << "\n"; - } - else { - out << " location is not set\n"; - } - - if (value.department.isSet()) { - out << " department = " - << value.department.ref() << "\n"; - } - else { - out << " department is not set\n"; - } - - if (value.mobilePhone.isSet()) { - out << " mobilePhone = " - << value.mobilePhone.ref() << "\n"; - } - else { - out << " mobilePhone is not set\n"; - } - - if (value.linkedInProfileUrl.isSet()) { - out << " linkedInProfileUrl = " - << value.linkedInProfileUrl.ref() << "\n"; - } - else { - out << " linkedInProfileUrl is not set\n"; - } - - if (value.workPhone.isSet()) { - out << " workPhone = " - << value.workPhone.ref() << "\n"; - } - else { - out << " workPhone is not set\n"; - } - - if (value.companyStartDate.isSet()) { - out << " companyStartDate = " - << value.companyStartDate.ref() << "\n"; - } - else { - out << " companyStartDate is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { w.writeStructBegin(QStringLiteral("Accounting")); if (s.uploadLimitEnd.isSet()) { w.writeFieldBegin( @@ -10982,7 +8983,10 @@ void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s) { w.writeStructEnd(); } -void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { +void readAccounting( + ThriftBinaryBufferReader & r, + Accounting & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -11206,399 +9210,203 @@ void readAccounting(ThriftBinaryBufferReader & r, Accounting & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Accounting & value) +void Accounting::print(QTextStream & strm) const { - out << "Accounting: {\n"; + strm << "Accounting: {\n"; - if (value.uploadLimitEnd.isSet()) { - out << " uploadLimitEnd = " - << value.uploadLimitEnd.ref() << "\n"; + if (uploadLimitEnd.isSet()) { + strm << " uploadLimitEnd = " + << uploadLimitEnd.ref() << "\n"; } else { - out << " uploadLimitEnd is not set\n"; + strm << " uploadLimitEnd is not set\n"; } - if (value.uploadLimitNextMonth.isSet()) { - out << " uploadLimitNextMonth = " - << value.uploadLimitNextMonth.ref() << "\n"; + if (uploadLimitNextMonth.isSet()) { + strm << " uploadLimitNextMonth = " + << uploadLimitNextMonth.ref() << "\n"; } else { - out << " uploadLimitNextMonth is not set\n"; + strm << " uploadLimitNextMonth is not set\n"; } - if (value.premiumServiceStatus.isSet()) { - out << " premiumServiceStatus = " - << value.premiumServiceStatus.ref() << "\n"; + if (premiumServiceStatus.isSet()) { + strm << " premiumServiceStatus = " + << premiumServiceStatus.ref() << "\n"; } else { - out << " premiumServiceStatus is not set\n"; + strm << " premiumServiceStatus is not set\n"; } - if (value.premiumOrderNumber.isSet()) { - out << " premiumOrderNumber = " - << value.premiumOrderNumber.ref() << "\n"; + if (premiumOrderNumber.isSet()) { + strm << " premiumOrderNumber = " + << premiumOrderNumber.ref() << "\n"; } else { - out << " premiumOrderNumber is not set\n"; + strm << " premiumOrderNumber is not set\n"; } - if (value.premiumCommerceService.isSet()) { - out << " premiumCommerceService = " - << value.premiumCommerceService.ref() << "\n"; + if (premiumCommerceService.isSet()) { + strm << " premiumCommerceService = " + << premiumCommerceService.ref() << "\n"; } else { - out << " premiumCommerceService is not set\n"; + strm << " premiumCommerceService is not set\n"; } - if (value.premiumServiceStart.isSet()) { - out << " premiumServiceStart = " - << value.premiumServiceStart.ref() << "\n"; + if (premiumServiceStart.isSet()) { + strm << " premiumServiceStart = " + << premiumServiceStart.ref() << "\n"; } else { - out << " premiumServiceStart is not set\n"; + strm << " premiumServiceStart is not set\n"; } - if (value.premiumServiceSKU.isSet()) { - out << " premiumServiceSKU = " - << value.premiumServiceSKU.ref() << "\n"; + if (premiumServiceSKU.isSet()) { + strm << " premiumServiceSKU = " + << premiumServiceSKU.ref() << "\n"; } else { - out << " premiumServiceSKU is not set\n"; + strm << " premiumServiceSKU is not set\n"; } - if (value.lastSuccessfulCharge.isSet()) { - out << " lastSuccessfulCharge = " - << value.lastSuccessfulCharge.ref() << "\n"; + if (lastSuccessfulCharge.isSet()) { + strm << " lastSuccessfulCharge = " + << lastSuccessfulCharge.ref() << "\n"; } else { - out << " lastSuccessfulCharge is not set\n"; + strm << " lastSuccessfulCharge is not set\n"; } - if (value.lastFailedCharge.isSet()) { - out << " lastFailedCharge = " - << value.lastFailedCharge.ref() << "\n"; + if (lastFailedCharge.isSet()) { + strm << " lastFailedCharge = " + << lastFailedCharge.ref() << "\n"; } else { - out << " lastFailedCharge is not set\n"; + strm << " lastFailedCharge is not set\n"; } - if (value.lastFailedChargeReason.isSet()) { - out << " lastFailedChargeReason = " - << value.lastFailedChargeReason.ref() << "\n"; + if (lastFailedChargeReason.isSet()) { + strm << " lastFailedChargeReason = " + << lastFailedChargeReason.ref() << "\n"; } else { - out << " lastFailedChargeReason is not set\n"; + strm << " lastFailedChargeReason is not set\n"; } - if (value.nextPaymentDue.isSet()) { - out << " nextPaymentDue = " - << value.nextPaymentDue.ref() << "\n"; + if (nextPaymentDue.isSet()) { + strm << " nextPaymentDue = " + << nextPaymentDue.ref() << "\n"; } else { - out << " nextPaymentDue is not set\n"; + strm << " nextPaymentDue is not set\n"; } - if (value.premiumLockUntil.isSet()) { - out << " premiumLockUntil = " - << value.premiumLockUntil.ref() << "\n"; + if (premiumLockUntil.isSet()) { + strm << " premiumLockUntil = " + << premiumLockUntil.ref() << "\n"; } else { - out << " premiumLockUntil is not set\n"; + strm << " premiumLockUntil is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - if (value.premiumSubscriptionNumber.isSet()) { - out << " premiumSubscriptionNumber = " - << value.premiumSubscriptionNumber.ref() << "\n"; + if (premiumSubscriptionNumber.isSet()) { + strm << " premiumSubscriptionNumber = " + << premiumSubscriptionNumber.ref() << "\n"; } else { - out << " premiumSubscriptionNumber is not set\n"; + strm << " premiumSubscriptionNumber is not set\n"; } - if (value.lastRequestedCharge.isSet()) { - out << " lastRequestedCharge = " - << value.lastRequestedCharge.ref() << "\n"; + if (lastRequestedCharge.isSet()) { + strm << " lastRequestedCharge = " + << lastRequestedCharge.ref() << "\n"; } else { - out << " lastRequestedCharge is not set\n"; + strm << " lastRequestedCharge is not set\n"; } - if (value.currency.isSet()) { - out << " currency = " - << value.currency.ref() << "\n"; + if (currency.isSet()) { + strm << " currency = " + << currency.ref() << "\n"; } else { - out << " currency is not set\n"; + strm << " currency is not set\n"; } - if (value.unitPrice.isSet()) { - out << " unitPrice = " - << value.unitPrice.ref() << "\n"; + if (unitPrice.isSet()) { + strm << " unitPrice = " + << unitPrice.ref() << "\n"; } else { - out << " unitPrice is not set\n"; + strm << " unitPrice is not set\n"; } - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; + if (businessId.isSet()) { + strm << " businessId = " + << businessId.ref() << "\n"; } else { - out << " businessId is not set\n"; + strm << " businessId is not set\n"; } - if (value.businessName.isSet()) { - out << " businessName = " - << value.businessName.ref() << "\n"; + if (businessName.isSet()) { + strm << " businessName = " + << businessName.ref() << "\n"; } else { - out << " businessName is not set\n"; + strm << " businessName is not set\n"; } - if (value.businessRole.isSet()) { - out << " businessRole = " - << value.businessRole.ref() << "\n"; + if (businessRole.isSet()) { + strm << " businessRole = " + << businessRole.ref() << "\n"; } else { - out << " businessRole is not set\n"; + strm << " businessRole is not set\n"; } - if (value.unitDiscount.isSet()) { - out << " unitDiscount = " - << value.unitDiscount.ref() << "\n"; + if (unitDiscount.isSet()) { + strm << " unitDiscount = " + << unitDiscount.ref() << "\n"; } else { - out << " unitDiscount is not set\n"; + strm << " unitDiscount is not set\n"; } - if (value.nextChargeDate.isSet()) { - out << " nextChargeDate = " - << value.nextChargeDate.ref() << "\n"; + if (nextChargeDate.isSet()) { + strm << " nextChargeDate = " + << nextChargeDate.ref() << "\n"; } else { - out << " nextChargeDate is not set\n"; + strm << " nextChargeDate is not set\n"; } - if (value.availablePoints.isSet()) { - out << " availablePoints = " - << value.availablePoints.ref() << "\n"; + if (availablePoints.isSet()) { + strm << " availablePoints = " + << availablePoints.ref() << "\n"; } else { - out << " availablePoints is not set\n"; + strm << " availablePoints is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Accounting & value) +void writeBusinessUserInfo( + ThriftBinaryBufferWriter & w, + const BusinessUserInfo & s) { - out << "Accounting: {\n"; - - if (value.uploadLimitEnd.isSet()) { - out << " uploadLimitEnd = " - << value.uploadLimitEnd.ref() << "\n"; - } - else { - out << " uploadLimitEnd is not set\n"; - } - - if (value.uploadLimitNextMonth.isSet()) { - out << " uploadLimitNextMonth = " - << value.uploadLimitNextMonth.ref() << "\n"; - } - else { - out << " uploadLimitNextMonth is not set\n"; - } - - if (value.premiumServiceStatus.isSet()) { - out << " premiumServiceStatus = " - << value.premiumServiceStatus.ref() << "\n"; - } - else { - out << " premiumServiceStatus is not set\n"; - } - - if (value.premiumOrderNumber.isSet()) { - out << " premiumOrderNumber = " - << value.premiumOrderNumber.ref() << "\n"; - } - else { - out << " premiumOrderNumber is not set\n"; - } - - if (value.premiumCommerceService.isSet()) { - out << " premiumCommerceService = " - << value.premiumCommerceService.ref() << "\n"; - } - else { - out << " premiumCommerceService is not set\n"; - } - - if (value.premiumServiceStart.isSet()) { - out << " premiumServiceStart = " - << value.premiumServiceStart.ref() << "\n"; - } - else { - out << " premiumServiceStart is not set\n"; - } - - if (value.premiumServiceSKU.isSet()) { - out << " premiumServiceSKU = " - << value.premiumServiceSKU.ref() << "\n"; - } - else { - out << " premiumServiceSKU is not set\n"; - } - - if (value.lastSuccessfulCharge.isSet()) { - out << " lastSuccessfulCharge = " - << value.lastSuccessfulCharge.ref() << "\n"; - } - else { - out << " lastSuccessfulCharge is not set\n"; - } - - if (value.lastFailedCharge.isSet()) { - out << " lastFailedCharge = " - << value.lastFailedCharge.ref() << "\n"; - } - else { - out << " lastFailedCharge is not set\n"; - } - - if (value.lastFailedChargeReason.isSet()) { - out << " lastFailedChargeReason = " - << value.lastFailedChargeReason.ref() << "\n"; - } - else { - out << " lastFailedChargeReason is not set\n"; - } - - if (value.nextPaymentDue.isSet()) { - out << " nextPaymentDue = " - << value.nextPaymentDue.ref() << "\n"; - } - else { - out << " nextPaymentDue is not set\n"; - } - - if (value.premiumLockUntil.isSet()) { - out << " premiumLockUntil = " - << value.premiumLockUntil.ref() << "\n"; - } - else { - out << " premiumLockUntil is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - if (value.premiumSubscriptionNumber.isSet()) { - out << " premiumSubscriptionNumber = " - << value.premiumSubscriptionNumber.ref() << "\n"; - } - else { - out << " premiumSubscriptionNumber is not set\n"; - } - - if (value.lastRequestedCharge.isSet()) { - out << " lastRequestedCharge = " - << value.lastRequestedCharge.ref() << "\n"; - } - else { - out << " lastRequestedCharge is not set\n"; - } - - if (value.currency.isSet()) { - out << " currency = " - << value.currency.ref() << "\n"; - } - else { - out << " currency is not set\n"; - } - - if (value.unitPrice.isSet()) { - out << " unitPrice = " - << value.unitPrice.ref() << "\n"; - } - else { - out << " unitPrice is not set\n"; - } - - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; - } - else { - out << " businessId is not set\n"; - } - - if (value.businessName.isSet()) { - out << " businessName = " - << value.businessName.ref() << "\n"; - } - else { - out << " businessName is not set\n"; - } - - if (value.businessRole.isSet()) { - out << " businessRole = " - << value.businessRole.ref() << "\n"; - } - else { - out << " businessRole is not set\n"; - } - - if (value.unitDiscount.isSet()) { - out << " unitDiscount = " - << value.unitDiscount.ref() << "\n"; - } - else { - out << " unitDiscount is not set\n"; - } - - if (value.nextChargeDate.isSet()) { - out << " nextChargeDate = " - << value.nextChargeDate.ref() << "\n"; - } - else { - out << " nextChargeDate is not set\n"; - } - - if (value.availablePoints.isSet()) { - out << " availablePoints = " - << value.availablePoints.ref() << "\n"; - } - else { - out << " availablePoints is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo & s) { w.writeStructBegin(QStringLiteral("BusinessUserInfo")); if (s.businessId.isSet()) { w.writeFieldBegin( @@ -11644,7 +9452,10 @@ void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo w.writeStructEnd(); } -void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { +void readBusinessUserInfo( + ThriftBinaryBufferReader & r, + BusinessUserInfo & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -11706,111 +9517,59 @@ void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BusinessUserInfo & value) +void BusinessUserInfo::print(QTextStream & strm) const { - out << "BusinessUserInfo: {\n"; + strm << "BusinessUserInfo: {\n"; - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; + if (businessId.isSet()) { + strm << " businessId = " + << businessId.ref() << "\n"; } else { - out << " businessId is not set\n"; + strm << " businessId is not set\n"; } - if (value.businessName.isSet()) { - out << " businessName = " - << value.businessName.ref() << "\n"; + if (businessName.isSet()) { + strm << " businessName = " + << businessName.ref() << "\n"; } else { - out << " businessName is not set\n"; + strm << " businessName is not set\n"; } - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; + if (role.isSet()) { + strm << " role = " + << role.ref() << "\n"; } else { - out << " role is not set\n"; + strm << " role is not set\n"; } - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; + if (email.isSet()) { + strm << " email = " + << email.ref() << "\n"; } else { - out << " email is not set\n"; + strm << " email is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const BusinessUserInfo & value) +void writeAccountLimits( + ThriftBinaryBufferWriter & w, + const AccountLimits & s) { - out << "BusinessUserInfo: {\n"; - - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; - } - else { - out << " businessId is not set\n"; - } - - if (value.businessName.isSet()) { - out << " businessName = " - << value.businessName.ref() << "\n"; - } - else { - out << " businessName is not set\n"; - } - - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; - } - else { - out << " role is not set\n"; - } - - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; - } - else { - out << " email is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s) { w.writeStructBegin(QStringLiteral("AccountLimits")); if (s.userMailLimitDaily.isSet()) { w.writeFieldBegin( @@ -11904,7 +9663,10 @@ void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s) { w.writeStructEnd(); } -void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s) { +void readAccountLimits( + ThriftBinaryBufferReader & r, + AccountLimits & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -12020,207 +9782,107 @@ void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const AccountLimits & value) +void AccountLimits::print(QTextStream & strm) const { - out << "AccountLimits: {\n"; + strm << "AccountLimits: {\n"; - if (value.userMailLimitDaily.isSet()) { - out << " userMailLimitDaily = " - << value.userMailLimitDaily.ref() << "\n"; + if (userMailLimitDaily.isSet()) { + strm << " userMailLimitDaily = " + << userMailLimitDaily.ref() << "\n"; } else { - out << " userMailLimitDaily is not set\n"; + strm << " userMailLimitDaily is not set\n"; } - if (value.noteSizeMax.isSet()) { - out << " noteSizeMax = " - << value.noteSizeMax.ref() << "\n"; + if (noteSizeMax.isSet()) { + strm << " noteSizeMax = " + << noteSizeMax.ref() << "\n"; } else { - out << " noteSizeMax is not set\n"; + strm << " noteSizeMax is not set\n"; } - if (value.resourceSizeMax.isSet()) { - out << " resourceSizeMax = " - << value.resourceSizeMax.ref() << "\n"; + if (resourceSizeMax.isSet()) { + strm << " resourceSizeMax = " + << resourceSizeMax.ref() << "\n"; } else { - out << " resourceSizeMax is not set\n"; + strm << " resourceSizeMax is not set\n"; } - if (value.userLinkedNotebookMax.isSet()) { - out << " userLinkedNotebookMax = " - << value.userLinkedNotebookMax.ref() << "\n"; + if (userLinkedNotebookMax.isSet()) { + strm << " userLinkedNotebookMax = " + << userLinkedNotebookMax.ref() << "\n"; } else { - out << " userLinkedNotebookMax is not set\n"; + strm << " userLinkedNotebookMax is not set\n"; } - if (value.uploadLimit.isSet()) { - out << " uploadLimit = " - << value.uploadLimit.ref() << "\n"; + if (uploadLimit.isSet()) { + strm << " uploadLimit = " + << uploadLimit.ref() << "\n"; } else { - out << " uploadLimit is not set\n"; + strm << " uploadLimit is not set\n"; } - if (value.userNoteCountMax.isSet()) { - out << " userNoteCountMax = " - << value.userNoteCountMax.ref() << "\n"; + if (userNoteCountMax.isSet()) { + strm << " userNoteCountMax = " + << userNoteCountMax.ref() << "\n"; } else { - out << " userNoteCountMax is not set\n"; + strm << " userNoteCountMax is not set\n"; } - if (value.userNotebookCountMax.isSet()) { - out << " userNotebookCountMax = " - << value.userNotebookCountMax.ref() << "\n"; + if (userNotebookCountMax.isSet()) { + strm << " userNotebookCountMax = " + << userNotebookCountMax.ref() << "\n"; } else { - out << " userNotebookCountMax is not set\n"; + strm << " userNotebookCountMax is not set\n"; } - if (value.userTagCountMax.isSet()) { - out << " userTagCountMax = " - << value.userTagCountMax.ref() << "\n"; + if (userTagCountMax.isSet()) { + strm << " userTagCountMax = " + << userTagCountMax.ref() << "\n"; } else { - out << " userTagCountMax is not set\n"; + strm << " userTagCountMax is not set\n"; } - if (value.noteTagCountMax.isSet()) { - out << " noteTagCountMax = " - << value.noteTagCountMax.ref() << "\n"; + if (noteTagCountMax.isSet()) { + strm << " noteTagCountMax = " + << noteTagCountMax.ref() << "\n"; } else { - out << " noteTagCountMax is not set\n"; + strm << " noteTagCountMax is not set\n"; } - if (value.userSavedSearchesMax.isSet()) { - out << " userSavedSearchesMax = " - << value.userSavedSearchesMax.ref() << "\n"; + if (userSavedSearchesMax.isSet()) { + strm << " userSavedSearchesMax = " + << userSavedSearchesMax.ref() << "\n"; } else { - out << " userSavedSearchesMax is not set\n"; + strm << " userSavedSearchesMax is not set\n"; } - if (value.noteResourceCountMax.isSet()) { - out << " noteResourceCountMax = " - << value.noteResourceCountMax.ref() << "\n"; + if (noteResourceCountMax.isSet()) { + strm << " noteResourceCountMax = " + << noteResourceCountMax.ref() << "\n"; } else { - out << " noteResourceCountMax is not set\n"; + strm << " noteResourceCountMax is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const AccountLimits & value) +void writeUser( + ThriftBinaryBufferWriter & w, + const User & s) { - out << "AccountLimits: {\n"; - - if (value.userMailLimitDaily.isSet()) { - out << " userMailLimitDaily = " - << value.userMailLimitDaily.ref() << "\n"; - } - else { - out << " userMailLimitDaily is not set\n"; - } - - if (value.noteSizeMax.isSet()) { - out << " noteSizeMax = " - << value.noteSizeMax.ref() << "\n"; - } - else { - out << " noteSizeMax is not set\n"; - } - - if (value.resourceSizeMax.isSet()) { - out << " resourceSizeMax = " - << value.resourceSizeMax.ref() << "\n"; - } - else { - out << " resourceSizeMax is not set\n"; - } - - if (value.userLinkedNotebookMax.isSet()) { - out << " userLinkedNotebookMax = " - << value.userLinkedNotebookMax.ref() << "\n"; - } - else { - out << " userLinkedNotebookMax is not set\n"; - } - - if (value.uploadLimit.isSet()) { - out << " uploadLimit = " - << value.uploadLimit.ref() << "\n"; - } - else { - out << " uploadLimit is not set\n"; - } - - if (value.userNoteCountMax.isSet()) { - out << " userNoteCountMax = " - << value.userNoteCountMax.ref() << "\n"; - } - else { - out << " userNoteCountMax is not set\n"; - } - - if (value.userNotebookCountMax.isSet()) { - out << " userNotebookCountMax = " - << value.userNotebookCountMax.ref() << "\n"; - } - else { - out << " userNotebookCountMax is not set\n"; - } - - if (value.userTagCountMax.isSet()) { - out << " userTagCountMax = " - << value.userTagCountMax.ref() << "\n"; - } - else { - out << " userTagCountMax is not set\n"; - } - - if (value.noteTagCountMax.isSet()) { - out << " noteTagCountMax = " - << value.noteTagCountMax.ref() << "\n"; - } - else { - out << " noteTagCountMax is not set\n"; - } - - if (value.userSavedSearchesMax.isSet()) { - out << " userSavedSearchesMax = " - << value.userSavedSearchesMax.ref() << "\n"; - } - else { - out << " userSavedSearchesMax is not set\n"; - } - - if (value.noteResourceCountMax.isSet()) { - out << " noteResourceCountMax = " - << value.noteResourceCountMax.ref() << "\n"; - } - else { - out << " noteResourceCountMax is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeUser(ThriftBinaryBufferWriter & w, const User & s) { w.writeStructBegin(QStringLiteral("User")); if (s.id.isSet()) { w.writeFieldBegin( @@ -12370,7 +10032,10 @@ void writeUser(ThriftBinaryBufferWriter & w, const User & s) { w.writeStructEnd(); } -void readUser(ThriftBinaryBufferReader & r, User & s) { +void readUser( + ThriftBinaryBufferReader & r, + User & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -12549,359 +10214,203 @@ void readUser(ThriftBinaryBufferReader & r, User & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const User & value) +void User::print(QTextStream & strm) const { - out << "User: {\n"; + strm << "User: {\n"; - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; + if (id.isSet()) { + strm << " id = " + << id.ref() << "\n"; } else { - out << " id is not set\n"; + strm << " id is not set\n"; } - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (username.isSet()) { + strm << " username = " + << username.ref() << "\n"; } else { - out << " username is not set\n"; + strm << " username is not set\n"; } - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; + if (email.isSet()) { + strm << " email = " + << email.ref() << "\n"; } else { - out << " email is not set\n"; + strm << " email is not set\n"; } - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.timezone.isSet()) { - out << " timezone = " - << value.timezone.ref() << "\n"; + if (timezone.isSet()) { + strm << " timezone = " + << timezone.ref() << "\n"; } else { - out << " timezone is not set\n"; + strm << " timezone is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.serviceLevel.isSet()) { - out << " serviceLevel = " - << value.serviceLevel.ref() << "\n"; + if (serviceLevel.isSet()) { + strm << " serviceLevel = " + << serviceLevel.ref() << "\n"; } else { - out << " serviceLevel is not set\n"; + strm << " serviceLevel is not set\n"; } - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; + if (created.isSet()) { + strm << " created = " + << created.ref() << "\n"; } else { - out << " created is not set\n"; + strm << " created is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; + if (deleted.isSet()) { + strm << " deleted = " + << deleted.ref() << "\n"; } else { - out << " deleted is not set\n"; + strm << " deleted is not set\n"; } - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; + if (active.isSet()) { + strm << " active = " + << active.ref() << "\n"; } else { - out << " active is not set\n"; + strm << " active is not set\n"; } - if (value.shardId.isSet()) { - out << " shardId = " - << value.shardId.ref() << "\n"; + if (shardId.isSet()) { + strm << " shardId = " + << shardId.ref() << "\n"; } else { - out << " shardId is not set\n"; + strm << " shardId is not set\n"; } - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; + if (attributes.isSet()) { + strm << " attributes = " + << attributes.ref() << "\n"; } else { - out << " attributes is not set\n"; + strm << " attributes is not set\n"; } - if (value.accounting.isSet()) { - out << " accounting = " - << value.accounting.ref() << "\n"; + if (accounting.isSet()) { + strm << " accounting = " + << accounting.ref() << "\n"; } else { - out << " accounting is not set\n"; + strm << " accounting is not set\n"; } - if (value.businessUserInfo.isSet()) { - out << " businessUserInfo = " - << value.businessUserInfo.ref() << "\n"; + if (businessUserInfo.isSet()) { + strm << " businessUserInfo = " + << businessUserInfo.ref() << "\n"; } else { - out << " businessUserInfo is not set\n"; + strm << " businessUserInfo is not set\n"; } - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; + if (photoUrl.isSet()) { + strm << " photoUrl = " + << photoUrl.ref() << "\n"; } else { - out << " photoUrl is not set\n"; + strm << " photoUrl is not set\n"; } - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; + if (photoLastUpdated.isSet()) { + strm << " photoLastUpdated = " + << photoLastUpdated.ref() << "\n"; } else { - out << " photoLastUpdated is not set\n"; + strm << " photoLastUpdated is not set\n"; } - if (value.accountLimits.isSet()) { - out << " accountLimits = " - << value.accountLimits.ref() << "\n"; + if (accountLimits.isSet()) { + strm << " accountLimits = " + << accountLimits.ref() << "\n"; } else { - out << " accountLimits is not set\n"; + strm << " accountLimits is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const User & value) +void writeContact( + ThriftBinaryBufferWriter & w, + const Contact & s) { - out << "User: {\n"; - - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; + w.writeStructBegin(QStringLiteral("Contact")); + if (s.name.isSet()) { + w.writeFieldBegin( + QStringLiteral("name"), + ThriftFieldType::T_STRING, + 1); + w.writeString(s.name.ref()); + w.writeFieldEnd(); } - else { - out << " id is not set\n"; + if (s.id.isSet()) { + w.writeFieldBegin( + QStringLiteral("id"), + ThriftFieldType::T_STRING, + 2); + w.writeString(s.id.ref()); + w.writeFieldEnd(); } - - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (s.type.isSet()) { + w.writeFieldBegin( + QStringLiteral("type"), + ThriftFieldType::T_I32, + 3); + w.writeI32(static_cast(s.type.ref())); + w.writeFieldEnd(); } - else { - out << " username is not set\n"; + if (s.photoUrl.isSet()) { + w.writeFieldBegin( + QStringLiteral("photoUrl"), + ThriftFieldType::T_STRING, + 4); + w.writeString(s.photoUrl.ref()); + w.writeFieldEnd(); } - - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; - } - else { - out << " email is not set\n"; - } - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.timezone.isSet()) { - out << " timezone = " - << value.timezone.ref() << "\n"; - } - else { - out << " timezone is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.serviceLevel.isSet()) { - out << " serviceLevel = " - << value.serviceLevel.ref() << "\n"; - } - else { - out << " serviceLevel is not set\n"; - } - - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; - } - else { - out << " created is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; - } - else { - out << " deleted is not set\n"; - } - - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; - } - else { - out << " active is not set\n"; - } - - if (value.shardId.isSet()) { - out << " shardId = " - << value.shardId.ref() << "\n"; - } - else { - out << " shardId is not set\n"; - } - - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; - } - else { - out << " attributes is not set\n"; - } - - if (value.accounting.isSet()) { - out << " accounting = " - << value.accounting.ref() << "\n"; - } - else { - out << " accounting is not set\n"; - } - - if (value.businessUserInfo.isSet()) { - out << " businessUserInfo = " - << value.businessUserInfo.ref() << "\n"; - } - else { - out << " businessUserInfo is not set\n"; - } - - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; - } - else { - out << " photoUrl is not set\n"; - } - - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; - } - else { - out << " photoLastUpdated is not set\n"; - } - - if (value.accountLimits.isSet()) { - out << " accountLimits = " - << value.accountLimits.ref() << "\n"; - } - else { - out << " accountLimits is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeContact(ThriftBinaryBufferWriter & w, const Contact & s) { - w.writeStructBegin(QStringLiteral("Contact")); - if (s.name.isSet()) { - w.writeFieldBegin( - QStringLiteral("name"), - ThriftFieldType::T_STRING, - 1); - w.writeString(s.name.ref()); - w.writeFieldEnd(); - } - if (s.id.isSet()) { - w.writeFieldBegin( - QStringLiteral("id"), - ThriftFieldType::T_STRING, - 2); - w.writeString(s.id.ref()); - w.writeFieldEnd(); - } - if (s.type.isSet()) { - w.writeFieldBegin( - QStringLiteral("type"), - ThriftFieldType::T_I32, - 3); - w.writeI32(static_cast(s.type.ref())); - w.writeFieldEnd(); - } - if (s.photoUrl.isSet()) { - w.writeFieldBegin( - QStringLiteral("photoUrl"), - ThriftFieldType::T_STRING, - 4); - w.writeString(s.photoUrl.ref()); - w.writeFieldEnd(); - } - if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin( - QStringLiteral("photoLastUpdated"), - ThriftFieldType::T_I64, - 5); - w.writeI64(s.photoLastUpdated.ref()); - w.writeFieldEnd(); + if (s.photoLastUpdated.isSet()) { + w.writeFieldBegin( + QStringLiteral("photoLastUpdated"), + ThriftFieldType::T_I64, + 5); + w.writeI64(s.photoLastUpdated.ref()); + w.writeFieldEnd(); } if (s.messagingPermit.isSet()) { w.writeFieldBegin( @@ -12923,7 +10432,10 @@ void writeContact(ThriftBinaryBufferWriter & w, const Contact & s) { w.writeStructEnd(); } -void readContact(ThriftBinaryBufferReader & r, Contact & s) { +void readContact( + ThriftBinaryBufferReader & r, + Contact & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -13003,143 +10515,75 @@ void readContact(ThriftBinaryBufferReader & r, Contact & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Contact & value) +void Contact::print(QTextStream & strm) const { - out << "Contact: {\n"; + strm << "Contact: {\n"; - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; + if (id.isSet()) { + strm << " id = " + << id.ref() << "\n"; } else { - out << " id is not set\n"; + strm << " id is not set\n"; } - if (value.type.isSet()) { - out << " type = " - << value.type.ref() << "\n"; + if (type.isSet()) { + strm << " type = " + << type.ref() << "\n"; } else { - out << " type is not set\n"; + strm << " type is not set\n"; } - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; + if (photoUrl.isSet()) { + strm << " photoUrl = " + << photoUrl.ref() << "\n"; } else { - out << " photoUrl is not set\n"; + strm << " photoUrl is not set\n"; } - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; + if (photoLastUpdated.isSet()) { + strm << " photoLastUpdated = " + << photoLastUpdated.ref() << "\n"; } else { - out << " photoLastUpdated is not set\n"; + strm << " photoLastUpdated is not set\n"; } - if (value.messagingPermit.isSet()) { - out << " messagingPermit = " - << value.messagingPermit.ref() << "\n"; + if (messagingPermit.isSet()) { + strm << " messagingPermit = " + << messagingPermit.ref() << "\n"; } else { - out << " messagingPermit is not set\n"; + strm << " messagingPermit is not set\n"; } - if (value.messagingPermitExpires.isSet()) { - out << " messagingPermitExpires = " - << value.messagingPermitExpires.ref() << "\n"; + if (messagingPermitExpires.isSet()) { + strm << " messagingPermitExpires = " + << messagingPermitExpires.ref() << "\n"; } else { - out << " messagingPermitExpires is not set\n"; + strm << " messagingPermitExpires is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Contact & value) +void writeIdentity( + ThriftBinaryBufferWriter & w, + const Identity & s) { - out << "Contact: {\n"; - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; - } - else { - out << " id is not set\n"; - } - - if (value.type.isSet()) { - out << " type = " - << value.type.ref() << "\n"; - } - else { - out << " type is not set\n"; - } - - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; - } - else { - out << " photoUrl is not set\n"; - } - - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; - } - else { - out << " photoLastUpdated is not set\n"; - } - - if (value.messagingPermit.isSet()) { - out << " messagingPermit = " - << value.messagingPermit.ref() << "\n"; - } - else { - out << " messagingPermit is not set\n"; - } - - if (value.messagingPermitExpires.isSet()) { - out << " messagingPermitExpires = " - << value.messagingPermitExpires.ref() << "\n"; - } - else { - out << " messagingPermitExpires is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s) { w.writeStructBegin(QStringLiteral("Identity")); w.writeFieldBegin( QStringLiteral("id"), @@ -13207,7 +10651,10 @@ void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s) { w.writeStructEnd(); } -void readIdentity(ThriftBinaryBufferReader & r, Identity & s) { +void readIdentity( + ThriftBinaryBufferReader & r, + Identity & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -13296,150 +10743,80 @@ void readIdentity(ThriftBinaryBufferReader & r, Identity & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!id_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Identity.id has no value")); + if (!id_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Identity.id has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Identity & value) +void Identity::print(QTextStream & strm) const { - out << "Identity: {\n"; - out << " id = " - << "IdentityID" << "\n"; + strm << "Identity: {\n"; + strm << " id = " + << id << "\n"; - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; + if (contact.isSet()) { + strm << " contact = " + << contact.ref() << "\n"; } else { - out << " contact is not set\n"; + strm << " contact is not set\n"; } - if (value.userId.isSet()) { - out << " userId = " - << value.userId.ref() << "\n"; + if (userId.isSet()) { + strm << " userId = " + << userId.ref() << "\n"; } else { - out << " userId is not set\n"; + strm << " userId is not set\n"; } - if (value.deactivated.isSet()) { - out << " deactivated = " - << value.deactivated.ref() << "\n"; + if (deactivated.isSet()) { + strm << " deactivated = " + << deactivated.ref() << "\n"; } else { - out << " deactivated is not set\n"; + strm << " deactivated is not set\n"; } - if (value.sameBusiness.isSet()) { - out << " sameBusiness = " - << value.sameBusiness.ref() << "\n"; + if (sameBusiness.isSet()) { + strm << " sameBusiness = " + << sameBusiness.ref() << "\n"; } else { - out << " sameBusiness is not set\n"; + strm << " sameBusiness is not set\n"; } - if (value.blocked.isSet()) { - out << " blocked = " - << value.blocked.ref() << "\n"; + if (blocked.isSet()) { + strm << " blocked = " + << blocked.ref() << "\n"; } else { - out << " blocked is not set\n"; + strm << " blocked is not set\n"; } - if (value.userConnected.isSet()) { - out << " userConnected = " - << value.userConnected.ref() << "\n"; + if (userConnected.isSet()) { + strm << " userConnected = " + << userConnected.ref() << "\n"; } else { - out << " userConnected is not set\n"; + strm << " userConnected is not set\n"; } - if (value.eventId.isSet()) { - out << " eventId = " - << value.eventId.ref() << "\n"; + if (eventId.isSet()) { + strm << " eventId = " + << eventId.ref() << "\n"; } else { - out << " eventId is not set\n"; + strm << " eventId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Identity & value) +void writeTag( + ThriftBinaryBufferWriter & w, + const Tag & s) { - out << "Identity: {\n"; - out << " id = " - << "IdentityID" << "\n"; - - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; - } - else { - out << " contact is not set\n"; - } - - if (value.userId.isSet()) { - out << " userId = " - << value.userId.ref() << "\n"; - } - else { - out << " userId is not set\n"; - } - - if (value.deactivated.isSet()) { - out << " deactivated = " - << value.deactivated.ref() << "\n"; - } - else { - out << " deactivated is not set\n"; - } - - if (value.sameBusiness.isSet()) { - out << " sameBusiness = " - << value.sameBusiness.ref() << "\n"; - } - else { - out << " sameBusiness is not set\n"; - } - - if (value.blocked.isSet()) { - out << " blocked = " - << value.blocked.ref() << "\n"; - } - else { - out << " blocked is not set\n"; - } - - if (value.userConnected.isSet()) { - out << " userConnected = " - << value.userConnected.ref() << "\n"; - } - else { - out << " userConnected is not set\n"; - } - - if (value.eventId.isSet()) { - out << " eventId = " - << value.eventId.ref() << "\n"; - } - else { - out << " eventId is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeTag(ThriftBinaryBufferWriter & w, const Tag & s) { w.writeStructBegin(QStringLiteral("Tag")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -13477,7 +10854,10 @@ void writeTag(ThriftBinaryBufferWriter & w, const Tag & s) { w.writeStructEnd(); } -void readTag(ThriftBinaryBufferReader & r, Tag & s) { +void readTag( + ThriftBinaryBufferReader & r, + Tag & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -13530,95 +10910,51 @@ void readTag(ThriftBinaryBufferReader & r, Tag & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Tag & value) +void Tag::print(QTextStream & strm) const { - out << "Tag: {\n"; + strm << "Tag: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.parentGuid.isSet()) { - out << " parentGuid = " - << value.parentGuid.ref() << "\n"; + if (parentGuid.isSet()) { + strm << " parentGuid = " + << parentGuid.ref() << "\n"; } else { - out << " parentGuid is not set\n"; + strm << " parentGuid is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Tag & value) +void writeLazyMap( + ThriftBinaryBufferWriter & w, + const LazyMap & s) { - out << "Tag: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.parentGuid.isSet()) { - out << " parentGuid = " - << value.parentGuid.ref() << "\n"; - } - else { - out << " parentGuid is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeStructBegin(QStringLiteral("LazyMap")); if (s.keysOnly.isSet()) { w.writeFieldBegin( @@ -13649,7 +10985,10 @@ void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s) { w.writeStructEnd(); } -void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { +void readLazyMap( + ThriftBinaryBufferReader & r, + LazyMap & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -13707,75 +11046,43 @@ void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const LazyMap & value) +void LazyMap::print(QTextStream & strm) const { - out << "LazyMap: {\n"; + strm << "LazyMap: {\n"; - if (value.keysOnly.isSet()) { - out << " keysOnly = " + if (keysOnly.isSet()) { + strm << " keysOnly = " << "QSet {"; - for(const auto & v: value.keysOnly.ref()) { - out << v; + for(const auto & v: keysOnly.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " keysOnly is not set\n"; + strm << " keysOnly is not set\n"; } - if (value.fullMap.isSet()) { - out << " fullMap = " + if (fullMap.isSet()) { + strm << " fullMap = " << "QMap {"; - for(const auto & it: toRange(value.fullMap.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; + for(const auto & it: toRange(fullMap.ref())) { + strm << " [" << it.key() << "] = " << it.value() << "\n"; } + strm << " }\n"; } else { - out << " fullMap is not set\n"; + strm << " fullMap is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const LazyMap & value) +void writeResourceAttributes( + ThriftBinaryBufferWriter & w, + const ResourceAttributes & s) { - out << "LazyMap: {\n"; - - if (value.keysOnly.isSet()) { - out << " keysOnly = " - << "QSet {"; - for(const auto & v: value.keysOnly.ref()) { - out << v; - } - } - else { - out << " keysOnly is not set\n"; - } - - if (value.fullMap.isSet()) { - out << " fullMap = " - << "QMap {"; - for(const auto & it: toRange(value.fullMap.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; - } - } - else { - out << " fullMap is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttributes & s) { w.writeStructBegin(QStringLiteral("ResourceAttributes")); if (s.sourceURL.isSet()) { w.writeFieldBegin( @@ -13877,7 +11184,10 @@ void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttribu w.writeStructEnd(); } -void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s) { +void readResourceAttributes( + ThriftBinaryBufferReader & r, + ResourceAttributes & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -14002,247 +11312,139 @@ void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const ResourceAttributes & value) +void ResourceAttributes::print(QTextStream & strm) const { - out << "ResourceAttributes: {\n"; + strm << "ResourceAttributes: {\n"; - if (value.sourceURL.isSet()) { - out << " sourceURL = " - << value.sourceURL.ref() << "\n"; + if (sourceURL.isSet()) { + strm << " sourceURL = " + << sourceURL.ref() << "\n"; } else { - out << " sourceURL is not set\n"; + strm << " sourceURL is not set\n"; } - if (value.timestamp.isSet()) { - out << " timestamp = " - << value.timestamp.ref() << "\n"; + if (timestamp.isSet()) { + strm << " timestamp = " + << timestamp.ref() << "\n"; } else { - out << " timestamp is not set\n"; + strm << " timestamp is not set\n"; } - if (value.latitude.isSet()) { - out << " latitude = " - << value.latitude.ref() << "\n"; + if (latitude.isSet()) { + strm << " latitude = " + << latitude.ref() << "\n"; } else { - out << " latitude is not set\n"; + strm << " latitude is not set\n"; } - if (value.longitude.isSet()) { - out << " longitude = " - << value.longitude.ref() << "\n"; + if (longitude.isSet()) { + strm << " longitude = " + << longitude.ref() << "\n"; } else { - out << " longitude is not set\n"; + strm << " longitude is not set\n"; } - if (value.altitude.isSet()) { - out << " altitude = " - << value.altitude.ref() << "\n"; + if (altitude.isSet()) { + strm << " altitude = " + << altitude.ref() << "\n"; } else { - out << " altitude is not set\n"; + strm << " altitude is not set\n"; } - if (value.cameraMake.isSet()) { - out << " cameraMake = " - << value.cameraMake.ref() << "\n"; + if (cameraMake.isSet()) { + strm << " cameraMake = " + << cameraMake.ref() << "\n"; } else { - out << " cameraMake is not set\n"; + strm << " cameraMake is not set\n"; } - if (value.cameraModel.isSet()) { - out << " cameraModel = " - << value.cameraModel.ref() << "\n"; + if (cameraModel.isSet()) { + strm << " cameraModel = " + << cameraModel.ref() << "\n"; } else { - out << " cameraModel is not set\n"; + strm << " cameraModel is not set\n"; } - if (value.clientWillIndex.isSet()) { - out << " clientWillIndex = " - << value.clientWillIndex.ref() << "\n"; + if (clientWillIndex.isSet()) { + strm << " clientWillIndex = " + << clientWillIndex.ref() << "\n"; } else { - out << " clientWillIndex is not set\n"; + strm << " clientWillIndex is not set\n"; } - if (value.recoType.isSet()) { - out << " recoType = " - << value.recoType.ref() << "\n"; + if (recoType.isSet()) { + strm << " recoType = " + << recoType.ref() << "\n"; } else { - out << " recoType is not set\n"; + strm << " recoType is not set\n"; } - if (value.fileName.isSet()) { - out << " fileName = " - << value.fileName.ref() << "\n"; + if (fileName.isSet()) { + strm << " fileName = " + << fileName.ref() << "\n"; } else { - out << " fileName is not set\n"; + strm << " fileName is not set\n"; } - if (value.attachment.isSet()) { - out << " attachment = " - << value.attachment.ref() << "\n"; + if (attachment.isSet()) { + strm << " attachment = " + << attachment.ref() << "\n"; } else { - out << " attachment is not set\n"; + strm << " attachment is not set\n"; } - if (value.applicationData.isSet()) { - out << " applicationData = " - << value.applicationData.ref() << "\n"; + if (applicationData.isSet()) { + strm << " applicationData = " + << applicationData.ref() << "\n"; } else { - out << " applicationData is not set\n"; + strm << " applicationData is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const ResourceAttributes & value) +void writeResource( + ThriftBinaryBufferWriter & w, + const Resource & s) { - out << "ResourceAttributes: {\n"; - - if (value.sourceURL.isSet()) { - out << " sourceURL = " - << value.sourceURL.ref() << "\n"; - } - else { - out << " sourceURL is not set\n"; - } - - if (value.timestamp.isSet()) { - out << " timestamp = " - << value.timestamp.ref() << "\n"; + w.writeStructBegin(QStringLiteral("Resource")); + if (s.guid.isSet()) { + w.writeFieldBegin( + QStringLiteral("guid"), + ThriftFieldType::T_STRING, + 1); + w.writeString(s.guid.ref()); + w.writeFieldEnd(); } - else { - out << " timestamp is not set\n"; + if (s.noteGuid.isSet()) { + w.writeFieldBegin( + QStringLiteral("noteGuid"), + ThriftFieldType::T_STRING, + 2); + w.writeString(s.noteGuid.ref()); + w.writeFieldEnd(); } - - if (value.latitude.isSet()) { - out << " latitude = " - << value.latitude.ref() << "\n"; - } - else { - out << " latitude is not set\n"; - } - - if (value.longitude.isSet()) { - out << " longitude = " - << value.longitude.ref() << "\n"; - } - else { - out << " longitude is not set\n"; - } - - if (value.altitude.isSet()) { - out << " altitude = " - << value.altitude.ref() << "\n"; - } - else { - out << " altitude is not set\n"; - } - - if (value.cameraMake.isSet()) { - out << " cameraMake = " - << value.cameraMake.ref() << "\n"; - } - else { - out << " cameraMake is not set\n"; - } - - if (value.cameraModel.isSet()) { - out << " cameraModel = " - << value.cameraModel.ref() << "\n"; - } - else { - out << " cameraModel is not set\n"; - } - - if (value.clientWillIndex.isSet()) { - out << " clientWillIndex = " - << value.clientWillIndex.ref() << "\n"; - } - else { - out << " clientWillIndex is not set\n"; - } - - if (value.recoType.isSet()) { - out << " recoType = " - << value.recoType.ref() << "\n"; - } - else { - out << " recoType is not set\n"; - } - - if (value.fileName.isSet()) { - out << " fileName = " - << value.fileName.ref() << "\n"; - } - else { - out << " fileName is not set\n"; - } - - if (value.attachment.isSet()) { - out << " attachment = " - << value.attachment.ref() << "\n"; - } - else { - out << " attachment is not set\n"; - } - - if (value.applicationData.isSet()) { - out << " applicationData = " - << value.applicationData.ref() << "\n"; - } - else { - out << " applicationData is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeResource(ThriftBinaryBufferWriter & w, const Resource & s) { - w.writeStructBegin(QStringLiteral("Resource")); - if (s.guid.isSet()) { - w.writeFieldBegin( - QStringLiteral("guid"), - ThriftFieldType::T_STRING, - 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); - } - if (s.noteGuid.isSet()) { - w.writeFieldBegin( - QStringLiteral("noteGuid"), - ThriftFieldType::T_STRING, - 2); - w.writeString(s.noteGuid.ref()); - w.writeFieldEnd(); - } - if (s.data.isSet()) { - w.writeFieldBegin( - QStringLiteral("data"), - ThriftFieldType::T_STRUCT, - 3); - writeData(w, s.data.ref()); - w.writeFieldEnd(); + if (s.data.isSet()) { + w.writeFieldBegin( + QStringLiteral("data"), + ThriftFieldType::T_STRUCT, + 3); + writeData(w, s.data.ref()); + w.writeFieldEnd(); } if (s.mime.isSet()) { w.writeFieldBegin( @@ -14320,7 +11522,10 @@ void writeResource(ThriftBinaryBufferWriter & w, const Resource & s) { w.writeStructEnd(); } -void readResource(ThriftBinaryBufferReader & r, Resource & s) { +void readResource( + ThriftBinaryBufferReader & r, + Resource & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -14445,223 +11650,115 @@ void readResource(ThriftBinaryBufferReader & r, Resource & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Resource & value) +void Resource::print(QTextStream & strm) const { - out << "Resource: {\n"; + strm << "Resource: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; + if (noteGuid.isSet()) { + strm << " noteGuid = " + << noteGuid.ref() << "\n"; } else { - out << " noteGuid is not set\n"; + strm << " noteGuid is not set\n"; } - if (value.data.isSet()) { - out << " data = " - << value.data.ref() << "\n"; + if (data.isSet()) { + strm << " data = " + << data.ref() << "\n"; } else { - out << " data is not set\n"; + strm << " data is not set\n"; } - if (value.mime.isSet()) { - out << " mime = " - << value.mime.ref() << "\n"; + if (mime.isSet()) { + strm << " mime = " + << mime.ref() << "\n"; } else { - out << " mime is not set\n"; + strm << " mime is not set\n"; } - if (value.width.isSet()) { - out << " width = " - << value.width.ref() << "\n"; + if (width.isSet()) { + strm << " width = " + << width.ref() << "\n"; } else { - out << " width is not set\n"; + strm << " width is not set\n"; } - if (value.height.isSet()) { - out << " height = " - << value.height.ref() << "\n"; + if (height.isSet()) { + strm << " height = " + << height.ref() << "\n"; } else { - out << " height is not set\n"; + strm << " height is not set\n"; } - if (value.duration.isSet()) { - out << " duration = " - << value.duration.ref() << "\n"; + if (duration.isSet()) { + strm << " duration = " + << duration.ref() << "\n"; } else { - out << " duration is not set\n"; + strm << " duration is not set\n"; } - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; + if (active.isSet()) { + strm << " active = " + << active.ref() << "\n"; } else { - out << " active is not set\n"; + strm << " active is not set\n"; } - if (value.recognition.isSet()) { - out << " recognition = " - << value.recognition.ref() << "\n"; + if (recognition.isSet()) { + strm << " recognition = " + << recognition.ref() << "\n"; } else { - out << " recognition is not set\n"; + strm << " recognition is not set\n"; } - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; + if (attributes.isSet()) { + strm << " attributes = " + << attributes.ref() << "\n"; } else { - out << " attributes is not set\n"; + strm << " attributes is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.alternateData.isSet()) { - out << " alternateData = " - << value.alternateData.ref() << "\n"; + if (alternateData.isSet()) { + strm << " alternateData = " + << alternateData.ref() << "\n"; } else { - out << " alternateData is not set\n"; + strm << " alternateData is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Resource & value) +void writeNoteAttributes( + ThriftBinaryBufferWriter & w, + const NoteAttributes & s) { - out << "Resource: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.noteGuid.isSet()) { - out << " noteGuid = " - << value.noteGuid.ref() << "\n"; - } - else { - out << " noteGuid is not set\n"; - } - - if (value.data.isSet()) { - out << " data = " - << value.data.ref() << "\n"; - } - else { - out << " data is not set\n"; - } - - if (value.mime.isSet()) { - out << " mime = " - << value.mime.ref() << "\n"; - } - else { - out << " mime is not set\n"; - } - - if (value.width.isSet()) { - out << " width = " - << value.width.ref() << "\n"; - } - else { - out << " width is not set\n"; - } - - if (value.height.isSet()) { - out << " height = " - << value.height.ref() << "\n"; - } - else { - out << " height is not set\n"; - } - - if (value.duration.isSet()) { - out << " duration = " - << value.duration.ref() << "\n"; - } - else { - out << " duration is not set\n"; - } - - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; - } - else { - out << " active is not set\n"; - } - - if (value.recognition.isSet()) { - out << " recognition = " - << value.recognition.ref() << "\n"; - } - else { - out << " recognition is not set\n"; - } - - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; - } - else { - out << " attributes is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.alternateData.isSet()) { - out << " alternateData = " - << value.alternateData.ref() << "\n"; - } - else { - out << " alternateData is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) { w.writeStructBegin(QStringLiteral("NoteAttributes")); if (s.subjectDate.isSet()) { w.writeFieldBegin( @@ -14848,7 +11945,10 @@ void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s) w.writeStructEnd(); } -void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { +void readNoteAttributes( + ThriftBinaryBufferReader & r, + NoteAttributes & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -15076,389 +12176,199 @@ void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteAttributes & value) +void NoteAttributes::print(QTextStream & strm) const { - out << "NoteAttributes: {\n"; + strm << "NoteAttributes: {\n"; - if (value.subjectDate.isSet()) { - out << " subjectDate = " - << value.subjectDate.ref() << "\n"; + if (subjectDate.isSet()) { + strm << " subjectDate = " + << subjectDate.ref() << "\n"; } else { - out << " subjectDate is not set\n"; + strm << " subjectDate is not set\n"; } - if (value.latitude.isSet()) { - out << " latitude = " - << value.latitude.ref() << "\n"; + if (latitude.isSet()) { + strm << " latitude = " + << latitude.ref() << "\n"; } else { - out << " latitude is not set\n"; + strm << " latitude is not set\n"; } - if (value.longitude.isSet()) { - out << " longitude = " - << value.longitude.ref() << "\n"; + if (longitude.isSet()) { + strm << " longitude = " + << longitude.ref() << "\n"; } else { - out << " longitude is not set\n"; + strm << " longitude is not set\n"; } - if (value.altitude.isSet()) { - out << " altitude = " - << value.altitude.ref() << "\n"; + if (altitude.isSet()) { + strm << " altitude = " + << altitude.ref() << "\n"; } else { - out << " altitude is not set\n"; + strm << " altitude is not set\n"; } - if (value.author.isSet()) { - out << " author = " - << value.author.ref() << "\n"; + if (author.isSet()) { + strm << " author = " + << author.ref() << "\n"; } else { - out << " author is not set\n"; + strm << " author is not set\n"; } - if (value.source.isSet()) { - out << " source = " - << value.source.ref() << "\n"; + if (source.isSet()) { + strm << " source = " + << source.ref() << "\n"; } else { - out << " source is not set\n"; + strm << " source is not set\n"; } - if (value.sourceURL.isSet()) { - out << " sourceURL = " - << value.sourceURL.ref() << "\n"; + if (sourceURL.isSet()) { + strm << " sourceURL = " + << sourceURL.ref() << "\n"; } else { - out << " sourceURL is not set\n"; + strm << " sourceURL is not set\n"; } - if (value.sourceApplication.isSet()) { - out << " sourceApplication = " - << value.sourceApplication.ref() << "\n"; + if (sourceApplication.isSet()) { + strm << " sourceApplication = " + << sourceApplication.ref() << "\n"; } else { - out << " sourceApplication is not set\n"; + strm << " sourceApplication is not set\n"; } - if (value.shareDate.isSet()) { - out << " shareDate = " - << value.shareDate.ref() << "\n"; + if (shareDate.isSet()) { + strm << " shareDate = " + << shareDate.ref() << "\n"; } else { - out << " shareDate is not set\n"; + strm << " shareDate is not set\n"; } - if (value.reminderOrder.isSet()) { - out << " reminderOrder = " - << value.reminderOrder.ref() << "\n"; + if (reminderOrder.isSet()) { + strm << " reminderOrder = " + << reminderOrder.ref() << "\n"; } else { - out << " reminderOrder is not set\n"; + strm << " reminderOrder is not set\n"; } - if (value.reminderDoneTime.isSet()) { - out << " reminderDoneTime = " - << value.reminderDoneTime.ref() << "\n"; + if (reminderDoneTime.isSet()) { + strm << " reminderDoneTime = " + << reminderDoneTime.ref() << "\n"; } else { - out << " reminderDoneTime is not set\n"; + strm << " reminderDoneTime is not set\n"; } - if (value.reminderTime.isSet()) { - out << " reminderTime = " - << value.reminderTime.ref() << "\n"; + if (reminderTime.isSet()) { + strm << " reminderTime = " + << reminderTime.ref() << "\n"; } else { - out << " reminderTime is not set\n"; + strm << " reminderTime is not set\n"; } - if (value.placeName.isSet()) { - out << " placeName = " - << value.placeName.ref() << "\n"; + if (placeName.isSet()) { + strm << " placeName = " + << placeName.ref() << "\n"; } else { - out << " placeName is not set\n"; + strm << " placeName is not set\n"; } - if (value.contentClass.isSet()) { - out << " contentClass = " - << value.contentClass.ref() << "\n"; + if (contentClass.isSet()) { + strm << " contentClass = " + << contentClass.ref() << "\n"; } else { - out << " contentClass is not set\n"; + strm << " contentClass is not set\n"; } - if (value.applicationData.isSet()) { - out << " applicationData = " - << value.applicationData.ref() << "\n"; + if (applicationData.isSet()) { + strm << " applicationData = " + << applicationData.ref() << "\n"; } else { - out << " applicationData is not set\n"; + strm << " applicationData is not set\n"; } - if (value.lastEditedBy.isSet()) { - out << " lastEditedBy = " - << value.lastEditedBy.ref() << "\n"; + if (lastEditedBy.isSet()) { + strm << " lastEditedBy = " + << lastEditedBy.ref() << "\n"; } else { - out << " lastEditedBy is not set\n"; + strm << " lastEditedBy is not set\n"; } - if (value.classifications.isSet()) { - out << " classifications = " + if (classifications.isSet()) { + strm << " classifications = " << "QMap {"; - for(const auto & it: toRange(value.classifications.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; + for(const auto & it: toRange(classifications.ref())) { + strm << " [" << it.key() << "] = " << it.value() << "\n"; } + strm << " }\n"; } else { - out << " classifications is not set\n"; + strm << " classifications is not set\n"; } - if (value.creatorId.isSet()) { - out << " creatorId = " - << value.creatorId.ref() << "\n"; + if (creatorId.isSet()) { + strm << " creatorId = " + << creatorId.ref() << "\n"; } else { - out << " creatorId is not set\n"; + strm << " creatorId is not set\n"; } - if (value.lastEditorId.isSet()) { - out << " lastEditorId = " - << value.lastEditorId.ref() << "\n"; + if (lastEditorId.isSet()) { + strm << " lastEditorId = " + << lastEditorId.ref() << "\n"; } else { - out << " lastEditorId is not set\n"; + strm << " lastEditorId is not set\n"; } - if (value.sharedWithBusiness.isSet()) { - out << " sharedWithBusiness = " - << value.sharedWithBusiness.ref() << "\n"; + if (sharedWithBusiness.isSet()) { + strm << " sharedWithBusiness = " + << sharedWithBusiness.ref() << "\n"; } else { - out << " sharedWithBusiness is not set\n"; + strm << " sharedWithBusiness is not set\n"; } - if (value.conflictSourceNoteGuid.isSet()) { - out << " conflictSourceNoteGuid = " - << value.conflictSourceNoteGuid.ref() << "\n"; + if (conflictSourceNoteGuid.isSet()) { + strm << " conflictSourceNoteGuid = " + << conflictSourceNoteGuid.ref() << "\n"; } else { - out << " conflictSourceNoteGuid is not set\n"; + strm << " conflictSourceNoteGuid is not set\n"; } - if (value.noteTitleQuality.isSet()) { - out << " noteTitleQuality = " - << value.noteTitleQuality.ref() << "\n"; + if (noteTitleQuality.isSet()) { + strm << " noteTitleQuality = " + << noteTitleQuality.ref() << "\n"; } else { - out << " noteTitleQuality is not set\n"; + strm << " noteTitleQuality is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteAttributes & value) +void writeSharedNote( + ThriftBinaryBufferWriter & w, + const SharedNote & s) { - out << "NoteAttributes: {\n"; - - if (value.subjectDate.isSet()) { - out << " subjectDate = " - << value.subjectDate.ref() << "\n"; - } - else { - out << " subjectDate is not set\n"; - } - - if (value.latitude.isSet()) { - out << " latitude = " - << value.latitude.ref() << "\n"; - } - else { - out << " latitude is not set\n"; - } - - if (value.longitude.isSet()) { - out << " longitude = " - << value.longitude.ref() << "\n"; - } - else { - out << " longitude is not set\n"; - } - - if (value.altitude.isSet()) { - out << " altitude = " - << value.altitude.ref() << "\n"; - } - else { - out << " altitude is not set\n"; - } - - if (value.author.isSet()) { - out << " author = " - << value.author.ref() << "\n"; - } - else { - out << " author is not set\n"; - } - - if (value.source.isSet()) { - out << " source = " - << value.source.ref() << "\n"; - } - else { - out << " source is not set\n"; - } - - if (value.sourceURL.isSet()) { - out << " sourceURL = " - << value.sourceURL.ref() << "\n"; - } - else { - out << " sourceURL is not set\n"; - } - - if (value.sourceApplication.isSet()) { - out << " sourceApplication = " - << value.sourceApplication.ref() << "\n"; - } - else { - out << " sourceApplication is not set\n"; - } - - if (value.shareDate.isSet()) { - out << " shareDate = " - << value.shareDate.ref() << "\n"; - } - else { - out << " shareDate is not set\n"; - } - - if (value.reminderOrder.isSet()) { - out << " reminderOrder = " - << value.reminderOrder.ref() << "\n"; - } - else { - out << " reminderOrder is not set\n"; - } - - if (value.reminderDoneTime.isSet()) { - out << " reminderDoneTime = " - << value.reminderDoneTime.ref() << "\n"; - } - else { - out << " reminderDoneTime is not set\n"; - } - - if (value.reminderTime.isSet()) { - out << " reminderTime = " - << value.reminderTime.ref() << "\n"; - } - else { - out << " reminderTime is not set\n"; - } - - if (value.placeName.isSet()) { - out << " placeName = " - << value.placeName.ref() << "\n"; - } - else { - out << " placeName is not set\n"; - } - - if (value.contentClass.isSet()) { - out << " contentClass = " - << value.contentClass.ref() << "\n"; - } - else { - out << " contentClass is not set\n"; - } - - if (value.applicationData.isSet()) { - out << " applicationData = " - << value.applicationData.ref() << "\n"; - } - else { - out << " applicationData is not set\n"; - } - - if (value.lastEditedBy.isSet()) { - out << " lastEditedBy = " - << value.lastEditedBy.ref() << "\n"; - } - else { - out << " lastEditedBy is not set\n"; - } - - if (value.classifications.isSet()) { - out << " classifications = " - << "QMap {"; - for(const auto & it: toRange(value.classifications.ref())) { - out << "[" << it.key() << "] = " << it.value() << "\n"; - } - } - else { - out << " classifications is not set\n"; - } - - if (value.creatorId.isSet()) { - out << " creatorId = " - << value.creatorId.ref() << "\n"; - } - else { - out << " creatorId is not set\n"; - } - - if (value.lastEditorId.isSet()) { - out << " lastEditorId = " - << value.lastEditorId.ref() << "\n"; - } - else { - out << " lastEditorId is not set\n"; - } - - if (value.sharedWithBusiness.isSet()) { - out << " sharedWithBusiness = " - << value.sharedWithBusiness.ref() << "\n"; - } - else { - out << " sharedWithBusiness is not set\n"; - } - - if (value.conflictSourceNoteGuid.isSet()) { - out << " conflictSourceNoteGuid = " - << value.conflictSourceNoteGuid.ref() << "\n"; - } - else { - out << " conflictSourceNoteGuid is not set\n"; - } - - if (value.noteTitleQuality.isSet()) { - out << " noteTitleQuality = " - << value.noteTitleQuality.ref() << "\n"; - } - else { - out << " noteTitleQuality is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s) { w.writeStructBegin(QStringLiteral("SharedNote")); if (s.sharerUserID.isSet()) { w.writeFieldBegin( @@ -15512,7 +12422,10 @@ void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s) { w.writeStructEnd(); } -void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { +void readSharedNote( + ThriftBinaryBufferReader & r, + SharedNote & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -15583,127 +12496,67 @@ void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SharedNote & value) +void SharedNote::print(QTextStream & strm) const { - out << "SharedNote: {\n"; + strm << "SharedNote: {\n"; - if (value.sharerUserID.isSet()) { - out << " sharerUserID = " - << value.sharerUserID.ref() << "\n"; + if (sharerUserID.isSet()) { + strm << " sharerUserID = " + << sharerUserID.ref() << "\n"; } else { - out << " sharerUserID is not set\n"; + strm << " sharerUserID is not set\n"; } - if (value.recipientIdentity.isSet()) { - out << " recipientIdentity = " - << value.recipientIdentity.ref() << "\n"; + if (recipientIdentity.isSet()) { + strm << " recipientIdentity = " + << recipientIdentity.ref() << "\n"; } else { - out << " recipientIdentity is not set\n"; + strm << " recipientIdentity is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; + if (serviceCreated.isSet()) { + strm << " serviceCreated = " + << serviceCreated.ref() << "\n"; } else { - out << " serviceCreated is not set\n"; + strm << " serviceCreated is not set\n"; } - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; + if (serviceUpdated.isSet()) { + strm << " serviceUpdated = " + << serviceUpdated.ref() << "\n"; } else { - out << " serviceUpdated is not set\n"; + strm << " serviceUpdated is not set\n"; } - if (value.serviceAssigned.isSet()) { - out << " serviceAssigned = " - << value.serviceAssigned.ref() << "\n"; + if (serviceAssigned.isSet()) { + strm << " serviceAssigned = " + << serviceAssigned.ref() << "\n"; } else { - out << " serviceAssigned is not set\n"; + strm << " serviceAssigned is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SharedNote & value) +void writeNoteRestrictions( + ThriftBinaryBufferWriter & w, + const NoteRestrictions & s) { - out << "SharedNote: {\n"; - - if (value.sharerUserID.isSet()) { - out << " sharerUserID = " - << value.sharerUserID.ref() << "\n"; - } - else { - out << " sharerUserID is not set\n"; - } - - if (value.recipientIdentity.isSet()) { - out << " recipientIdentity = " - << value.recipientIdentity.ref() << "\n"; - } - else { - out << " recipientIdentity is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; - } - else { - out << " serviceCreated is not set\n"; - } - - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; - } - else { - out << " serviceUpdated is not set\n"; - } - - if (value.serviceAssigned.isSet()) { - out << " serviceAssigned = " - << value.serviceAssigned.ref() << "\n"; - } - else { - out << " serviceAssigned is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions & s) { w.writeStructBegin(QStringLiteral("NoteRestrictions")); if (s.noUpdateTitle.isSet()) { w.writeFieldBegin( @@ -15749,7 +12602,10 @@ void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions w.writeStructEnd(); } -void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s) { +void readNoteRestrictions( + ThriftBinaryBufferReader & r, + NoteRestrictions & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -15811,111 +12667,59 @@ void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteRestrictions & value) +void NoteRestrictions::print(QTextStream & strm) const { - out << "NoteRestrictions: {\n"; + strm << "NoteRestrictions: {\n"; - if (value.noUpdateTitle.isSet()) { - out << " noUpdateTitle = " - << value.noUpdateTitle.ref() << "\n"; + if (noUpdateTitle.isSet()) { + strm << " noUpdateTitle = " + << noUpdateTitle.ref() << "\n"; } else { - out << " noUpdateTitle is not set\n"; + strm << " noUpdateTitle is not set\n"; } - if (value.noUpdateContent.isSet()) { - out << " noUpdateContent = " - << value.noUpdateContent.ref() << "\n"; + if (noUpdateContent.isSet()) { + strm << " noUpdateContent = " + << noUpdateContent.ref() << "\n"; } else { - out << " noUpdateContent is not set\n"; + strm << " noUpdateContent is not set\n"; } - if (value.noEmail.isSet()) { - out << " noEmail = " - << value.noEmail.ref() << "\n"; + if (noEmail.isSet()) { + strm << " noEmail = " + << noEmail.ref() << "\n"; } else { - out << " noEmail is not set\n"; + strm << " noEmail is not set\n"; } - if (value.noShare.isSet()) { - out << " noShare = " - << value.noShare.ref() << "\n"; + if (noShare.isSet()) { + strm << " noShare = " + << noShare.ref() << "\n"; } else { - out << " noShare is not set\n"; + strm << " noShare is not set\n"; } - if (value.noSharePublicly.isSet()) { - out << " noSharePublicly = " - << value.noSharePublicly.ref() << "\n"; + if (noSharePublicly.isSet()) { + strm << " noSharePublicly = " + << noSharePublicly.ref() << "\n"; } else { - out << " noSharePublicly is not set\n"; + strm << " noSharePublicly is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteRestrictions & value) +void writeNoteLimits( + ThriftBinaryBufferWriter & w, + const NoteLimits & s) { - out << "NoteRestrictions: {\n"; - - if (value.noUpdateTitle.isSet()) { - out << " noUpdateTitle = " - << value.noUpdateTitle.ref() << "\n"; - } - else { - out << " noUpdateTitle is not set\n"; - } - - if (value.noUpdateContent.isSet()) { - out << " noUpdateContent = " - << value.noUpdateContent.ref() << "\n"; - } - else { - out << " noUpdateContent is not set\n"; - } - - if (value.noEmail.isSet()) { - out << " noEmail = " - << value.noEmail.ref() << "\n"; - } - else { - out << " noEmail is not set\n"; - } - - if (value.noShare.isSet()) { - out << " noShare = " - << value.noShare.ref() << "\n"; - } - else { - out << " noShare is not set\n"; - } - - if (value.noSharePublicly.isSet()) { - out << " noSharePublicly = " - << value.noSharePublicly.ref() << "\n"; - } - else { - out << " noSharePublicly is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s) { w.writeStructBegin(QStringLiteral("NoteLimits")); if (s.noteResourceCountMax.isSet()) { w.writeFieldBegin( @@ -15961,7 +12765,10 @@ void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s) { w.writeStructEnd(); } -void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s) { +void readNoteLimits( + ThriftBinaryBufferReader & r, + NoteLimits & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -16023,111 +12830,59 @@ void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NoteLimits & value) +void NoteLimits::print(QTextStream & strm) const { - out << "NoteLimits: {\n"; + strm << "NoteLimits: {\n"; - if (value.noteResourceCountMax.isSet()) { - out << " noteResourceCountMax = " - << value.noteResourceCountMax.ref() << "\n"; + if (noteResourceCountMax.isSet()) { + strm << " noteResourceCountMax = " + << noteResourceCountMax.ref() << "\n"; } else { - out << " noteResourceCountMax is not set\n"; + strm << " noteResourceCountMax is not set\n"; } - if (value.uploadLimit.isSet()) { - out << " uploadLimit = " - << value.uploadLimit.ref() << "\n"; + if (uploadLimit.isSet()) { + strm << " uploadLimit = " + << uploadLimit.ref() << "\n"; } else { - out << " uploadLimit is not set\n"; + strm << " uploadLimit is not set\n"; } - if (value.resourceSizeMax.isSet()) { - out << " resourceSizeMax = " - << value.resourceSizeMax.ref() << "\n"; + if (resourceSizeMax.isSet()) { + strm << " resourceSizeMax = " + << resourceSizeMax.ref() << "\n"; } else { - out << " resourceSizeMax is not set\n"; + strm << " resourceSizeMax is not set\n"; } - if (value.noteSizeMax.isSet()) { - out << " noteSizeMax = " - << value.noteSizeMax.ref() << "\n"; + if (noteSizeMax.isSet()) { + strm << " noteSizeMax = " + << noteSizeMax.ref() << "\n"; } else { - out << " noteSizeMax is not set\n"; + strm << " noteSizeMax is not set\n"; } - if (value.uploaded.isSet()) { - out << " uploaded = " - << value.uploaded.ref() << "\n"; + if (uploaded.isSet()) { + strm << " uploaded = " + << uploaded.ref() << "\n"; } else { - out << " uploaded is not set\n"; + strm << " uploaded is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NoteLimits & value) +void writeNote( + ThriftBinaryBufferWriter & w, + const Note & s) { - out << "NoteLimits: {\n"; - - if (value.noteResourceCountMax.isSet()) { - out << " noteResourceCountMax = " - << value.noteResourceCountMax.ref() << "\n"; - } - else { - out << " noteResourceCountMax is not set\n"; - } - - if (value.uploadLimit.isSet()) { - out << " uploadLimit = " - << value.uploadLimit.ref() << "\n"; - } - else { - out << " uploadLimit is not set\n"; - } - - if (value.resourceSizeMax.isSet()) { - out << " resourceSizeMax = " - << value.resourceSizeMax.ref() << "\n"; - } - else { - out << " resourceSizeMax is not set\n"; - } - - if (value.noteSizeMax.isSet()) { - out << " noteSizeMax = " - << value.noteSizeMax.ref() << "\n"; - } - else { - out << " noteSizeMax is not set\n"; - } - - if (value.uploaded.isSet()) { - out << " uploaded = " - << value.uploaded.ref() << "\n"; - } - else { - out << " uploaded is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeStructBegin(QStringLiteral("Note")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -16293,7 +13048,10 @@ void writeNote(ThriftBinaryBufferWriter & w, const Note & s) { w.writeStructEnd(); } -void readNote(ThriftBinaryBufferReader & r, Note & s) { +void readNote( + ThriftBinaryBufferReader & r, + Note & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -16408,7 +13166,11 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Note.tagGuids)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Note.tagGuids)")); + } for(qint32 i = 0; i < size; i++) { Guid elem; r.readString(elem); @@ -16427,7 +13189,11 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Note.resources)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Note.resources)")); + } for(qint32 i = 0; i < size; i++) { Resource elem; readResource(r, elem); @@ -16455,7 +13221,11 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Note.tagNames)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Note.tagNames)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -16474,7 +13244,11 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Note.sharedNotes)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Note.sharedNotes)")); + } for(qint32 i = 0; i < size; i++) { SharedNote elem; readSharedNote(r, elem); @@ -16512,343 +13286,179 @@ void readNote(ThriftBinaryBufferReader & r, Note & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Note & value) +void Note::print(QTextStream & strm) const { - out << "Note: {\n"; + strm << "Note: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; + if (title.isSet()) { + strm << " title = " + << title.ref() << "\n"; } else { - out << " title is not set\n"; + strm << " title is not set\n"; } - if (value.content.isSet()) { - out << " content = " - << value.content.ref() << "\n"; + if (content.isSet()) { + strm << " content = " + << content.ref() << "\n"; } else { - out << " content is not set\n"; + strm << " content is not set\n"; } - if (value.contentHash.isSet()) { - out << " contentHash = " - << value.contentHash.ref() << "\n"; + if (contentHash.isSet()) { + strm << " contentHash = " + << contentHash.ref() << "\n"; } else { - out << " contentHash is not set\n"; + strm << " contentHash is not set\n"; } - if (value.contentLength.isSet()) { - out << " contentLength = " - << value.contentLength.ref() << "\n"; + if (contentLength.isSet()) { + strm << " contentLength = " + << contentLength.ref() << "\n"; } else { - out << " contentLength is not set\n"; + strm << " contentLength is not set\n"; } - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; + if (created.isSet()) { + strm << " created = " + << created.ref() << "\n"; } else { - out << " created is not set\n"; + strm << " created is not set\n"; } - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; + if (updated.isSet()) { + strm << " updated = " + << updated.ref() << "\n"; } else { - out << " updated is not set\n"; + strm << " updated is not set\n"; } - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; + if (deleted.isSet()) { + strm << " deleted = " + << deleted.ref() << "\n"; } else { - out << " deleted is not set\n"; + strm << " deleted is not set\n"; } - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; + if (active.isSet()) { + strm << " active = " + << active.ref() << "\n"; } else { - out << " active is not set\n"; + strm << " active is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.tagGuids.isSet()) { - out << " tagGuids = " + if (tagGuids.isSet()) { + strm << " tagGuids = " << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; + for(const auto & v: tagGuids.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tagGuids is not set\n"; + strm << " tagGuids is not set\n"; } - if (value.resources.isSet()) { - out << " resources = " + if (resources.isSet()) { + strm << " resources = " << "QList {"; - for(const auto & v: value.resources.ref()) { - out << v; + for(const auto & v: resources.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " resources is not set\n"; + strm << " resources is not set\n"; } - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; + if (attributes.isSet()) { + strm << " attributes = " + << attributes.ref() << "\n"; } else { - out << " attributes is not set\n"; + strm << " attributes is not set\n"; } - if (value.tagNames.isSet()) { - out << " tagNames = " + if (tagNames.isSet()) { + strm << " tagNames = " << "QList {"; - for(const auto & v: value.tagNames.ref()) { - out << v; + for(const auto & v: tagNames.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " tagNames is not set\n"; + strm << " tagNames is not set\n"; } - if (value.sharedNotes.isSet()) { - out << " sharedNotes = " + if (sharedNotes.isSet()) { + strm << " sharedNotes = " << "QList {"; - for(const auto & v: value.sharedNotes.ref()) { - out << v; + for(const auto & v: sharedNotes.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " sharedNotes is not set\n"; + strm << " sharedNotes is not set\n"; } - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; + if (restrictions.isSet()) { + strm << " restrictions = " + << restrictions.ref() << "\n"; } else { - out << " restrictions is not set\n"; + strm << " restrictions is not set\n"; } - if (value.limits.isSet()) { - out << " limits = " - << value.limits.ref() << "\n"; + if (limits.isSet()) { + strm << " limits = " + << limits.ref() << "\n"; } else { - out << " limits is not set\n"; + strm << " limits is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Note & value) +void writePublishing( + ThriftBinaryBufferWriter & w, + const Publishing & s) { - out << "Note: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; - } - else { - out << " title is not set\n"; - } - - if (value.content.isSet()) { - out << " content = " - << value.content.ref() << "\n"; - } - else { - out << " content is not set\n"; - } - - if (value.contentHash.isSet()) { - out << " contentHash = " - << value.contentHash.ref() << "\n"; - } - else { - out << " contentHash is not set\n"; - } - - if (value.contentLength.isSet()) { - out << " contentLength = " - << value.contentLength.ref() << "\n"; - } - else { - out << " contentLength is not set\n"; - } - - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; - } - else { - out << " created is not set\n"; - } - - if (value.updated.isSet()) { - out << " updated = " - << value.updated.ref() << "\n"; - } - else { - out << " updated is not set\n"; - } - - if (value.deleted.isSet()) { - out << " deleted = " - << value.deleted.ref() << "\n"; - } - else { - out << " deleted is not set\n"; - } - - if (value.active.isSet()) { - out << " active = " - << value.active.ref() << "\n"; - } - else { - out << " active is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; - } - else { - out << " notebookGuid is not set\n"; - } - - if (value.tagGuids.isSet()) { - out << " tagGuids = " - << "QList {"; - for(const auto & v: value.tagGuids.ref()) { - out << v; - } - } - else { - out << " tagGuids is not set\n"; - } - - if (value.resources.isSet()) { - out << " resources = " - << "QList {"; - for(const auto & v: value.resources.ref()) { - out << v; - } - } - else { - out << " resources is not set\n"; - } - - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; - } - else { - out << " attributes is not set\n"; - } - - if (value.tagNames.isSet()) { - out << " tagNames = " - << "QList {"; - for(const auto & v: value.tagNames.ref()) { - out << v; - } - } - else { - out << " tagNames is not set\n"; - } - - if (value.sharedNotes.isSet()) { - out << " sharedNotes = " - << "QList {"; - for(const auto & v: value.sharedNotes.ref()) { - out << v; - } - } - else { - out << " sharedNotes is not set\n"; - } - - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; - } - else { - out << " restrictions is not set\n"; - } - - if (value.limits.isSet()) { - out << " limits = " - << value.limits.ref() << "\n"; - } - else { - out << " limits is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s) { w.writeStructBegin(QStringLiteral("Publishing")); if (s.uri.isSet()) { w.writeFieldBegin( @@ -16886,7 +13496,10 @@ void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s) { w.writeStructEnd(); } -void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { +void readPublishing( + ThriftBinaryBufferReader & r, + Publishing & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -16939,95 +13552,51 @@ void readPublishing(ThriftBinaryBufferReader & r, Publishing & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Publishing & value) +void Publishing::print(QTextStream & strm) const { - out << "Publishing: {\n"; + strm << "Publishing: {\n"; - if (value.uri.isSet()) { - out << " uri = " - << value.uri.ref() << "\n"; + if (uri.isSet()) { + strm << " uri = " + << uri.ref() << "\n"; } else { - out << " uri is not set\n"; + strm << " uri is not set\n"; } - if (value.order.isSet()) { - out << " order = " - << value.order.ref() << "\n"; + if (order.isSet()) { + strm << " order = " + << order.ref() << "\n"; } else { - out << " order is not set\n"; + strm << " order is not set\n"; } - if (value.ascending.isSet()) { - out << " ascending = " - << value.ascending.ref() << "\n"; + if (ascending.isSet()) { + strm << " ascending = " + << ascending.ref() << "\n"; } else { - out << " ascending is not set\n"; + strm << " ascending is not set\n"; } - if (value.publicDescription.isSet()) { - out << " publicDescription = " - << value.publicDescription.ref() << "\n"; + if (publicDescription.isSet()) { + strm << " publicDescription = " + << publicDescription.ref() << "\n"; } else { - out << " publicDescription is not set\n"; + strm << " publicDescription is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Publishing & value) +void writeBusinessNotebook( + ThriftBinaryBufferWriter & w, + const BusinessNotebook & s) { - out << "Publishing: {\n"; - - if (value.uri.isSet()) { - out << " uri = " - << value.uri.ref() << "\n"; - } - else { - out << " uri is not set\n"; - } - - if (value.order.isSet()) { - out << " order = " - << value.order.ref() << "\n"; - } - else { - out << " order is not set\n"; - } - - if (value.ascending.isSet()) { - out << " ascending = " - << value.ascending.ref() << "\n"; - } - else { - out << " ascending is not set\n"; - } - - if (value.publicDescription.isSet()) { - out << " publicDescription = " - << value.publicDescription.ref() << "\n"; - } - else { - out << " publicDescription is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook & s) { w.writeStructBegin(QStringLiteral("BusinessNotebook")); if (s.notebookDescription.isSet()) { w.writeFieldBegin( @@ -17057,7 +13626,10 @@ void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook w.writeStructEnd(); } -void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { +void readBusinessNotebook( + ThriftBinaryBufferReader & r, + BusinessNotebook & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -17101,79 +13673,43 @@ void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BusinessNotebook & value) +void BusinessNotebook::print(QTextStream & strm) const { - out << "BusinessNotebook: {\n"; + strm << "BusinessNotebook: {\n"; - if (value.notebookDescription.isSet()) { - out << " notebookDescription = " - << value.notebookDescription.ref() << "\n"; + if (notebookDescription.isSet()) { + strm << " notebookDescription = " + << notebookDescription.ref() << "\n"; } else { - out << " notebookDescription is not set\n"; + strm << " notebookDescription is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.recommended.isSet()) { - out << " recommended = " - << value.recommended.ref() << "\n"; + if (recommended.isSet()) { + strm << " recommended = " + << recommended.ref() << "\n"; } else { - out << " recommended is not set\n"; + strm << " recommended is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const BusinessNotebook & value) +void writeSavedSearchScope( + ThriftBinaryBufferWriter & w, + const SavedSearchScope & s) { - out << "BusinessNotebook: {\n"; - - if (value.notebookDescription.isSet()) { - out << " notebookDescription = " - << value.notebookDescription.ref() << "\n"; - } - else { - out << " notebookDescription is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.recommended.isSet()) { - out << " recommended = " - << value.recommended.ref() << "\n"; - } - else { - out << " recommended is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope & s) { w.writeStructBegin(QStringLiteral("SavedSearchScope")); if (s.includeAccount.isSet()) { w.writeFieldBegin( @@ -17203,7 +13739,10 @@ void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope w.writeStructEnd(); } -void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s) { +void readSavedSearchScope( + ThriftBinaryBufferReader & r, + SavedSearchScope & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -17247,79 +13786,43 @@ void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SavedSearchScope & value) +void SavedSearchScope::print(QTextStream & strm) const { - out << "SavedSearchScope: {\n"; + strm << "SavedSearchScope: {\n"; - if (value.includeAccount.isSet()) { - out << " includeAccount = " - << value.includeAccount.ref() << "\n"; + if (includeAccount.isSet()) { + strm << " includeAccount = " + << includeAccount.ref() << "\n"; } else { - out << " includeAccount is not set\n"; + strm << " includeAccount is not set\n"; } - if (value.includePersonalLinkedNotebooks.isSet()) { - out << " includePersonalLinkedNotebooks = " - << value.includePersonalLinkedNotebooks.ref() << "\n"; + if (includePersonalLinkedNotebooks.isSet()) { + strm << " includePersonalLinkedNotebooks = " + << includePersonalLinkedNotebooks.ref() << "\n"; } else { - out << " includePersonalLinkedNotebooks is not set\n"; + strm << " includePersonalLinkedNotebooks is not set\n"; } - if (value.includeBusinessLinkedNotebooks.isSet()) { - out << " includeBusinessLinkedNotebooks = " - << value.includeBusinessLinkedNotebooks.ref() << "\n"; + if (includeBusinessLinkedNotebooks.isSet()) { + strm << " includeBusinessLinkedNotebooks = " + << includeBusinessLinkedNotebooks.ref() << "\n"; } else { - out << " includeBusinessLinkedNotebooks is not set\n"; + strm << " includeBusinessLinkedNotebooks is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SavedSearchScope & value) +void writeSavedSearch( + ThriftBinaryBufferWriter & w, + const SavedSearch & s) { - out << "SavedSearchScope: {\n"; - - if (value.includeAccount.isSet()) { - out << " includeAccount = " - << value.includeAccount.ref() << "\n"; - } - else { - out << " includeAccount is not set\n"; - } - - if (value.includePersonalLinkedNotebooks.isSet()) { - out << " includePersonalLinkedNotebooks = " - << value.includePersonalLinkedNotebooks.ref() << "\n"; - } - else { - out << " includePersonalLinkedNotebooks is not set\n"; - } - - if (value.includeBusinessLinkedNotebooks.isSet()) { - out << " includeBusinessLinkedNotebooks = " - << value.includeBusinessLinkedNotebooks.ref() << "\n"; - } - else { - out << " includeBusinessLinkedNotebooks is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s) { w.writeStructBegin(QStringLiteral("SavedSearch")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -17373,7 +13876,10 @@ void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s) { w.writeStructEnd(); } -void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { +void readSavedSearch( + ThriftBinaryBufferReader & r, + SavedSearch & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -17444,127 +13950,67 @@ void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SavedSearch & value) +void SavedSearch::print(QTextStream & strm) const { - out << "SavedSearch: {\n"; + strm << "SavedSearch: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.query.isSet()) { - out << " query = " - << value.query.ref() << "\n"; + if (query.isSet()) { + strm << " query = " + << query.ref() << "\n"; } else { - out << " query is not set\n"; + strm << " query is not set\n"; } - if (value.format.isSet()) { - out << " format = " - << value.format.ref() << "\n"; + if (format.isSet()) { + strm << " format = " + << format.ref() << "\n"; } else { - out << " format is not set\n"; + strm << " format is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.scope.isSet()) { - out << " scope = " - << value.scope.ref() << "\n"; + if (scope.isSet()) { + strm << " scope = " + << scope.ref() << "\n"; } else { - out << " scope is not set\n"; + strm << " scope is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SavedSearch & value) +void writeSharedNotebookRecipientSettings( + ThriftBinaryBufferWriter & w, + const SharedNotebookRecipientSettings & s) { - out << "SavedSearch: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.query.isSet()) { - out << " query = " - << value.query.ref() << "\n"; - } - else { - out << " query is not set\n"; - } - - if (value.format.isSet()) { - out << " format = " - << value.format.ref() << "\n"; - } - else { - out << " format is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.scope.isSet()) { - out << " scope = " - << value.scope.ref() << "\n"; - } - else { - out << " scope is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const SharedNotebookRecipientSettings & s) { w.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { w.writeFieldBegin( @@ -17586,7 +14032,10 @@ void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const Sh w.writeStructEnd(); } -void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNotebookRecipientSettings & s) { +void readSharedNotebookRecipientSettings( + ThriftBinaryBufferReader & r, + SharedNotebookRecipientSettings & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -17621,71 +14070,43 @@ void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNot r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SharedNotebookRecipientSettings & value) +void SharedNotebookRecipientSettings::print(QTextStream & strm) const { - out << "SharedNotebookRecipientSettings: {\n"; + strm << "SharedNotebookRecipientSettings: {\n"; - if (value.reminderNotifyEmail.isSet()) { - out << " reminderNotifyEmail = " - << value.reminderNotifyEmail.ref() << "\n"; + if (reminderNotifyEmail.isSet()) { + strm << " reminderNotifyEmail = " + << reminderNotifyEmail.ref() << "\n"; } else { - out << " reminderNotifyEmail is not set\n"; + strm << " reminderNotifyEmail is not set\n"; } - if (value.reminderNotifyInApp.isSet()) { - out << " reminderNotifyInApp = " - << value.reminderNotifyInApp.ref() << "\n"; + if (reminderNotifyInApp.isSet()) { + strm << " reminderNotifyInApp = " + << reminderNotifyInApp.ref() << "\n"; } else { - out << " reminderNotifyInApp is not set\n"; + strm << " reminderNotifyInApp is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SharedNotebookRecipientSettings & value) +void writeNotebookRecipientSettings( + ThriftBinaryBufferWriter & w, + const NotebookRecipientSettings & s) { - out << "SharedNotebookRecipientSettings: {\n"; - - if (value.reminderNotifyEmail.isSet()) { - out << " reminderNotifyEmail = " - << value.reminderNotifyEmail.ref() << "\n"; - } - else { - out << " reminderNotifyEmail is not set\n"; - } - - if (value.reminderNotifyInApp.isSet()) { - out << " reminderNotifyInApp = " - << value.reminderNotifyInApp.ref() << "\n"; - } - else { - out << " reminderNotifyInApp is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const NotebookRecipientSettings & s) { - w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); - if (s.reminderNotifyEmail.isSet()) { - w.writeFieldBegin( - QStringLiteral("reminderNotifyEmail"), - ThriftFieldType::T_BOOL, - 1); - w.writeBool(s.reminderNotifyEmail.ref()); - w.writeFieldEnd(); + w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); + if (s.reminderNotifyEmail.isSet()) { + w.writeFieldBegin( + QStringLiteral("reminderNotifyEmail"), + ThriftFieldType::T_BOOL, + 1); + w.writeBool(s.reminderNotifyEmail.ref()); + w.writeFieldEnd(); } if (s.reminderNotifyInApp.isSet()) { w.writeFieldBegin( @@ -17723,7 +14144,10 @@ void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const Notebook w.writeStructEnd(); } -void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipientSettings & s) { +void readNotebookRecipientSettings( + ThriftBinaryBufferReader & r, + NotebookRecipientSettings & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -17785,111 +14209,59 @@ void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipie r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotebookRecipientSettings & value) +void NotebookRecipientSettings::print(QTextStream & strm) const { - out << "NotebookRecipientSettings: {\n"; + strm << "NotebookRecipientSettings: {\n"; - if (value.reminderNotifyEmail.isSet()) { - out << " reminderNotifyEmail = " - << value.reminderNotifyEmail.ref() << "\n"; + if (reminderNotifyEmail.isSet()) { + strm << " reminderNotifyEmail = " + << reminderNotifyEmail.ref() << "\n"; } else { - out << " reminderNotifyEmail is not set\n"; + strm << " reminderNotifyEmail is not set\n"; } - if (value.reminderNotifyInApp.isSet()) { - out << " reminderNotifyInApp = " - << value.reminderNotifyInApp.ref() << "\n"; + if (reminderNotifyInApp.isSet()) { + strm << " reminderNotifyInApp = " + << reminderNotifyInApp.ref() << "\n"; } else { - out << " reminderNotifyInApp is not set\n"; + strm << " reminderNotifyInApp is not set\n"; } - if (value.inMyList.isSet()) { - out << " inMyList = " - << value.inMyList.ref() << "\n"; + if (inMyList.isSet()) { + strm << " inMyList = " + << inMyList.ref() << "\n"; } else { - out << " inMyList is not set\n"; + strm << " inMyList is not set\n"; } - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; + if (stack.isSet()) { + strm << " stack = " + << stack.ref() << "\n"; } else { - out << " stack is not set\n"; + strm << " stack is not set\n"; } - if (value.recipientStatus.isSet()) { - out << " recipientStatus = " - << value.recipientStatus.ref() << "\n"; + if (recipientStatus.isSet()) { + strm << " recipientStatus = " + << recipientStatus.ref() << "\n"; } else { - out << " recipientStatus is not set\n"; + strm << " recipientStatus is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotebookRecipientSettings & value) +void writeSharedNotebook( + ThriftBinaryBufferWriter & w, + const SharedNotebook & s) { - out << "NotebookRecipientSettings: {\n"; - - if (value.reminderNotifyEmail.isSet()) { - out << " reminderNotifyEmail = " - << value.reminderNotifyEmail.ref() << "\n"; - } - else { - out << " reminderNotifyEmail is not set\n"; - } - - if (value.reminderNotifyInApp.isSet()) { - out << " reminderNotifyInApp = " - << value.reminderNotifyInApp.ref() << "\n"; - } - else { - out << " reminderNotifyInApp is not set\n"; - } - - if (value.inMyList.isSet()) { - out << " inMyList = " - << value.inMyList.ref() << "\n"; - } - else { - out << " inMyList is not set\n"; - } - - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; - } - else { - out << " stack is not set\n"; - } - - if (value.recipientStatus.isSet()) { - out << " recipientStatus = " - << value.recipientStatus.ref() << "\n"; - } - else { - out << " recipientStatus is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s) { w.writeStructBegin(QStringLiteral("SharedNotebook")); if (s.id.isSet()) { w.writeFieldBegin( @@ -18023,7 +14395,10 @@ void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s) w.writeStructEnd(); } -void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { +void readSharedNotebook( + ThriftBinaryBufferReader & r, + SharedNotebook & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -18184,287 +14559,147 @@ void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const SharedNotebook & value) +void SharedNotebook::print(QTextStream & strm) const { - out << "SharedNotebook: {\n"; + strm << "SharedNotebook: {\n"; - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; + if (id.isSet()) { + strm << " id = " + << id.ref() << "\n"; } else { - out << " id is not set\n"; + strm << " id is not set\n"; } - if (value.userId.isSet()) { - out << " userId = " - << value.userId.ref() << "\n"; + if (userId.isSet()) { + strm << " userId = " + << userId.ref() << "\n"; } else { - out << " userId is not set\n"; + strm << " userId is not set\n"; } - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; + if (notebookGuid.isSet()) { + strm << " notebookGuid = " + << notebookGuid.ref() << "\n"; } else { - out << " notebookGuid is not set\n"; + strm << " notebookGuid is not set\n"; } - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; + if (email.isSet()) { + strm << " email = " + << email.ref() << "\n"; } else { - out << " email is not set\n"; + strm << " email is not set\n"; } - if (value.recipientIdentityId.isSet()) { - out << " recipientIdentityId = " - << value.recipientIdentityId.ref() << "\n"; + if (recipientIdentityId.isSet()) { + strm << " recipientIdentityId = " + << recipientIdentityId.ref() << "\n"; } else { - out << " recipientIdentityId is not set\n"; + strm << " recipientIdentityId is not set\n"; } - if (value.notebookModifiable.isSet()) { - out << " notebookModifiable = " - << value.notebookModifiable.ref() << "\n"; + if (notebookModifiable.isSet()) { + strm << " notebookModifiable = " + << notebookModifiable.ref() << "\n"; } else { - out << " notebookModifiable is not set\n"; + strm << " notebookModifiable is not set\n"; } - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; + if (serviceCreated.isSet()) { + strm << " serviceCreated = " + << serviceCreated.ref() << "\n"; } else { - out << " serviceCreated is not set\n"; + strm << " serviceCreated is not set\n"; } - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; + if (serviceUpdated.isSet()) { + strm << " serviceUpdated = " + << serviceUpdated.ref() << "\n"; } else { - out << " serviceUpdated is not set\n"; + strm << " serviceUpdated is not set\n"; } - if (value.globalId.isSet()) { - out << " globalId = " - << value.globalId.ref() << "\n"; + if (globalId.isSet()) { + strm << " globalId = " + << globalId.ref() << "\n"; } else { - out << " globalId is not set\n"; + strm << " globalId is not set\n"; } - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (username.isSet()) { + strm << " username = " + << username.ref() << "\n"; } else { - out << " username is not set\n"; + strm << " username is not set\n"; } - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; + if (privilege.isSet()) { + strm << " privilege = " + << privilege.ref() << "\n"; } else { - out << " privilege is not set\n"; + strm << " privilege is not set\n"; } - if (value.recipientSettings.isSet()) { - out << " recipientSettings = " - << value.recipientSettings.ref() << "\n"; + if (recipientSettings.isSet()) { + strm << " recipientSettings = " + << recipientSettings.ref() << "\n"; } else { - out << " recipientSettings is not set\n"; + strm << " recipientSettings is not set\n"; } - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; + if (sharerUserId.isSet()) { + strm << " sharerUserId = " + << sharerUserId.ref() << "\n"; } else { - out << " sharerUserId is not set\n"; + strm << " sharerUserId is not set\n"; } - if (value.recipientUsername.isSet()) { - out << " recipientUsername = " - << value.recipientUsername.ref() << "\n"; + if (recipientUsername.isSet()) { + strm << " recipientUsername = " + << recipientUsername.ref() << "\n"; } else { - out << " recipientUsername is not set\n"; + strm << " recipientUsername is not set\n"; } - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; + if (recipientUserId.isSet()) { + strm << " recipientUserId = " + << recipientUserId.ref() << "\n"; } else { - out << " recipientUserId is not set\n"; + strm << " recipientUserId is not set\n"; } - if (value.serviceAssigned.isSet()) { - out << " serviceAssigned = " - << value.serviceAssigned.ref() << "\n"; + if (serviceAssigned.isSet()) { + strm << " serviceAssigned = " + << serviceAssigned.ref() << "\n"; } else { - out << " serviceAssigned is not set\n"; + strm << " serviceAssigned is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const SharedNotebook & value) +void writeCanMoveToContainerRestrictions( + ThriftBinaryBufferWriter & w, + const CanMoveToContainerRestrictions & s) { - out << "SharedNotebook: {\n"; - - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; - } - else { - out << " id is not set\n"; - } - - if (value.userId.isSet()) { - out << " userId = " - << value.userId.ref() << "\n"; - } - else { - out << " userId is not set\n"; - } - - if (value.notebookGuid.isSet()) { - out << " notebookGuid = " - << value.notebookGuid.ref() << "\n"; - } - else { - out << " notebookGuid is not set\n"; - } - - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; - } - else { - out << " email is not set\n"; - } - - if (value.recipientIdentityId.isSet()) { - out << " recipientIdentityId = " - << value.recipientIdentityId.ref() << "\n"; - } - else { - out << " recipientIdentityId is not set\n"; - } - - if (value.notebookModifiable.isSet()) { - out << " notebookModifiable = " - << value.notebookModifiable.ref() << "\n"; - } - else { - out << " notebookModifiable is not set\n"; - } - - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; - } - else { - out << " serviceCreated is not set\n"; - } - - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; - } - else { - out << " serviceUpdated is not set\n"; - } - - if (value.globalId.isSet()) { - out << " globalId = " - << value.globalId.ref() << "\n"; - } - else { - out << " globalId is not set\n"; - } - - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; - } - else { - out << " username is not set\n"; - } - - if (value.privilege.isSet()) { - out << " privilege = " - << value.privilege.ref() << "\n"; - } - else { - out << " privilege is not set\n"; - } - - if (value.recipientSettings.isSet()) { - out << " recipientSettings = " - << value.recipientSettings.ref() << "\n"; - } - else { - out << " recipientSettings is not set\n"; - } - - if (value.sharerUserId.isSet()) { - out << " sharerUserId = " - << value.sharerUserId.ref() << "\n"; - } - else { - out << " sharerUserId is not set\n"; - } - - if (value.recipientUsername.isSet()) { - out << " recipientUsername = " - << value.recipientUsername.ref() << "\n"; - } - else { - out << " recipientUsername is not set\n"; - } - - if (value.recipientUserId.isSet()) { - out << " recipientUserId = " - << value.recipientUserId.ref() << "\n"; - } - else { - out << " recipientUserId is not set\n"; - } - - if (value.serviceAssigned.isSet()) { - out << " serviceAssigned = " - << value.serviceAssigned.ref() << "\n"; - } - else { - out << " serviceAssigned is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const CanMoveToContainerRestrictions & s) { w.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); if (s.canMoveToContainer.isSet()) { w.writeFieldBegin( @@ -18478,7 +14713,10 @@ void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const Can w.writeStructEnd(); } -void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToContainerRestrictions & s) { +void readCanMoveToContainerRestrictions( + ThriftBinaryBufferReader & r, + CanMoveToContainerRestrictions & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -18504,47 +14742,27 @@ void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToC r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const CanMoveToContainerRestrictions & value) +void CanMoveToContainerRestrictions::print(QTextStream & strm) const { - out << "CanMoveToContainerRestrictions: {\n"; + strm << "CanMoveToContainerRestrictions: {\n"; - if (value.canMoveToContainer.isSet()) { - out << " canMoveToContainer = " - << value.canMoveToContainer.ref() << "\n"; + if (canMoveToContainer.isSet()) { + strm << " canMoveToContainer = " + << canMoveToContainer.ref() << "\n"; } else { - out << " canMoveToContainer is not set\n"; + strm << " canMoveToContainer is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const CanMoveToContainerRestrictions & value) +void writeNotebookRestrictions( + ThriftBinaryBufferWriter & w, + const NotebookRestrictions & s) { - out << "CanMoveToContainerRestrictions: {\n"; - - if (value.canMoveToContainer.isSet()) { - out << " canMoveToContainer = " - << value.canMoveToContainer.ref() << "\n"; - } - else { - out << " canMoveToContainer is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestrictions & s) { w.writeStructBegin(QStringLiteral("NotebookRestrictions")); if (s.noReadNotes.isSet()) { w.writeFieldBegin( @@ -18782,7 +15000,10 @@ void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestr w.writeStructEnd(); } -void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions & s) { +void readNotebookRestrictions( + ThriftBinaryBufferReader & r, + NotebookRestrictions & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -19060,495 +15281,251 @@ void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotebookRestrictions & value) +void NotebookRestrictions::print(QTextStream & strm) const { - out << "NotebookRestrictions: {\n"; + strm << "NotebookRestrictions: {\n"; - if (value.noReadNotes.isSet()) { - out << " noReadNotes = " - << value.noReadNotes.ref() << "\n"; + if (noReadNotes.isSet()) { + strm << " noReadNotes = " + << noReadNotes.ref() << "\n"; } else { - out << " noReadNotes is not set\n"; + strm << " noReadNotes is not set\n"; } - if (value.noCreateNotes.isSet()) { - out << " noCreateNotes = " - << value.noCreateNotes.ref() << "\n"; + if (noCreateNotes.isSet()) { + strm << " noCreateNotes = " + << noCreateNotes.ref() << "\n"; } else { - out << " noCreateNotes is not set\n"; + strm << " noCreateNotes is not set\n"; } - if (value.noUpdateNotes.isSet()) { - out << " noUpdateNotes = " - << value.noUpdateNotes.ref() << "\n"; + if (noUpdateNotes.isSet()) { + strm << " noUpdateNotes = " + << noUpdateNotes.ref() << "\n"; } else { - out << " noUpdateNotes is not set\n"; + strm << " noUpdateNotes is not set\n"; } - if (value.noExpungeNotes.isSet()) { - out << " noExpungeNotes = " - << value.noExpungeNotes.ref() << "\n"; + if (noExpungeNotes.isSet()) { + strm << " noExpungeNotes = " + << noExpungeNotes.ref() << "\n"; } else { - out << " noExpungeNotes is not set\n"; + strm << " noExpungeNotes is not set\n"; } - if (value.noShareNotes.isSet()) { - out << " noShareNotes = " - << value.noShareNotes.ref() << "\n"; + if (noShareNotes.isSet()) { + strm << " noShareNotes = " + << noShareNotes.ref() << "\n"; } else { - out << " noShareNotes is not set\n"; + strm << " noShareNotes is not set\n"; } - if (value.noEmailNotes.isSet()) { - out << " noEmailNotes = " - << value.noEmailNotes.ref() << "\n"; + if (noEmailNotes.isSet()) { + strm << " noEmailNotes = " + << noEmailNotes.ref() << "\n"; } else { - out << " noEmailNotes is not set\n"; + strm << " noEmailNotes is not set\n"; } - if (value.noSendMessageToRecipients.isSet()) { - out << " noSendMessageToRecipients = " - << value.noSendMessageToRecipients.ref() << "\n"; + if (noSendMessageToRecipients.isSet()) { + strm << " noSendMessageToRecipients = " + << noSendMessageToRecipients.ref() << "\n"; } else { - out << " noSendMessageToRecipients is not set\n"; + strm << " noSendMessageToRecipients is not set\n"; } - if (value.noUpdateNotebook.isSet()) { - out << " noUpdateNotebook = " - << value.noUpdateNotebook.ref() << "\n"; + if (noUpdateNotebook.isSet()) { + strm << " noUpdateNotebook = " + << noUpdateNotebook.ref() << "\n"; } else { - out << " noUpdateNotebook is not set\n"; + strm << " noUpdateNotebook is not set\n"; } - if (value.noExpungeNotebook.isSet()) { - out << " noExpungeNotebook = " - << value.noExpungeNotebook.ref() << "\n"; + if (noExpungeNotebook.isSet()) { + strm << " noExpungeNotebook = " + << noExpungeNotebook.ref() << "\n"; } else { - out << " noExpungeNotebook is not set\n"; + strm << " noExpungeNotebook is not set\n"; } - if (value.noSetDefaultNotebook.isSet()) { - out << " noSetDefaultNotebook = " - << value.noSetDefaultNotebook.ref() << "\n"; + if (noSetDefaultNotebook.isSet()) { + strm << " noSetDefaultNotebook = " + << noSetDefaultNotebook.ref() << "\n"; } else { - out << " noSetDefaultNotebook is not set\n"; + strm << " noSetDefaultNotebook is not set\n"; } - if (value.noSetNotebookStack.isSet()) { - out << " noSetNotebookStack = " - << value.noSetNotebookStack.ref() << "\n"; + if (noSetNotebookStack.isSet()) { + strm << " noSetNotebookStack = " + << noSetNotebookStack.ref() << "\n"; } else { - out << " noSetNotebookStack is not set\n"; + strm << " noSetNotebookStack is not set\n"; } - if (value.noPublishToPublic.isSet()) { - out << " noPublishToPublic = " - << value.noPublishToPublic.ref() << "\n"; + if (noPublishToPublic.isSet()) { + strm << " noPublishToPublic = " + << noPublishToPublic.ref() << "\n"; } else { - out << " noPublishToPublic is not set\n"; + strm << " noPublishToPublic is not set\n"; } - if (value.noPublishToBusinessLibrary.isSet()) { - out << " noPublishToBusinessLibrary = " - << value.noPublishToBusinessLibrary.ref() << "\n"; + if (noPublishToBusinessLibrary.isSet()) { + strm << " noPublishToBusinessLibrary = " + << noPublishToBusinessLibrary.ref() << "\n"; } else { - out << " noPublishToBusinessLibrary is not set\n"; + strm << " noPublishToBusinessLibrary is not set\n"; } - if (value.noCreateTags.isSet()) { - out << " noCreateTags = " - << value.noCreateTags.ref() << "\n"; + if (noCreateTags.isSet()) { + strm << " noCreateTags = " + << noCreateTags.ref() << "\n"; } else { - out << " noCreateTags is not set\n"; + strm << " noCreateTags is not set\n"; } - if (value.noUpdateTags.isSet()) { - out << " noUpdateTags = " - << value.noUpdateTags.ref() << "\n"; + if (noUpdateTags.isSet()) { + strm << " noUpdateTags = " + << noUpdateTags.ref() << "\n"; } else { - out << " noUpdateTags is not set\n"; + strm << " noUpdateTags is not set\n"; } - if (value.noExpungeTags.isSet()) { - out << " noExpungeTags = " - << value.noExpungeTags.ref() << "\n"; + if (noExpungeTags.isSet()) { + strm << " noExpungeTags = " + << noExpungeTags.ref() << "\n"; } else { - out << " noExpungeTags is not set\n"; + strm << " noExpungeTags is not set\n"; } - if (value.noSetParentTag.isSet()) { - out << " noSetParentTag = " - << value.noSetParentTag.ref() << "\n"; + if (noSetParentTag.isSet()) { + strm << " noSetParentTag = " + << noSetParentTag.ref() << "\n"; } else { - out << " noSetParentTag is not set\n"; + strm << " noSetParentTag is not set\n"; } - if (value.noCreateSharedNotebooks.isSet()) { - out << " noCreateSharedNotebooks = " - << value.noCreateSharedNotebooks.ref() << "\n"; + if (noCreateSharedNotebooks.isSet()) { + strm << " noCreateSharedNotebooks = " + << noCreateSharedNotebooks.ref() << "\n"; } else { - out << " noCreateSharedNotebooks is not set\n"; + strm << " noCreateSharedNotebooks is not set\n"; } - if (value.updateWhichSharedNotebookRestrictions.isSet()) { - out << " updateWhichSharedNotebookRestrictions = " - << value.updateWhichSharedNotebookRestrictions.ref() << "\n"; + if (updateWhichSharedNotebookRestrictions.isSet()) { + strm << " updateWhichSharedNotebookRestrictions = " + << updateWhichSharedNotebookRestrictions.ref() << "\n"; } else { - out << " updateWhichSharedNotebookRestrictions is not set\n"; + strm << " updateWhichSharedNotebookRestrictions is not set\n"; } - if (value.expungeWhichSharedNotebookRestrictions.isSet()) { - out << " expungeWhichSharedNotebookRestrictions = " - << value.expungeWhichSharedNotebookRestrictions.ref() << "\n"; + if (expungeWhichSharedNotebookRestrictions.isSet()) { + strm << " expungeWhichSharedNotebookRestrictions = " + << expungeWhichSharedNotebookRestrictions.ref() << "\n"; } else { - out << " expungeWhichSharedNotebookRestrictions is not set\n"; + strm << " expungeWhichSharedNotebookRestrictions is not set\n"; } - if (value.noShareNotesWithBusiness.isSet()) { - out << " noShareNotesWithBusiness = " - << value.noShareNotesWithBusiness.ref() << "\n"; + if (noShareNotesWithBusiness.isSet()) { + strm << " noShareNotesWithBusiness = " + << noShareNotesWithBusiness.ref() << "\n"; } else { - out << " noShareNotesWithBusiness is not set\n"; + strm << " noShareNotesWithBusiness is not set\n"; } - if (value.noRenameNotebook.isSet()) { - out << " noRenameNotebook = " - << value.noRenameNotebook.ref() << "\n"; + if (noRenameNotebook.isSet()) { + strm << " noRenameNotebook = " + << noRenameNotebook.ref() << "\n"; } else { - out << " noRenameNotebook is not set\n"; + strm << " noRenameNotebook is not set\n"; } - if (value.noSetInMyList.isSet()) { - out << " noSetInMyList = " - << value.noSetInMyList.ref() << "\n"; + if (noSetInMyList.isSet()) { + strm << " noSetInMyList = " + << noSetInMyList.ref() << "\n"; } else { - out << " noSetInMyList is not set\n"; + strm << " noSetInMyList is not set\n"; } - if (value.noChangeContact.isSet()) { - out << " noChangeContact = " - << value.noChangeContact.ref() << "\n"; + if (noChangeContact.isSet()) { + strm << " noChangeContact = " + << noChangeContact.ref() << "\n"; } else { - out << " noChangeContact is not set\n"; + strm << " noChangeContact is not set\n"; } - if (value.canMoveToContainerRestrictions.isSet()) { - out << " canMoveToContainerRestrictions = " - << value.canMoveToContainerRestrictions.ref() << "\n"; + if (canMoveToContainerRestrictions.isSet()) { + strm << " canMoveToContainerRestrictions = " + << canMoveToContainerRestrictions.ref() << "\n"; } else { - out << " canMoveToContainerRestrictions is not set\n"; + strm << " canMoveToContainerRestrictions is not set\n"; } - if (value.noSetReminderNotifyEmail.isSet()) { - out << " noSetReminderNotifyEmail = " - << value.noSetReminderNotifyEmail.ref() << "\n"; + if (noSetReminderNotifyEmail.isSet()) { + strm << " noSetReminderNotifyEmail = " + << noSetReminderNotifyEmail.ref() << "\n"; } else { - out << " noSetReminderNotifyEmail is not set\n"; + strm << " noSetReminderNotifyEmail is not set\n"; } - if (value.noSetReminderNotifyInApp.isSet()) { - out << " noSetReminderNotifyInApp = " - << value.noSetReminderNotifyInApp.ref() << "\n"; + if (noSetReminderNotifyInApp.isSet()) { + strm << " noSetReminderNotifyInApp = " + << noSetReminderNotifyInApp.ref() << "\n"; } else { - out << " noSetReminderNotifyInApp is not set\n"; + strm << " noSetReminderNotifyInApp is not set\n"; } - if (value.noSetRecipientSettingsStack.isSet()) { - out << " noSetRecipientSettingsStack = " - << value.noSetRecipientSettingsStack.ref() << "\n"; + if (noSetRecipientSettingsStack.isSet()) { + strm << " noSetRecipientSettingsStack = " + << noSetRecipientSettingsStack.ref() << "\n"; } else { - out << " noSetRecipientSettingsStack is not set\n"; + strm << " noSetRecipientSettingsStack is not set\n"; } - if (value.noCanMoveNote.isSet()) { - out << " noCanMoveNote = " - << value.noCanMoveNote.ref() << "\n"; + if (noCanMoveNote.isSet()) { + strm << " noCanMoveNote = " + << noCanMoveNote.ref() << "\n"; } else { - out << " noCanMoveNote is not set\n"; + strm << " noCanMoveNote is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotebookRestrictions & value) +void writeNotebook( + ThriftBinaryBufferWriter & w, + const Notebook & s) { - out << "NotebookRestrictions: {\n"; - - if (value.noReadNotes.isSet()) { - out << " noReadNotes = " - << value.noReadNotes.ref() << "\n"; - } - else { - out << " noReadNotes is not set\n"; - } - - if (value.noCreateNotes.isSet()) { - out << " noCreateNotes = " - << value.noCreateNotes.ref() << "\n"; - } - else { - out << " noCreateNotes is not set\n"; - } - - if (value.noUpdateNotes.isSet()) { - out << " noUpdateNotes = " - << value.noUpdateNotes.ref() << "\n"; - } - else { - out << " noUpdateNotes is not set\n"; - } - - if (value.noExpungeNotes.isSet()) { - out << " noExpungeNotes = " - << value.noExpungeNotes.ref() << "\n"; - } - else { - out << " noExpungeNotes is not set\n"; - } - - if (value.noShareNotes.isSet()) { - out << " noShareNotes = " - << value.noShareNotes.ref() << "\n"; - } - else { - out << " noShareNotes is not set\n"; - } - - if (value.noEmailNotes.isSet()) { - out << " noEmailNotes = " - << value.noEmailNotes.ref() << "\n"; - } - else { - out << " noEmailNotes is not set\n"; - } - - if (value.noSendMessageToRecipients.isSet()) { - out << " noSendMessageToRecipients = " - << value.noSendMessageToRecipients.ref() << "\n"; - } - else { - out << " noSendMessageToRecipients is not set\n"; - } - - if (value.noUpdateNotebook.isSet()) { - out << " noUpdateNotebook = " - << value.noUpdateNotebook.ref() << "\n"; - } - else { - out << " noUpdateNotebook is not set\n"; - } - - if (value.noExpungeNotebook.isSet()) { - out << " noExpungeNotebook = " - << value.noExpungeNotebook.ref() << "\n"; - } - else { - out << " noExpungeNotebook is not set\n"; - } - - if (value.noSetDefaultNotebook.isSet()) { - out << " noSetDefaultNotebook = " - << value.noSetDefaultNotebook.ref() << "\n"; - } - else { - out << " noSetDefaultNotebook is not set\n"; - } - - if (value.noSetNotebookStack.isSet()) { - out << " noSetNotebookStack = " - << value.noSetNotebookStack.ref() << "\n"; - } - else { - out << " noSetNotebookStack is not set\n"; - } - - if (value.noPublishToPublic.isSet()) { - out << " noPublishToPublic = " - << value.noPublishToPublic.ref() << "\n"; - } - else { - out << " noPublishToPublic is not set\n"; - } - - if (value.noPublishToBusinessLibrary.isSet()) { - out << " noPublishToBusinessLibrary = " - << value.noPublishToBusinessLibrary.ref() << "\n"; - } - else { - out << " noPublishToBusinessLibrary is not set\n"; - } - - if (value.noCreateTags.isSet()) { - out << " noCreateTags = " - << value.noCreateTags.ref() << "\n"; - } - else { - out << " noCreateTags is not set\n"; - } - - if (value.noUpdateTags.isSet()) { - out << " noUpdateTags = " - << value.noUpdateTags.ref() << "\n"; - } - else { - out << " noUpdateTags is not set\n"; - } - - if (value.noExpungeTags.isSet()) { - out << " noExpungeTags = " - << value.noExpungeTags.ref() << "\n"; - } - else { - out << " noExpungeTags is not set\n"; - } - - if (value.noSetParentTag.isSet()) { - out << " noSetParentTag = " - << value.noSetParentTag.ref() << "\n"; - } - else { - out << " noSetParentTag is not set\n"; - } - - if (value.noCreateSharedNotebooks.isSet()) { - out << " noCreateSharedNotebooks = " - << value.noCreateSharedNotebooks.ref() << "\n"; - } - else { - out << " noCreateSharedNotebooks is not set\n"; - } - - if (value.updateWhichSharedNotebookRestrictions.isSet()) { - out << " updateWhichSharedNotebookRestrictions = " - << value.updateWhichSharedNotebookRestrictions.ref() << "\n"; - } - else { - out << " updateWhichSharedNotebookRestrictions is not set\n"; - } - - if (value.expungeWhichSharedNotebookRestrictions.isSet()) { - out << " expungeWhichSharedNotebookRestrictions = " - << value.expungeWhichSharedNotebookRestrictions.ref() << "\n"; - } - else { - out << " expungeWhichSharedNotebookRestrictions is not set\n"; - } - - if (value.noShareNotesWithBusiness.isSet()) { - out << " noShareNotesWithBusiness = " - << value.noShareNotesWithBusiness.ref() << "\n"; - } - else { - out << " noShareNotesWithBusiness is not set\n"; - } - - if (value.noRenameNotebook.isSet()) { - out << " noRenameNotebook = " - << value.noRenameNotebook.ref() << "\n"; - } - else { - out << " noRenameNotebook is not set\n"; - } - - if (value.noSetInMyList.isSet()) { - out << " noSetInMyList = " - << value.noSetInMyList.ref() << "\n"; - } - else { - out << " noSetInMyList is not set\n"; - } - - if (value.noChangeContact.isSet()) { - out << " noChangeContact = " - << value.noChangeContact.ref() << "\n"; - } - else { - out << " noChangeContact is not set\n"; - } - - if (value.canMoveToContainerRestrictions.isSet()) { - out << " canMoveToContainerRestrictions = " - << value.canMoveToContainerRestrictions.ref() << "\n"; - } - else { - out << " canMoveToContainerRestrictions is not set\n"; - } - - if (value.noSetReminderNotifyEmail.isSet()) { - out << " noSetReminderNotifyEmail = " - << value.noSetReminderNotifyEmail.ref() << "\n"; - } - else { - out << " noSetReminderNotifyEmail is not set\n"; - } - - if (value.noSetReminderNotifyInApp.isSet()) { - out << " noSetReminderNotifyInApp = " - << value.noSetReminderNotifyInApp.ref() << "\n"; - } - else { - out << " noSetReminderNotifyInApp is not set\n"; - } - - if (value.noSetRecipientSettingsStack.isSet()) { - out << " noSetRecipientSettingsStack = " - << value.noSetRecipientSettingsStack.ref() << "\n"; - } - else { - out << " noSetRecipientSettingsStack is not set\n"; - } - - if (value.noCanMoveNote.isSet()) { - out << " noCanMoveNote = " - << value.noCanMoveNote.ref() << "\n"; - } - else { - out << " noCanMoveNote is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeStructBegin(QStringLiteral("Notebook")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -19682,7 +15659,10 @@ void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s) { w.writeStructEnd(); } -void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { +void readNotebook( + ThriftBinaryBufferReader & r, + Notebook & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -19779,7 +15759,11 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_I64) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Notebook.sharedNotebookIds)")); + if (elemType != ThriftFieldType::T_I64) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Notebook.sharedNotebookIds)")); + } for(qint32 i = 0; i < size; i++) { qint64 elem; r.readI64(elem); @@ -19798,7 +15782,11 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (Notebook.sharedNotebooks)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (Notebook.sharedNotebooks)")); + } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; readSharedNotebook(r, elem); @@ -19854,283 +15842,147 @@ void readNotebook(ThriftBinaryBufferReader & r, Notebook & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const Notebook & value) +void Notebook::print(QTextStream & strm) const { - out << "Notebook: {\n"; + strm << "Notebook: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.defaultNotebook.isSet()) { - out << " defaultNotebook = " - << value.defaultNotebook.ref() << "\n"; + if (defaultNotebook.isSet()) { + strm << " defaultNotebook = " + << defaultNotebook.ref() << "\n"; } else { - out << " defaultNotebook is not set\n"; + strm << " defaultNotebook is not set\n"; } - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; + if (serviceCreated.isSet()) { + strm << " serviceCreated = " + << serviceCreated.ref() << "\n"; } else { - out << " serviceCreated is not set\n"; + strm << " serviceCreated is not set\n"; } - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; + if (serviceUpdated.isSet()) { + strm << " serviceUpdated = " + << serviceUpdated.ref() << "\n"; } else { - out << " serviceUpdated is not set\n"; + strm << " serviceUpdated is not set\n"; } - if (value.publishing.isSet()) { - out << " publishing = " - << value.publishing.ref() << "\n"; + if (publishing.isSet()) { + strm << " publishing = " + << publishing.ref() << "\n"; } else { - out << " publishing is not set\n"; + strm << " publishing is not set\n"; } - if (value.published.isSet()) { - out << " published = " - << value.published.ref() << "\n"; + if (published.isSet()) { + strm << " published = " + << published.ref() << "\n"; } else { - out << " published is not set\n"; + strm << " published is not set\n"; } - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; + if (stack.isSet()) { + strm << " stack = " + << stack.ref() << "\n"; } else { - out << " stack is not set\n"; + strm << " stack is not set\n"; } - if (value.sharedNotebookIds.isSet()) { - out << " sharedNotebookIds = " + if (sharedNotebookIds.isSet()) { + strm << " sharedNotebookIds = " << "QList {"; - for(const auto & v: value.sharedNotebookIds.ref()) { - out << v; + for(const auto & v: sharedNotebookIds.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " sharedNotebookIds is not set\n"; + strm << " sharedNotebookIds is not set\n"; } - if (value.sharedNotebooks.isSet()) { - out << " sharedNotebooks = " + if (sharedNotebooks.isSet()) { + strm << " sharedNotebooks = " << "QList {"; - for(const auto & v: value.sharedNotebooks.ref()) { - out << v; + for(const auto & v: sharedNotebooks.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " sharedNotebooks is not set\n"; + strm << " sharedNotebooks is not set\n"; } - if (value.businessNotebook.isSet()) { - out << " businessNotebook = " - << value.businessNotebook.ref() << "\n"; + if (businessNotebook.isSet()) { + strm << " businessNotebook = " + << businessNotebook.ref() << "\n"; } else { - out << " businessNotebook is not set\n"; + strm << " businessNotebook is not set\n"; } - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; + if (contact.isSet()) { + strm << " contact = " + << contact.ref() << "\n"; } else { - out << " contact is not set\n"; + strm << " contact is not set\n"; } - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; + if (restrictions.isSet()) { + strm << " restrictions = " + << restrictions.ref() << "\n"; } else { - out << " restrictions is not set\n"; + strm << " restrictions is not set\n"; } - if (value.recipientSettings.isSet()) { - out << " recipientSettings = " - << value.recipientSettings.ref() << "\n"; + if (recipientSettings.isSet()) { + strm << " recipientSettings = " + << recipientSettings.ref() << "\n"; } else { - out << " recipientSettings is not set\n"; + strm << " recipientSettings is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const Notebook & value) +void writeLinkedNotebook( + ThriftBinaryBufferWriter & w, + const LinkedNotebook & s) { - out << "Notebook: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.defaultNotebook.isSet()) { - out << " defaultNotebook = " - << value.defaultNotebook.ref() << "\n"; - } - else { - out << " defaultNotebook is not set\n"; - } - - if (value.serviceCreated.isSet()) { - out << " serviceCreated = " - << value.serviceCreated.ref() << "\n"; - } - else { - out << " serviceCreated is not set\n"; - } - - if (value.serviceUpdated.isSet()) { - out << " serviceUpdated = " - << value.serviceUpdated.ref() << "\n"; - } - else { - out << " serviceUpdated is not set\n"; - } - - if (value.publishing.isSet()) { - out << " publishing = " - << value.publishing.ref() << "\n"; - } - else { - out << " publishing is not set\n"; - } - - if (value.published.isSet()) { - out << " published = " - << value.published.ref() << "\n"; - } - else { - out << " published is not set\n"; - } - - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; - } - else { - out << " stack is not set\n"; - } - - if (value.sharedNotebookIds.isSet()) { - out << " sharedNotebookIds = " - << "QList {"; - for(const auto & v: value.sharedNotebookIds.ref()) { - out << v; - } - } - else { - out << " sharedNotebookIds is not set\n"; - } - - if (value.sharedNotebooks.isSet()) { - out << " sharedNotebooks = " - << "QList {"; - for(const auto & v: value.sharedNotebooks.ref()) { - out << v; - } - } - else { - out << " sharedNotebooks is not set\n"; - } - - if (value.businessNotebook.isSet()) { - out << " businessNotebook = " - << value.businessNotebook.ref() << "\n"; - } - else { - out << " businessNotebook is not set\n"; - } - - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; - } - else { - out << " contact is not set\n"; - } - - if (value.restrictions.isSet()) { - out << " restrictions = " - << value.restrictions.ref() << "\n"; - } - else { - out << " restrictions is not set\n"; - } - - if (value.recipientSettings.isSet()) { - out << " recipientSettings = " - << value.recipientSettings.ref() << "\n"; - } - else { - out << " recipientSettings is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s) { w.writeStructBegin(QStringLiteral("LinkedNotebook")); if (s.shareName.isSet()) { w.writeFieldBegin( @@ -20224,7 +16076,10 @@ void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s) w.writeStructEnd(); } -void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s) { +void readLinkedNotebook( + ThriftBinaryBufferReader & r, + LinkedNotebook & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -20309,238 +16164,138 @@ void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s) { if (fieldType == ThriftFieldType::T_STRING) { QString v; r.readString(v); - s.webApiUrlPrefix = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 11) { - if (fieldType == ThriftFieldType::T_STRING) { - QString v; - r.readString(v); - s.stack = v; - } else { - r.skip(fieldType); - } - } else - if (fieldId == 12) { - if (fieldType == ThriftFieldType::T_I32) { - qint32 v; - r.readI32(v); - s.businessId = v; - } else { - r.skip(fieldType); - } - } else - { - r.skip(fieldType); - } - r.readFieldEnd(); - } - r.readStructEnd(); -} - -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const LinkedNotebook & value) -{ - out << "LinkedNotebook: {\n"; - - if (value.shareName.isSet()) { - out << " shareName = " - << value.shareName.ref() << "\n"; - } - else { - out << " shareName is not set\n"; - } - - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; - } - else { - out << " username is not set\n"; - } - - if (value.shardId.isSet()) { - out << " shardId = " - << value.shardId.ref() << "\n"; - } - else { - out << " shardId is not set\n"; - } - - if (value.sharedNotebookGlobalId.isSet()) { - out << " sharedNotebookGlobalId = " - << value.sharedNotebookGlobalId.ref() << "\n"; - } - else { - out << " sharedNotebookGlobalId is not set\n"; - } - - if (value.uri.isSet()) { - out << " uri = " - << value.uri.ref() << "\n"; - } - else { - out << " uri is not set\n"; - } - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; - } - else { - out << " updateSequenceNum is not set\n"; - } - - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; - } - else { - out << " noteStoreUrl is not set\n"; - } - - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; - } - else { - out << " webApiUrlPrefix is not set\n"; - } - - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; - } - else { - out << " stack is not set\n"; - } - - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; - } - else { - out << " businessId is not set\n"; + s.webApiUrlPrefix = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 11) { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + r.readString(v); + s.stack = v; + } else { + r.skip(fieldType); + } + } else + if (fieldId == 12) { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + r.readI32(v); + s.businessId = v; + } else { + r.skip(fieldType); + } + } else + { + r.skip(fieldType); + } + r.readFieldEnd(); } - - out << "}\n"; - return out; + r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const LinkedNotebook & value) +void LinkedNotebook::print(QTextStream & strm) const { - out << "LinkedNotebook: {\n"; + strm << "LinkedNotebook: {\n"; - if (value.shareName.isSet()) { - out << " shareName = " - << value.shareName.ref() << "\n"; + if (shareName.isSet()) { + strm << " shareName = " + << shareName.ref() << "\n"; } else { - out << " shareName is not set\n"; + strm << " shareName is not set\n"; } - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (username.isSet()) { + strm << " username = " + << username.ref() << "\n"; } else { - out << " username is not set\n"; + strm << " username is not set\n"; } - if (value.shardId.isSet()) { - out << " shardId = " - << value.shardId.ref() << "\n"; + if (shardId.isSet()) { + strm << " shardId = " + << shardId.ref() << "\n"; } else { - out << " shardId is not set\n"; + strm << " shardId is not set\n"; } - if (value.sharedNotebookGlobalId.isSet()) { - out << " sharedNotebookGlobalId = " - << value.sharedNotebookGlobalId.ref() << "\n"; + if (sharedNotebookGlobalId.isSet()) { + strm << " sharedNotebookGlobalId = " + << sharedNotebookGlobalId.ref() << "\n"; } else { - out << " sharedNotebookGlobalId is not set\n"; + strm << " sharedNotebookGlobalId is not set\n"; } - if (value.uri.isSet()) { - out << " uri = " - << value.uri.ref() << "\n"; + if (uri.isSet()) { + strm << " uri = " + << uri.ref() << "\n"; } else { - out << " uri is not set\n"; + strm << " uri is not set\n"; } - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.updateSequenceNum.isSet()) { - out << " updateSequenceNum = " - << value.updateSequenceNum.ref() << "\n"; + if (updateSequenceNum.isSet()) { + strm << " updateSequenceNum = " + << updateSequenceNum.ref() << "\n"; } else { - out << " updateSequenceNum is not set\n"; + strm << " updateSequenceNum is not set\n"; } - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; + if (noteStoreUrl.isSet()) { + strm << " noteStoreUrl = " + << noteStoreUrl.ref() << "\n"; } else { - out << " noteStoreUrl is not set\n"; + strm << " noteStoreUrl is not set\n"; } - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; + if (webApiUrlPrefix.isSet()) { + strm << " webApiUrlPrefix = " + << webApiUrlPrefix.ref() << "\n"; } else { - out << " webApiUrlPrefix is not set\n"; + strm << " webApiUrlPrefix is not set\n"; } - if (value.stack.isSet()) { - out << " stack = " - << value.stack.ref() << "\n"; + if (stack.isSet()) { + strm << " stack = " + << stack.ref() << "\n"; } else { - out << " stack is not set\n"; + strm << " stack is not set\n"; } - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; + if (businessId.isSet()) { + strm << " businessId = " + << businessId.ref() << "\n"; } else { - out << " businessId is not set\n"; + strm << " businessId is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescriptor & s) { +void writeNotebookDescriptor( + ThriftBinaryBufferWriter & w, + const NotebookDescriptor & s) +{ w.writeStructBegin(QStringLiteral("NotebookDescriptor")); if (s.guid.isSet()) { w.writeFieldBegin( @@ -20586,7 +16341,10 @@ void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescrip w.writeStructEnd(); } -void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s) { +void readNotebookDescriptor( + ThriftBinaryBufferReader & r, + NotebookDescriptor & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -20648,111 +16406,59 @@ void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const NotebookDescriptor & value) +void NotebookDescriptor::print(QTextStream & strm) const { - out << "NotebookDescriptor: {\n"; + strm << "NotebookDescriptor: {\n"; - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; + if (guid.isSet()) { + strm << " guid = " + << guid.ref() << "\n"; } else { - out << " guid is not set\n"; + strm << " guid is not set\n"; } - if (value.notebookDisplayName.isSet()) { - out << " notebookDisplayName = " - << value.notebookDisplayName.ref() << "\n"; + if (notebookDisplayName.isSet()) { + strm << " notebookDisplayName = " + << notebookDisplayName.ref() << "\n"; } else { - out << " notebookDisplayName is not set\n"; + strm << " notebookDisplayName is not set\n"; } - if (value.contactName.isSet()) { - out << " contactName = " - << value.contactName.ref() << "\n"; + if (contactName.isSet()) { + strm << " contactName = " + << contactName.ref() << "\n"; } else { - out << " contactName is not set\n"; + strm << " contactName is not set\n"; } - if (value.hasSharedNotebook.isSet()) { - out << " hasSharedNotebook = " - << value.hasSharedNotebook.ref() << "\n"; + if (hasSharedNotebook.isSet()) { + strm << " hasSharedNotebook = " + << hasSharedNotebook.ref() << "\n"; } else { - out << " hasSharedNotebook is not set\n"; + strm << " hasSharedNotebook is not set\n"; } - if (value.joinedUserCount.isSet()) { - out << " joinedUserCount = " - << value.joinedUserCount.ref() << "\n"; + if (joinedUserCount.isSet()) { + strm << " joinedUserCount = " + << joinedUserCount.ref() << "\n"; } else { - out << " joinedUserCount is not set\n"; + strm << " joinedUserCount is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const NotebookDescriptor & value) +void writeUserProfile( + ThriftBinaryBufferWriter & w, + const UserProfile & s) { - out << "NotebookDescriptor: {\n"; - - if (value.guid.isSet()) { - out << " guid = " - << value.guid.ref() << "\n"; - } - else { - out << " guid is not set\n"; - } - - if (value.notebookDisplayName.isSet()) { - out << " notebookDisplayName = " - << value.notebookDisplayName.ref() << "\n"; - } - else { - out << " notebookDisplayName is not set\n"; - } - - if (value.contactName.isSet()) { - out << " contactName = " - << value.contactName.ref() << "\n"; - } - else { - out << " contactName is not set\n"; - } - - if (value.hasSharedNotebook.isSet()) { - out << " hasSharedNotebook = " - << value.hasSharedNotebook.ref() << "\n"; - } - else { - out << " hasSharedNotebook is not set\n"; - } - - if (value.joinedUserCount.isSet()) { - out << " joinedUserCount = " - << value.joinedUserCount.ref() << "\n"; - } - else { - out << " joinedUserCount is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s) { w.writeStructBegin(QStringLiteral("UserProfile")); if (s.id.isSet()) { w.writeFieldBegin( @@ -20838,7 +16544,10 @@ void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s) { w.writeStructEnd(); } -void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { +void readUserProfile( + ThriftBinaryBufferReader & r, + UserProfile & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -20945,191 +16654,99 @@ void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const UserProfile & value) +void UserProfile::print(QTextStream & strm) const { - out << "UserProfile: {\n"; + strm << "UserProfile: {\n"; - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; + if (id.isSet()) { + strm << " id = " + << id.ref() << "\n"; } else { - out << " id is not set\n"; + strm << " id is not set\n"; } - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; + if (name.isSet()) { + strm << " name = " + << name.ref() << "\n"; } else { - out << " name is not set\n"; + strm << " name is not set\n"; } - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; + if (email.isSet()) { + strm << " email = " + << email.ref() << "\n"; } else { - out << " email is not set\n"; + strm << " email is not set\n"; } - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (username.isSet()) { + strm << " username = " + << username.ref() << "\n"; } else { - out << " username is not set\n"; + strm << " username is not set\n"; } - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; + if (attributes.isSet()) { + strm << " attributes = " + << attributes.ref() << "\n"; } else { - out << " attributes is not set\n"; + strm << " attributes is not set\n"; } - if (value.joined.isSet()) { - out << " joined = " - << value.joined.ref() << "\n"; + if (joined.isSet()) { + strm << " joined = " + << joined.ref() << "\n"; } else { - out << " joined is not set\n"; + strm << " joined is not set\n"; } - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; + if (photoLastUpdated.isSet()) { + strm << " photoLastUpdated = " + << photoLastUpdated.ref() << "\n"; } else { - out << " photoLastUpdated is not set\n"; + strm << " photoLastUpdated is not set\n"; } - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; + if (photoUrl.isSet()) { + strm << " photoUrl = " + << photoUrl.ref() << "\n"; } else { - out << " photoUrl is not set\n"; + strm << " photoUrl is not set\n"; } - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; + if (role.isSet()) { + strm << " role = " + << role.ref() << "\n"; } else { - out << " role is not set\n"; + strm << " role is not set\n"; } - if (value.status.isSet()) { - out << " status = " - << value.status.ref() << "\n"; + if (status.isSet()) { + strm << " status = " + << status.ref() << "\n"; } else { - out << " status is not set\n"; + strm << " status is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const UserProfile & value) +void writeRelatedContentImage( + ThriftBinaryBufferWriter & w, + const RelatedContentImage & s) { - out << "UserProfile: {\n"; - - if (value.id.isSet()) { - out << " id = " - << value.id.ref() << "\n"; - } - else { - out << " id is not set\n"; - } - - if (value.name.isSet()) { - out << " name = " - << value.name.ref() << "\n"; - } - else { - out << " name is not set\n"; - } - - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; - } - else { - out << " email is not set\n"; - } - - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; - } - else { - out << " username is not set\n"; - } - - if (value.attributes.isSet()) { - out << " attributes = " - << value.attributes.ref() << "\n"; - } - else { - out << " attributes is not set\n"; - } - - if (value.joined.isSet()) { - out << " joined = " - << value.joined.ref() << "\n"; - } - else { - out << " joined is not set\n"; - } - - if (value.photoLastUpdated.isSet()) { - out << " photoLastUpdated = " - << value.photoLastUpdated.ref() << "\n"; - } - else { - out << " photoLastUpdated is not set\n"; - } - - if (value.photoUrl.isSet()) { - out << " photoUrl = " - << value.photoUrl.ref() << "\n"; - } - else { - out << " photoUrl is not set\n"; - } - - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; - } - else { - out << " role is not set\n"; - } - - if (value.status.isSet()) { - out << " status = " - << value.status.ref() << "\n"; - } - else { - out << " status is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContentImage & s) { w.writeStructBegin(QStringLiteral("RelatedContentImage")); if (s.url.isSet()) { w.writeFieldBegin( @@ -21175,7 +16792,10 @@ void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContent w.writeStructEnd(); } -void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & s) { +void readRelatedContentImage( + ThriftBinaryBufferReader & r, + RelatedContentImage & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -21237,111 +16857,59 @@ void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const RelatedContentImage & value) +void RelatedContentImage::print(QTextStream & strm) const { - out << "RelatedContentImage: {\n"; + strm << "RelatedContentImage: {\n"; - if (value.url.isSet()) { - out << " url = " - << value.url.ref() << "\n"; + if (url.isSet()) { + strm << " url = " + << url.ref() << "\n"; } else { - out << " url is not set\n"; + strm << " url is not set\n"; } - if (value.width.isSet()) { - out << " width = " - << value.width.ref() << "\n"; + if (width.isSet()) { + strm << " width = " + << width.ref() << "\n"; } else { - out << " width is not set\n"; + strm << " width is not set\n"; } - if (value.height.isSet()) { - out << " height = " - << value.height.ref() << "\n"; + if (height.isSet()) { + strm << " height = " + << height.ref() << "\n"; } else { - out << " height is not set\n"; + strm << " height is not set\n"; } - if (value.pixelRatio.isSet()) { - out << " pixelRatio = " - << value.pixelRatio.ref() << "\n"; + if (pixelRatio.isSet()) { + strm << " pixelRatio = " + << pixelRatio.ref() << "\n"; } else { - out << " pixelRatio is not set\n"; + strm << " pixelRatio is not set\n"; } - if (value.fileSize.isSet()) { - out << " fileSize = " - << value.fileSize.ref() << "\n"; + if (fileSize.isSet()) { + strm << " fileSize = " + << fileSize.ref() << "\n"; } else { - out << " fileSize is not set\n"; + strm << " fileSize is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const RelatedContentImage & value) +void writeRelatedContent( + ThriftBinaryBufferWriter & w, + const RelatedContent & s) { - out << "RelatedContentImage: {\n"; - - if (value.url.isSet()) { - out << " url = " - << value.url.ref() << "\n"; - } - else { - out << " url is not set\n"; - } - - if (value.width.isSet()) { - out << " width = " - << value.width.ref() << "\n"; - } - else { - out << " width is not set\n"; - } - - if (value.height.isSet()) { - out << " height = " - << value.height.ref() << "\n"; - } - else { - out << " height is not set\n"; - } - - if (value.pixelRatio.isSet()) { - out << " pixelRatio = " - << value.pixelRatio.ref() << "\n"; - } - else { - out << " pixelRatio is not set\n"; - } - - if (value.fileSize.isSet()) { - out << " fileSize = " - << value.fileSize.ref() << "\n"; - } - else { - out << " fileSize is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) { w.writeStructBegin(QStringLiteral("RelatedContent")); if (s.contentId.isSet()) { w.writeFieldBegin( @@ -21483,7 +17051,10 @@ void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s) w.writeStructEnd(); } -void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { +void readRelatedContent( + ThriftBinaryBufferReader & r, + RelatedContent & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -21580,7 +17151,11 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedContent.thumbnails)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedContent.thumbnails)")); + } for(qint32 i = 0; i < size; i++) { RelatedContentImage elem; readRelatedContentImage(r, elem); @@ -21644,7 +17219,11 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (RelatedContent.authors)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (RelatedContent.authors)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -21664,299 +17243,155 @@ void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const RelatedContent & value) +void RelatedContent::print(QTextStream & strm) const { - out << "RelatedContent: {\n"; + strm << "RelatedContent: {\n"; - if (value.contentId.isSet()) { - out << " contentId = " - << value.contentId.ref() << "\n"; + if (contentId.isSet()) { + strm << " contentId = " + << contentId.ref() << "\n"; } else { - out << " contentId is not set\n"; + strm << " contentId is not set\n"; } - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; + if (title.isSet()) { + strm << " title = " + << title.ref() << "\n"; } else { - out << " title is not set\n"; + strm << " title is not set\n"; } - if (value.url.isSet()) { - out << " url = " - << value.url.ref() << "\n"; + if (url.isSet()) { + strm << " url = " + << url.ref() << "\n"; } else { - out << " url is not set\n"; + strm << " url is not set\n"; } - if (value.sourceId.isSet()) { - out << " sourceId = " - << value.sourceId.ref() << "\n"; + if (sourceId.isSet()) { + strm << " sourceId = " + << sourceId.ref() << "\n"; } else { - out << " sourceId is not set\n"; + strm << " sourceId is not set\n"; } - if (value.sourceUrl.isSet()) { - out << " sourceUrl = " - << value.sourceUrl.ref() << "\n"; + if (sourceUrl.isSet()) { + strm << " sourceUrl = " + << sourceUrl.ref() << "\n"; } else { - out << " sourceUrl is not set\n"; + strm << " sourceUrl is not set\n"; } - if (value.sourceFaviconUrl.isSet()) { - out << " sourceFaviconUrl = " - << value.sourceFaviconUrl.ref() << "\n"; + if (sourceFaviconUrl.isSet()) { + strm << " sourceFaviconUrl = " + << sourceFaviconUrl.ref() << "\n"; } else { - out << " sourceFaviconUrl is not set\n"; + strm << " sourceFaviconUrl is not set\n"; } - if (value.sourceName.isSet()) { - out << " sourceName = " - << value.sourceName.ref() << "\n"; + if (sourceName.isSet()) { + strm << " sourceName = " + << sourceName.ref() << "\n"; } else { - out << " sourceName is not set\n"; + strm << " sourceName is not set\n"; } - if (value.date.isSet()) { - out << " date = " - << value.date.ref() << "\n"; + if (date.isSet()) { + strm << " date = " + << date.ref() << "\n"; } else { - out << " date is not set\n"; + strm << " date is not set\n"; } - if (value.teaser.isSet()) { - out << " teaser = " - << value.teaser.ref() << "\n"; + if (teaser.isSet()) { + strm << " teaser = " + << teaser.ref() << "\n"; } else { - out << " teaser is not set\n"; + strm << " teaser is not set\n"; } - if (value.thumbnails.isSet()) { - out << " thumbnails = " + if (thumbnails.isSet()) { + strm << " thumbnails = " << "QList {"; - for(const auto & v: value.thumbnails.ref()) { - out << v; + for(const auto & v: thumbnails.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " thumbnails is not set\n"; + strm << " thumbnails is not set\n"; } - if (value.contentType.isSet()) { - out << " contentType = " - << value.contentType.ref() << "\n"; + if (contentType.isSet()) { + strm << " contentType = " + << contentType.ref() << "\n"; } else { - out << " contentType is not set\n"; + strm << " contentType is not set\n"; } - if (value.accessType.isSet()) { - out << " accessType = " - << value.accessType.ref() << "\n"; + if (accessType.isSet()) { + strm << " accessType = " + << accessType.ref() << "\n"; } else { - out << " accessType is not set\n"; + strm << " accessType is not set\n"; } - if (value.visibleUrl.isSet()) { - out << " visibleUrl = " - << value.visibleUrl.ref() << "\n"; + if (visibleUrl.isSet()) { + strm << " visibleUrl = " + << visibleUrl.ref() << "\n"; } else { - out << " visibleUrl is not set\n"; + strm << " visibleUrl is not set\n"; } - if (value.clipUrl.isSet()) { - out << " clipUrl = " - << value.clipUrl.ref() << "\n"; + if (clipUrl.isSet()) { + strm << " clipUrl = " + << clipUrl.ref() << "\n"; } else { - out << " clipUrl is not set\n"; + strm << " clipUrl is not set\n"; } - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; + if (contact.isSet()) { + strm << " contact = " + << contact.ref() << "\n"; } else { - out << " contact is not set\n"; + strm << " contact is not set\n"; } - if (value.authors.isSet()) { - out << " authors = " + if (authors.isSet()) { + strm << " authors = " << "QList {"; - for(const auto & v: value.authors.ref()) { - out << v; + for(const auto & v: authors.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " authors is not set\n"; + strm << " authors is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const RelatedContent & value) +void writeBusinessInvitation( + ThriftBinaryBufferWriter & w, + const BusinessInvitation & s) { - out << "RelatedContent: {\n"; - - if (value.contentId.isSet()) { - out << " contentId = " - << value.contentId.ref() << "\n"; - } - else { - out << " contentId is not set\n"; - } - - if (value.title.isSet()) { - out << " title = " - << value.title.ref() << "\n"; - } - else { - out << " title is not set\n"; - } - - if (value.url.isSet()) { - out << " url = " - << value.url.ref() << "\n"; - } - else { - out << " url is not set\n"; - } - - if (value.sourceId.isSet()) { - out << " sourceId = " - << value.sourceId.ref() << "\n"; - } - else { - out << " sourceId is not set\n"; - } - - if (value.sourceUrl.isSet()) { - out << " sourceUrl = " - << value.sourceUrl.ref() << "\n"; - } - else { - out << " sourceUrl is not set\n"; - } - - if (value.sourceFaviconUrl.isSet()) { - out << " sourceFaviconUrl = " - << value.sourceFaviconUrl.ref() << "\n"; - } - else { - out << " sourceFaviconUrl is not set\n"; - } - - if (value.sourceName.isSet()) { - out << " sourceName = " - << value.sourceName.ref() << "\n"; - } - else { - out << " sourceName is not set\n"; - } - - if (value.date.isSet()) { - out << " date = " - << value.date.ref() << "\n"; - } - else { - out << " date is not set\n"; - } - - if (value.teaser.isSet()) { - out << " teaser = " - << value.teaser.ref() << "\n"; - } - else { - out << " teaser is not set\n"; - } - - if (value.thumbnails.isSet()) { - out << " thumbnails = " - << "QList {"; - for(const auto & v: value.thumbnails.ref()) { - out << v; - } - } - else { - out << " thumbnails is not set\n"; - } - - if (value.contentType.isSet()) { - out << " contentType = " - << value.contentType.ref() << "\n"; - } - else { - out << " contentType is not set\n"; - } - - if (value.accessType.isSet()) { - out << " accessType = " - << value.accessType.ref() << "\n"; - } - else { - out << " accessType is not set\n"; - } - - if (value.visibleUrl.isSet()) { - out << " visibleUrl = " - << value.visibleUrl.ref() << "\n"; - } - else { - out << " visibleUrl is not set\n"; - } - - if (value.clipUrl.isSet()) { - out << " clipUrl = " - << value.clipUrl.ref() << "\n"; - } - else { - out << " clipUrl is not set\n"; - } - - if (value.contact.isSet()) { - out << " contact = " - << value.contact.ref() << "\n"; - } - else { - out << " contact is not set\n"; - } - - if (value.authors.isSet()) { - out << " authors = " - << "QList {"; - for(const auto & v: value.authors.ref()) { - out << v; - } - } - else { - out << " authors is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitation & s) { w.writeStructBegin(QStringLiteral("BusinessInvitation")); if (s.businessId.isSet()) { w.writeFieldBegin( @@ -22026,7 +17461,10 @@ void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitat w.writeStructEnd(); } -void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s) { +void readBusinessInvitation( + ThriftBinaryBufferReader & r, + BusinessInvitation & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -22108,166 +17546,90 @@ void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s } } else { - r.skip(fieldType); - } - r.readFieldEnd(); - } - r.readStructEnd(); -} - -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BusinessInvitation & value) -{ - out << "BusinessInvitation: {\n"; - - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; - } - else { - out << " businessId is not set\n"; - } - - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; - } - else { - out << " email is not set\n"; - } - - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; - } - else { - out << " role is not set\n"; - } - - if (value.status.isSet()) { - out << " status = " - << value.status.ref() << "\n"; - } - else { - out << " status is not set\n"; - } - - if (value.requesterId.isSet()) { - out << " requesterId = " - << value.requesterId.ref() << "\n"; - } - else { - out << " requesterId is not set\n"; - } - - if (value.fromWorkChat.isSet()) { - out << " fromWorkChat = " - << value.fromWorkChat.ref() << "\n"; - } - else { - out << " fromWorkChat is not set\n"; - } - - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; - } - else { - out << " created is not set\n"; - } - - if (value.mostRecentReminder.isSet()) { - out << " mostRecentReminder = " - << value.mostRecentReminder.ref() << "\n"; - } - else { - out << " mostRecentReminder is not set\n"; + r.skip(fieldType); + } + r.readFieldEnd(); } - - out << "}\n"; - return out; + r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const BusinessInvitation & value) +void BusinessInvitation::print(QTextStream & strm) const { - out << "BusinessInvitation: {\n"; + strm << "BusinessInvitation: {\n"; - if (value.businessId.isSet()) { - out << " businessId = " - << value.businessId.ref() << "\n"; + if (businessId.isSet()) { + strm << " businessId = " + << businessId.ref() << "\n"; } else { - out << " businessId is not set\n"; + strm << " businessId is not set\n"; } - if (value.email.isSet()) { - out << " email = " - << value.email.ref() << "\n"; + if (email.isSet()) { + strm << " email = " + << email.ref() << "\n"; } else { - out << " email is not set\n"; + strm << " email is not set\n"; } - if (value.role.isSet()) { - out << " role = " - << value.role.ref() << "\n"; + if (role.isSet()) { + strm << " role = " + << role.ref() << "\n"; } else { - out << " role is not set\n"; + strm << " role is not set\n"; } - if (value.status.isSet()) { - out << " status = " - << value.status.ref() << "\n"; + if (status.isSet()) { + strm << " status = " + << status.ref() << "\n"; } else { - out << " status is not set\n"; + strm << " status is not set\n"; } - if (value.requesterId.isSet()) { - out << " requesterId = " - << value.requesterId.ref() << "\n"; + if (requesterId.isSet()) { + strm << " requesterId = " + << requesterId.ref() << "\n"; } else { - out << " requesterId is not set\n"; + strm << " requesterId is not set\n"; } - if (value.fromWorkChat.isSet()) { - out << " fromWorkChat = " - << value.fromWorkChat.ref() << "\n"; + if (fromWorkChat.isSet()) { + strm << " fromWorkChat = " + << fromWorkChat.ref() << "\n"; } else { - out << " fromWorkChat is not set\n"; + strm << " fromWorkChat is not set\n"; } - if (value.created.isSet()) { - out << " created = " - << value.created.ref() << "\n"; + if (created.isSet()) { + strm << " created = " + << created.ref() << "\n"; } else { - out << " created is not set\n"; + strm << " created is not set\n"; } - if (value.mostRecentReminder.isSet()) { - out << " mostRecentReminder = " - << value.mostRecentReminder.ref() << "\n"; + if (mostRecentReminder.isSet()) { + strm << " mostRecentReminder = " + << mostRecentReminder.ref() << "\n"; } else { - out << " mostRecentReminder is not set\n"; + strm << " mostRecentReminder is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s) { +void writeUserIdentity( + ThriftBinaryBufferWriter & w, + const UserIdentity & s) +{ w.writeStructBegin(QStringLiteral("UserIdentity")); if (s.type.isSet()) { w.writeFieldBegin( @@ -22297,7 +17659,10 @@ void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s) { w.writeStructEnd(); } -void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s) { +void readUserIdentity( + ThriftBinaryBufferReader & r, + UserIdentity & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -22341,79 +17706,43 @@ void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const UserIdentity & value) +void UserIdentity::print(QTextStream & strm) const { - out << "UserIdentity: {\n"; + strm << "UserIdentity: {\n"; - if (value.type.isSet()) { - out << " type = " - << value.type.ref() << "\n"; + if (type.isSet()) { + strm << " type = " + << type.ref() << "\n"; } else { - out << " type is not set\n"; + strm << " type is not set\n"; } - if (value.stringIdentifier.isSet()) { - out << " stringIdentifier = " - << value.stringIdentifier.ref() << "\n"; + if (stringIdentifier.isSet()) { + strm << " stringIdentifier = " + << stringIdentifier.ref() << "\n"; } else { - out << " stringIdentifier is not set\n"; + strm << " stringIdentifier is not set\n"; } - if (value.longIdentifier.isSet()) { - out << " longIdentifier = " - << value.longIdentifier.ref() << "\n"; + if (longIdentifier.isSet()) { + strm << " longIdentifier = " + << longIdentifier.ref() << "\n"; } else { - out << " longIdentifier is not set\n"; + strm << " longIdentifier is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const UserIdentity & value) +void writePublicUserInfo( + ThriftBinaryBufferWriter & w, + const PublicUserInfo & s) { - out << "UserIdentity: {\n"; - - if (value.type.isSet()) { - out << " type = " - << value.type.ref() << "\n"; - } - else { - out << " type is not set\n"; - } - - if (value.stringIdentifier.isSet()) { - out << " stringIdentifier = " - << value.stringIdentifier.ref() << "\n"; - } - else { - out << " stringIdentifier is not set\n"; - } - - if (value.longIdentifier.isSet()) { - out << " longIdentifier = " - << value.longIdentifier.ref() << "\n"; - } - else { - out << " longIdentifier is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s) { w.writeStructBegin(QStringLiteral("PublicUserInfo")); w.writeFieldBegin( QStringLiteral("userId"), @@ -22457,7 +17786,10 @@ void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s) w.writeStructEnd(); } -void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { +void readPublicUserInfo( + ThriftBinaryBufferReader & r, + PublicUserInfo & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -22519,102 +17851,56 @@ void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!userId_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("PublicUserInfo.userId has no value")); + if (!userId_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("PublicUserInfo.userId has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const PublicUserInfo & value) +void PublicUserInfo::print(QTextStream & strm) const { - out << "PublicUserInfo: {\n"; - out << " userId = " - << "UserID" << "\n"; + strm << "PublicUserInfo: {\n"; + strm << " userId = " + << userId << "\n"; - if (value.serviceLevel.isSet()) { - out << " serviceLevel = " - << value.serviceLevel.ref() << "\n"; + if (serviceLevel.isSet()) { + strm << " serviceLevel = " + << serviceLevel.ref() << "\n"; } else { - out << " serviceLevel is not set\n"; + strm << " serviceLevel is not set\n"; } - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; + if (username.isSet()) { + strm << " username = " + << username.ref() << "\n"; } else { - out << " username is not set\n"; + strm << " username is not set\n"; } - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; + if (noteStoreUrl.isSet()) { + strm << " noteStoreUrl = " + << noteStoreUrl.ref() << "\n"; } else { - out << " noteStoreUrl is not set\n"; + strm << " noteStoreUrl is not set\n"; } - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; + if (webApiUrlPrefix.isSet()) { + strm << " webApiUrlPrefix = " + << webApiUrlPrefix.ref() << "\n"; } else { - out << " webApiUrlPrefix is not set\n"; + strm << " webApiUrlPrefix is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const PublicUserInfo & value) +void writeUserUrls( + ThriftBinaryBufferWriter & w, + const UserUrls & s) { - out << "PublicUserInfo: {\n"; - out << " userId = " - << "UserID" << "\n"; - - if (value.serviceLevel.isSet()) { - out << " serviceLevel = " - << value.serviceLevel.ref() << "\n"; - } - else { - out << " serviceLevel is not set\n"; - } - - if (value.username.isSet()) { - out << " username = " - << value.username.ref() << "\n"; - } - else { - out << " username is not set\n"; - } - - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; - } - else { - out << " noteStoreUrl is not set\n"; - } - - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; - } - else { - out << " webApiUrlPrefix is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s) { w.writeStructBegin(QStringLiteral("UserUrls")); if (s.noteStoreUrl.isSet()) { w.writeFieldBegin( @@ -22668,7 +17954,10 @@ void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s) { w.writeStructEnd(); } -void readUserUrls(ThriftBinaryBufferReader & r, UserUrls & s) { +void readUserUrls( + ThriftBinaryBufferReader & r, + UserUrls & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -22739,127 +18028,67 @@ void readUserUrls(ThriftBinaryBufferReader & r, UserUrls & s) { r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const UserUrls & value) +void UserUrls::print(QTextStream & strm) const { - out << "UserUrls: {\n"; + strm << "UserUrls: {\n"; - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; + if (noteStoreUrl.isSet()) { + strm << " noteStoreUrl = " + << noteStoreUrl.ref() << "\n"; } else { - out << " noteStoreUrl is not set\n"; + strm << " noteStoreUrl is not set\n"; } - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; + if (webApiUrlPrefix.isSet()) { + strm << " webApiUrlPrefix = " + << webApiUrlPrefix.ref() << "\n"; } else { - out << " webApiUrlPrefix is not set\n"; + strm << " webApiUrlPrefix is not set\n"; } - if (value.userStoreUrl.isSet()) { - out << " userStoreUrl = " - << value.userStoreUrl.ref() << "\n"; + if (userStoreUrl.isSet()) { + strm << " userStoreUrl = " + << userStoreUrl.ref() << "\n"; } else { - out << " userStoreUrl is not set\n"; + strm << " userStoreUrl is not set\n"; } - if (value.utilityUrl.isSet()) { - out << " utilityUrl = " - << value.utilityUrl.ref() << "\n"; + if (utilityUrl.isSet()) { + strm << " utilityUrl = " + << utilityUrl.ref() << "\n"; } else { - out << " utilityUrl is not set\n"; + strm << " utilityUrl is not set\n"; } - if (value.messageStoreUrl.isSet()) { - out << " messageStoreUrl = " - << value.messageStoreUrl.ref() << "\n"; + if (messageStoreUrl.isSet()) { + strm << " messageStoreUrl = " + << messageStoreUrl.ref() << "\n"; } else { - out << " messageStoreUrl is not set\n"; + strm << " messageStoreUrl is not set\n"; } - if (value.userWebSocketUrl.isSet()) { - out << " userWebSocketUrl = " - << value.userWebSocketUrl.ref() << "\n"; + if (userWebSocketUrl.isSet()) { + strm << " userWebSocketUrl = " + << userWebSocketUrl.ref() << "\n"; } else { - out << " userWebSocketUrl is not set\n"; + strm << " userWebSocketUrl is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const UserUrls & value) +void writeAuthenticationResult( + ThriftBinaryBufferWriter & w, + const AuthenticationResult & s) { - out << "UserUrls: {\n"; - - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; - } - else { - out << " noteStoreUrl is not set\n"; - } - - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; - } - else { - out << " webApiUrlPrefix is not set\n"; - } - - if (value.userStoreUrl.isSet()) { - out << " userStoreUrl = " - << value.userStoreUrl.ref() << "\n"; - } - else { - out << " userStoreUrl is not set\n"; - } - - if (value.utilityUrl.isSet()) { - out << " utilityUrl = " - << value.utilityUrl.ref() << "\n"; - } - else { - out << " utilityUrl is not set\n"; - } - - if (value.messageStoreUrl.isSet()) { - out << " messageStoreUrl = " - << value.messageStoreUrl.ref() << "\n"; - } - else { - out << " messageStoreUrl is not set\n"; - } - - if (value.userWebSocketUrl.isSet()) { - out << " userWebSocketUrl = " - << value.userWebSocketUrl.ref() << "\n"; - } - else { - out << " userWebSocketUrl is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const AuthenticationResult & s) { w.writeStructBegin(QStringLiteral("AuthenticationResult")); w.writeFieldBegin( QStringLiteral("currentTime"), @@ -22939,7 +18168,10 @@ void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const Authenticatio w.writeStructEnd(); } -void readAuthenticationResult(ThriftBinaryBufferReader & r, AuthenticationResult & s) { +void readAuthenticationResult( + ThriftBinaryBufferReader & r, + AuthenticationResult & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -23050,160 +18282,86 @@ void readAuthenticationResult(ThriftBinaryBufferReader & r, AuthenticationResult r.readFieldEnd(); } r.readStructEnd(); - if(!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.currentTime has no value")); - if(!authenticationToken_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.authenticationToken has no value")); - if(!expiration_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.expiration has no value")); + if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.currentTime has no value")); + if (!authenticationToken_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.authenticationToken has no value")); + if (!expiration_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.expiration has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const AuthenticationResult & value) +void AuthenticationResult::print(QTextStream & strm) const { - out << "AuthenticationResult: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; - out << " authenticationToken = " - << "QString" << "\n"; - out << " expiration = " - << "Timestamp" << "\n"; + strm << "AuthenticationResult: {\n"; + strm << " currentTime = " + << currentTime << "\n"; + strm << " authenticationToken = " + << authenticationToken << "\n"; + strm << " expiration = " + << expiration << "\n"; - if (value.user.isSet()) { - out << " user = " - << value.user.ref() << "\n"; + if (user.isSet()) { + strm << " user = " + << user.ref() << "\n"; } else { - out << " user is not set\n"; + strm << " user is not set\n"; } - if (value.publicUserInfo.isSet()) { - out << " publicUserInfo = " - << value.publicUserInfo.ref() << "\n"; + if (publicUserInfo.isSet()) { + strm << " publicUserInfo = " + << publicUserInfo.ref() << "\n"; } else { - out << " publicUserInfo is not set\n"; + strm << " publicUserInfo is not set\n"; } - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; + if (noteStoreUrl.isSet()) { + strm << " noteStoreUrl = " + << noteStoreUrl.ref() << "\n"; } else { - out << " noteStoreUrl is not set\n"; + strm << " noteStoreUrl is not set\n"; } - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; + if (webApiUrlPrefix.isSet()) { + strm << " webApiUrlPrefix = " + << webApiUrlPrefix.ref() << "\n"; } else { - out << " webApiUrlPrefix is not set\n"; + strm << " webApiUrlPrefix is not set\n"; } - if (value.secondFactorRequired.isSet()) { - out << " secondFactorRequired = " - << value.secondFactorRequired.ref() << "\n"; + if (secondFactorRequired.isSet()) { + strm << " secondFactorRequired = " + << secondFactorRequired.ref() << "\n"; } else { - out << " secondFactorRequired is not set\n"; + strm << " secondFactorRequired is not set\n"; } - if (value.secondFactorDeliveryHint.isSet()) { - out << " secondFactorDeliveryHint = " - << value.secondFactorDeliveryHint.ref() << "\n"; + if (secondFactorDeliveryHint.isSet()) { + strm << " secondFactorDeliveryHint = " + << secondFactorDeliveryHint.ref() << "\n"; } else { - out << " secondFactorDeliveryHint is not set\n"; + strm << " secondFactorDeliveryHint is not set\n"; } - if (value.urls.isSet()) { - out << " urls = " - << value.urls.ref() << "\n"; + if (urls.isSet()) { + strm << " urls = " + << urls.ref() << "\n"; } else { - out << " urls is not set\n"; + strm << " urls is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const AuthenticationResult & value) +void writeBootstrapSettings( + ThriftBinaryBufferWriter & w, + const BootstrapSettings & s) { - out << "AuthenticationResult: {\n"; - out << " currentTime = " - << "Timestamp" << "\n"; - out << " authenticationToken = " - << "QString" << "\n"; - out << " expiration = " - << "Timestamp" << "\n"; - - if (value.user.isSet()) { - out << " user = " - << value.user.ref() << "\n"; - } - else { - out << " user is not set\n"; - } - - if (value.publicUserInfo.isSet()) { - out << " publicUserInfo = " - << value.publicUserInfo.ref() << "\n"; - } - else { - out << " publicUserInfo is not set\n"; - } - - if (value.noteStoreUrl.isSet()) { - out << " noteStoreUrl = " - << value.noteStoreUrl.ref() << "\n"; - } - else { - out << " noteStoreUrl is not set\n"; - } - - if (value.webApiUrlPrefix.isSet()) { - out << " webApiUrlPrefix = " - << value.webApiUrlPrefix.ref() << "\n"; - } - else { - out << " webApiUrlPrefix is not set\n"; - } - - if (value.secondFactorRequired.isSet()) { - out << " secondFactorRequired = " - << value.secondFactorRequired.ref() << "\n"; - } - else { - out << " secondFactorRequired is not set\n"; - } - - if (value.secondFactorDeliveryHint.isSet()) { - out << " secondFactorDeliveryHint = " - << value.secondFactorDeliveryHint.ref() << "\n"; - } - else { - out << " secondFactorDeliveryHint is not set\n"; - } - - if (value.urls.isSet()) { - out << " urls = " - << value.urls.ref() << "\n"; - } - else { - out << " urls is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSettings & s) { w.writeStructBegin(QStringLiteral("BootstrapSettings")); w.writeFieldBegin( QStringLiteral("serviceHost"), @@ -23313,7 +18471,10 @@ void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSetting w.writeStructEnd(); } -void readBootstrapSettings(ThriftBinaryBufferReader & r, BootstrapSettings & s) { +void readBootstrapSettings( + ThriftBinaryBufferReader & r, + BootstrapSettings & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -23462,213 +18623,113 @@ void readBootstrapSettings(ThriftBinaryBufferReader & r, BootstrapSettings & s) r.readFieldEnd(); } r.readStructEnd(); - if(!serviceHost_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.serviceHost has no value")); - if(!marketingUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.marketingUrl has no value")); - if(!supportUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.supportUrl has no value")); - if(!accountEmailDomain_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.accountEmailDomain has no value")); + if (!serviceHost_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.serviceHost has no value")); + if (!marketingUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.marketingUrl has no value")); + if (!supportUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.supportUrl has no value")); + if (!accountEmailDomain_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.accountEmailDomain has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BootstrapSettings & value) +void BootstrapSettings::print(QTextStream & strm) const { - out << "BootstrapSettings: {\n"; - out << " serviceHost = " - << "QString" << "\n"; - out << " marketingUrl = " - << "QString" << "\n"; - out << " supportUrl = " - << "QString" << "\n"; - out << " accountEmailDomain = " - << "QString" << "\n"; + strm << "BootstrapSettings: {\n"; + strm << " serviceHost = " + << serviceHost << "\n"; + strm << " marketingUrl = " + << marketingUrl << "\n"; + strm << " supportUrl = " + << supportUrl << "\n"; + strm << " accountEmailDomain = " + << accountEmailDomain << "\n"; - if (value.enableFacebookSharing.isSet()) { - out << " enableFacebookSharing = " - << value.enableFacebookSharing.ref() << "\n"; + if (enableFacebookSharing.isSet()) { + strm << " enableFacebookSharing = " + << enableFacebookSharing.ref() << "\n"; } else { - out << " enableFacebookSharing is not set\n"; + strm << " enableFacebookSharing is not set\n"; } - if (value.enableGiftSubscriptions.isSet()) { - out << " enableGiftSubscriptions = " - << value.enableGiftSubscriptions.ref() << "\n"; + if (enableGiftSubscriptions.isSet()) { + strm << " enableGiftSubscriptions = " + << enableGiftSubscriptions.ref() << "\n"; } else { - out << " enableGiftSubscriptions is not set\n"; + strm << " enableGiftSubscriptions is not set\n"; } - if (value.enableSupportTickets.isSet()) { - out << " enableSupportTickets = " - << value.enableSupportTickets.ref() << "\n"; + if (enableSupportTickets.isSet()) { + strm << " enableSupportTickets = " + << enableSupportTickets.ref() << "\n"; } else { - out << " enableSupportTickets is not set\n"; + strm << " enableSupportTickets is not set\n"; } - if (value.enableSharedNotebooks.isSet()) { - out << " enableSharedNotebooks = " - << value.enableSharedNotebooks.ref() << "\n"; + if (enableSharedNotebooks.isSet()) { + strm << " enableSharedNotebooks = " + << enableSharedNotebooks.ref() << "\n"; } else { - out << " enableSharedNotebooks is not set\n"; + strm << " enableSharedNotebooks is not set\n"; } - if (value.enableSingleNoteSharing.isSet()) { - out << " enableSingleNoteSharing = " - << value.enableSingleNoteSharing.ref() << "\n"; + if (enableSingleNoteSharing.isSet()) { + strm << " enableSingleNoteSharing = " + << enableSingleNoteSharing.ref() << "\n"; } else { - out << " enableSingleNoteSharing is not set\n"; + strm << " enableSingleNoteSharing is not set\n"; } - if (value.enableSponsoredAccounts.isSet()) { - out << " enableSponsoredAccounts = " - << value.enableSponsoredAccounts.ref() << "\n"; + if (enableSponsoredAccounts.isSet()) { + strm << " enableSponsoredAccounts = " + << enableSponsoredAccounts.ref() << "\n"; } else { - out << " enableSponsoredAccounts is not set\n"; + strm << " enableSponsoredAccounts is not set\n"; } - if (value.enableTwitterSharing.isSet()) { - out << " enableTwitterSharing = " - << value.enableTwitterSharing.ref() << "\n"; + if (enableTwitterSharing.isSet()) { + strm << " enableTwitterSharing = " + << enableTwitterSharing.ref() << "\n"; } else { - out << " enableTwitterSharing is not set\n"; + strm << " enableTwitterSharing is not set\n"; } - if (value.enableLinkedInSharing.isSet()) { - out << " enableLinkedInSharing = " - << value.enableLinkedInSharing.ref() << "\n"; + if (enableLinkedInSharing.isSet()) { + strm << " enableLinkedInSharing = " + << enableLinkedInSharing.ref() << "\n"; } else { - out << " enableLinkedInSharing is not set\n"; + strm << " enableLinkedInSharing is not set\n"; } - if (value.enablePublicNotebooks.isSet()) { - out << " enablePublicNotebooks = " - << value.enablePublicNotebooks.ref() << "\n"; + if (enablePublicNotebooks.isSet()) { + strm << " enablePublicNotebooks = " + << enablePublicNotebooks.ref() << "\n"; } else { - out << " enablePublicNotebooks is not set\n"; + strm << " enablePublicNotebooks is not set\n"; } - if (value.enableGoogle.isSet()) { - out << " enableGoogle = " - << value.enableGoogle.ref() << "\n"; + if (enableGoogle.isSet()) { + strm << " enableGoogle = " + << enableGoogle.ref() << "\n"; } else { - out << " enableGoogle is not set\n"; + strm << " enableGoogle is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const BootstrapSettings & value) +void writeBootstrapProfile( + ThriftBinaryBufferWriter & w, + const BootstrapProfile & s) { - out << "BootstrapSettings: {\n"; - out << " serviceHost = " - << "QString" << "\n"; - out << " marketingUrl = " - << "QString" << "\n"; - out << " supportUrl = " - << "QString" << "\n"; - out << " accountEmailDomain = " - << "QString" << "\n"; - - if (value.enableFacebookSharing.isSet()) { - out << " enableFacebookSharing = " - << value.enableFacebookSharing.ref() << "\n"; - } - else { - out << " enableFacebookSharing is not set\n"; - } - - if (value.enableGiftSubscriptions.isSet()) { - out << " enableGiftSubscriptions = " - << value.enableGiftSubscriptions.ref() << "\n"; - } - else { - out << " enableGiftSubscriptions is not set\n"; - } - - if (value.enableSupportTickets.isSet()) { - out << " enableSupportTickets = " - << value.enableSupportTickets.ref() << "\n"; - } - else { - out << " enableSupportTickets is not set\n"; - } - - if (value.enableSharedNotebooks.isSet()) { - out << " enableSharedNotebooks = " - << value.enableSharedNotebooks.ref() << "\n"; - } - else { - out << " enableSharedNotebooks is not set\n"; - } - - if (value.enableSingleNoteSharing.isSet()) { - out << " enableSingleNoteSharing = " - << value.enableSingleNoteSharing.ref() << "\n"; - } - else { - out << " enableSingleNoteSharing is not set\n"; - } - - if (value.enableSponsoredAccounts.isSet()) { - out << " enableSponsoredAccounts = " - << value.enableSponsoredAccounts.ref() << "\n"; - } - else { - out << " enableSponsoredAccounts is not set\n"; - } - - if (value.enableTwitterSharing.isSet()) { - out << " enableTwitterSharing = " - << value.enableTwitterSharing.ref() << "\n"; - } - else { - out << " enableTwitterSharing is not set\n"; - } - - if (value.enableLinkedInSharing.isSet()) { - out << " enableLinkedInSharing = " - << value.enableLinkedInSharing.ref() << "\n"; - } - else { - out << " enableLinkedInSharing is not set\n"; - } - - if (value.enablePublicNotebooks.isSet()) { - out << " enablePublicNotebooks = " - << value.enablePublicNotebooks.ref() << "\n"; - } - else { - out << " enablePublicNotebooks is not set\n"; - } - - if (value.enableGoogle.isSet()) { - out << " enableGoogle = " - << value.enableGoogle.ref() << "\n"; - } - else { - out << " enableGoogle is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBootstrapProfile(ThriftBinaryBufferWriter & w, const BootstrapProfile & s) { w.writeStructBegin(QStringLiteral("BootstrapProfile")); w.writeFieldBegin( QStringLiteral("name"), @@ -23686,7 +18747,10 @@ void writeBootstrapProfile(ThriftBinaryBufferWriter & w, const BootstrapProfile w.writeStructEnd(); } -void readBootstrapProfile(ThriftBinaryBufferReader & r, BootstrapProfile & s) { +void readBootstrapProfile( + ThriftBinaryBufferReader & r, + BootstrapProfile & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -23723,41 +18787,26 @@ void readBootstrapProfile(ThriftBinaryBufferReader & r, BootstrapProfile & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!name_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.name has no value")); - if(!settings_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.settings has no value")); + if (!name_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.name has no value")); + if (!settings_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.settings has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BootstrapProfile & value) +void BootstrapProfile::print(QTextStream & strm) const { - out << "BootstrapProfile: {\n"; - out << " name = " - << "QString" << "\n"; - out << " settings = " - << "BootstrapSettings" << "\n"; - out << "}\n"; - return out; + strm << "BootstrapProfile: {\n"; + strm << " name = " + << name << "\n"; + strm << " settings = " + << settings << "\n"; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// -QDebug & operator<<( - QDebug & out, const BootstrapProfile & value) +void writeBootstrapInfo( + ThriftBinaryBufferWriter & w, + const BootstrapInfo & s) { - out << "BootstrapProfile: {\n"; - out << " name = " - << "QString" << "\n"; - out << " settings = " - << "BootstrapSettings" << "\n"; - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s) { w.writeStructBegin(QStringLiteral("BootstrapInfo")); w.writeFieldBegin( QStringLiteral("profiles"), @@ -23773,7 +18822,10 @@ void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s) { w.writeStructEnd(); } -void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s) { +void readBootstrapInfo( + ThriftBinaryBufferReader & r, + BootstrapInfo & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -23791,7 +18843,11 @@ void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s) { ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (BootstrapInfo.profiles)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (BootstrapInfo.profiles)")); + } for(qint32 i = 0; i < size; i++) { BootstrapProfile elem; readBootstrapProfile(r, elem); @@ -23809,31 +18865,19 @@ void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s) { r.readFieldEnd(); } r.readStructEnd(); - if(!profiles_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapInfo.profiles has no value")); -} - -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const BootstrapInfo & value) -{ - out << "BootstrapInfo: {\n"; - out << " profiles = " - << "QList" << "\n"; - out << "}\n"; - return out; + if (!profiles_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapInfo.profiles has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const BootstrapInfo & value) +void BootstrapInfo::print(QTextStream & strm) const { - out << "BootstrapInfo: {\n"; - out << " profiles = " - << "QList" << "\n"; - out << "}\n"; - return out; + strm << "BootstrapInfo: {\n"; + strm << " profiles = " + << "QList {"; + for(const auto & v: profiles) { + strm << " " << v << "\n"; + } + strm << "}\n"; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -23845,7 +18889,10 @@ EDAMUserException::EDAMUserException(const EDAMUserException& other) : EvernoteE errorCode = other.errorCode; parameter = other.parameter; } -void writeEDAMUserException(ThriftBinaryBufferWriter & w, const EDAMUserException & s) { +void writeEDAMUserException( + ThriftBinaryBufferWriter & w, + const EDAMUserException & s) +{ w.writeStructBegin(QStringLiteral("EDAMUserException")); w.writeFieldBegin( QStringLiteral("errorCode"), @@ -23865,7 +18912,10 @@ void writeEDAMUserException(ThriftBinaryBufferWriter & w, const EDAMUserExceptio w.writeStructEnd(); } -void readEDAMUserException(ThriftBinaryBufferReader & r, EDAMUserException & s) { +void readEDAMUserException( + ThriftBinaryBufferReader & r, + EDAMUserException & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -23900,49 +18950,24 @@ void readEDAMUserException(ThriftBinaryBufferReader & r, EDAMUserException & s) r.readFieldEnd(); } r.readStructEnd(); - if(!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMUserException.errorCode has no value")); -} - -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const EDAMUserException & value) -{ - out << "EDAMUserException: {\n"; - out << " errorCode = " - << "EDAMErrorCode" << "\n"; - - if (value.parameter.isSet()) { - out << " parameter = " - << value.parameter.ref() << "\n"; - } - else { - out << " parameter is not set\n"; - } - - out << "}\n"; - return out; + if (!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMUserException.errorCode has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const EDAMUserException & value) +void EDAMUserException::print(QTextStream & strm) const { - out << "EDAMUserException: {\n"; - out << " errorCode = " - << "EDAMErrorCode" << "\n"; + strm << "EDAMUserException: {\n"; + strm << " errorCode = " + << errorCode << "\n"; - if (value.parameter.isSet()) { - out << " parameter = " - << value.parameter.ref() << "\n"; + if (parameter.isSet()) { + strm << " parameter = " + << parameter.ref() << "\n"; } else { - out << " parameter is not set\n"; + strm << " parameter is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -23955,7 +18980,10 @@ EDAMSystemException::EDAMSystemException(const EDAMSystemException& other) : Eve message = other.message; rateLimitDuration = other.rateLimitDuration; } -void writeEDAMSystemException(ThriftBinaryBufferWriter & w, const EDAMSystemException & s) { +void writeEDAMSystemException( + ThriftBinaryBufferWriter & w, + const EDAMSystemException & s) +{ w.writeStructBegin(QStringLiteral("EDAMSystemException")); w.writeFieldBegin( QStringLiteral("errorCode"), @@ -23983,7 +19011,10 @@ void writeEDAMSystemException(ThriftBinaryBufferWriter & w, const EDAMSystemExce w.writeStructEnd(); } -void readEDAMSystemException(ThriftBinaryBufferReader & r, EDAMSystemException & s) { +void readEDAMSystemException( + ThriftBinaryBufferReader & r, + EDAMSystemException & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -24027,65 +19058,32 @@ void readEDAMSystemException(ThriftBinaryBufferReader & r, EDAMSystemException & r.readFieldEnd(); } r.readStructEnd(); - if(!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMSystemException.errorCode has no value")); -} - -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const EDAMSystemException & value) -{ - out << "EDAMSystemException: {\n"; - out << " errorCode = " - << "EDAMErrorCode" << "\n"; - - if (value.message.isSet()) { - out << " message = " - << value.message.ref() << "\n"; - } - else { - out << " message is not set\n"; - } - - if (value.rateLimitDuration.isSet()) { - out << " rateLimitDuration = " - << value.rateLimitDuration.ref() << "\n"; - } - else { - out << " rateLimitDuration is not set\n"; - } - - out << "}\n"; - return out; + if (!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMSystemException.errorCode has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const EDAMSystemException & value) +void EDAMSystemException::print(QTextStream & strm) const { - out << "EDAMSystemException: {\n"; - out << " errorCode = " - << "EDAMErrorCode" << "\n"; + strm << "EDAMSystemException: {\n"; + strm << " errorCode = " + << errorCode << "\n"; - if (value.message.isSet()) { - out << " message = " - << value.message.ref() << "\n"; + if (message.isSet()) { + strm << " message = " + << message.ref() << "\n"; } else { - out << " message is not set\n"; + strm << " message is not set\n"; } - if (value.rateLimitDuration.isSet()) { - out << " rateLimitDuration = " - << value.rateLimitDuration.ref() << "\n"; + if (rateLimitDuration.isSet()) { + strm << " rateLimitDuration = " + << rateLimitDuration.ref() << "\n"; } else { - out << " rateLimitDuration is not set\n"; + strm << " rateLimitDuration is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -24097,7 +19095,10 @@ EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) identifier = other.identifier; key = other.key; } -void writeEDAMNotFoundException(ThriftBinaryBufferWriter & w, const EDAMNotFoundException & s) { +void writeEDAMNotFoundException( + ThriftBinaryBufferWriter & w, + const EDAMNotFoundException & s) +{ w.writeStructBegin(QStringLiteral("EDAMNotFoundException")); if (s.identifier.isSet()) { w.writeFieldBegin( @@ -24119,7 +19120,10 @@ void writeEDAMNotFoundException(ThriftBinaryBufferWriter & w, const EDAMNotFound w.writeStructEnd(); } -void readEDAMNotFoundException(ThriftBinaryBufferReader & r, EDAMNotFoundException & s) { +void readEDAMNotFoundException( + ThriftBinaryBufferReader & r, + EDAMNotFoundException & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -24154,58 +19158,27 @@ void readEDAMNotFoundException(ThriftBinaryBufferReader & r, EDAMNotFoundExcepti r.readStructEnd(); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const EDAMNotFoundException & value) -{ - out << "EDAMNotFoundException: {\n"; - - if (value.identifier.isSet()) { - out << " identifier = " - << value.identifier.ref() << "\n"; - } - else { - out << " identifier is not set\n"; - } - - if (value.key.isSet()) { - out << " key = " - << value.key.ref() << "\n"; - } - else { - out << " key is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const EDAMNotFoundException & value) +void EDAMNotFoundException::print(QTextStream & strm) const { - out << "EDAMNotFoundException: {\n"; + strm << "EDAMNotFoundException: {\n"; - if (value.identifier.isSet()) { - out << " identifier = " - << value.identifier.ref() << "\n"; + if (identifier.isSet()) { + strm << " identifier = " + << identifier.ref() << "\n"; } else { - out << " identifier is not set\n"; + strm << " identifier is not set\n"; } - if (value.key.isSet()) { - out << " key = " - << value.key.ref() << "\n"; + if (key.isSet()) { + strm << " key = " + << key.ref() << "\n"; } else { - out << " key is not set\n"; + strm << " key is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -24218,7 +19191,10 @@ EDAMInvalidContactsException::EDAMInvalidContactsException(const EDAMInvalidCont parameter = other.parameter; reasons = other.reasons; } -void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMInvalidContactsException & s) { +void writeEDAMInvalidContactsException( + ThriftBinaryBufferWriter & w, + const EDAMInvalidContactsException & s) +{ w.writeStructBegin(QStringLiteral("EDAMInvalidContactsException")); w.writeFieldBegin( QStringLiteral("contacts"), @@ -24254,7 +19230,10 @@ void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMI w.writeStructEnd(); } -void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidContactsException & s) { +void readEDAMInvalidContactsException( + ThriftBinaryBufferReader & r, + EDAMInvalidContactsException & s) +{ QString fname; ThriftFieldType::type fieldType; qint16 fieldId; @@ -24272,7 +19251,11 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_STRUCT) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (EDAMInvalidContactsException.contacts)")); + if (elemType != ThriftFieldType::T_STRUCT) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (EDAMInvalidContactsException.contacts)")); + } for(qint32 i = 0; i < size; i++) { Contact elem; readContact(r, elem); @@ -24300,7 +19283,11 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC ThriftFieldType::type elemType; r.readListBegin(elemType, size); v.reserve(size); - if(elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect list type (EDAMInvalidContactsException.reasons)")); + if (elemType != ThriftFieldType::T_I32) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect list type (EDAMInvalidContactsException.reasons)")); + } for(qint32 i = 0; i < size; i++) { EDAMInvalidContactReason elem; readEnumEDAMInvalidContactReason(r, elem); @@ -24318,71 +19305,40 @@ void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidC r.readFieldEnd(); } r.readStructEnd(); - if(!contacts_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMInvalidContactsException.contacts has no value")); + if (!contacts_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMInvalidContactsException.contacts has no value")); } -//////////////////////////////////////////////////////////////////////////////// - -QTextStream & operator<<( - QTextStream & out, const EDAMInvalidContactsException & value) +void EDAMInvalidContactsException::print(QTextStream & strm) const { - out << "EDAMInvalidContactsException: {\n"; - out << " contacts = " - << "QList" << "\n"; - - if (value.parameter.isSet()) { - out << " parameter = " - << value.parameter.ref() << "\n"; - } - else { - out << " parameter is not set\n"; - } - - if (value.reasons.isSet()) { - out << " reasons = " - << "QList {"; - for(const auto & v: value.reasons.ref()) { - out << v; - } + strm << "EDAMInvalidContactsException: {\n"; + strm << " contacts = " + << "QList {"; + for(const auto & v: contacts) { + strm << " " << v << "\n"; } - else { - out << " reasons is not set\n"; - } - - out << "}\n"; - return out; -} - -//////////////////////////////////////////////////////////////////////////////// - -QDebug & operator<<( - QDebug & out, const EDAMInvalidContactsException & value) -{ - out << "EDAMInvalidContactsException: {\n"; - out << " contacts = " - << "QList" << "\n"; + strm << "}\n"; - if (value.parameter.isSet()) { - out << " parameter = " - << value.parameter.ref() << "\n"; + if (parameter.isSet()) { + strm << " parameter = " + << parameter.ref() << "\n"; } else { - out << " parameter is not set\n"; + strm << " parameter is not set\n"; } - if (value.reasons.isSet()) { - out << " reasons = " + if (reasons.isSet()) { + strm << " reasons = " << "QList {"; - for(const auto & v: value.reasons.ref()) { - out << v; + for(const auto & v: reasons.ref()) { + strm << " " << v << "\n"; } + strm << " }\n"; } else { - out << " reasons is not set\n"; + strm << " reasons is not set\n"; } - out << "}\n"; - return out; + strm << "}\n"; } //////////////////////////////////////////////////////////////////////////////// From 44b25515b006ea5740c77e82053d53f540b1b408 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 23 Oct 2019 07:52:01 +0300 Subject: [PATCH 047/188] Minor formatting improvement in generated code --- QEverCloud/src/generated/Types.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index 6041309c..f4acb2ba 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -1470,7 +1470,11 @@ void readSyncChunkFilter( ThriftFieldType::type elemType; r.readSetBegin(elemType, size); v.reserve(size); - if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect set type (SyncChunkFilter.notebookGuids)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect set type (SyncChunkFilter.notebookGuids)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); @@ -4791,7 +4795,11 @@ void readRelatedResultSpec( ThriftFieldType::type elemType; r.readSetBegin(elemType, size); v.reserve(size); - if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect set type (RelatedResultSpec.relatedContentTypes)")); + if (elemType != ThriftFieldType::T_I32) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect set type (RelatedResultSpec.relatedContentTypes)")); + } for(qint32 i = 0; i < size; i++) { RelatedContentType elem; readEnumRelatedContentType(r, elem); @@ -11004,7 +11012,11 @@ void readLazyMap( ThriftFieldType::type elemType; r.readSetBegin(elemType, size); v.reserve(size); - if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect set type (LazyMap.keysOnly)")); + if (elemType != ThriftFieldType::T_STRING) { + throw ThriftException( + ThriftException::Type::INVALID_DATA, + QStringLiteral("Incorrect set type (LazyMap.keysOnly)")); + } for(qint32 i = 0; i < size; i++) { QString elem; r.readString(elem); From 3d5a875886a4c704747e0a20c2d064997df6f92b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 24 Oct 2019 07:55:26 +0300 Subject: [PATCH 048/188] Update generated code - introduce logging for service calls --- QEverCloud/src/generated/Services.cpp | 1312 +++++++++++++++++++++++++ 1 file changed, 1312 insertions(+) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index e95a7769..db2456de 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -729,6 +729,8 @@ namespace { QByteArray NoteStore_getSyncState_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_getSyncState_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -749,6 +751,8 @@ QByteArray NoteStore_getSyncState_prepareParams( SyncState NoteStore_getSyncState_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getSyncState_readReply"); + bool resultIsSet = false; SyncState result = SyncState(); ThriftBinaryBufferReader r(reply); @@ -833,6 +837,8 @@ QVariant NoteStore_getSyncState_readReplyAsync(QByteArray reply) SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSyncState"); + if (!ctx) { ctx = m_ctx; } @@ -845,6 +851,8 @@ SyncState NoteStore::getSyncState( AsyncResult * NoteStore::getSyncStateAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSyncStateAsync"); + if (!ctx) { ctx = m_ctx; } @@ -863,6 +871,12 @@ QByteArray NoteStore_getFilteredSyncChunk_prepareParams( qint32 maxEntries, const SyncChunkFilter & filter) { + QEC_DEBUG("note_store", "NoteStore_getFilteredSyncChunk_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " filter = " << filter); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -901,6 +915,8 @@ QByteArray NoteStore_getFilteredSyncChunk_prepareParams( SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getFilteredSyncChunk_readReply"); + bool resultIsSet = false; SyncChunk result = SyncChunk(); ThriftBinaryBufferReader r(reply); @@ -988,6 +1004,12 @@ SyncChunk NoteStore::getFilteredSyncChunk( const SyncChunkFilter & filter, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk"); + QEC_TRACE("note_store", "Parameters:\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " filter = " << filter); + if (!ctx) { ctx = m_ctx; } @@ -1006,6 +1028,12 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( const SyncChunkFilter & filter, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunkAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " filter = " << filter); + if (!ctx) { ctx = m_ctx; } @@ -1025,6 +1053,10 @@ QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { + QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncState_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1051,6 +1083,8 @@ QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncState_readReply"); + bool resultIsSet = false; SyncState result = SyncState(); ThriftBinaryBufferReader r(reply); @@ -1146,6 +1180,10 @@ SyncState NoteStore::getLinkedNotebookSyncState( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -1160,6 +1198,10 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncStateAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -1180,6 +1222,13 @@ QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( qint32 maxEntries, bool fullSyncOnly) { + QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncChunk_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook << "\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " fullSyncOnly = " << fullSyncOnly); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1224,6 +1273,8 @@ QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncChunk_readReply"); + bool resultIsSet = false; SyncChunk result = SyncChunk(); ThriftBinaryBufferReader r(reply); @@ -1322,6 +1373,13 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( bool fullSyncOnly, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook << "\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " fullSyncOnly = " << fullSyncOnly); + if (!ctx) { ctx = m_ctx; } @@ -1342,6 +1400,13 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( bool fullSyncOnly, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunkAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook << "\n" + << " afterUSN = " << afterUSN << "\n" + << " maxEntries = " << maxEntries << "\n" + << " fullSyncOnly = " << fullSyncOnly); + if (!ctx) { ctx = m_ctx; } @@ -1361,6 +1426,8 @@ namespace { QByteArray NoteStore_listNotebooks_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listNotebooks_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1381,6 +1448,8 @@ QByteArray NoteStore_listNotebooks_prepareParams( QList NoteStore_listNotebooks_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listNotebooks_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -1479,6 +1548,8 @@ QVariant NoteStore_listNotebooks_readReplyAsync(QByteArray reply) QList NoteStore::listNotebooks( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listNotebooks"); + if (!ctx) { ctx = m_ctx; } @@ -1491,6 +1562,8 @@ QList NoteStore::listNotebooks( AsyncResult * NoteStore::listNotebooksAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listNotebooksAsync"); + if (!ctx) { ctx = m_ctx; } @@ -1506,6 +1579,8 @@ namespace { QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listAccessibleBusinessNotebooks_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1526,6 +1601,8 @@ QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listAccessibleBusinessNotebooks_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -1624,6 +1701,8 @@ QVariant NoteStore_listAccessibleBusinessNotebooks_readReplyAsync(QByteArray rep QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks"); + if (!ctx) { ctx = m_ctx; } @@ -1636,6 +1715,8 @@ QList NoteStore::listAccessibleBusinessNotebooks( AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooksAsync"); + if (!ctx) { ctx = m_ctx; } @@ -1652,6 +1733,10 @@ QByteArray NoteStore_getNotebook_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1678,6 +1763,8 @@ QByteArray NoteStore_getNotebook_prepareParams( Notebook NoteStore_getNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNotebook_readReply"); + bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader r(reply); @@ -1773,6 +1860,10 @@ Notebook NoteStore::getNotebook( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -1787,6 +1878,10 @@ AsyncResult * NoteStore::getNotebookAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -1803,6 +1898,8 @@ namespace { QByteArray NoteStore_getDefaultNotebook_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_getDefaultNotebook_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1823,6 +1920,8 @@ QByteArray NoteStore_getDefaultNotebook_prepareParams( Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getDefaultNotebook_readReply"); + bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader r(reply); @@ -1907,6 +2006,8 @@ QVariant NoteStore_getDefaultNotebook_readReplyAsync(QByteArray reply) Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook"); + if (!ctx) { ctx = m_ctx; } @@ -1919,6 +2020,8 @@ Notebook NoteStore::getDefaultNotebook( AsyncResult * NoteStore::getDefaultNotebookAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getDefaultNotebookAsync"); + if (!ctx) { ctx = m_ctx; } @@ -1935,6 +2038,10 @@ QByteArray NoteStore_createNotebook_prepareParams( QString authenticationToken, const Notebook & notebook) { + QEC_DEBUG("note_store", "NoteStore_createNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -1961,6 +2068,8 @@ QByteArray NoteStore_createNotebook_prepareParams( Notebook NoteStore_createNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createNotebook_readReply"); + bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader r(reply); @@ -2056,6 +2165,10 @@ Notebook NoteStore::createNotebook( const Notebook & notebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + if (!ctx) { ctx = m_ctx; } @@ -2070,6 +2183,10 @@ AsyncResult * NoteStore::createNotebookAsync( const Notebook & notebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + if (!ctx) { ctx = m_ctx; } @@ -2087,6 +2204,10 @@ QByteArray NoteStore_updateNotebook_prepareParams( QString authenticationToken, const Notebook & notebook) { + QEC_DEBUG("note_store", "NoteStore_updateNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2113,6 +2234,8 @@ QByteArray NoteStore_updateNotebook_prepareParams( qint32 NoteStore_updateNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateNotebook_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -2208,6 +2331,10 @@ qint32 NoteStore::updateNotebook( const Notebook & notebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + if (!ctx) { ctx = m_ctx; } @@ -2222,6 +2349,10 @@ AsyncResult * NoteStore::updateNotebookAsync( const Notebook & notebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + if (!ctx) { ctx = m_ctx; } @@ -2239,6 +2370,10 @@ QByteArray NoteStore_expungeNotebook_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_expungeNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2265,6 +2400,8 @@ QByteArray NoteStore_expungeNotebook_prepareParams( qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_expungeNotebook_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -2360,6 +2497,10 @@ qint32 NoteStore::expungeNotebook( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -2374,6 +2515,10 @@ AsyncResult * NoteStore::expungeNotebookAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -2390,6 +2535,8 @@ namespace { QByteArray NoteStore_listTags_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listTags_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2410,6 +2557,8 @@ QByteArray NoteStore_listTags_prepareParams( QList NoteStore_listTags_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listTags_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -2508,6 +2657,8 @@ QVariant NoteStore_listTags_readReplyAsync(QByteArray reply) QList NoteStore::listTags( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listTags"); + if (!ctx) { ctx = m_ctx; } @@ -2520,6 +2671,8 @@ QList NoteStore::listTags( AsyncResult * NoteStore::listTagsAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listTagsAsync"); + if (!ctx) { ctx = m_ctx; } @@ -2536,6 +2689,10 @@ QByteArray NoteStore_listTagsByNotebook_prepareParams( QString authenticationToken, Guid notebookGuid) { + QEC_DEBUG("note_store", "NoteStore_listTagsByNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2562,6 +2719,8 @@ QByteArray NoteStore_listTagsByNotebook_prepareParams( QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listTagsByNotebook_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -2671,6 +2830,10 @@ QList NoteStore::listTagsByNotebook( Guid notebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -2685,6 +2848,10 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( Guid notebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listTagsByNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -2702,6 +2869,10 @@ QByteArray NoteStore_getTag_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getTag_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2728,6 +2899,8 @@ QByteArray NoteStore_getTag_prepareParams( Tag NoteStore_getTag_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getTag_readReply"); + bool resultIsSet = false; Tag result = Tag(); ThriftBinaryBufferReader r(reply); @@ -2823,6 +2996,10 @@ Tag NoteStore::getTag( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getTag"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -2837,6 +3014,10 @@ AsyncResult * NoteStore::getTagAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getTagAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -2854,6 +3035,10 @@ QByteArray NoteStore_createTag_prepareParams( QString authenticationToken, const Tag & tag) { + QEC_DEBUG("note_store", "NoteStore_createTag_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -2880,6 +3065,8 @@ QByteArray NoteStore_createTag_prepareParams( Tag NoteStore_createTag_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createTag_readReply"); + bool resultIsSet = false; Tag result = Tag(); ThriftBinaryBufferReader r(reply); @@ -2975,6 +3162,10 @@ Tag NoteStore::createTag( const Tag & tag, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createTag"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + if (!ctx) { ctx = m_ctx; } @@ -2989,6 +3180,10 @@ AsyncResult * NoteStore::createTagAsync( const Tag & tag, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createTagAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + if (!ctx) { ctx = m_ctx; } @@ -3006,6 +3201,10 @@ QByteArray NoteStore_updateTag_prepareParams( QString authenticationToken, const Tag & tag) { + QEC_DEBUG("note_store", "NoteStore_updateTag_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3032,6 +3231,8 @@ QByteArray NoteStore_updateTag_prepareParams( qint32 NoteStore_updateTag_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateTag_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -3127,6 +3328,10 @@ qint32 NoteStore::updateTag( const Tag & tag, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateTag"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + if (!ctx) { ctx = m_ctx; } @@ -3141,6 +3346,10 @@ AsyncResult * NoteStore::updateTagAsync( const Tag & tag, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateTagAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + if (!ctx) { ctx = m_ctx; } @@ -3158,6 +3367,10 @@ QByteArray NoteStore_untagAll_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_untagAll_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3184,6 +3397,8 @@ QByteArray NoteStore_untagAll_prepareParams( void NoteStore_untagAll_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_untagAll_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -3262,6 +3477,10 @@ void NoteStore::untagAll( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::untagAll"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3276,6 +3495,10 @@ AsyncResult * NoteStore::untagAllAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::untagAllAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3293,6 +3516,10 @@ QByteArray NoteStore_expungeTag_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_expungeTag_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3319,6 +3546,8 @@ QByteArray NoteStore_expungeTag_prepareParams( qint32 NoteStore_expungeTag_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_expungeTag_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -3414,6 +3643,10 @@ qint32 NoteStore::expungeTag( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeTag"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3428,6 +3661,10 @@ AsyncResult * NoteStore::expungeTagAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeTagAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3444,6 +3681,8 @@ namespace { QByteArray NoteStore_listSearches_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listSearches_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3464,6 +3703,8 @@ QByteArray NoteStore_listSearches_prepareParams( QList NoteStore_listSearches_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listSearches_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -3562,6 +3803,8 @@ QVariant NoteStore_listSearches_readReplyAsync(QByteArray reply) QList NoteStore::listSearches( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listSearches"); + if (!ctx) { ctx = m_ctx; } @@ -3574,6 +3817,8 @@ QList NoteStore::listSearches( AsyncResult * NoteStore::listSearchesAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listSearchesAsync"); + if (!ctx) { ctx = m_ctx; } @@ -3590,6 +3835,10 @@ QByteArray NoteStore_getSearch_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getSearch_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3616,6 +3865,8 @@ QByteArray NoteStore_getSearch_prepareParams( SavedSearch NoteStore_getSearch_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getSearch_readReply"); + bool resultIsSet = false; SavedSearch result = SavedSearch(); ThriftBinaryBufferReader r(reply); @@ -3711,6 +3962,10 @@ SavedSearch NoteStore::getSearch( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSearch"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3725,6 +3980,10 @@ AsyncResult * NoteStore::getSearchAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSearchAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -3742,6 +4001,10 @@ QByteArray NoteStore_createSearch_prepareParams( QString authenticationToken, const SavedSearch & search) { + QEC_DEBUG("note_store", "NoteStore_createSearch_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3768,6 +4031,8 @@ QByteArray NoteStore_createSearch_prepareParams( SavedSearch NoteStore_createSearch_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createSearch_readReply"); + bool resultIsSet = false; SavedSearch result = SavedSearch(); ThriftBinaryBufferReader r(reply); @@ -3853,6 +4118,10 @@ SavedSearch NoteStore::createSearch( const SavedSearch & search, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createSearch"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + if (!ctx) { ctx = m_ctx; } @@ -3867,6 +4136,10 @@ AsyncResult * NoteStore::createSearchAsync( const SavedSearch & search, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createSearchAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + if (!ctx) { ctx = m_ctx; } @@ -3884,6 +4157,10 @@ QByteArray NoteStore_updateSearch_prepareParams( QString authenticationToken, const SavedSearch & search) { + QEC_DEBUG("note_store", "NoteStore_updateSearch_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -3910,6 +4187,8 @@ QByteArray NoteStore_updateSearch_prepareParams( qint32 NoteStore_updateSearch_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateSearch_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -4005,6 +4284,10 @@ qint32 NoteStore::updateSearch( const SavedSearch & search, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateSearch"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + if (!ctx) { ctx = m_ctx; } @@ -4019,6 +4302,10 @@ AsyncResult * NoteStore::updateSearchAsync( const SavedSearch & search, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateSearchAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + if (!ctx) { ctx = m_ctx; } @@ -4036,6 +4323,10 @@ QByteArray NoteStore_expungeSearch_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_expungeSearch_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4062,6 +4353,8 @@ QByteArray NoteStore_expungeSearch_prepareParams( qint32 NoteStore_expungeSearch_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_expungeSearch_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -4157,6 +4450,10 @@ qint32 NoteStore::expungeSearch( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeSearch"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -4171,6 +4468,10 @@ AsyncResult * NoteStore::expungeSearchAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeSearchAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -4189,6 +4490,11 @@ QByteArray NoteStore_findNoteOffset_prepareParams( const NoteFilter & filter, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_findNoteOffset_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4221,6 +4527,8 @@ QByteArray NoteStore_findNoteOffset_prepareParams( qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_findNoteOffset_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -4317,6 +4625,11 @@ qint32 NoteStore::findNoteOffset( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNoteOffset"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -4333,6 +4646,11 @@ AsyncResult * NoteStore::findNoteOffsetAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNoteOffsetAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -4354,6 +4672,13 @@ QByteArray NoteStore_findNotesMetadata_prepareParams( qint32 maxNotes, const NotesMetadataResultSpec & resultSpec) { + QEC_DEBUG("note_store", "NoteStore_findNotesMetadata_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " offset = " << offset << "\n" + << " maxNotes = " << maxNotes << "\n" + << " resultSpec = " << resultSpec); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4398,6 +4723,8 @@ QByteArray NoteStore_findNotesMetadata_prepareParams( NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_findNotesMetadata_readReply"); + bool resultIsSet = false; NotesMetadataList result = NotesMetadataList(); ThriftBinaryBufferReader r(reply); @@ -4496,6 +4823,13 @@ NotesMetadataList NoteStore::findNotesMetadata( const NotesMetadataResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNotesMetadata"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " offset = " << offset << "\n" + << " maxNotes = " << maxNotes << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -4516,6 +4850,13 @@ AsyncResult * NoteStore::findNotesMetadataAsync( const NotesMetadataResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNotesMetadataAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " offset = " << offset << "\n" + << " maxNotes = " << maxNotes << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -4537,6 +4878,11 @@ QByteArray NoteStore_findNoteCounts_prepareParams( const NoteFilter & filter, bool withTrash) { + QEC_DEBUG("note_store", "NoteStore_findNoteCounts_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " withTrash = " << withTrash); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4569,6 +4915,8 @@ QByteArray NoteStore_findNoteCounts_prepareParams( NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_findNoteCounts_readReply"); + bool resultIsSet = false; NoteCollectionCounts result = NoteCollectionCounts(); ThriftBinaryBufferReader r(reply); @@ -4665,6 +5013,11 @@ NoteCollectionCounts NoteStore::findNoteCounts( bool withTrash, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNoteCounts"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " withTrash = " << withTrash); + if (!ctx) { ctx = m_ctx; } @@ -4681,6 +5034,11 @@ AsyncResult * NoteStore::findNoteCountsAsync( bool withTrash, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findNoteCountsAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " filter = " << filter << "\n" + << " withTrash = " << withTrash); + if (!ctx) { ctx = m_ctx; } @@ -4700,6 +5058,11 @@ QByteArray NoteStore_getNoteWithResultSpec_prepareParams( Guid guid, const NoteResultSpec & resultSpec) { + QEC_DEBUG("note_store", "NoteStore_getNoteWithResultSpec_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " resultSpec = " << resultSpec); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4732,6 +5095,8 @@ QByteArray NoteStore_getNoteWithResultSpec_prepareParams( Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteWithResultSpec_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -4828,6 +5193,11 @@ Note NoteStore::getNoteWithResultSpec( const NoteResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -4844,6 +5214,11 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( const NoteResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpecAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -4866,6 +5241,14 @@ QByteArray NoteStore_getNote_prepareParams( bool withResourcesRecognition, bool withResourcesAlternateData) { + QEC_DEBUG("note_store", "NoteStore_getNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withContent = " << withContent << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -4916,6 +5299,8 @@ QByteArray NoteStore_getNote_prepareParams( Note NoteStore_getNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNote_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -5015,6 +5400,14 @@ Note NoteStore::getNote( bool withResourcesAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withContent = " << withContent << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -5037,6 +5430,14 @@ AsyncResult * NoteStore::getNoteAsync( bool withResourcesAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withContent = " << withContent << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -5058,6 +5459,10 @@ QByteArray NoteStore_getNoteApplicationData_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getNoteApplicationData_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5084,6 +5489,8 @@ QByteArray NoteStore_getNoteApplicationData_prepareParams( LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteApplicationData_readReply"); + bool resultIsSet = false; LazyMap result = LazyMap(); ThriftBinaryBufferReader r(reply); @@ -5179,6 +5586,10 @@ LazyMap NoteStore::getNoteApplicationData( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -5193,6 +5604,10 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -5211,6 +5626,11 @@ QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( Guid guid, QString key) { + QEC_DEBUG("note_store", "NoteStore_getNoteApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5243,6 +5663,8 @@ QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteApplicationDataEntry_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -5339,6 +5761,11 @@ QString NoteStore::getNoteApplicationDataEntry( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -5355,6 +5782,11 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -5375,6 +5807,12 @@ QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( QString key, QString value) { + QEC_DEBUG("note_store", "NoteStore_setNoteApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5413,6 +5851,8 @@ QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_setNoteApplicationDataEntry_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -5510,6 +5950,12 @@ qint32 NoteStore::setNoteApplicationDataEntry( QString value, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + if (!ctx) { ctx = m_ctx; } @@ -5528,6 +5974,12 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( QString value, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + if (!ctx) { ctx = m_ctx; } @@ -5548,6 +6000,11 @@ QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( Guid guid, QString key) { + QEC_DEBUG("note_store", "NoteStore_unsetNoteApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5580,6 +6037,8 @@ QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_unsetNoteApplicationDataEntry_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -5676,6 +6135,11 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -5692,6 +6156,11 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -5710,6 +6179,10 @@ QByteArray NoteStore_getNoteContent_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getNoteContent_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5736,6 +6209,8 @@ QByteArray NoteStore_getNoteContent_prepareParams( QString NoteStore_getNoteContent_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteContent_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -5831,6 +6306,10 @@ QString NoteStore::getNoteContent( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteContent"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -5845,6 +6324,10 @@ AsyncResult * NoteStore::getNoteContentAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteContentAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -5864,6 +6347,12 @@ QByteArray NoteStore_getNoteSearchText_prepareParams( bool noteOnly, bool tokenizeForIndexing) { + QEC_DEBUG("note_store", "NoteStore_getNoteSearchText_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteOnly = " << noteOnly << "\n" + << " tokenizeForIndexing = " << tokenizeForIndexing); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -5902,6 +6391,8 @@ QByteArray NoteStore_getNoteSearchText_prepareParams( QString NoteStore_getNoteSearchText_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteSearchText_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -5999,6 +6490,12 @@ QString NoteStore::getNoteSearchText( bool tokenizeForIndexing, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteSearchText"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteOnly = " << noteOnly << "\n" + << " tokenizeForIndexing = " << tokenizeForIndexing); + if (!ctx) { ctx = m_ctx; } @@ -6017,6 +6514,12 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( bool tokenizeForIndexing, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteSearchTextAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteOnly = " << noteOnly << "\n" + << " tokenizeForIndexing = " << tokenizeForIndexing); + if (!ctx) { ctx = m_ctx; } @@ -6036,6 +6539,10 @@ QByteArray NoteStore_getResourceSearchText_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceSearchText_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6062,6 +6569,8 @@ QByteArray NoteStore_getResourceSearchText_prepareParams( QString NoteStore_getResourceSearchText_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceSearchText_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -6157,6 +6666,10 @@ QString NoteStore::getResourceSearchText( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceSearchText"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6171,6 +6684,10 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceSearchTextAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6188,6 +6705,10 @@ QByteArray NoteStore_getNoteTagNames_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getNoteTagNames_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6214,6 +6735,8 @@ QByteArray NoteStore_getNoteTagNames_prepareParams( QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteTagNames_readReply"); + bool resultIsSet = false; QStringList result = QStringList(); ThriftBinaryBufferReader r(reply); @@ -6323,6 +6846,10 @@ QStringList NoteStore::getNoteTagNames( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteTagNames"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6337,6 +6864,10 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteTagNamesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6354,6 +6885,10 @@ QByteArray NoteStore_createNote_prepareParams( QString authenticationToken, const Note & note) { + QEC_DEBUG("note_store", "NoteStore_createNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6380,6 +6915,8 @@ QByteArray NoteStore_createNote_prepareParams( Note NoteStore_createNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createNote_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -6475,6 +7012,10 @@ Note NoteStore::createNote( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -6489,6 +7030,10 @@ AsyncResult * NoteStore::createNoteAsync( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -6506,6 +7051,10 @@ QByteArray NoteStore_updateNote_prepareParams( QString authenticationToken, const Note & note) { + QEC_DEBUG("note_store", "NoteStore_updateNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6532,6 +7081,8 @@ QByteArray NoteStore_updateNote_prepareParams( Note NoteStore_updateNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateNote_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -6627,6 +7178,10 @@ Note NoteStore::updateNote( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -6641,6 +7196,10 @@ AsyncResult * NoteStore::updateNoteAsync( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -6658,6 +7217,10 @@ QByteArray NoteStore_deleteNote_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_deleteNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6684,6 +7247,8 @@ QByteArray NoteStore_deleteNote_prepareParams( qint32 NoteStore_deleteNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_deleteNote_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -6779,6 +7344,10 @@ qint32 NoteStore::deleteNote( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::deleteNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6793,6 +7362,10 @@ AsyncResult * NoteStore::deleteNoteAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::deleteNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6810,6 +7383,10 @@ QByteArray NoteStore_expungeNote_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_expungeNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6836,6 +7413,8 @@ QByteArray NoteStore_expungeNote_prepareParams( qint32 NoteStore_expungeNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_expungeNote_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -6931,6 +7510,10 @@ qint32 NoteStore::expungeNote( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6945,6 +7528,10 @@ AsyncResult * NoteStore::expungeNoteAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -6963,6 +7550,11 @@ QByteArray NoteStore_copyNote_prepareParams( Guid noteGuid, Guid toNotebookGuid) { + QEC_DEBUG("note_store", "NoteStore_copyNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " toNotebookGuid = " << toNotebookGuid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -6995,6 +7587,8 @@ QByteArray NoteStore_copyNote_prepareParams( Note NoteStore_copyNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_copyNote_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -7091,6 +7685,11 @@ Note NoteStore::copyNote( Guid toNotebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::copyNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " toNotebookGuid = " << toNotebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -7107,6 +7706,11 @@ AsyncResult * NoteStore::copyNoteAsync( Guid toNotebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::copyNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " toNotebookGuid = " << toNotebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -7125,6 +7729,10 @@ QByteArray NoteStore_listNoteVersions_prepareParams( QString authenticationToken, Guid noteGuid) { + QEC_DEBUG("note_store", "NoteStore_listNoteVersions_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -7151,6 +7759,8 @@ QByteArray NoteStore_listNoteVersions_prepareParams( QList NoteStore_listNoteVersions_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listNoteVersions_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -7260,6 +7870,10 @@ QList NoteStore::listNoteVersions( Guid noteGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listNoteVersions"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid); + if (!ctx) { ctx = m_ctx; } @@ -7274,6 +7888,10 @@ AsyncResult * NoteStore::listNoteVersionsAsync( Guid noteGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listNoteVersionsAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid); + if (!ctx) { ctx = m_ctx; } @@ -7295,6 +7913,14 @@ QByteArray NoteStore_getNoteVersion_prepareParams( bool withResourcesRecognition, bool withResourcesAlternateData) { + QEC_DEBUG("note_store", "NoteStore_getNoteVersion_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " updateSequenceNum = " << updateSequenceNum << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -7345,6 +7971,8 @@ QByteArray NoteStore_getNoteVersion_prepareParams( Note NoteStore_getNoteVersion_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNoteVersion_readReply"); + bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader r(reply); @@ -7444,6 +8072,14 @@ Note NoteStore::getNoteVersion( bool withResourcesAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteVersion"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " updateSequenceNum = " << updateSequenceNum << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -7466,6 +8102,14 @@ AsyncResult * NoteStore::getNoteVersionAsync( bool withResourcesAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNoteVersionAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " updateSequenceNum = " << updateSequenceNum << "\n" + << " withResourcesData = " << withResourcesData << "\n" + << " withResourcesRecognition = " << withResourcesRecognition << "\n" + << " withResourcesAlternateData = " << withResourcesAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -7491,6 +8135,14 @@ QByteArray NoteStore_getResource_prepareParams( bool withAttributes, bool withAlternateData) { + QEC_DEBUG("note_store", "NoteStore_getResource_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAttributes = " << withAttributes << "\n" + << " withAlternateData = " << withAlternateData); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -7541,6 +8193,8 @@ QByteArray NoteStore_getResource_prepareParams( Resource NoteStore_getResource_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResource_readReply"); + bool resultIsSet = false; Resource result = Resource(); ThriftBinaryBufferReader r(reply); @@ -7640,6 +8294,14 @@ Resource NoteStore::getResource( bool withAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResource"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAttributes = " << withAttributes << "\n" + << " withAlternateData = " << withAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -7662,6 +8324,14 @@ AsyncResult * NoteStore::getResourceAsync( bool withAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAttributes = " << withAttributes << "\n" + << " withAlternateData = " << withAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -7683,6 +8353,10 @@ QByteArray NoteStore_getResourceApplicationData_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceApplicationData_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -7709,6 +8383,8 @@ QByteArray NoteStore_getResourceApplicationData_prepareParams( LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceApplicationData_readReply"); + bool resultIsSet = false; LazyMap result = LazyMap(); ThriftBinaryBufferReader r(reply); @@ -7804,6 +8480,10 @@ LazyMap NoteStore::getResourceApplicationData( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -7818,6 +8498,10 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -7836,6 +8520,11 @@ QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( Guid guid, QString key) { + QEC_DEBUG("note_store", "NoteStore_getResourceApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -7868,6 +8557,8 @@ QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceApplicationDataEntry_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -7964,6 +8655,11 @@ QString NoteStore::getResourceApplicationDataEntry( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -7980,6 +8676,11 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -8000,6 +8701,12 @@ QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( QString key, QString value) { + QEC_DEBUG("note_store", "NoteStore_setResourceApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8038,6 +8745,8 @@ QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_setResourceApplicationDataEntry_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -8135,6 +8844,12 @@ qint32 NoteStore::setResourceApplicationDataEntry( QString value, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + if (!ctx) { ctx = m_ctx; } @@ -8153,6 +8868,12 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( QString value, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key << "\n" + << " value = " << value); + if (!ctx) { ctx = m_ctx; } @@ -8173,6 +8894,11 @@ QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( Guid guid, QString key) { + QEC_DEBUG("note_store", "NoteStore_unsetResourceApplicationDataEntry_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8205,6 +8931,8 @@ QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_unsetResourceApplicationDataEntry_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -8301,6 +9029,11 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -8317,6 +9050,11 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( QString key, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntryAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " key = " << key); + if (!ctx) { ctx = m_ctx; } @@ -8335,6 +9073,10 @@ QByteArray NoteStore_updateResource_prepareParams( QString authenticationToken, const Resource & resource) { + QEC_DEBUG("note_store", "NoteStore_updateResource_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " resource = " << resource); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8361,6 +9103,8 @@ QByteArray NoteStore_updateResource_prepareParams( qint32 NoteStore_updateResource_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateResource_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -8456,6 +9200,10 @@ qint32 NoteStore::updateResource( const Resource & resource, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateResource"); + QEC_TRACE("note_store", "Parameters:\n" + << " resource = " << resource); + if (!ctx) { ctx = m_ctx; } @@ -8470,6 +9218,10 @@ AsyncResult * NoteStore::updateResourceAsync( const Resource & resource, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateResourceAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " resource = " << resource); + if (!ctx) { ctx = m_ctx; } @@ -8487,6 +9239,10 @@ QByteArray NoteStore_getResourceData_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceData_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8513,6 +9269,8 @@ QByteArray NoteStore_getResourceData_prepareParams( QByteArray NoteStore_getResourceData_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceData_readReply"); + bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader r(reply); @@ -8608,6 +9366,10 @@ QByteArray NoteStore::getResourceData( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceData"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -8622,6 +9384,10 @@ AsyncResult * NoteStore::getResourceDataAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceDataAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -8643,6 +9409,14 @@ QByteArray NoteStore_getResourceByHash_prepareParams( bool withRecognition, bool withAlternateData) { + QEC_DEBUG("note_store", "NoteStore_getResourceByHash_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " contentHash = " << contentHash << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAlternateData = " << withAlternateData); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8693,6 +9467,8 @@ QByteArray NoteStore_getResourceByHash_prepareParams( Resource NoteStore_getResourceByHash_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceByHash_readReply"); + bool resultIsSet = false; Resource result = Resource(); ThriftBinaryBufferReader r(reply); @@ -8792,6 +9568,14 @@ Resource NoteStore::getResourceByHash( bool withAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceByHash"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " contentHash = " << contentHash << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAlternateData = " << withAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -8814,6 +9598,14 @@ AsyncResult * NoteStore::getResourceByHashAsync( bool withAlternateData, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceByHashAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid << "\n" + << " contentHash = " << contentHash << "\n" + << " withData = " << withData << "\n" + << " withRecognition = " << withRecognition << "\n" + << " withAlternateData = " << withAlternateData); + if (!ctx) { ctx = m_ctx; } @@ -8835,6 +9627,10 @@ QByteArray NoteStore_getResourceRecognition_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceRecognition_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -8861,6 +9657,8 @@ QByteArray NoteStore_getResourceRecognition_prepareParams( QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceRecognition_readReply"); + bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader r(reply); @@ -8956,6 +9754,10 @@ QByteArray NoteStore::getResourceRecognition( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceRecognition"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -8970,6 +9772,10 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceRecognitionAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -8987,6 +9793,10 @@ QByteArray NoteStore_getResourceAlternateData_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceAlternateData_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9013,6 +9823,8 @@ QByteArray NoteStore_getResourceAlternateData_prepareParams( QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceAlternateData_readReply"); + bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader r(reply); @@ -9108,6 +9920,10 @@ QByteArray NoteStore::getResourceAlternateData( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -9122,6 +9938,10 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceAlternateDataAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -9139,6 +9959,10 @@ QByteArray NoteStore_getResourceAttributes_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_getResourceAttributes_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9165,6 +9989,8 @@ QByteArray NoteStore_getResourceAttributes_prepareParams( ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getResourceAttributes_readReply"); + bool resultIsSet = false; ResourceAttributes result = ResourceAttributes(); ThriftBinaryBufferReader r(reply); @@ -9260,6 +10086,10 @@ ResourceAttributes NoteStore::getResourceAttributes( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceAttributes"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -9274,6 +10104,10 @@ AsyncResult * NoteStore::getResourceAttributesAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getResourceAttributesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -9291,6 +10125,11 @@ QByteArray NoteStore_getPublicNotebook_prepareParams( UserID userId, QString publicUri) { + QEC_DEBUG("note_store", "NoteStore_getPublicNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " userId = " << userId << "\n" + << " publicUri = " << publicUri); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9317,6 +10156,8 @@ QByteArray NoteStore_getPublicNotebook_prepareParams( Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getPublicNotebook_readReply"); + bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader r(reply); @@ -9403,6 +10244,11 @@ Notebook NoteStore::getPublicNotebook( QString publicUri, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getPublicNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " userId = " << userId << "\n" + << " publicUri = " << publicUri); + if (!ctx) { ctx = m_ctx; } @@ -9418,6 +10264,11 @@ AsyncResult * NoteStore::getPublicNotebookAsync( QString publicUri, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getPublicNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " userId = " << userId << "\n" + << " publicUri = " << publicUri); + if (!ctx) { ctx = m_ctx; } @@ -9436,6 +10287,11 @@ QByteArray NoteStore_shareNotebook_prepareParams( const SharedNotebook & sharedNotebook, QString message) { + QEC_DEBUG("note_store", "NoteStore_shareNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook << "\n" + << " message = " << message); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9468,6 +10324,8 @@ QByteArray NoteStore_shareNotebook_prepareParams( SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_shareNotebook_readReply"); + bool resultIsSet = false; SharedNotebook result = SharedNotebook(); ThriftBinaryBufferReader r(reply); @@ -9564,6 +10422,11 @@ SharedNotebook NoteStore::shareNotebook( QString message, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::shareNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook << "\n" + << " message = " << message); + if (!ctx) { ctx = m_ctx; } @@ -9580,6 +10443,11 @@ AsyncResult * NoteStore::shareNotebookAsync( QString message, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::shareNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook << "\n" + << " message = " << message); + if (!ctx) { ctx = m_ctx; } @@ -9598,6 +10466,10 @@ QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( QString authenticationToken, const NotebookShareTemplate & shareTemplate) { + QEC_DEBUG("note_store", "NoteStore_createOrUpdateNotebookShares_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareTemplate = " << shareTemplate); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9624,6 +10496,8 @@ QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createOrUpdateNotebookShares_readReply"); + bool resultIsSet = false; CreateOrUpdateNotebookSharesResult result = CreateOrUpdateNotebookSharesResult(); ThriftBinaryBufferReader r(reply); @@ -9729,6 +10603,10 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( const NotebookShareTemplate & shareTemplate, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareTemplate = " << shareTemplate); + if (!ctx) { ctx = m_ctx; } @@ -9743,6 +10621,10 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( const NotebookShareTemplate & shareTemplate, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookSharesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareTemplate = " << shareTemplate); + if (!ctx) { ctx = m_ctx; } @@ -9760,6 +10642,10 @@ QByteArray NoteStore_updateSharedNotebook_prepareParams( QString authenticationToken, const SharedNotebook & sharedNotebook) { + QEC_DEBUG("note_store", "NoteStore_updateSharedNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9786,6 +10672,8 @@ QByteArray NoteStore_updateSharedNotebook_prepareParams( qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateSharedNotebook_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -9881,6 +10769,10 @@ qint32 NoteStore::updateSharedNotebook( const SharedNotebook & sharedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -9895,6 +10787,10 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( const SharedNotebook & sharedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateSharedNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -9913,6 +10809,11 @@ QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( QString notebookGuid, const NotebookRecipientSettings & recipientSettings) { + QEC_DEBUG("note_store", "NoteStore_setNotebookRecipientSettings_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid << "\n" + << " recipientSettings = " << recipientSettings); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -9945,6 +10846,8 @@ QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_setNotebookRecipientSettings_readReply"); + bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader r(reply); @@ -10041,6 +10944,11 @@ Notebook NoteStore::setNotebookRecipientSettings( const NotebookRecipientSettings & recipientSettings, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid << "\n" + << " recipientSettings = " << recipientSettings); + if (!ctx) { ctx = m_ctx; } @@ -10057,6 +10965,11 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( const NotebookRecipientSettings & recipientSettings, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettingsAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid << "\n" + << " recipientSettings = " << recipientSettings); + if (!ctx) { ctx = m_ctx; } @@ -10074,6 +10987,8 @@ namespace { QByteArray NoteStore_listSharedNotebooks_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listSharedNotebooks_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10094,6 +11009,8 @@ QByteArray NoteStore_listSharedNotebooks_prepareParams( QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listSharedNotebooks_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -10202,6 +11119,8 @@ QVariant NoteStore_listSharedNotebooks_readReplyAsync(QByteArray reply) QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks"); + if (!ctx) { ctx = m_ctx; } @@ -10214,6 +11133,8 @@ QList NoteStore::listSharedNotebooks( AsyncResult * NoteStore::listSharedNotebooksAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listSharedNotebooksAsync"); + if (!ctx) { ctx = m_ctx; } @@ -10230,6 +11151,10 @@ QByteArray NoteStore_createLinkedNotebook_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { + QEC_DEBUG("note_store", "NoteStore_createLinkedNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10256,6 +11181,8 @@ QByteArray NoteStore_createLinkedNotebook_prepareParams( LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_createLinkedNotebook_readReply"); + bool resultIsSet = false; LinkedNotebook result = LinkedNotebook(); ThriftBinaryBufferReader r(reply); @@ -10351,6 +11278,10 @@ LinkedNotebook NoteStore::createLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -10365,6 +11296,10 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::createLinkedNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -10382,6 +11317,10 @@ QByteArray NoteStore_updateLinkedNotebook_prepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { + QEC_DEBUG("note_store", "NoteStore_updateLinkedNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10408,6 +11347,8 @@ QByteArray NoteStore_updateLinkedNotebook_prepareParams( qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateLinkedNotebook_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -10503,6 +11444,10 @@ qint32 NoteStore::updateLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -10517,6 +11462,10 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + if (!ctx) { ctx = m_ctx; } @@ -10533,6 +11482,8 @@ namespace { QByteArray NoteStore_listLinkedNotebooks_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_listLinkedNotebooks_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10553,6 +11504,8 @@ QByteArray NoteStore_listLinkedNotebooks_prepareParams( QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_listLinkedNotebooks_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -10661,6 +11614,8 @@ QVariant NoteStore_listLinkedNotebooks_readReplyAsync(QByteArray reply) QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks"); + if (!ctx) { ctx = m_ctx; } @@ -10673,6 +11628,8 @@ QList NoteStore::listLinkedNotebooks( AsyncResult * NoteStore::listLinkedNotebooksAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooksAsync"); + if (!ctx) { ctx = m_ctx; } @@ -10689,6 +11646,10 @@ QByteArray NoteStore_expungeLinkedNotebook_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_expungeLinkedNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10715,6 +11676,8 @@ QByteArray NoteStore_expungeLinkedNotebook_prepareParams( qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_expungeLinkedNotebook_readReply"); + bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader r(reply); @@ -10810,6 +11773,10 @@ qint32 NoteStore::expungeLinkedNotebook( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -10824,6 +11791,10 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -10841,6 +11812,10 @@ QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( QString shareKeyOrGlobalId, QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNotebook_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -10867,6 +11842,8 @@ QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNotebook_readReply"); + bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader r(reply); @@ -10962,6 +11939,10 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( QString shareKeyOrGlobalId, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); + if (!ctx) { ctx = m_ctx; } @@ -10976,6 +11957,10 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( QString shareKeyOrGlobalId, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebookAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); + if (!ctx) { ctx = m_ctx; } @@ -10992,6 +11977,8 @@ namespace { QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_getSharedNotebookByAuth_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11012,6 +11999,8 @@ QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getSharedNotebookByAuth_readReply"); + bool resultIsSet = false; SharedNotebook result = SharedNotebook(); ThriftBinaryBufferReader r(reply); @@ -11106,6 +12095,8 @@ QVariant NoteStore_getSharedNotebookByAuth_readReplyAsync(QByteArray reply) SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth"); + if (!ctx) { ctx = m_ctx; } @@ -11118,6 +12109,8 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( AsyncResult * NoteStore::getSharedNotebookByAuthAsync( IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuthAsync"); + if (!ctx) { ctx = m_ctx; } @@ -11134,6 +12127,10 @@ QByteArray NoteStore_emailNote_prepareParams( QString authenticationToken, const NoteEmailParameters & parameters) { + QEC_DEBUG("note_store", "NoteStore_emailNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11160,6 +12157,8 @@ QByteArray NoteStore_emailNote_prepareParams( void NoteStore_emailNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_emailNote_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -11238,6 +12237,10 @@ void NoteStore::emailNote( const NoteEmailParameters & parameters, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::emailNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + if (!ctx) { ctx = m_ctx; } @@ -11252,6 +12255,10 @@ AsyncResult * NoteStore::emailNoteAsync( const NoteEmailParameters & parameters, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::emailNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + if (!ctx) { ctx = m_ctx; } @@ -11269,6 +12276,10 @@ QByteArray NoteStore_shareNote_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_shareNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11295,6 +12306,8 @@ QByteArray NoteStore_shareNote_prepareParams( QString NoteStore_shareNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_shareNote_readReply"); + bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader r(reply); @@ -11390,6 +12403,10 @@ QString NoteStore::shareNote( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::shareNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -11404,6 +12421,10 @@ AsyncResult * NoteStore::shareNoteAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::shareNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -11421,6 +12442,10 @@ QByteArray NoteStore_stopSharingNote_prepareParams( QString authenticationToken, Guid guid) { + QEC_DEBUG("note_store", "NoteStore_stopSharingNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11447,6 +12472,8 @@ QByteArray NoteStore_stopSharingNote_prepareParams( void NoteStore_stopSharingNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_stopSharingNote_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -11525,6 +12552,10 @@ void NoteStore::stopSharingNote( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::stopSharingNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -11539,6 +12570,10 @@ AsyncResult * NoteStore::stopSharingNoteAsync( Guid guid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::stopSharingNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + if (!ctx) { ctx = m_ctx; } @@ -11557,6 +12592,11 @@ QByteArray NoteStore_authenticateToSharedNote_prepareParams( QString noteKey, QString authenticationToken) { + QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNote_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteKey = " << noteKey); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11589,6 +12629,8 @@ QByteArray NoteStore_authenticateToSharedNote_prepareParams( AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNote_readReply"); + bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader r(reply); @@ -11685,6 +12727,11 @@ AuthenticationResult NoteStore::authenticateToSharedNote( QString noteKey, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteKey = " << noteKey); + if (!ctx) { ctx = m_ctx; } @@ -11701,6 +12748,11 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( QString noteKey, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNoteAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid << "\n" + << " noteKey = " << noteKey); + if (!ctx) { ctx = m_ctx; } @@ -11720,6 +12772,11 @@ QByteArray NoteStore_findRelated_prepareParams( const RelatedQuery & query, const RelatedResultSpec & resultSpec) { + QEC_DEBUG("note_store", "NoteStore_findRelated_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " query = " << query << "\n" + << " resultSpec = " << resultSpec); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11752,6 +12809,8 @@ QByteArray NoteStore_findRelated_prepareParams( RelatedResult NoteStore_findRelated_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_findRelated_readReply"); + bool resultIsSet = false; RelatedResult result = RelatedResult(); ThriftBinaryBufferReader r(reply); @@ -11848,6 +12907,11 @@ RelatedResult NoteStore::findRelated( const RelatedResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findRelated"); + QEC_TRACE("note_store", "Parameters:\n" + << " query = " << query << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -11864,6 +12928,11 @@ AsyncResult * NoteStore::findRelatedAsync( const RelatedResultSpec & resultSpec, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::findRelatedAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " query = " << query << "\n" + << " resultSpec = " << resultSpec); + if (!ctx) { ctx = m_ctx; } @@ -11882,6 +12951,10 @@ QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( QString authenticationToken, const Note & note) { + QEC_DEBUG("note_store", "NoteStore_updateNoteIfUsnMatches_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -11908,6 +12981,8 @@ QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_updateNoteIfUsnMatches_readReply"); + bool resultIsSet = false; UpdateNoteIfUsnMatchesResult result = UpdateNoteIfUsnMatchesResult(); ThriftBinaryBufferReader r(reply); @@ -12003,6 +13078,10 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -12017,6 +13096,10 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( const Note & note, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatchesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + if (!ctx) { ctx = m_ctx; } @@ -12034,6 +13117,10 @@ QByteArray NoteStore_manageNotebookShares_prepareParams( QString authenticationToken, const ManageNotebookSharesParameters & parameters) { + QEC_DEBUG("note_store", "NoteStore_manageNotebookShares_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12060,6 +13147,8 @@ QByteArray NoteStore_manageNotebookShares_prepareParams( ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_manageNotebookShares_readReply"); + bool resultIsSet = false; ManageNotebookSharesResult result = ManageNotebookSharesResult(); ThriftBinaryBufferReader r(reply); @@ -12155,6 +13244,10 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( const ManageNotebookSharesParameters & parameters, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::manageNotebookShares"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + if (!ctx) { ctx = m_ctx; } @@ -12169,6 +13262,10 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( const ManageNotebookSharesParameters & parameters, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::manageNotebookSharesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + if (!ctx) { ctx = m_ctx; } @@ -12186,6 +13283,10 @@ QByteArray NoteStore_getNotebookShares_prepareParams( QString authenticationToken, QString notebookGuid) { + QEC_DEBUG("note_store", "NoteStore_getNotebookShares_prepareParams"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12212,6 +13313,8 @@ QByteArray NoteStore_getNotebookShares_prepareParams( ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) { + QEC_DEBUG("note_store", "NoteStore_getNotebookShares_readReply"); + bool resultIsSet = false; ShareRelationships result = ShareRelationships(); ThriftBinaryBufferReader r(reply); @@ -12307,6 +13410,10 @@ ShareRelationships NoteStore::getNotebookShares( QString notebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNotebookShares"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -12321,6 +13428,10 @@ AsyncResult * NoteStore::getNotebookSharesAsync( QString notebookGuid, IRequestContextPtr ctx) { + QEC_DEBUG("note_store", "NoteStore::getNotebookSharesAsync"); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + if (!ctx) { ctx = m_ctx; } @@ -12501,6 +13612,12 @@ QByteArray UserStore_checkVersion_prepareParams( qint16 edamVersionMajor, qint16 edamVersionMinor) { + QEC_DEBUG("user_store", "UserStore_checkVersion_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " clientName = " << clientName << "\n" + << " edamVersionMajor = " << edamVersionMajor << "\n" + << " edamVersionMinor = " << edamVersionMinor); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12533,6 +13650,8 @@ QByteArray UserStore_checkVersion_prepareParams( bool UserStore_checkVersion_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_checkVersion_readReply"); + bool resultIsSet = false; bool result = bool(); ThriftBinaryBufferReader r(reply); @@ -12600,6 +13719,12 @@ bool UserStore::checkVersion( qint16 edamVersionMinor, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::checkVersion"); + QEC_TRACE("user_store", "Parameters:\n" + << " clientName = " << clientName << "\n" + << " edamVersionMajor = " << edamVersionMajor << "\n" + << " edamVersionMinor = " << edamVersionMinor); + if (!ctx) { ctx = m_ctx; } @@ -12617,6 +13742,12 @@ AsyncResult * UserStore::checkVersionAsync( qint16 edamVersionMinor, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::checkVersionAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " clientName = " << clientName << "\n" + << " edamVersionMajor = " << edamVersionMajor << "\n" + << " edamVersionMinor = " << edamVersionMinor); + if (!ctx) { ctx = m_ctx; } @@ -12634,6 +13765,10 @@ namespace { QByteArray UserStore_getBootstrapInfo_prepareParams( QString locale) { + QEC_DEBUG("user_store", "UserStore_getBootstrapInfo_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " locale = " << locale); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12654,6 +13789,8 @@ QByteArray UserStore_getBootstrapInfo_prepareParams( BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_getBootstrapInfo_readReply"); + bool resultIsSet = false; BootstrapInfo result = BootstrapInfo(); ThriftBinaryBufferReader r(reply); @@ -12719,6 +13856,10 @@ BootstrapInfo UserStore::getBootstrapInfo( QString locale, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getBootstrapInfo"); + QEC_TRACE("user_store", "Parameters:\n" + << " locale = " << locale); + if (!ctx) { ctx = m_ctx; } @@ -12732,6 +13873,10 @@ AsyncResult * UserStore::getBootstrapInfoAsync( QString locale, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getBootstrapInfoAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " locale = " << locale); + if (!ctx) { ctx = m_ctx; } @@ -12753,6 +13898,13 @@ QByteArray UserStore_authenticateLongSession_prepareParams( QString deviceDescription, bool supportsTwoFactor) { + QEC_DEBUG("user_store", "UserStore_authenticateLongSession_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username << "\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription << "\n" + << " supportsTwoFactor = " << supportsTwoFactor); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12809,6 +13961,8 @@ QByteArray UserStore_authenticateLongSession_prepareParams( AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_authenticateLongSession_readReply"); + bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader r(reply); @@ -12900,6 +14054,13 @@ AuthenticationResult UserStore::authenticateLongSession( bool supportsTwoFactor, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::authenticateLongSession"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username << "\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription << "\n" + << " supportsTwoFactor = " << supportsTwoFactor); + if (!ctx) { ctx = m_ctx; } @@ -12925,6 +14086,13 @@ AsyncResult * UserStore::authenticateLongSessionAsync( bool supportsTwoFactor, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::authenticateLongSessionAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username << "\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription << "\n" + << " supportsTwoFactor = " << supportsTwoFactor); + if (!ctx) { ctx = m_ctx; } @@ -12949,6 +14117,11 @@ QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( QString deviceIdentifier, QString deviceDescription) { + QEC_DEBUG("user_store", "UserStore_completeTwoFactorAuthentication_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -12987,6 +14160,8 @@ QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_completeTwoFactorAuthentication_readReply"); + bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader r(reply); @@ -13074,6 +14249,11 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( QString deviceDescription, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication"); + QEC_TRACE("user_store", "Parameters:\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription); + if (!ctx) { ctx = m_ctx; } @@ -13092,6 +14272,11 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( QString deviceDescription, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthenticationAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " deviceIdentifier = " << deviceIdentifier << "\n" + << " deviceDescription = " << deviceDescription); + if (!ctx) { ctx = m_ctx; } @@ -13110,6 +14295,8 @@ namespace { QByteArray UserStore_revokeLongSession_prepareParams( QString authenticationToken) { + QEC_DEBUG("user_store", "UserStore_revokeLongSession_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13130,6 +14317,8 @@ QByteArray UserStore_revokeLongSession_prepareParams( void UserStore_revokeLongSession_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_revokeLongSession_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -13197,6 +14386,8 @@ QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) void UserStore::revokeLongSession( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::revokeLongSession"); + if (!ctx) { ctx = m_ctx; } @@ -13209,6 +14400,8 @@ void UserStore::revokeLongSession( AsyncResult * UserStore::revokeLongSessionAsync( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::revokeLongSessionAsync"); + if (!ctx) { ctx = m_ctx; } @@ -13224,6 +14417,8 @@ namespace { QByteArray UserStore_authenticateToBusiness_prepareParams( QString authenticationToken) { + QEC_DEBUG("user_store", "UserStore_authenticateToBusiness_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13244,6 +14439,8 @@ QByteArray UserStore_authenticateToBusiness_prepareParams( AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_authenticateToBusiness_readReply"); + bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader r(reply); @@ -13328,6 +14525,8 @@ QVariant UserStore_authenticateToBusiness_readReplyAsync(QByteArray reply) AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::authenticateToBusiness"); + if (!ctx) { ctx = m_ctx; } @@ -13340,6 +14539,8 @@ AuthenticationResult UserStore::authenticateToBusiness( AsyncResult * UserStore::authenticateToBusinessAsync( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::authenticateToBusinessAsync"); + if (!ctx) { ctx = m_ctx; } @@ -13355,6 +14556,8 @@ namespace { QByteArray UserStore_getUser_prepareParams( QString authenticationToken) { + QEC_DEBUG("user_store", "UserStore_getUser_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13375,6 +14578,8 @@ QByteArray UserStore_getUser_prepareParams( User UserStore_getUser_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_getUser_readReply"); + bool resultIsSet = false; User result = User(); ThriftBinaryBufferReader r(reply); @@ -13459,6 +14664,8 @@ QVariant UserStore_getUser_readReplyAsync(QByteArray reply) User UserStore::getUser( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getUser"); + if (!ctx) { ctx = m_ctx; } @@ -13471,6 +14678,8 @@ User UserStore::getUser( AsyncResult * UserStore::getUserAsync( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getUserAsync"); + if (!ctx) { ctx = m_ctx; } @@ -13486,6 +14695,10 @@ namespace { QByteArray UserStore_getPublicUserInfo_prepareParams( QString username) { + QEC_DEBUG("user_store", "UserStore_getPublicUserInfo_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13506,6 +14719,8 @@ QByteArray UserStore_getPublicUserInfo_prepareParams( PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_getPublicUserInfo_readReply"); + bool resultIsSet = false; PublicUserInfo result = PublicUserInfo(); ThriftBinaryBufferReader r(reply); @@ -13601,6 +14816,10 @@ PublicUserInfo UserStore::getPublicUserInfo( QString username, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getPublicUserInfo"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username); + if (!ctx) { ctx = m_ctx; } @@ -13614,6 +14833,10 @@ AsyncResult * UserStore::getPublicUserInfoAsync( QString username, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getPublicUserInfoAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username); + if (!ctx) { ctx = m_ctx; } @@ -13629,6 +14852,8 @@ namespace { QByteArray UserStore_getUserUrls_prepareParams( QString authenticationToken) { + QEC_DEBUG("user_store", "UserStore_getUserUrls_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13649,6 +14874,8 @@ QByteArray UserStore_getUserUrls_prepareParams( UserUrls UserStore_getUserUrls_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_getUserUrls_readReply"); + bool resultIsSet = false; UserUrls result = UserUrls(); ThriftBinaryBufferReader r(reply); @@ -13733,6 +14960,8 @@ QVariant UserStore_getUserUrls_readReplyAsync(QByteArray reply) UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getUserUrls"); + if (!ctx) { ctx = m_ctx; } @@ -13745,6 +14974,8 @@ UserUrls UserStore::getUserUrls( AsyncResult * UserStore::getUserUrlsAsync( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getUserUrlsAsync"); + if (!ctx) { ctx = m_ctx; } @@ -13761,6 +14992,10 @@ QByteArray UserStore_inviteToBusiness_prepareParams( QString authenticationToken, QString emailAddress) { + QEC_DEBUG("user_store", "UserStore_inviteToBusiness_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13787,6 +15022,8 @@ QByteArray UserStore_inviteToBusiness_prepareParams( void UserStore_inviteToBusiness_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_inviteToBusiness_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -13855,6 +15092,10 @@ void UserStore::inviteToBusiness( QString emailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::inviteToBusiness"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + if (!ctx) { ctx = m_ctx; } @@ -13869,6 +15110,10 @@ AsyncResult * UserStore::inviteToBusinessAsync( QString emailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::inviteToBusinessAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + if (!ctx) { ctx = m_ctx; } @@ -13886,6 +15131,10 @@ QByteArray UserStore_removeFromBusiness_prepareParams( QString authenticationToken, QString emailAddress) { + QEC_DEBUG("user_store", "UserStore_removeFromBusiness_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -13912,6 +15161,8 @@ QByteArray UserStore_removeFromBusiness_prepareParams( void UserStore_removeFromBusiness_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_removeFromBusiness_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -13990,6 +15241,10 @@ void UserStore::removeFromBusiness( QString emailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::removeFromBusiness"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + if (!ctx) { ctx = m_ctx; } @@ -14004,6 +15259,10 @@ AsyncResult * UserStore::removeFromBusinessAsync( QString emailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::removeFromBusinessAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + if (!ctx) { ctx = m_ctx; } @@ -14022,6 +15281,11 @@ QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( QString oldEmailAddress, QString newEmailAddress) { + QEC_DEBUG("user_store", "UserStore_updateBusinessUserIdentifier_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " oldEmailAddress = " << oldEmailAddress << "\n" + << " newEmailAddress = " << newEmailAddress); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -14054,6 +15318,8 @@ QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_updateBusinessUserIdentifier_readReply"); + ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; @@ -14133,6 +15399,11 @@ void UserStore::updateBusinessUserIdentifier( QString newEmailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier"); + QEC_TRACE("user_store", "Parameters:\n" + << " oldEmailAddress = " << oldEmailAddress << "\n" + << " newEmailAddress = " << newEmailAddress); + if (!ctx) { ctx = m_ctx; } @@ -14149,6 +15420,11 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( QString newEmailAddress, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifierAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " oldEmailAddress = " << oldEmailAddress << "\n" + << " newEmailAddress = " << newEmailAddress); + if (!ctx) { ctx = m_ctx; } @@ -14166,6 +15442,8 @@ namespace { QByteArray UserStore_listBusinessUsers_prepareParams( QString authenticationToken) { + QEC_DEBUG("user_store", "UserStore_listBusinessUsers_prepareParams"); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -14186,6 +15464,8 @@ QByteArray UserStore_listBusinessUsers_prepareParams( QList UserStore_listBusinessUsers_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_listBusinessUsers_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -14284,6 +15564,8 @@ QVariant UserStore_listBusinessUsers_readReplyAsync(QByteArray reply) QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::listBusinessUsers"); + if (!ctx) { ctx = m_ctx; } @@ -14296,6 +15578,8 @@ QList UserStore::listBusinessUsers( AsyncResult * UserStore::listBusinessUsersAsync( IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::listBusinessUsersAsync"); + if (!ctx) { ctx = m_ctx; } @@ -14312,6 +15596,10 @@ QByteArray UserStore_listBusinessInvitations_prepareParams( QString authenticationToken, bool includeRequestedInvitations) { + QEC_DEBUG("user_store", "UserStore_listBusinessInvitations_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " includeRequestedInvitations = " << includeRequestedInvitations); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -14338,6 +15626,8 @@ QByteArray UserStore_listBusinessInvitations_prepareParams( QList UserStore_listBusinessInvitations_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_listBusinessInvitations_readReply"); + bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader r(reply); @@ -14437,6 +15727,10 @@ QList UserStore::listBusinessInvitations( bool includeRequestedInvitations, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::listBusinessInvitations"); + QEC_TRACE("user_store", "Parameters:\n" + << " includeRequestedInvitations = " << includeRequestedInvitations); + if (!ctx) { ctx = m_ctx; } @@ -14451,6 +15745,10 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( bool includeRequestedInvitations, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::listBusinessInvitationsAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " includeRequestedInvitations = " << includeRequestedInvitations); + if (!ctx) { ctx = m_ctx; } @@ -14467,6 +15765,10 @@ namespace { QByteArray UserStore_getAccountLimits_prepareParams( ServiceLevel serviceLevel) { + QEC_DEBUG("user_store", "UserStore_getAccountLimits_prepareParams"); + QEC_TRACE("user_store", "Parameters:\n" + << " serviceLevel = " << serviceLevel); + ThriftBinaryBufferWriter w; qint32 cseqid = 0; w.writeMessageBegin( @@ -14487,6 +15789,8 @@ QByteArray UserStore_getAccountLimits_prepareParams( AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) { + QEC_DEBUG("user_store", "UserStore_getAccountLimits_readReply"); + bool resultIsSet = false; AccountLimits result = AccountLimits(); ThriftBinaryBufferReader r(reply); @@ -14562,6 +15866,10 @@ AccountLimits UserStore::getAccountLimits( ServiceLevel serviceLevel, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getAccountLimits"); + QEC_TRACE("user_store", "Parameters:\n" + << " serviceLevel = " << serviceLevel); + if (!ctx) { ctx = m_ctx; } @@ -14575,6 +15883,10 @@ AsyncResult * UserStore::getAccountLimitsAsync( ServiceLevel serviceLevel, IRequestContextPtr ctx) { + QEC_DEBUG("user_store", "UserStore::getAccountLimitsAsync"); + QEC_TRACE("user_store", "Parameters:\n" + << " serviceLevel = " << serviceLevel); + if (!ctx) { ctx = m_ctx; } From 4f8f486c169031d06bfe6af935c899a1d2f50b90 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 25 Oct 2019 07:13:22 +0300 Subject: [PATCH 049/188] Update generated code - remove redundant trace logs --- QEverCloud/src/generated/Services.cpp | 200 -------------------------- 1 file changed, 200 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index db2456de..3047dcb7 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -872,10 +872,6 @@ QByteArray NoteStore_getFilteredSyncChunk_prepareParams( const SyncChunkFilter & filter) { QEC_DEBUG("note_store", "NoteStore_getFilteredSyncChunk_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " afterUSN = " << afterUSN << "\n" - << " maxEntries = " << maxEntries << "\n" - << " filter = " << filter); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -1054,8 +1050,6 @@ QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( const LinkedNotebook & linkedNotebook) { QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncState_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -1223,11 +1217,6 @@ QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( bool fullSyncOnly) { QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncChunk_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook << "\n" - << " afterUSN = " << afterUSN << "\n" - << " maxEntries = " << maxEntries << "\n" - << " fullSyncOnly = " << fullSyncOnly); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -1734,8 +1723,6 @@ QByteArray NoteStore_getNotebook_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2039,8 +2026,6 @@ QByteArray NoteStore_createNotebook_prepareParams( const Notebook & notebook) { QEC_DEBUG("note_store", "NoteStore_createNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebook = " << notebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2205,8 +2190,6 @@ QByteArray NoteStore_updateNotebook_prepareParams( const Notebook & notebook) { QEC_DEBUG("note_store", "NoteStore_updateNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebook = " << notebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2371,8 +2354,6 @@ QByteArray NoteStore_expungeNotebook_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_expungeNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2690,8 +2671,6 @@ QByteArray NoteStore_listTagsByNotebook_prepareParams( Guid notebookGuid) { QEC_DEBUG("note_store", "NoteStore_listTagsByNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebookGuid = " << notebookGuid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -2870,8 +2849,6 @@ QByteArray NoteStore_getTag_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getTag_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3036,8 +3013,6 @@ QByteArray NoteStore_createTag_prepareParams( const Tag & tag) { QEC_DEBUG("note_store", "NoteStore_createTag_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " tag = " << tag); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3202,8 +3177,6 @@ QByteArray NoteStore_updateTag_prepareParams( const Tag & tag) { QEC_DEBUG("note_store", "NoteStore_updateTag_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " tag = " << tag); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3368,8 +3341,6 @@ QByteArray NoteStore_untagAll_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_untagAll_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3517,8 +3488,6 @@ QByteArray NoteStore_expungeTag_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_expungeTag_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -3836,8 +3805,6 @@ QByteArray NoteStore_getSearch_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getSearch_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4002,8 +3969,6 @@ QByteArray NoteStore_createSearch_prepareParams( const SavedSearch & search) { QEC_DEBUG("note_store", "NoteStore_createSearch_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " search = " << search); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4158,8 +4123,6 @@ QByteArray NoteStore_updateSearch_prepareParams( const SavedSearch & search) { QEC_DEBUG("note_store", "NoteStore_updateSearch_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " search = " << search); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4324,8 +4287,6 @@ QByteArray NoteStore_expungeSearch_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_expungeSearch_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4491,9 +4452,6 @@ QByteArray NoteStore_findNoteOffset_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_findNoteOffset_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " filter = " << filter << "\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4673,11 +4631,6 @@ QByteArray NoteStore_findNotesMetadata_prepareParams( const NotesMetadataResultSpec & resultSpec) { QEC_DEBUG("note_store", "NoteStore_findNotesMetadata_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " filter = " << filter << "\n" - << " offset = " << offset << "\n" - << " maxNotes = " << maxNotes << "\n" - << " resultSpec = " << resultSpec); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -4879,9 +4832,6 @@ QByteArray NoteStore_findNoteCounts_prepareParams( bool withTrash) { QEC_DEBUG("note_store", "NoteStore_findNoteCounts_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " filter = " << filter << "\n" - << " withTrash = " << withTrash); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5059,9 +5009,6 @@ QByteArray NoteStore_getNoteWithResultSpec_prepareParams( const NoteResultSpec & resultSpec) { QEC_DEBUG("note_store", "NoteStore_getNoteWithResultSpec_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " resultSpec = " << resultSpec); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5242,12 +5189,6 @@ QByteArray NoteStore_getNote_prepareParams( bool withResourcesAlternateData) { QEC_DEBUG("note_store", "NoteStore_getNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " withContent = " << withContent << "\n" - << " withResourcesData = " << withResourcesData << "\n" - << " withResourcesRecognition = " << withResourcesRecognition << "\n" - << " withResourcesAlternateData = " << withResourcesAlternateData); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5460,8 +5401,6 @@ QByteArray NoteStore_getNoteApplicationData_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getNoteApplicationData_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5627,9 +5566,6 @@ QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( QString key) { QEC_DEBUG("note_store", "NoteStore_getNoteApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -5808,10 +5744,6 @@ QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( QString value) { QEC_DEBUG("note_store", "NoteStore_setNoteApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key << "\n" - << " value = " << value); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6001,9 +5933,6 @@ QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( QString key) { QEC_DEBUG("note_store", "NoteStore_unsetNoteApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6180,8 +6109,6 @@ QByteArray NoteStore_getNoteContent_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getNoteContent_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6348,10 +6275,6 @@ QByteArray NoteStore_getNoteSearchText_prepareParams( bool tokenizeForIndexing) { QEC_DEBUG("note_store", "NoteStore_getNoteSearchText_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " noteOnly = " << noteOnly << "\n" - << " tokenizeForIndexing = " << tokenizeForIndexing); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6540,8 +6463,6 @@ QByteArray NoteStore_getResourceSearchText_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceSearchText_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6706,8 +6627,6 @@ QByteArray NoteStore_getNoteTagNames_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getNoteTagNames_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -6886,8 +6805,6 @@ QByteArray NoteStore_createNote_prepareParams( const Note & note) { QEC_DEBUG("note_store", "NoteStore_createNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7052,8 +6969,6 @@ QByteArray NoteStore_updateNote_prepareParams( const Note & note) { QEC_DEBUG("note_store", "NoteStore_updateNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7218,8 +7133,6 @@ QByteArray NoteStore_deleteNote_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_deleteNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7384,8 +7297,6 @@ QByteArray NoteStore_expungeNote_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_expungeNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7551,9 +7462,6 @@ QByteArray NoteStore_copyNote_prepareParams( Guid toNotebookGuid) { QEC_DEBUG("note_store", "NoteStore_copyNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " noteGuid = " << noteGuid << "\n" - << " toNotebookGuid = " << toNotebookGuid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7730,8 +7638,6 @@ QByteArray NoteStore_listNoteVersions_prepareParams( Guid noteGuid) { QEC_DEBUG("note_store", "NoteStore_listNoteVersions_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " noteGuid = " << noteGuid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -7914,12 +7820,6 @@ QByteArray NoteStore_getNoteVersion_prepareParams( bool withResourcesAlternateData) { QEC_DEBUG("note_store", "NoteStore_getNoteVersion_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " noteGuid = " << noteGuid << "\n" - << " updateSequenceNum = " << updateSequenceNum << "\n" - << " withResourcesData = " << withResourcesData << "\n" - << " withResourcesRecognition = " << withResourcesRecognition << "\n" - << " withResourcesAlternateData = " << withResourcesAlternateData); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8136,12 +8036,6 @@ QByteArray NoteStore_getResource_prepareParams( bool withAlternateData) { QEC_DEBUG("note_store", "NoteStore_getResource_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " withData = " << withData << "\n" - << " withRecognition = " << withRecognition << "\n" - << " withAttributes = " << withAttributes << "\n" - << " withAlternateData = " << withAlternateData); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8354,8 +8248,6 @@ QByteArray NoteStore_getResourceApplicationData_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceApplicationData_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8521,9 +8413,6 @@ QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( QString key) { QEC_DEBUG("note_store", "NoteStore_getResourceApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8702,10 +8591,6 @@ QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( QString value) { QEC_DEBUG("note_store", "NoteStore_setResourceApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key << "\n" - << " value = " << value); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -8895,9 +8780,6 @@ QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( QString key) { QEC_DEBUG("note_store", "NoteStore_unsetResourceApplicationDataEntry_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " key = " << key); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9074,8 +8956,6 @@ QByteArray NoteStore_updateResource_prepareParams( const Resource & resource) { QEC_DEBUG("note_store", "NoteStore_updateResource_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " resource = " << resource); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9240,8 +9120,6 @@ QByteArray NoteStore_getResourceData_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceData_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9410,12 +9288,6 @@ QByteArray NoteStore_getResourceByHash_prepareParams( bool withAlternateData) { QEC_DEBUG("note_store", "NoteStore_getResourceByHash_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " noteGuid = " << noteGuid << "\n" - << " contentHash = " << contentHash << "\n" - << " withData = " << withData << "\n" - << " withRecognition = " << withRecognition << "\n" - << " withAlternateData = " << withAlternateData); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9628,8 +9500,6 @@ QByteArray NoteStore_getResourceRecognition_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceRecognition_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9794,8 +9664,6 @@ QByteArray NoteStore_getResourceAlternateData_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceAlternateData_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -9960,8 +9828,6 @@ QByteArray NoteStore_getResourceAttributes_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_getResourceAttributes_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10126,9 +9992,6 @@ QByteArray NoteStore_getPublicNotebook_prepareParams( QString publicUri) { QEC_DEBUG("note_store", "NoteStore_getPublicNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " userId = " << userId << "\n" - << " publicUri = " << publicUri); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10288,9 +10151,6 @@ QByteArray NoteStore_shareNotebook_prepareParams( QString message) { QEC_DEBUG("note_store", "NoteStore_shareNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " sharedNotebook = " << sharedNotebook << "\n" - << " message = " << message); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10467,8 +10327,6 @@ QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( const NotebookShareTemplate & shareTemplate) { QEC_DEBUG("note_store", "NoteStore_createOrUpdateNotebookShares_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " shareTemplate = " << shareTemplate); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10643,8 +10501,6 @@ QByteArray NoteStore_updateSharedNotebook_prepareParams( const SharedNotebook & sharedNotebook) { QEC_DEBUG("note_store", "NoteStore_updateSharedNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " sharedNotebook = " << sharedNotebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -10810,9 +10666,6 @@ QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( const NotebookRecipientSettings & recipientSettings) { QEC_DEBUG("note_store", "NoteStore_setNotebookRecipientSettings_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebookGuid = " << notebookGuid << "\n" - << " recipientSettings = " << recipientSettings); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -11152,8 +11005,6 @@ QByteArray NoteStore_createLinkedNotebook_prepareParams( const LinkedNotebook & linkedNotebook) { QEC_DEBUG("note_store", "NoteStore_createLinkedNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -11318,8 +11169,6 @@ QByteArray NoteStore_updateLinkedNotebook_prepareParams( const LinkedNotebook & linkedNotebook) { QEC_DEBUG("note_store", "NoteStore_updateLinkedNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -11647,8 +11496,6 @@ QByteArray NoteStore_expungeLinkedNotebook_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_expungeLinkedNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -11813,8 +11660,6 @@ QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( QString authenticationToken) { QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNotebook_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12128,8 +11973,6 @@ QByteArray NoteStore_emailNote_prepareParams( const NoteEmailParameters & parameters) { QEC_DEBUG("note_store", "NoteStore_emailNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " parameters = " << parameters); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12277,8 +12120,6 @@ QByteArray NoteStore_shareNote_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_shareNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12443,8 +12284,6 @@ QByteArray NoteStore_stopSharingNote_prepareParams( Guid guid) { QEC_DEBUG("note_store", "NoteStore_stopSharingNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12593,9 +12432,6 @@ QByteArray NoteStore_authenticateToSharedNote_prepareParams( QString authenticationToken) { QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNote_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid << "\n" - << " noteKey = " << noteKey); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12773,9 +12609,6 @@ QByteArray NoteStore_findRelated_prepareParams( const RelatedResultSpec & resultSpec) { QEC_DEBUG("note_store", "NoteStore_findRelated_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " query = " << query << "\n" - << " resultSpec = " << resultSpec); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -12952,8 +12785,6 @@ QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( const Note & note) { QEC_DEBUG("note_store", "NoteStore_updateNoteIfUsnMatches_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -13118,8 +12949,6 @@ QByteArray NoteStore_manageNotebookShares_prepareParams( const ManageNotebookSharesParameters & parameters) { QEC_DEBUG("note_store", "NoteStore_manageNotebookShares_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " parameters = " << parameters); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -13284,8 +13113,6 @@ QByteArray NoteStore_getNotebookShares_prepareParams( QString notebookGuid) { QEC_DEBUG("note_store", "NoteStore_getNotebookShares_prepareParams"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebookGuid = " << notebookGuid); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -13613,10 +13440,6 @@ QByteArray UserStore_checkVersion_prepareParams( qint16 edamVersionMinor) { QEC_DEBUG("user_store", "UserStore_checkVersion_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " clientName = " << clientName << "\n" - << " edamVersionMajor = " << edamVersionMajor << "\n" - << " edamVersionMinor = " << edamVersionMinor); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -13766,8 +13589,6 @@ QByteArray UserStore_getBootstrapInfo_prepareParams( QString locale) { QEC_DEBUG("user_store", "UserStore_getBootstrapInfo_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " locale = " << locale); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -13899,11 +13720,6 @@ QByteArray UserStore_authenticateLongSession_prepareParams( bool supportsTwoFactor) { QEC_DEBUG("user_store", "UserStore_authenticateLongSession_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " username = " << username << "\n" - << " deviceIdentifier = " << deviceIdentifier << "\n" - << " deviceDescription = " << deviceDescription << "\n" - << " supportsTwoFactor = " << supportsTwoFactor); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -14118,9 +13934,6 @@ QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( QString deviceDescription) { QEC_DEBUG("user_store", "UserStore_completeTwoFactorAuthentication_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " deviceIdentifier = " << deviceIdentifier << "\n" - << " deviceDescription = " << deviceDescription); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -14696,8 +14509,6 @@ QByteArray UserStore_getPublicUserInfo_prepareParams( QString username) { QEC_DEBUG("user_store", "UserStore_getPublicUserInfo_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " username = " << username); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -14993,8 +14804,6 @@ QByteArray UserStore_inviteToBusiness_prepareParams( QString emailAddress) { QEC_DEBUG("user_store", "UserStore_inviteToBusiness_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " emailAddress = " << emailAddress); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -15132,8 +14941,6 @@ QByteArray UserStore_removeFromBusiness_prepareParams( QString emailAddress) { QEC_DEBUG("user_store", "UserStore_removeFromBusiness_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " emailAddress = " << emailAddress); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -15282,9 +15089,6 @@ QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( QString newEmailAddress) { QEC_DEBUG("user_store", "UserStore_updateBusinessUserIdentifier_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " oldEmailAddress = " << oldEmailAddress << "\n" - << " newEmailAddress = " << newEmailAddress); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -15597,8 +15401,6 @@ QByteArray UserStore_listBusinessInvitations_prepareParams( bool includeRequestedInvitations) { QEC_DEBUG("user_store", "UserStore_listBusinessInvitations_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " includeRequestedInvitations = " << includeRequestedInvitations); ThriftBinaryBufferWriter w; qint32 cseqid = 0; @@ -15766,8 +15568,6 @@ QByteArray UserStore_getAccountLimits_prepareParams( ServiceLevel serviceLevel) { QEC_DEBUG("user_store", "UserStore_getAccountLimits_prepareParams"); - QEC_TRACE("user_store", "Parameters:\n" - << " serviceLevel = " << serviceLevel); ThriftBinaryBufferWriter w; qint32 cseqid = 0; From e1dd2efac3d4ecef1b08ba5b9508190bd0b0e361 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 25 Oct 2019 08:00:38 +0300 Subject: [PATCH 050/188] Introduce separate timeouts for Evernote service calls --- QEverCloud/headers/AsyncResult.h | 4 +- QEverCloud/headers/InkNoteImageDownloader.h | 7 +- QEverCloud/headers/OAuth.h | 6 +- QEverCloud/headers/RequestContext.h | 8 +- QEverCloud/headers/Thumbnail.h | 8 +- QEverCloud/src/AsyncResult.cpp | 20 +- QEverCloud/src/AsyncResult_p.cpp | 37 +- QEverCloud/src/AsyncResult_p.h | 21 +- QEverCloud/src/DurableService.cpp | 2 +- QEverCloud/src/Http.cpp | 93 +- QEverCloud/src/Http.h | 52 +- QEverCloud/src/InkNoteImageDownloader.cpp | 6 +- QEverCloud/src/OAuth.cpp | 19 +- QEverCloud/src/RequestContext.cpp | 16 +- QEverCloud/src/Thumbnail.cpp | 19 +- QEverCloud/src/generated/Services.cpp | 1335 ++++++++++++++++--- 16 files changed, 1347 insertions(+), 306 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index e8a9f2ad..df421053 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -55,11 +55,11 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject typedef QVariant (*ReadFunctionType)(QByteArray replyData); - AsyncResult(QString url, QByteArray postData, + AsyncResult(QString url, QByteArray postData, qint64 timeoutMsec, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); - AsyncResult(QNetworkRequest request, QByteArray postData, + AsyncResult(QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); diff --git a/QEverCloud/headers/InkNoteImageDownloader.h b/QEverCloud/headers/InkNoteImageDownloader.h index 53fb76fe..87ebf429 100644 --- a/QEverCloud/headers/InkNoteImageDownloader.h +++ b/QEverCloud/headers/InkNoteImageDownloader.h @@ -121,11 +121,14 @@ class QEVERCLOUD_EXPORT InkNoteImageDownloader * The guid of the ink note's resource * @param isPublic * Specify true for public ink notes. In this case authentication token is - * not sent to with the request as it shoud be according to the docs. + * not sent to with the request as it should be according to the docs. + * @param timeoutMsec + * Timeout for download request in milliseconds * @return downloaded data. * */ - QByteArray download(Guid guid, bool isPublic = false); + QByteArray download( + Guid guid, const bool isPublic = false, const qint64 timeoutMsec = 30000); private: InkNoteImageDownloaderPrivate * const d_ptr; diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index c0a7fcda..3393042f 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -78,8 +78,12 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget * get it from the Evernote * @param consumerSecret * along with this + * @param timeoutMsec + * Timeout for network requests in milliseconds */ - void authenticate(QString host, QString consumerKey, QString consumerSecret); + void authenticate( + QString host, QString consumerKey, QString consumerSecret, + const qint64 timeoutMsec = 30000); /** * @return true if the last call to authenticate resulted in a successful diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index e52a3dae..d2421674 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -40,7 +40,7 @@ class QEVERCLOUD_EXPORT IRequestContext virtual QString authenticationToken() const = 0; /** Request timeout in milliseconds */ - virtual quint64 requestTimeout() const = 0; + virtual qint64 requestTimeout() const = 0; /** Should request timeout be exponentially increased on retries or not */ virtual bool increaseRequestTimeoutExponentially() const = 0; @@ -49,7 +49,7 @@ class QEVERCLOUD_EXPORT IRequestContext * Max request timeout in milliseconds (upper boundary for exponentially * increasing timeouts on retries) */ - virtual quint64 maxRequestTimeout() const = 0; + virtual qint64 maxRequestTimeout() const = 0; /** Max number of attempts to retry a request */ virtual quint32 maxRequestRetryCount() const = 0; @@ -67,9 +67,9 @@ using IRequestContextPtr = std::shared_ptr; QEVERCLOUD_EXPORT IRequestContextPtr newRequestContext( QString authenticationToken = {}, - quint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, + qint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, - quint64 maxRequestTimeout = DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, + qint64 maxRequestTimeout = DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, quint32 maxRequestRetryCount = DEFAULT_MAX_REQUEST_RETRY_COUNT); } // namespace qevercloud diff --git a/QEverCloud/headers/Thumbnail.h b/QEverCloud/headers/Thumbnail.h index 4e6d0cf4..37cca786 100644 --- a/QEverCloud/headers/Thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -126,15 +126,19 @@ class QEVERCLOUD_EXPORT Thumbnail * token is not sent to with the request as it shoud be according to the docs. * @param isResourceGuid * true if guid denotes a resource and false if it denotes a note. + * @param timeoutMsec + * Timeout for download request in milliseconds * @return downloaded data. * */ QByteArray download( - Guid guid, bool isPublic = false, bool isResourceGuid = false); + Guid guid, const bool isPublic = false, const bool isResourceGuid = false, + const qint64 timeoutMsec = 30000); /** Asynchronous version of @link download @endlink function*/ AsyncResult * downloadAsync( - Guid guid, bool isPublic = false, bool isResourceGuid = false); + Guid guid, const bool isPublic = false, const bool isResourceGuid = false, + const qint64 timeoutMsec = 30000); /** * @brief Prepares a POST request for a thumbnail download. diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 535d535e..5c3f92f7 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -25,22 +25,26 @@ QVariant AsyncResult::asIs(QByteArray replyData) return replyData; } -AsyncResult::AsyncResult(QString url, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, QObject * parent) : +AsyncResult::AsyncResult( + QString url, QByteArray postData, qint64 timeoutMsec, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, + QObject * parent) : QObject(parent), - d_ptr(new AsyncResultPrivate(url, postData, readFunction, autoDelete, this)) + d_ptr(new AsyncResultPrivate( + url, postData, timeoutMsec, readFunction, autoDelete, this)) { if (!url.isEmpty()) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } } -AsyncResult::AsyncResult(QNetworkRequest request, QByteArray postData, - qevercloud::AsyncResult::ReadFunctionType readFunction, - bool autoDelete, QObject * parent) : +AsyncResult::AsyncResult( + QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + qevercloud::AsyncResult::ReadFunctionType readFunction, bool autoDelete, + QObject * parent) : QObject(parent), - d_ptr(new AsyncResultPrivate(request, postData, readFunction, autoDelete, this)) + d_ptr(new AsyncResultPrivate( + request, postData, timeoutMsec, readFunction, autoDelete, this)) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 44b44f5d..e674c55e 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -11,30 +11,33 @@ namespace qevercloud { -AsyncResultPrivate::AsyncResultPrivate(QString url, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q) : +AsyncResultPrivate::AsyncResultPrivate( + QString url, QByteArray postData, qint64 timeoutMsec, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, + AsyncResult * q) : m_request(createEvernoteRequest(url)), m_postData(postData), + m_timeoutMsec(timeoutMsec), m_readFunction(readFunction), m_autoDelete(autoDelete), q_ptr(q) {} -AsyncResultPrivate::AsyncResultPrivate(QNetworkRequest request, - QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q) : +AsyncResultPrivate::AsyncResultPrivate( + QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, + AsyncResult * q) : m_request(request), m_postData(postData), + m_timeoutMsec(timeoutMsec), m_readFunction(readFunction), m_autoDelete(autoDelete), q_ptr(q) {} -AsyncResultPrivate::AsyncResultPrivate(QVariant result, - QSharedPointer error, - bool autoDelete, AsyncResult * q) : +AsyncResultPrivate::AsyncResultPrivate( + QVariant result, QSharedPointer error, + bool autoDelete, AsyncResult * q) : m_autoDelete(autoDelete), q_ptr(q) { @@ -57,7 +60,7 @@ void AsyncResultPrivate::start() QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &AsyncResultPrivate::onReplyFetched); replyFetcher->start( - evernoteNetworkAccessManager(), m_request, m_postData); + evernoteNetworkAccessManager(), m_request, m_timeoutMsec, m_postData); } void AsyncResultPrivate::onReplyFetched(QObject * rp) @@ -82,16 +85,19 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) result = m_readFunction(reply->receivedData()); } } - catch(const EverCloudException & e) { + catch(const EverCloudException & e) + { error = e.exceptionData(); } - catch(const std::exception & e) { + catch(const std::exception & e) + { error = QSharedPointer( new EverCloudExceptionData( QString::fromUtf8("Exception of type \"%1\" with the message: %2") .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); } - catch(...) { + catch(...) + { error = QSharedPointer( new EverCloudExceptionData(QStringLiteral("Unknown exception"))); } @@ -99,7 +105,8 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) setValue(result, error); } -void AsyncResultPrivate::setValue(QVariant result, QSharedPointer error) +void AsyncResultPrivate::setValue( + QVariant result, QSharedPointer error) { Q_Q(AsyncResult); QObject::connect(this, &AsyncResultPrivate::finished, diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 99953e55..4649fe03 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -17,17 +17,19 @@ class AsyncResultPrivate: public QObject { Q_OBJECT public: - explicit AsyncResultPrivate(QString url, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q); + explicit AsyncResultPrivate( + QString url, QByteArray postData, qint64 timeoutMsec, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, + AsyncResult * q); - explicit AsyncResultPrivate(QNetworkRequest request, QByteArray postData, - AsyncResult::ReadFunctionType readFunction, - bool autoDelete, AsyncResult * q); + explicit AsyncResultPrivate( + QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + AsyncResult::ReadFunctionType readFunction, bool autoDelete, + AsyncResult * q); - explicit AsyncResultPrivate(QVariant result, - QSharedPointer error, - bool autoDelete, AsyncResult * q); + explicit AsyncResultPrivate( + QVariant result, QSharedPointer error, + bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); @@ -44,6 +46,7 @@ public Q_SLOTS: public: QNetworkRequest m_request; QByteArray m_postData; + qint64 m_timeoutMsec = 0; AsyncResult::ReadFunctionType m_readFunction; bool m_autoDelete; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 7485702f..44f5df19 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -186,7 +186,7 @@ AsyncResult * DurableService::executeAsyncRequest( RetryState state; state.m_retryCount = ctx->maxRequestRetryCount(); - AsyncResult * result = new AsyncResult(QString(), QByteArray()); + AsyncResult * result = new AsyncResult(QString(), QByteArray(), 0); doExecuteAsyncRequest(std::move(asyncRequest), std::move(ctx), std::move(state), result); diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 4db5492d..656ec743 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -22,34 +22,38 @@ namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + ReplyFetcher::ReplyFetcher(QObject * parent) : QObject(parent), - m_success(false), - m_httpStatusCode(0) + m_ticker(new QTimer(this)) { - m_ticker = new QTimer(this); - QObject::connect(m_ticker, &QTimer::timeout, - this, &ReplyFetcher::checkForTimeout); + QObject::connect( + m_ticker, &QTimer::timeout, + this, &ReplyFetcher::checkForTimeout); } -void ReplyFetcher::start(QNetworkAccessManager * nam, QUrl url) +void ReplyFetcher::start( + QNetworkAccessManager * nam, QUrl url, qint64 timeoutMsec) { QNetworkRequest request; request.setUrl(url); - start(nam, request); + start(nam, request, timeoutMsec); } void ReplyFetcher::start( - QNetworkAccessManager * nam, QNetworkRequest request, QByteArray postData) + QNetworkAccessManager * nam, QNetworkRequest request, qint64 timeoutMsec, + QByteArray postData) { m_httpStatusCode= 0; m_errorText.clear(); m_receivedData.clear(); - m_success = true; // not in finished() signal handler, it might not be - // called according to the docs - // besides, I've added timeout feature + + // NOTE: onFinished slot might not be called so initializing to true + m_success = true; m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); + m_timeoutMsec = timeoutMsec; m_ticker->start(1000); if (postData.isNull()) { @@ -71,19 +75,21 @@ void ReplyFetcher::start( this, &ReplyFetcher::onDownloadProgress); } -void ReplyFetcher::onDownloadProgress(qint64, qint64) +void ReplyFetcher::onDownloadProgress(qint64 downloaded, qint64 total) { + Q_UNUSED(downloaded) + Q_UNUSED(total) + m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); } void ReplyFetcher::checkForTimeout() { - const int timeout = requestTimeout(); - if (timeout < 0) { + if (m_timeoutMsec < 0) { return; } - if ((QDateTime::currentMSecsSinceEpoch() - m_lastNetworkTime) > timeout) { + if ((QDateTime::currentMSecsSinceEpoch() - m_lastNetworkTime) > m_timeoutMsec) { setError(QStringLiteral("Connection timeout.")); } } @@ -131,8 +137,32 @@ void ReplyFetcher::setError(QString errorText) emit replyFetched(this); } -QByteArray simpleDownload(QNetworkAccessManager* nam, QNetworkRequest request, - QByteArray postData, int * httpStatusCode) +//////////////////////////////////////////////////////////////////////////////// + +ReplyFetcherLauncher::ReplyFetcherLauncher( + ReplyFetcher * fetcher, + QNetworkAccessManager * nam, + const QNetworkRequest & request, + const qint64 timeoutMsec, + const QByteArray & postData) : + QObject(nam), + m_fetcher(fetcher), + m_nam(nam), + m_request(request), + m_timeoutMsec(timeoutMsec), + m_postData(postData) +{} + +void ReplyFetcherLauncher::start() +{ + m_fetcher->start(m_nam, m_request, m_timeoutMsec, m_postData); +} + +//////////////////////////////////////////////////////////////////////////////// + +QByteArray simpleDownload( + QNetworkAccessManager* nam, QNetworkRequest request, const qint64 timeoutMsec, + QByteArray postData, int * httpStatusCode) { ReplyFetcher * fetcher = new ReplyFetcher; QEventLoop loop; @@ -140,7 +170,7 @@ QByteArray simpleDownload(QNetworkAccessManager* nam, QNetworkRequest request, &loop, SLOT(quit())); ReplyFetcherLauncher * fetcherLauncher = - new ReplyFetcherLauncher(fetcher, nam, request, postData); + new ReplyFetcherLauncher(fetcher, nam, request, timeoutMsec, postData); QTimer::singleShot(0, fetcherLauncher, SLOT(start())); loop.exec(QEventLoop::ExcludeUserInputEvents); @@ -168,30 +198,23 @@ QNetworkRequest createEvernoteRequest(QString url) request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-thrift")); -#if QT_VERSION < 0x050000 - request.setRawHeader( - "User-Agent", - QString::fromUtf8("QEverCloud %1.%2") - .arg(libraryVersion() / 10000) - .arg(libraryVersion() % 10000).toLatin1()); -#else request.setHeader( QNetworkRequest::UserAgentHeader, QString::fromUtf8("QEverCloud %1.%2") .arg(libraryVersion() / 10000) .arg(libraryVersion() % 10000)); -#endif request.setRawHeader("Accept", "application/x-thrift"); return request; } -QByteArray askEvernote(QString url, QByteArray postData) +QByteArray askEvernote(QString url, QByteArray postData, const qint64 timeoutMsec) { int httpStatusCode = 0; QByteArray reply = simpleDownload( evernoteNetworkAccessManager(), createEvernoteRequest(url), + timeoutMsec, postData, &httpStatusCode); @@ -203,22 +226,6 @@ QByteArray askEvernote(QString url, QByteArray postData) return reply; } -ReplyFetcherLauncher::ReplyFetcherLauncher(ReplyFetcher * fetcher, - QNetworkAccessManager * nam, - const QNetworkRequest & request, - const QByteArray & postData) : - QObject(nam), - m_fetcher(fetcher), - m_nam(nam), - m_request(request), - m_postData(postData) -{} - -void ReplyFetcherLauncher::start() -{ - m_fetcher->start(m_nam, m_request, m_postData); -} - } // namespace qevercloud /** @endcond */ diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index 4101c519..b623e01f 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -27,20 +27,22 @@ namespace qevercloud { -QNetworkAccessManager * evernoteNetworkAccessManager(); +//////////////////////////////////////////////////////////////////////////////// -// the class greatly simplifies QNetworkReply handling +/** + * @brief The ReplyFetcher class simplifies handling of QNetworkReply + */ class ReplyFetcher: public QObject { Q_OBJECT public: ReplyFetcher(QObject * parent = Q_NULLPTR); - void start(QNetworkAccessManager * nam, QUrl url); + void start(QNetworkAccessManager * nam, QUrl url, qint64 timeoutMsec); // if !postData.isNull() then POST will be issued instead of GET void start(QNetworkAccessManager * nam, QNetworkRequest request, - QByteArray postData = QByteArray()); + qint64 timeoutMsec, QByteArray postData = QByteArray()); bool isError() { return !m_success; } @@ -51,13 +53,13 @@ class ReplyFetcher: public QObject int httpStatusCode() { return m_httpStatusCode; } Q_SIGNALS: - void replyFetched(QObject*); // sends itself + void replyFetched(QObject * self); // sends itself private Q_SLOTS: void onFinished(); void onError(QNetworkReply::NetworkError); - void onSslErrors(QList l); - void onDownloadProgress(qint64, qint64); + void onSslErrors(QList list); + void onDownloadProgress(qint64 downloaded, qint64 total); void checkForTimeout(); private: @@ -65,30 +67,43 @@ private Q_SLOTS: private: QSharedPointer m_reply; - bool m_success; - QString m_errorText; - QByteArray m_receivedData; - int m_httpStatusCode; - QTimer* m_ticker; - qint64 m_lastNetworkTime; + bool m_success = false; + + QString m_errorText; + QByteArray m_receivedData; + int m_httpStatusCode = 0; + + QTimer * m_ticker; + qint64 m_lastNetworkTime = 0; + qint64 m_timeoutMsec = 0; }; +//////////////////////////////////////////////////////////////////////////////// + +QNetworkAccessManager * evernoteNetworkAccessManager(); + QNetworkRequest createEvernoteRequest(QString url); -QByteArray askEvernote(QString url, QByteArray postData); +QByteArray askEvernote(QString url, QByteArray postData, const qint64 timeoutMsec); QByteArray simpleDownload(QNetworkAccessManager * nam, QNetworkRequest request, + const qint64 timeoutMsec, QByteArray postData = QByteArray(), int * httpStatusCode = Q_NULLPTR); +//////////////////////////////////////////////////////////////////////////////// + +/** + * @brief The ReplyFetcherLauncher class simplifies ReplyFetcher starting + */ class ReplyFetcherLauncher: public QObject { Q_OBJECT public: - explicit ReplyFetcherLauncher(ReplyFetcher * fetcher, - QNetworkAccessManager * nam, - const QNetworkRequest & request, - const QByteArray & postData); + explicit ReplyFetcherLauncher( + ReplyFetcher * fetcher, QNetworkAccessManager * nam, + const QNetworkRequest & request, const qint64 timeoutMsec, + const QByteArray & postData); public Q_SLOTS: void start(); @@ -97,6 +112,7 @@ public Q_SLOTS: ReplyFetcher * m_fetcher; QNetworkAccessManager * m_nam; QNetworkRequest m_request; + qint64 m_timeoutMsec; QByteArray m_postData; }; diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index bb846bb7..765a389d 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -85,7 +85,8 @@ InkNoteImageDownloader & InkNoteImageDownloader::setHeight(int height) return *this; } -QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) +QByteArray InkNoteImageDownloader::download( + Guid guid, const bool isPublic, const qint64 timeoutMsec) { QEC_DEBUG("ink_note_image", "Downloading ink note image: guid = " << guid << (isPublic ? "public" : "non-public")); @@ -110,7 +111,8 @@ QByteArray InkNoteImageDownloader::download(Guid guid, bool isPublic) << postRequest.first.url()); QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), - postRequest.first, postRequest.second, + postRequest.first, timeoutMsec, + postRequest.second, &httpStatusCode); if (httpStatusCode != 200) { QEC_WARNING("ink_note_image", "Failed to download slice " diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index 7c3d65a1..a6dec54e 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -87,19 +87,20 @@ public Q_SLOTS: public: void setError(QString error); - bool m_isSucceeded; + bool m_isSucceeded = false; QSize m_sizeHint; QString m_errorText; QString m_oauthUrlBase; QString m_host; + qint64 m_timeoutMsec = 0; EvernoteOAuthWebView::OAuthResult m_oauthResult; }; EvernoteOAuthWebViewPrivate::EvernoteOAuthWebViewPrivate(QWidget * parent) #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE - : QWebEngineView(parent), m_isSucceeded(false) + : QWebEngineView(parent) #else - : QWebView(parent), m_isSucceeded(false) + : QWebView(parent) #endif { #ifndef QEVERCLOUD_USE_QT_WEB_ENGINE @@ -134,13 +135,15 @@ EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : } void EvernoteOAuthWebView::authenticate( - QString host, QString consumerKey, QString consumerSecret) + QString host, QString consumerKey, QString consumerSecret, + const qint64 timeoutMsec) { QEC_DEBUG("oauth", "Sending request to acquire temporary token"); Q_D(EvernoteOAuthWebView); d->m_host = host; d->m_isSucceeded = false; + d->m_timeoutMsec = timeoutMsec; d->setHtml(QLatin1String("")); d->history()->clear(); @@ -159,9 +162,9 @@ void EvernoteOAuthWebView::authenticate( d, &EvernoteOAuthWebViewPrivate::temporaryFinished); QUrl url(d->m_oauthUrlBase + QStringLiteral("&oauth_callback=nnoauth")); #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE - replyFetcher->start(evernoteNetworkAccessManager(), url); + replyFetcher->start(evernoteNetworkAccessManager(), url, timeoutMsec); #else - replyFetcher->start(d->page()->networkAccessManager(), url); + replyFetcher->start(d->page()->networkAccessManager(), url, timeoutMsec); #endif } @@ -244,9 +247,9 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) this, &EvernoteOAuthWebViewPrivate::permanentFinished); QUrl url(m_oauthUrlBase + QStringLiteral("&oauth_token=%1").arg(token)); #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE - replyFetcher->start(evernoteNetworkAccessManager(), url); + replyFetcher->start(evernoteNetworkAccessManager(), url, m_timeoutMsec); #else - replyFetcher->start(page()->networkAccessManager(), url); + replyFetcher->start(page()->networkAccessManager(), url, m_timeoutMsec); #endif } else diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index e1fc729f..8cbc6b93 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -7,9 +7,9 @@ namespace qevercloud { class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext { public: - RequestContext(QString authenticationToken, quint64 requestTimeout, + RequestContext(QString authenticationToken, qint64 requestTimeout, bool increaseRequestTimeoutExponentially, - quint64 maxRequestTimeout, + qint64 maxRequestTimeout, quint32 maxRequestRetryCount) : m_authenticationToken(std::move(authenticationToken)), m_requestTimeout(requestTimeout), @@ -23,7 +23,7 @@ class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext return m_authenticationToken; } - virtual quint64 requestTimeout() const Q_DECL_OVERRIDE + virtual qint64 requestTimeout() const Q_DECL_OVERRIDE { return m_requestTimeout; } @@ -33,7 +33,7 @@ class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext return m_increaseRequestTimeoutExponentially; } - virtual quint64 maxRequestTimeout() const Q_DECL_OVERRIDE + virtual qint64 maxRequestTimeout() const Q_DECL_OVERRIDE { return m_maxRequestTimeout; } @@ -45,9 +45,9 @@ class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext private: QString m_authenticationToken; - quint64 m_requestTimeout; + qint64 m_requestTimeout; bool m_increaseRequestTimeoutExponentially; - quint64 m_maxRequestTimeout; + qint64 m_maxRequestTimeout; quint32 m_maxRequestRetryCount; }; @@ -82,9 +82,9 @@ QDebug & operator<<(QDebug & dbg, const IRequestContext & ctx) IRequestContextPtr newRequestContext( QString authenticationToken, - quint64 requestTimeout, + qint64 requestTimeout, bool increaseRequestTimeoutExponentially, - quint64 maxRequestTimeout, + qint64 maxRequestTimeout, quint32 maxRequestRetryCount) { return std::make_shared( diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 0a67c8e1..4361f81a 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -78,7 +78,9 @@ Thumbnail & Thumbnail::setImageType(ImageType::type imageType) return *this; } -QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) +QByteArray Thumbnail::download( + Guid guid, const bool isPublic, const bool isResourceGuid, + const qint64 timeoutMsec) { QEC_DEBUG("thumbnail", "Downloading thumbnail: guid = " << guid << (isPublic ? "public" : "non-public") << ", " @@ -88,8 +90,13 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) QPair request = createPostRequest(guid, isPublic, isResourceGuid); - QByteArray reply = simpleDownload(evernoteNetworkAccessManager(), request.first, - request.second, &httpStatusCode); + QByteArray reply = simpleDownload( + evernoteNetworkAccessManager(), + request.first, + timeoutMsec, + request.second, + &httpStatusCode); + if (httpStatusCode != 200) { QEC_WARNING("thumbnail", "Failed to download thumbnail with guid " @@ -103,7 +110,9 @@ QByteArray Thumbnail::download(Guid guid, bool isPublic, bool isResourceGuid) return reply; } -AsyncResult* Thumbnail::downloadAsync(Guid guid, bool isPublic, bool isResourceGuid) +AsyncResult * Thumbnail::downloadAsync( + Guid guid, const bool isPublic, const bool isResourceGuid, + const qint64 timeoutMsec) { QEC_DEBUG("thumbnail", "Starting async thumbnail download: guid = " << guid << (isPublic ? "public" : "non-public") << ", " @@ -111,7 +120,7 @@ AsyncResult* Thumbnail::downloadAsync(Guid guid, bool isPublic, bool isResourceG QPair pair = createPostRequest(guid, isPublic, isResourceGuid); - auto res = new AsyncResult(pair.first, pair.second); + auto res = new AsyncResult(pair.first, pair.second, timeoutMsec); QObject::connect(res, &AsyncResult::finished, [=] (const QVariant & value, const QSharedPointer data) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 3047dcb7..e3939055 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -844,7 +844,12 @@ SyncState NoteStore::getSyncState( } QByteArray params = NoteStore_getSyncState_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getSyncState_readReply(reply); } @@ -856,9 +861,15 @@ AsyncResult * NoteStore::getSyncStateAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getSyncState_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_getSyncState_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getSyncState_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1014,7 +1025,12 @@ SyncChunk NoteStore::getFilteredSyncChunk( afterUSN, maxEntries, filter); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getFilteredSyncChunk_readReply(reply); } @@ -1033,12 +1049,18 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( ctx->authenticationToken(), afterUSN, maxEntries, filter); - return new AsyncResult(m_url, params, NoteStore_getFilteredSyncChunk_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getFilteredSyncChunk_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1184,7 +1206,12 @@ SyncState NoteStore::getLinkedNotebookSyncState( QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( ctx->authenticationToken(), linkedNotebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getLinkedNotebookSyncState_readReply(reply); } @@ -1199,10 +1226,16 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( ctx->authenticationToken(), linkedNotebook); - return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncState_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getLinkedNotebookSyncState_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1378,7 +1411,12 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( afterUSN, maxEntries, fullSyncOnly); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getLinkedNotebookSyncChunk_readReply(reply); } @@ -1399,13 +1437,19 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( ctx->authenticationToken(), linkedNotebook, afterUSN, maxEntries, fullSyncOnly); - return new AsyncResult(m_url, params, NoteStore_getLinkedNotebookSyncChunk_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getLinkedNotebookSyncChunk_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1544,7 +1588,12 @@ QList NoteStore::listNotebooks( } QByteArray params = NoteStore_listNotebooks_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listNotebooks_readReply(reply); } @@ -1556,9 +1605,15 @@ AsyncResult * NoteStore::listNotebooksAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listNotebooks_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listNotebooks_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listNotebooks_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1697,7 +1752,12 @@ QList NoteStore::listAccessibleBusinessNotebooks( } QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listAccessibleBusinessNotebooks_readReply(reply); } @@ -1709,9 +1769,15 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listAccessibleBusinessNotebooks_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listAccessibleBusinessNotebooks_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -1857,7 +1923,12 @@ Notebook NoteStore::getNotebook( QByteArray params = NoteStore_getNotebook_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNotebook_readReply(reply); } @@ -1872,10 +1943,16 @@ AsyncResult * NoteStore::getNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNotebook_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2000,7 +2077,12 @@ Notebook NoteStore::getDefaultNotebook( } QByteArray params = NoteStore_getDefaultNotebook_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getDefaultNotebook_readReply(reply); } @@ -2012,9 +2094,15 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getDefaultNotebook_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_getDefaultNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getDefaultNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2160,7 +2248,12 @@ Notebook NoteStore::createNotebook( QByteArray params = NoteStore_createNotebook_prepareParams( ctx->authenticationToken(), notebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createNotebook_readReply(reply); } @@ -2175,10 +2268,16 @@ AsyncResult * NoteStore::createNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createNotebook_prepareParams( ctx->authenticationToken(), notebook); - return new AsyncResult(m_url, params, NoteStore_createNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2324,7 +2423,12 @@ qint32 NoteStore::updateNotebook( QByteArray params = NoteStore_updateNotebook_prepareParams( ctx->authenticationToken(), notebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateNotebook_readReply(reply); } @@ -2339,10 +2443,16 @@ AsyncResult * NoteStore::updateNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateNotebook_prepareParams( ctx->authenticationToken(), notebook); - return new AsyncResult(m_url, params, NoteStore_updateNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2488,7 +2598,12 @@ qint32 NoteStore::expungeNotebook( QByteArray params = NoteStore_expungeNotebook_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_expungeNotebook_readReply(reply); } @@ -2503,10 +2618,16 @@ AsyncResult * NoteStore::expungeNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_expungeNotebook_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_expungeNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_expungeNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2645,7 +2766,12 @@ QList NoteStore::listTags( } QByteArray params = NoteStore_listTags_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listTags_readReply(reply); } @@ -2657,9 +2783,15 @@ AsyncResult * NoteStore::listTagsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listTags_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listTags_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listTags_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2819,7 +2951,12 @@ QList NoteStore::listTagsByNotebook( QByteArray params = NoteStore_listTagsByNotebook_prepareParams( ctx->authenticationToken(), notebookGuid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listTagsByNotebook_readReply(reply); } @@ -2834,10 +2971,16 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listTagsByNotebook_prepareParams( ctx->authenticationToken(), notebookGuid); - return new AsyncResult(m_url, params, NoteStore_listTagsByNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listTagsByNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -2983,7 +3126,12 @@ Tag NoteStore::getTag( QByteArray params = NoteStore_getTag_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getTag_readReply(reply); } @@ -2998,10 +3146,16 @@ AsyncResult * NoteStore::getTagAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getTag_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getTag_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getTag_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3147,7 +3301,12 @@ Tag NoteStore::createTag( QByteArray params = NoteStore_createTag_prepareParams( ctx->authenticationToken(), tag); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createTag_readReply(reply); } @@ -3162,10 +3321,16 @@ AsyncResult * NoteStore::createTagAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createTag_prepareParams( ctx->authenticationToken(), tag); - return new AsyncResult(m_url, params, NoteStore_createTag_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createTag_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3311,7 +3476,12 @@ qint32 NoteStore::updateTag( QByteArray params = NoteStore_updateTag_prepareParams( ctx->authenticationToken(), tag); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateTag_readReply(reply); } @@ -3326,10 +3496,16 @@ AsyncResult * NoteStore::updateTagAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateTag_prepareParams( ctx->authenticationToken(), tag); - return new AsyncResult(m_url, params, NoteStore_updateTag_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateTag_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3458,7 +3634,12 @@ void NoteStore::untagAll( QByteArray params = NoteStore_untagAll_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + NoteStore_untagAll_readReply(reply); } @@ -3473,10 +3654,16 @@ AsyncResult * NoteStore::untagAllAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_untagAll_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_untagAll_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_untagAll_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3622,7 +3809,12 @@ qint32 NoteStore::expungeTag( QByteArray params = NoteStore_expungeTag_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_expungeTag_readReply(reply); } @@ -3637,10 +3829,16 @@ AsyncResult * NoteStore::expungeTagAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_expungeTag_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_expungeTag_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_expungeTag_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3779,7 +3977,12 @@ QList NoteStore::listSearches( } QByteArray params = NoteStore_listSearches_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listSearches_readReply(reply); } @@ -3791,9 +3994,15 @@ AsyncResult * NoteStore::listSearchesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listSearches_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listSearches_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listSearches_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -3939,7 +4148,12 @@ SavedSearch NoteStore::getSearch( QByteArray params = NoteStore_getSearch_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getSearch_readReply(reply); } @@ -3954,10 +4168,16 @@ AsyncResult * NoteStore::getSearchAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getSearch_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getSearch_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getSearch_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4093,7 +4313,12 @@ SavedSearch NoteStore::createSearch( QByteArray params = NoteStore_createSearch_prepareParams( ctx->authenticationToken(), search); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createSearch_readReply(reply); } @@ -4108,10 +4333,16 @@ AsyncResult * NoteStore::createSearchAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createSearch_prepareParams( ctx->authenticationToken(), search); - return new AsyncResult(m_url, params, NoteStore_createSearch_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createSearch_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4257,7 +4488,12 @@ qint32 NoteStore::updateSearch( QByteArray params = NoteStore_updateSearch_prepareParams( ctx->authenticationToken(), search); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateSearch_readReply(reply); } @@ -4272,10 +4508,16 @@ AsyncResult * NoteStore::updateSearchAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateSearch_prepareParams( ctx->authenticationToken(), search); - return new AsyncResult(m_url, params, NoteStore_updateSearch_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateSearch_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4421,7 +4663,12 @@ qint32 NoteStore::expungeSearch( QByteArray params = NoteStore_expungeSearch_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_expungeSearch_readReply(reply); } @@ -4436,10 +4683,16 @@ AsyncResult * NoteStore::expungeSearchAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_expungeSearch_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_expungeSearch_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_expungeSearch_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4595,7 +4848,12 @@ qint32 NoteStore::findNoteOffset( ctx->authenticationToken(), filter, guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_findNoteOffset_readReply(reply); } @@ -4612,11 +4870,17 @@ AsyncResult * NoteStore::findNoteOffsetAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_findNoteOffset_prepareParams( ctx->authenticationToken(), filter, guid); - return new AsyncResult(m_url, params, NoteStore_findNoteOffset_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_findNoteOffset_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4792,7 +5056,12 @@ NotesMetadataList NoteStore::findNotesMetadata( offset, maxNotes, resultSpec); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_findNotesMetadata_readReply(reply); } @@ -4813,13 +5082,19 @@ AsyncResult * NoteStore::findNotesMetadataAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_findNotesMetadata_prepareParams( ctx->authenticationToken(), filter, offset, maxNotes, resultSpec); - return new AsyncResult(m_url, params, NoteStore_findNotesMetadata_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_findNotesMetadata_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -4975,7 +5250,12 @@ NoteCollectionCounts NoteStore::findNoteCounts( ctx->authenticationToken(), filter, withTrash); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_findNoteCounts_readReply(reply); } @@ -4992,11 +5272,17 @@ AsyncResult * NoteStore::findNoteCountsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_findNoteCounts_prepareParams( ctx->authenticationToken(), filter, withTrash); - return new AsyncResult(m_url, params, NoteStore_findNoteCounts_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_findNoteCounts_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -5152,7 +5438,12 @@ Note NoteStore::getNoteWithResultSpec( ctx->authenticationToken(), guid, resultSpec); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteWithResultSpec_readReply(reply); } @@ -5169,11 +5460,17 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( ctx->authenticationToken(), guid, resultSpec); - return new AsyncResult(m_url, params, NoteStore_getNoteWithResultSpec_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteWithResultSpec_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -5359,7 +5656,12 @@ Note NoteStore::getNote( withResourcesData, withResourcesRecognition, withResourcesAlternateData); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNote_readReply(reply); } @@ -5382,6 +5684,7 @@ AsyncResult * NoteStore::getNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNote_prepareParams( ctx->authenticationToken(), guid, @@ -5389,7 +5692,12 @@ AsyncResult * NoteStore::getNoteAsync( withResourcesData, withResourcesRecognition, withResourcesAlternateData); - return new AsyncResult(m_url, params, NoteStore_getNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -5535,7 +5843,12 @@ LazyMap NoteStore::getNoteApplicationData( QByteArray params = NoteStore_getNoteApplicationData_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteApplicationData_readReply(reply); } @@ -5550,10 +5863,16 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteApplicationData_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getNoteApplicationData_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteApplicationData_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -5709,7 +6028,12 @@ QString NoteStore::getNoteApplicationDataEntry( ctx->authenticationToken(), guid, key); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteApplicationDataEntry_readReply(reply); } @@ -5726,11 +6050,17 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key); - return new AsyncResult(m_url, params, NoteStore_getNoteApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -5896,7 +6226,12 @@ qint32 NoteStore::setNoteApplicationDataEntry( guid, key, value); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_setNoteApplicationDataEntry_readReply(reply); } @@ -5915,12 +6250,18 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key, value); - return new AsyncResult(m_url, params, NoteStore_setNoteApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_setNoteApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6076,7 +6417,12 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( ctx->authenticationToken(), guid, key); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_unsetNoteApplicationDataEntry_readReply(reply); } @@ -6093,11 +6439,17 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key); - return new AsyncResult(m_url, params, NoteStore_unsetNoteApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_unsetNoteApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6243,7 +6595,12 @@ QString NoteStore::getNoteContent( QByteArray params = NoteStore_getNoteContent_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteContent_readReply(reply); } @@ -6258,10 +6615,16 @@ AsyncResult * NoteStore::getNoteContentAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteContent_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getNoteContent_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteContent_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6427,7 +6790,12 @@ QString NoteStore::getNoteSearchText( guid, noteOnly, tokenizeForIndexing); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteSearchText_readReply(reply); } @@ -6446,12 +6814,18 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteSearchText_prepareParams( ctx->authenticationToken(), guid, noteOnly, tokenizeForIndexing); - return new AsyncResult(m_url, params, NoteStore_getNoteSearchText_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteSearchText_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6597,7 +6971,12 @@ QString NoteStore::getResourceSearchText( QByteArray params = NoteStore_getResourceSearchText_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceSearchText_readReply(reply); } @@ -6612,10 +6991,16 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceSearchText_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceSearchText_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceSearchText_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6775,7 +7160,12 @@ QStringList NoteStore::getNoteTagNames( QByteArray params = NoteStore_getNoteTagNames_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteTagNames_readReply(reply); } @@ -6790,10 +7180,16 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteTagNames_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getNoteTagNames_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteTagNames_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -6939,7 +7335,12 @@ Note NoteStore::createNote( QByteArray params = NoteStore_createNote_prepareParams( ctx->authenticationToken(), note); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createNote_readReply(reply); } @@ -6954,10 +7355,16 @@ AsyncResult * NoteStore::createNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createNote_prepareParams( ctx->authenticationToken(), note); - return new AsyncResult(m_url, params, NoteStore_createNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7103,7 +7510,12 @@ Note NoteStore::updateNote( QByteArray params = NoteStore_updateNote_prepareParams( ctx->authenticationToken(), note); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateNote_readReply(reply); } @@ -7118,10 +7530,16 @@ AsyncResult * NoteStore::updateNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateNote_prepareParams( ctx->authenticationToken(), note); - return new AsyncResult(m_url, params, NoteStore_updateNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7267,7 +7685,12 @@ qint32 NoteStore::deleteNote( QByteArray params = NoteStore_deleteNote_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_deleteNote_readReply(reply); } @@ -7282,10 +7705,16 @@ AsyncResult * NoteStore::deleteNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_deleteNote_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_deleteNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_deleteNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7431,7 +7860,12 @@ qint32 NoteStore::expungeNote( QByteArray params = NoteStore_expungeNote_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_expungeNote_readReply(reply); } @@ -7446,10 +7880,16 @@ AsyncResult * NoteStore::expungeNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_expungeNote_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_expungeNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_expungeNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7605,7 +8045,12 @@ Note NoteStore::copyNote( ctx->authenticationToken(), noteGuid, toNotebookGuid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_copyNote_readReply(reply); } @@ -7622,11 +8067,17 @@ AsyncResult * NoteStore::copyNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_copyNote_prepareParams( ctx->authenticationToken(), noteGuid, toNotebookGuid); - return new AsyncResult(m_url, params, NoteStore_copyNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_copyNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7786,7 +8237,12 @@ QList NoteStore::listNoteVersions( QByteArray params = NoteStore_listNoteVersions_prepareParams( ctx->authenticationToken(), noteGuid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listNoteVersions_readReply(reply); } @@ -7801,10 +8257,16 @@ AsyncResult * NoteStore::listNoteVersionsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listNoteVersions_prepareParams( ctx->authenticationToken(), noteGuid); - return new AsyncResult(m_url, params, NoteStore_listNoteVersions_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listNoteVersions_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -7990,7 +8452,12 @@ Note NoteStore::getNoteVersion( withResourcesData, withResourcesRecognition, withResourcesAlternateData); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNoteVersion_readReply(reply); } @@ -8013,6 +8480,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNoteVersion_prepareParams( ctx->authenticationToken(), noteGuid, @@ -8020,7 +8488,12 @@ AsyncResult * NoteStore::getNoteVersionAsync( withResourcesData, withResourcesRecognition, withResourcesAlternateData); - return new AsyncResult(m_url, params, NoteStore_getNoteVersion_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNoteVersion_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -8206,7 +8679,12 @@ Resource NoteStore::getResource( withRecognition, withAttributes, withAlternateData); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResource_readReply(reply); } @@ -8229,6 +8707,7 @@ AsyncResult * NoteStore::getResourceAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResource_prepareParams( ctx->authenticationToken(), guid, @@ -8236,7 +8715,12 @@ AsyncResult * NoteStore::getResourceAsync( withRecognition, withAttributes, withAlternateData); - return new AsyncResult(m_url, params, NoteStore_getResource_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResource_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -8382,7 +8866,12 @@ LazyMap NoteStore::getResourceApplicationData( QByteArray params = NoteStore_getResourceApplicationData_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceApplicationData_readReply(reply); } @@ -8397,10 +8886,16 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceApplicationData_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceApplicationData_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceApplicationData_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -8556,7 +9051,12 @@ QString NoteStore::getResourceApplicationDataEntry( ctx->authenticationToken(), guid, key); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceApplicationDataEntry_readReply(reply); } @@ -8573,11 +9073,17 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key); - return new AsyncResult(m_url, params, NoteStore_getResourceApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -8743,7 +9249,12 @@ qint32 NoteStore::setResourceApplicationDataEntry( guid, key, value); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_setResourceApplicationDataEntry_readReply(reply); } @@ -8762,12 +9273,18 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key, value); - return new AsyncResult(m_url, params, NoteStore_setResourceApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_setResourceApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -8923,7 +9440,12 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( ctx->authenticationToken(), guid, key); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_unsetResourceApplicationDataEntry_readReply(reply); } @@ -8940,11 +9462,17 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( ctx->authenticationToken(), guid, key); - return new AsyncResult(m_url, params, NoteStore_unsetResourceApplicationDataEntry_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_unsetResourceApplicationDataEntry_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9090,7 +9618,12 @@ qint32 NoteStore::updateResource( QByteArray params = NoteStore_updateResource_prepareParams( ctx->authenticationToken(), resource); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateResource_readReply(reply); } @@ -9105,10 +9638,16 @@ AsyncResult * NoteStore::updateResourceAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateResource_prepareParams( ctx->authenticationToken(), resource); - return new AsyncResult(m_url, params, NoteStore_updateResource_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateResource_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9254,7 +9793,12 @@ QByteArray NoteStore::getResourceData( QByteArray params = NoteStore_getResourceData_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceData_readReply(reply); } @@ -9269,10 +9813,16 @@ AsyncResult * NoteStore::getResourceDataAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceData_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceData_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceData_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9458,7 +10008,12 @@ Resource NoteStore::getResourceByHash( withData, withRecognition, withAlternateData); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceByHash_readReply(reply); } @@ -9481,6 +10036,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceByHash_prepareParams( ctx->authenticationToken(), noteGuid, @@ -9488,7 +10044,12 @@ AsyncResult * NoteStore::getResourceByHashAsync( withData, withRecognition, withAlternateData); - return new AsyncResult(m_url, params, NoteStore_getResourceByHash_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceByHash_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9634,7 +10195,12 @@ QByteArray NoteStore::getResourceRecognition( QByteArray params = NoteStore_getResourceRecognition_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceRecognition_readReply(reply); } @@ -9649,10 +10215,16 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceRecognition_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceRecognition_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceRecognition_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9798,7 +10370,12 @@ QByteArray NoteStore::getResourceAlternateData( QByteArray params = NoteStore_getResourceAlternateData_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceAlternateData_readReply(reply); } @@ -9813,10 +10390,16 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceAlternateData_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceAlternateData_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceAlternateData_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -9962,7 +10545,12 @@ ResourceAttributes NoteStore::getResourceAttributes( QByteArray params = NoteStore_getResourceAttributes_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getResourceAttributes_readReply(reply); } @@ -9977,10 +10565,16 @@ AsyncResult * NoteStore::getResourceAttributesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getResourceAttributes_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_getResourceAttributes_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getResourceAttributes_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10118,7 +10712,12 @@ Notebook NoteStore::getPublicNotebook( QByteArray params = NoteStore_getPublicNotebook_prepareParams( userId, publicUri); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getPublicNotebook_readReply(reply); } @@ -10135,10 +10734,16 @@ AsyncResult * NoteStore::getPublicNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getPublicNotebook_prepareParams( userId, publicUri); - return new AsyncResult(m_url, params, NoteStore_getPublicNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getPublicNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10294,7 +10899,12 @@ SharedNotebook NoteStore::shareNotebook( ctx->authenticationToken(), sharedNotebook, message); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_shareNotebook_readReply(reply); } @@ -10311,11 +10921,17 @@ AsyncResult * NoteStore::shareNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_shareNotebook_prepareParams( ctx->authenticationToken(), sharedNotebook, message); - return new AsyncResult(m_url, params, NoteStore_shareNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_shareNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10471,7 +11087,12 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( ctx->authenticationToken(), shareTemplate); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createOrUpdateNotebookShares_readReply(reply); } @@ -10486,10 +11107,16 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( ctx->authenticationToken(), shareTemplate); - return new AsyncResult(m_url, params, NoteStore_createOrUpdateNotebookShares_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createOrUpdateNotebookShares_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10635,7 +11262,12 @@ qint32 NoteStore::updateSharedNotebook( QByteArray params = NoteStore_updateSharedNotebook_prepareParams( ctx->authenticationToken(), sharedNotebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateSharedNotebook_readReply(reply); } @@ -10650,10 +11282,16 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateSharedNotebook_prepareParams( ctx->authenticationToken(), sharedNotebook); - return new AsyncResult(m_url, params, NoteStore_updateSharedNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateSharedNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10809,7 +11447,12 @@ Notebook NoteStore::setNotebookRecipientSettings( ctx->authenticationToken(), notebookGuid, recipientSettings); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_setNotebookRecipientSettings_readReply(reply); } @@ -10826,11 +11469,17 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( ctx->authenticationToken(), notebookGuid, recipientSettings); - return new AsyncResult(m_url, params, NoteStore_setNotebookRecipientSettings_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_setNotebookRecipientSettings_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -10979,7 +11628,12 @@ QList NoteStore::listSharedNotebooks( } QByteArray params = NoteStore_listSharedNotebooks_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listSharedNotebooks_readReply(reply); } @@ -10991,9 +11645,15 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listSharedNotebooks_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listSharedNotebooks_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listSharedNotebooks_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11139,7 +11799,12 @@ LinkedNotebook NoteStore::createLinkedNotebook( QByteArray params = NoteStore_createLinkedNotebook_prepareParams( ctx->authenticationToken(), linkedNotebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_createLinkedNotebook_readReply(reply); } @@ -11154,10 +11819,16 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_createLinkedNotebook_prepareParams( ctx->authenticationToken(), linkedNotebook); - return new AsyncResult(m_url, params, NoteStore_createLinkedNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_createLinkedNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11303,7 +11974,12 @@ qint32 NoteStore::updateLinkedNotebook( QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( ctx->authenticationToken(), linkedNotebook); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateLinkedNotebook_readReply(reply); } @@ -11318,10 +11994,16 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( ctx->authenticationToken(), linkedNotebook); - return new AsyncResult(m_url, params, NoteStore_updateLinkedNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateLinkedNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11470,7 +12152,12 @@ QList NoteStore::listLinkedNotebooks( } QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_listLinkedNotebooks_readReply(reply); } @@ -11482,9 +12169,15 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_listLinkedNotebooks_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_listLinkedNotebooks_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11630,7 +12323,12 @@ qint32 NoteStore::expungeLinkedNotebook( QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_expungeLinkedNotebook_readReply(reply); } @@ -11645,10 +12343,16 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_expungeLinkedNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_expungeLinkedNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11794,7 +12498,12 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( shareKeyOrGlobalId, ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_authenticateToSharedNotebook_readReply(reply); } @@ -11809,10 +12518,16 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( shareKeyOrGlobalId, ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNotebook_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_authenticateToSharedNotebook_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -11947,7 +12662,12 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( } QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getSharedNotebookByAuth_readReply(reply); } @@ -11959,9 +12679,15 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_getSharedNotebookByAuth_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getSharedNotebookByAuth_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12090,7 +12816,12 @@ void NoteStore::emailNote( QByteArray params = NoteStore_emailNote_prepareParams( ctx->authenticationToken(), parameters); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + NoteStore_emailNote_readReply(reply); } @@ -12105,10 +12836,16 @@ AsyncResult * NoteStore::emailNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_emailNote_prepareParams( ctx->authenticationToken(), parameters); - return new AsyncResult(m_url, params, NoteStore_emailNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_emailNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12254,7 +12991,12 @@ QString NoteStore::shareNote( QByteArray params = NoteStore_shareNote_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_shareNote_readReply(reply); } @@ -12269,10 +13011,16 @@ AsyncResult * NoteStore::shareNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_shareNote_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_shareNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_shareNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12401,7 +13149,12 @@ void NoteStore::stopSharingNote( QByteArray params = NoteStore_stopSharingNote_prepareParams( ctx->authenticationToken(), guid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + NoteStore_stopSharingNote_readReply(reply); } @@ -12416,10 +13169,16 @@ AsyncResult * NoteStore::stopSharingNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_stopSharingNote_prepareParams( ctx->authenticationToken(), guid); - return new AsyncResult(m_url, params, NoteStore_stopSharingNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_stopSharingNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12575,7 +13334,12 @@ AuthenticationResult NoteStore::authenticateToSharedNote( guid, noteKey, ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_authenticateToSharedNote_readReply(reply); } @@ -12592,11 +13356,17 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( guid, noteKey, ctx->authenticationToken()); - return new AsyncResult(m_url, params, NoteStore_authenticateToSharedNote_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_authenticateToSharedNote_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12752,7 +13522,12 @@ RelatedResult NoteStore::findRelated( ctx->authenticationToken(), query, resultSpec); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_findRelated_readReply(reply); } @@ -12769,11 +13544,17 @@ AsyncResult * NoteStore::findRelatedAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_findRelated_prepareParams( ctx->authenticationToken(), query, resultSpec); - return new AsyncResult(m_url, params, NoteStore_findRelated_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_findRelated_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -12919,7 +13700,12 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( ctx->authenticationToken(), note); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_updateNoteIfUsnMatches_readReply(reply); } @@ -12934,10 +13720,16 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( ctx->authenticationToken(), note); - return new AsyncResult(m_url, params, NoteStore_updateNoteIfUsnMatches_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_updateNoteIfUsnMatches_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -13083,7 +13875,12 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( QByteArray params = NoteStore_manageNotebookShares_prepareParams( ctx->authenticationToken(), parameters); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_manageNotebookShares_readReply(reply); } @@ -13098,10 +13895,16 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_manageNotebookShares_prepareParams( ctx->authenticationToken(), parameters); - return new AsyncResult(m_url, params, NoteStore_manageNotebookShares_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_manageNotebookShares_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -13247,7 +14050,12 @@ ShareRelationships NoteStore::getNotebookShares( QByteArray params = NoteStore_getNotebookShares_prepareParams( ctx->authenticationToken(), notebookGuid); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return NoteStore_getNotebookShares_readReply(reply); } @@ -13262,10 +14070,16 @@ AsyncResult * NoteStore::getNotebookSharesAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = NoteStore_getNotebookShares_prepareParams( ctx->authenticationToken(), notebookGuid); - return new AsyncResult(m_url, params, NoteStore_getNotebookShares_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + NoteStore_getNotebookShares_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -13555,7 +14369,12 @@ bool UserStore::checkVersion( clientName, edamVersionMajor, edamVersionMinor); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_checkVersion_readReply(reply); } @@ -13574,11 +14393,17 @@ AsyncResult * UserStore::checkVersionAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_checkVersion_prepareParams( clientName, edamVersionMajor, edamVersionMinor); - return new AsyncResult(m_url, params, UserStore_checkVersion_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_checkVersion_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -13686,7 +14511,12 @@ BootstrapInfo UserStore::getBootstrapInfo( } QByteArray params = UserStore_getBootstrapInfo_prepareParams( locale); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_getBootstrapInfo_readReply(reply); } @@ -13701,9 +14531,15 @@ AsyncResult * UserStore::getBootstrapInfoAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_getBootstrapInfo_prepareParams( locale); - return new AsyncResult(m_url, params, UserStore_getBootstrapInfo_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_getBootstrapInfo_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -13888,7 +14724,12 @@ AuthenticationResult UserStore::authenticateLongSession( deviceIdentifier, deviceDescription, supportsTwoFactor); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_authenticateLongSession_readReply(reply); } @@ -13912,6 +14753,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_authenticateLongSession_prepareParams( username, password, @@ -13920,7 +14762,12 @@ AsyncResult * UserStore::authenticateLongSessionAsync( deviceIdentifier, deviceDescription, supportsTwoFactor); - return new AsyncResult(m_url, params, UserStore_authenticateLongSession_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_authenticateLongSession_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14075,7 +14922,12 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( oneTimeCode, deviceIdentifier, deviceDescription); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_completeTwoFactorAuthentication_readReply(reply); } @@ -14093,12 +14945,18 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( ctx->authenticationToken(), oneTimeCode, deviceIdentifier, deviceDescription); - return new AsyncResult(m_url, params, UserStore_completeTwoFactorAuthentication_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_completeTwoFactorAuthentication_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14206,7 +15064,12 @@ void UserStore::revokeLongSession( } QByteArray params = UserStore_revokeLongSession_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + UserStore_revokeLongSession_readReply(reply); } @@ -14218,9 +15081,15 @@ AsyncResult * UserStore::revokeLongSessionAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_revokeLongSession_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, UserStore_revokeLongSession_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_revokeLongSession_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14345,7 +15214,12 @@ AuthenticationResult UserStore::authenticateToBusiness( } QByteArray params = UserStore_authenticateToBusiness_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_authenticateToBusiness_readReply(reply); } @@ -14357,9 +15231,15 @@ AsyncResult * UserStore::authenticateToBusinessAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_authenticateToBusiness_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, UserStore_authenticateToBusiness_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_authenticateToBusiness_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14484,7 +15364,12 @@ User UserStore::getUser( } QByteArray params = UserStore_getUser_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_getUser_readReply(reply); } @@ -14496,9 +15381,15 @@ AsyncResult * UserStore::getUserAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_getUser_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, UserStore_getUser_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_getUser_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14636,7 +15527,12 @@ PublicUserInfo UserStore::getPublicUserInfo( } QByteArray params = UserStore_getPublicUserInfo_prepareParams( username); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_getPublicUserInfo_readReply(reply); } @@ -14651,9 +15547,15 @@ AsyncResult * UserStore::getPublicUserInfoAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_getPublicUserInfo_prepareParams( username); - return new AsyncResult(m_url, params, UserStore_getPublicUserInfo_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_getPublicUserInfo_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14778,7 +15680,12 @@ UserUrls UserStore::getUserUrls( } QByteArray params = UserStore_getUserUrls_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_getUserUrls_readReply(reply); } @@ -14790,9 +15697,15 @@ AsyncResult * UserStore::getUserUrlsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_getUserUrls_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, UserStore_getUserUrls_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_getUserUrls_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -14911,7 +15824,12 @@ void UserStore::inviteToBusiness( QByteArray params = UserStore_inviteToBusiness_prepareParams( ctx->authenticationToken(), emailAddress); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + UserStore_inviteToBusiness_readReply(reply); } @@ -14926,10 +15844,16 @@ AsyncResult * UserStore::inviteToBusinessAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_inviteToBusiness_prepareParams( ctx->authenticationToken(), emailAddress); - return new AsyncResult(m_url, params, UserStore_inviteToBusiness_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_inviteToBusiness_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15058,7 +15982,12 @@ void UserStore::removeFromBusiness( QByteArray params = UserStore_removeFromBusiness_prepareParams( ctx->authenticationToken(), emailAddress); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + UserStore_removeFromBusiness_readReply(reply); } @@ -15073,10 +16002,16 @@ AsyncResult * UserStore::removeFromBusinessAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_removeFromBusiness_prepareParams( ctx->authenticationToken(), emailAddress); - return new AsyncResult(m_url, params, UserStore_removeFromBusiness_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_removeFromBusiness_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15215,7 +16150,12 @@ void UserStore::updateBusinessUserIdentifier( ctx->authenticationToken(), oldEmailAddress, newEmailAddress); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + UserStore_updateBusinessUserIdentifier_readReply(reply); } @@ -15232,11 +16172,17 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( ctx->authenticationToken(), oldEmailAddress, newEmailAddress); - return new AsyncResult(m_url, params, UserStore_updateBusinessUserIdentifier_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_updateBusinessUserIdentifier_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15375,7 +16321,12 @@ QList UserStore::listBusinessUsers( } QByteArray params = UserStore_listBusinessUsers_prepareParams( ctx->authenticationToken()); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_listBusinessUsers_readReply(reply); } @@ -15387,9 +16338,15 @@ AsyncResult * UserStore::listBusinessUsersAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_listBusinessUsers_prepareParams( ctx->authenticationToken()); - return new AsyncResult(m_url, params, UserStore_listBusinessUsers_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_listBusinessUsers_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15539,7 +16496,12 @@ QList UserStore::listBusinessInvitations( QByteArray params = UserStore_listBusinessInvitations_prepareParams( ctx->authenticationToken(), includeRequestedInvitations); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_listBusinessInvitations_readReply(reply); } @@ -15554,10 +16516,16 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_listBusinessInvitations_prepareParams( ctx->authenticationToken(), includeRequestedInvitations); - return new AsyncResult(m_url, params, UserStore_listBusinessInvitations_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_listBusinessInvitations_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15675,7 +16643,12 @@ AccountLimits UserStore::getAccountLimits( } QByteArray params = UserStore_getAccountLimits_prepareParams( serviceLevel); - QByteArray reply = askEvernote(m_url, params); + + QByteArray reply = askEvernote( + m_url, + params, + ctx->requestTimeout()); + return UserStore_getAccountLimits_readReply(reply); } @@ -15690,9 +16663,15 @@ AsyncResult * UserStore::getAccountLimitsAsync( if (!ctx) { ctx = m_ctx; } + QByteArray params = UserStore_getAccountLimits_prepareParams( serviceLevel); - return new AsyncResult(m_url, params, UserStore_getAccountLimits_readReplyAsync); + + return new AsyncResult( + m_url, + params, + ctx->requestTimeout(), + UserStore_getAccountLimits_readReplyAsync); } //////////////////////////////////////////////////////////////////////////////// From 47dd76e1adcc66bd0bf263c3682e300a72af7413 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 26 Oct 2019 12:43:35 +0300 Subject: [PATCH 051/188] Add dedicated NetworkException class for various network level errors handling --- QEverCloud/headers/Exceptions.h | 97 +++-- QEverCloud/src/DurableService.cpp | 52 ++- QEverCloud/src/Exceptions.cpp | 410 ++++++++++++-------- QEverCloud/src/Http.cpp | 22 +- QEverCloud/src/Http.h | 14 +- QEverCloud/src/tests/TestDurableService.cpp | 16 +- 6 files changed, 405 insertions(+), 206 deletions(-) diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index 237c702e..96cfe782 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -15,12 +15,53 @@ #include "generated/EDAMErrorCode.h" #include "generated/Types.h" +#include #include #include #include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + +/** + * @brief The NetworkException class represents QNetworkReply level errors. + */ +class QEVERCLOUD_EXPORT NetworkException: public EverCloudException +{ +public: + NetworkException(); + NetworkException(QNetworkReply::NetworkError error); + NetworkException(QNetworkReply::NetworkError error, QString message); + + QNetworkReply::NetworkError type() const; + + const char * what() const noexcept override; + + virtual QSharedPointer exceptionData() const override; + +protected: + QNetworkReply::NetworkError m_type; +}; + +/** + * Asynchronous API counterpart of NetworkException. See EverCloudExceptionData + * for more details. + */ +class QEVERCLOUD_EXPORT NetworkExceptionData: public EverCloudExceptionData +{ + Q_OBJECT + Q_DISABLE_COPY(NetworkExceptionData) +public: + explicit NetworkExceptionData(QString error, QNetworkReply::NetworkError type); + virtual void throwException() const override; + +protected: + QNetworkReply::NetworkError m_type; +}; + +//////////////////////////////////////////////////////////////////////////////// + /** * Errors of the Thrift protocol level. It could be wrongly formatted parameters * or return values for example. @@ -46,16 +87,16 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException Type type() const; - const char * what() const throw() Q_DECL_OVERRIDE; + const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + virtual QSharedPointer exceptionData() const override; protected: Type m_type; }; /** - * Asynchronous API conterpart of ThriftException. See EverCloudExceptionData + * Asynchronous API counterpart of ThriftException. See EverCloudExceptionData * for more details. */ class QEVERCLOUD_EXPORT ThriftExceptionData: public EverCloudExceptionData @@ -64,20 +105,16 @@ class QEVERCLOUD_EXPORT ThriftExceptionData: public EverCloudExceptionData Q_DISABLE_COPY(ThriftExceptionData) public: explicit ThriftExceptionData(QString error, ThriftException::Type type); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; protected: ThriftException::Type m_type; }; -inline QSharedPointer ThriftException::exceptionData() const -{ - return QSharedPointer( - new ThriftExceptionData(QString::fromUtf8(what()), type())); -} +//////////////////////////////////////////////////////////////////////////////// /** - * Asynchronous API conterpart of EDAMUserException. See EverCloudExceptionData + * Asynchronous API counterpart of EDAMUserException. See EverCloudExceptionData * for more details. */ class QEVERCLOUD_EXPORT EDAMUserExceptionData: public EvernoteExceptionData @@ -88,15 +125,17 @@ class QEVERCLOUD_EXPORT EDAMUserExceptionData: public EvernoteExceptionData explicit EDAMUserExceptionData( QString error, EDAMErrorCode errorCode, Optional parameter); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; protected: EDAMErrorCode m_errorCode; Optional m_parameter; }; +//////////////////////////////////////////////////////////////////////////////// + /** - * Asynchronous API conterpart of EDAMSystemException. + * Asynchronous API counterpart of EDAMSystemException. * See EverCloudExceptionData for more details. */ class QEVERCLOUD_EXPORT EDAMSystemExceptionData: public EvernoteExceptionData @@ -108,7 +147,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionData: public EvernoteExceptionData QString err, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; protected: EDAMErrorCode m_errorCode; @@ -116,8 +155,10 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionData: public EvernoteExceptionData Optional m_rateLimitDuration; }; +//////////////////////////////////////////////////////////////////////////////// + /** - * Asynchronous API conterpart of EDAMNotFoundException. + * Asynchronous API counterpart of EDAMNotFoundException. * See EverCloudExceptionData for more details. */ class QEVERCLOUD_EXPORT EDAMNotFoundExceptionData: public EvernoteExceptionData @@ -128,15 +169,17 @@ class QEVERCLOUD_EXPORT EDAMNotFoundExceptionData: public EvernoteExceptionData explicit EDAMNotFoundExceptionData( QString error, Optional identifier, Optional key); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; protected: Optional m_identifier; Optional m_key; }; +//////////////////////////////////////////////////////////////////////////////// + /** - * Asynchronous API conterpart of EDAMInvalidContactsException. + * Asynchronous API counterpart of EDAMInvalidContactsException. * See EverCloudExceptionData for more details. */ class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: @@ -149,7 +192,7 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: QList contacts, Optional parameter, Optional > reasons); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; protected: QList m_contacts; @@ -157,6 +200,8 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsExceptionData: Optional> m_reasons; }; +//////////////////////////////////////////////////////////////////////////////// + /** * EDAMSystemException for `errorCode = RATE_LIMIT_REACHED` */ @@ -164,11 +209,13 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + virtual QSharedPointer exceptionData() const override; }; +//////////////////////////////////////////////////////////////////////////////// + /** - * Asynchronous API conterpart of EDAMSystemExceptionRateLimitReached. + * Asynchronous API counterpart of EDAMSystemExceptionRateLimitReached. * See EverCloudExceptionData for more details. */ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: @@ -181,20 +228,24 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; }; +//////////////////////////////////////////////////////////////////////////////// + /** * EDAMSystemException for `errorCode = AUTH_EXPIRED` */ class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpired: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + virtual QSharedPointer exceptionData() const override; }; +//////////////////////////////////////////////////////////////////////////////// + /** - * Asynchronous API conterpart of EDAMSystemExceptionAuthExpired. + * Asynchronous API counterpart of EDAMSystemExceptionAuthExpired. * See EverCloudExceptionData for more details. */ class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpiredData: @@ -207,7 +258,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpiredData: QString error, EDAMErrorCode errorCode, Optional message, Optional rateLimitDuration); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; }; } // namespace qevercloud diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 44f5df19..1176d475 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -46,16 +46,58 @@ struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy return true; } - try { + try + { exceptionData->throwException(); } - catch(const ThriftException &) { - return true; + catch(const NetworkException & e) + { + switch(e.type()) + { + case QNetworkReply::TimeoutError: + return true; + case QNetworkReply::TemporaryNetworkFailureError: + return true; + case QNetworkReply::NetworkSessionFailedError: + return true; + case QNetworkReply::ProxyConnectionClosedError: + return true; + case QNetworkReply::ProxyTimeoutError: + return true; + case QNetworkReply::ContentReSendError: + return true; + case QNetworkReply::InternalServerError: + return true; + case QNetworkReply::ServiceUnavailableError: + return true; + case QNetworkReply::ProtocolFailure: + return true; + default: + return false; + } } - catch(const EDAMSystemException &) { + catch(const ThriftException & e) + { + switch(e.type()) + { + case ThriftException::Type::BAD_SEQUENCE_ID: + return true; + case ThriftException::Type::INTERNAL_ERROR: + return true; + case ThriftException::Type::PROTOCOL_ERROR: + return true; + case ThriftException::Type::UNKNOWN: + return true; + default: + return false; + } + } + catch(const EDAMSystemException &) + { return true; } - catch(...) { + catch(...) + { } return false; diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 25983934..d4f2372e 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -14,8 +14,138 @@ #include #include +#include + namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + +NetworkException::NetworkException() : + EverCloudException(), + m_type(QNetworkReply::UnknownNetworkError) +{} + +NetworkException::NetworkException(QNetworkReply::NetworkError type) : + EverCloudException(), + m_type(type) +{} + +NetworkException::NetworkException( + QNetworkReply::NetworkError type, + QString message) : + EverCloudException(message), + m_type(type) +{} + +QNetworkReply::NetworkError NetworkException::type() const +{ + return m_type; +} + +const char * NetworkException::what() const noexcept +{ + if (m_error.isEmpty()) + { + switch (m_type) + { + case QNetworkReply::NoError: + return "NetworkException: No error"; + case QNetworkReply::ConnectionRefusedError: + return "NetworkException: Connection refused"; + case QNetworkReply::RemoteHostClosedError: + return "NetworkException: Remote host closed"; + case QNetworkReply::HostNotFoundError: + return "NetworkException: Host not found"; + case QNetworkReply::TimeoutError: + return "NetworkException: The connection to remote host timed out"; + case QNetworkReply::OperationCanceledError: + return "NetworkException: Operation canceled"; + case QNetworkReply::SslHandshakeFailedError: + return "NetworkError: SSL handshake failed"; + case QNetworkReply::TemporaryNetworkFailureError: + return "NetworkError: Temporary network failure"; + case QNetworkReply::NetworkSessionFailedError: + return "NetworkError: Network session failed"; + case QNetworkReply::BackgroundRequestNotAllowedError: + return "NetworkError: Background request not allowed"; + case QNetworkReply::TooManyRedirectsError: + return "NetworkError: Too many redirects"; + case QNetworkReply::InsecureRedirectError: + return "NetworkError: Insecure redirect"; + case QNetworkReply::ProxyConnectionRefusedError: + return "NetworkError: Proxy connection refused"; + case QNetworkReply::ProxyConnectionClosedError: + return "NetworkError: Proxy connection closed"; + case QNetworkReply::ProxyNotFoundError: + return "NetworkError: Proxy not found"; + case QNetworkReply::ProxyTimeoutError: + return "NetworkError: Proxy timeout"; + case QNetworkReply::ProxyAuthenticationRequiredError: + return "NetworkError: Proxy authentication required"; + case QNetworkReply::ContentAccessDenied: + return "NetworkError: Content access denied"; + case QNetworkReply::ContentOperationNotPermittedError: + return "NetworkError: Content operation not permitted"; + case QNetworkReply::ContentNotFoundError: + return "NetworkError: Content not found"; + case QNetworkReply::AuthenticationRequiredError: + return "NetworkError: Authentication required"; + case QNetworkReply::ContentReSendError: + return "NetworkError: Content resend failed"; + case QNetworkReply::ContentConflictError: + return "NetworkError: Content conflict error"; + case QNetworkReply::ContentGoneError: + return "NetworkError: Content gone"; + case QNetworkReply::InternalServerError: + return "NetworkError: Internal server error"; + case QNetworkReply::OperationNotImplementedError: + return "NetworkError: Operation not implemented error"; + case QNetworkReply::ServiceUnavailableError: + return "NetworkError: Service unavailable"; + case QNetworkReply::ProtocolUnknownError: + return "NetworkError: Protocol unknown"; + case QNetworkReply::ProtocolInvalidOperationError: + return "NetworkError: Protocol invalid operation"; + case QNetworkReply::UnknownNetworkError: + return "NetworkError: Unknown network"; + case QNetworkReply::UnknownProxyError: + return "NetworkError: Unknown proxy"; + case QNetworkReply::UnknownContentError: + return "NetworkError: Unknown content"; + case QNetworkReply::ProtocolFailure: + return "NetworkError: Protocol failure"; + case QNetworkReply::UnknownServerError: + return "NetworkError: Unknown server"; + default: + return "NetworkError: (Invlaid exception type)"; + } + } + else + { + return m_error.constData(); + } +} + +QSharedPointer NetworkException::exceptionData() const +{ + return QSharedPointer( + new NetworkExceptionData(QString::fromUtf8(what()), type())); +} + +NetworkExceptionData::NetworkExceptionData( + QString error, + QNetworkReply::NetworkError type) : + EverCloudExceptionData(error), + m_type(type) +{} + +void NetworkExceptionData::throwException() const +{ + throw NetworkException(m_type, errorMessage); +} + +//////////////////////////////////////////////////////////////////////////////// + ThriftException::ThriftException() : EverCloudException(), m_type(Type::UNKNOWN) @@ -36,97 +166,102 @@ ThriftException::Type ThriftException::type() const return m_type; } -QByteArray strEDAMErrorCode(EDAMErrorCode errorCode) +const char * ThriftException::what() const noexcept { - switch(errorCode) + if (m_error.isEmpty()) + { + switch (m_type) + { + case Type::UNKNOWN: + return "ThriftException: Unknown application exception"; + case Type::UNKNOWN_METHOD: + return "ThriftException: Unknown method"; + case Type::INVALID_MESSAGE_TYPE: + return "ThriftException: Invalid message type"; + case Type::WRONG_METHOD_NAME: + return "ThriftException: Wrong method name"; + case Type::BAD_SEQUENCE_ID: + return "ThriftException: Bad sequence identifier"; + case Type::MISSING_RESULT: + return "ThriftException: Missing result"; + case Type::INVALID_DATA: + return "ThriftException: Invalid data"; + default: + return "ThriftException: (Invalid exception type)"; + }; + } + else { - case EDAMErrorCode::UNKNOWN: - return "UNKNOWN"; - case EDAMErrorCode::BAD_DATA_FORMAT: - return "BAD_DATA_FORMAT"; - case EDAMErrorCode::PERMISSION_DENIED: - return "PERMISSION_DENIED"; - case EDAMErrorCode::INTERNAL_ERROR: - return "INTERNAL_ERROR"; - case EDAMErrorCode::DATA_REQUIRED: - return "DATA_REQUIRED"; - case EDAMErrorCode::LIMIT_REACHED: - return "LIMIT_REACHED"; - case EDAMErrorCode::QUOTA_REACHED: - return "QUOTA_REACHED"; - case EDAMErrorCode::INVALID_AUTH: - return "INVALID_AUTH"; - case EDAMErrorCode::AUTH_EXPIRED: - return "AUTH_EXPIRED"; - case EDAMErrorCode::DATA_CONFLICT: - return "DATA_CONFLICT"; - case EDAMErrorCode::ENML_VALIDATION: - return "ENML_VALIDATION"; - case EDAMErrorCode::SHARD_UNAVAILABLE: - return "SHARD_UNAVAILABLE"; - case EDAMErrorCode::LEN_TOO_SHORT: - return "LEN_TOO_SHORT"; - case EDAMErrorCode::LEN_TOO_LONG: - return "LEN_TOO_LONG"; - case EDAMErrorCode::TOO_FEW: - return "TOO_FEW"; - case EDAMErrorCode::TOO_MANY: - return "TOO_MANY"; - case EDAMErrorCode::UNSUPPORTED_OPERATION: - return "UNSUPPORTED_OPERATION"; - case EDAMErrorCode::TAKEN_DOWN: - return "TAKEN_DOWN"; - case EDAMErrorCode::RATE_LIMIT_REACHED: - return "RATE_LIMIT_REACHED"; - default: - return "UNRECOGNIZED_ERROR_CODE"; + return m_error.constData(); } } -const char * EDAMUserException::what() const throw() +QSharedPointer ThriftException::exceptionData() const +{ + return QSharedPointer( + new ThriftExceptionData(QString::fromUtf8(what()), type())); +} + +ThriftExceptionData::ThriftExceptionData( + QString error, + ThriftException::Type type) : + EverCloudExceptionData(error), + m_type(type) +{} + +void ThriftExceptionData::throwException() const +{ + throw ThriftException(m_type, errorMessage); +} + +//////////////////////////////////////////////////////////////////////////////// + +const char * EDAMUserException::what() const noexcept { if (m_error.isEmpty()) { - m_error = "EDAMUserException: " + strEDAMErrorCode(errorCode); + QTextStream strm(&m_error); + strm << "EDAMUserException: " << errorCode; if (parameter.isSet()) { - m_error += " parameter=" + parameter->toUtf8(); + strm << " parameter=" << parameter->toUtf8(); } } return EvernoteException::what(); } -const char * EDAMSystemException::what() const throw() +const char * EDAMSystemException::what() const noexcept { if (m_error.isEmpty()) { - m_error = "EDAMSystemException: " + strEDAMErrorCode(errorCode); + QTextStream strm(&m_error); + strm << "EDAMSystemException: " << errorCode; if (message.isSet()) { - m_error += " " + message->toUtf8(); + strm << " " << message->toUtf8(); } if (rateLimitDuration.isSet()) { - m_error += QString::fromUtf8(" rateLimitDuration= %1 sec.") - .arg(rateLimitDuration).toUtf8(); + strm << " rateLimitDuration= " << rateLimitDuration << " sec."; } } return EvernoteException::what(); } -const char * EDAMNotFoundException::what() const throw() +const char * EDAMNotFoundException::what() const noexcept { if (m_error.isEmpty()) { - m_error = "EDAMNotFoundException: "; + QTextStream strm(&m_error); + strm << "EDAMNotFoundException: "; if (identifier.isSet()) { - m_error += " identifier=" + identifier->toUtf8(); + strm << " identifier=" << identifier; } if (key.isSet()) { - m_error += " key=" + key->toUtf8(); + strm << " key=" << key; } } @@ -193,7 +328,8 @@ EDAMInvalidContactsException::exceptionData() const } EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData( - QList contacts, Optional parameter, + QList contacts, + Optional parameter, Optional > reasons) : EvernoteExceptionData(QStringLiteral("EDAMInvalidContactsExceptionData")), m_contacts(contacts), @@ -201,18 +337,18 @@ EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData( m_reasons(reasons) {} -const char * EDAMInvalidContactsException::what() const throw() +const char * EDAMInvalidContactsException::what() const noexcept { return "EDAMInvalidContactsException"; } void EDAMInvalidContactsExceptionData::throwException() const { - EDAMInvalidContactsException exception; - exception.contacts = m_contacts; - exception.parameter = m_parameter; - exception.reasons = m_reasons; - throw exception; + EDAMInvalidContactsException e; + e.contacts = m_contacts; + e.parameter = m_parameter; + e.reasons = m_reasons; + throw e; } QSharedPointer EDAMUserException::exceptionData() const @@ -223,10 +359,10 @@ QSharedPointer EDAMUserException::exceptionData() const void EDAMUserExceptionData::throwException() const { - EDAMUserException exception; - exception.errorCode = m_errorCode; - exception.parameter = m_parameter; - throw exception; + EDAMUserException e; + e.errorCode = m_errorCode; + e.parameter = m_parameter; + throw e; } QSharedPointer EDAMSystemException::exceptionData() const @@ -237,10 +373,11 @@ QSharedPointer EDAMSystemException::exceptionData() cons rateLimitDuration)); } -EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, - EDAMErrorCode errorCode, - Optional message, - Optional rateLimitDuration) : +EDAMSystemExceptionData::EDAMSystemExceptionData( + QString error, + EDAMErrorCode errorCode, + Optional message, + Optional rateLimitDuration) : EvernoteExceptionData(error), m_errorCode(errorCode), m_message(message), @@ -249,26 +386,27 @@ EDAMSystemExceptionData::EDAMSystemExceptionData(QString error, void EDAMSystemExceptionData::throwException() const { - EDAMSystemException exception; - exception.errorCode = m_errorCode; - exception.message = m_message; - exception.rateLimitDuration = m_rateLimitDuration; - throw exception; + EDAMSystemException e; + e.errorCode = m_errorCode; + e.message = m_message; + e.rateLimitDuration = m_rateLimitDuration; + throw e; } EDAMSystemExceptionRateLimitReachedData::EDAMSystemExceptionRateLimitReachedData( - QString error, EDAMErrorCode errorCode, Optional message, + QString error, EDAMErrorCode errorCode, + Optional message, Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) {} void EDAMSystemExceptionRateLimitReachedData::throwException() const { - EDAMSystemExceptionRateLimitReached exception; - exception.errorCode = m_errorCode; - exception.message = m_message; - exception.rateLimitDuration = m_rateLimitDuration; - throw exception; + EDAMSystemExceptionRateLimitReached e; + e.errorCode = m_errorCode; + e.message = m_message; + e.rateLimitDuration = m_rateLimitDuration; + throw e; } QSharedPointer EDAMNotFoundException::exceptionData() const @@ -277,9 +415,10 @@ QSharedPointer EDAMNotFoundException::exceptionData() co new EDAMNotFoundExceptionData(QString::fromUtf8(what()), identifier, key)); } -EDAMNotFoundExceptionData::EDAMNotFoundExceptionData(QString error, - Optional identifier, - Optional key) : +EDAMNotFoundExceptionData::EDAMNotFoundExceptionData( + QString error, + Optional identifier, + Optional key) : EvernoteExceptionData(error), m_identifier(identifier), m_key(key) @@ -287,58 +426,28 @@ EDAMNotFoundExceptionData::EDAMNotFoundExceptionData(QString error, void EDAMNotFoundExceptionData::throwException() const { - EDAMNotFoundException exception; - exception.identifier = m_identifier; - exception.key = m_key; - throw exception; -} - -const char * ThriftException::what() const throw() -{ - if (m_error.isEmpty()) - { - switch (m_type) - { - case Type::UNKNOWN: - return "ThriftException: Unknown application exception"; - case Type::UNKNOWN_METHOD: - return "ThriftException: Unknown method"; - case Type::INVALID_MESSAGE_TYPE: - return "ThriftException: Invalid message type"; - case Type::WRONG_METHOD_NAME: - return "ThriftException: Wrong method name"; - case Type::BAD_SEQUENCE_ID: - return "ThriftException: Bad sequence identifier"; - case Type::MISSING_RESULT: - return "ThriftException: Missing result"; - case Type::INVALID_DATA: - return "ThriftException: Invalid data"; - default: - return "ThriftException: (Invalid exception type)"; - }; - } - else - { - return m_error.constData(); - } + EDAMNotFoundException e; + e.identifier = m_identifier; + e.key = m_key; + throw e; } void throwEDAMSystemException(const EDAMSystemException & baseException) { if (baseException.errorCode == EDAMErrorCode::AUTH_EXPIRED) { - EDAMSystemExceptionAuthExpired exception; - exception.errorCode = exception.errorCode; - exception.message = exception.message; - exception.rateLimitDuration = exception.rateLimitDuration; - throw exception; + EDAMSystemExceptionAuthExpired e; + e.errorCode = baseException.errorCode; + e.message = baseException.message; + e.rateLimitDuration = baseException.rateLimitDuration; + throw e; } if (baseException.errorCode == EDAMErrorCode::RATE_LIMIT_REACHED) { - EDAMSystemExceptionRateLimitReached exception; - exception.errorCode = exception.errorCode; - exception.message = exception.message; - exception.rateLimitDuration = exception.rateLimitDuration; - throw exception; + EDAMSystemExceptionRateLimitReached e; + e.errorCode = baseException.errorCode; + e.message = baseException.message; + e.rateLimitDuration = baseException.rateLimitDuration; + throw e; } throw baseException; @@ -348,48 +457,45 @@ QSharedPointer EDAMSystemExceptionRateLimitReached::exceptionData() const { return QSharedPointer( - new EDAMSystemExceptionRateLimitReachedData(QString::fromUtf8(what()), - errorCode, message, - rateLimitDuration)); + new EDAMSystemExceptionRateLimitReachedData( + QString::fromUtf8(what()), + errorCode, + message, + rateLimitDuration)); } QSharedPointer EDAMSystemExceptionAuthExpired::exceptionData() const { return QSharedPointer( - new EDAMSystemExceptionAuthExpiredData(QString::fromUtf8(what()), - errorCode, message, - rateLimitDuration)); + new EDAMSystemExceptionAuthExpiredData( + QString::fromUtf8(what()), + errorCode, + message, + rateLimitDuration)); } EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData( - QString error, EDAMErrorCode errorCode, Optional message, + QString error, + EDAMErrorCode errorCode, + Optional message, Optional rateLimitDuration) : EDAMSystemExceptionData(error, errorCode, message, rateLimitDuration) {} void EDAMSystemExceptionAuthExpiredData::throwException() const { - EDAMSystemExceptionAuthExpired exception; - exception.errorCode = m_errorCode; - exception.message = m_message; - exception.rateLimitDuration = m_rateLimitDuration; - throw exception; -} - -ThriftExceptionData::ThriftExceptionData(QString error, ThriftException::Type type) : - EverCloudExceptionData(error), - m_type(type) -{} - -void ThriftExceptionData::throwException() const -{ - throw ThriftException(m_type, errorMessage); + EDAMSystemExceptionAuthExpired e; + e.errorCode = m_errorCode; + e.message = m_message; + e.rateLimitDuration = m_rateLimitDuration; + throw e; } -EDAMUserExceptionData::EDAMUserExceptionData(QString error, - EDAMErrorCode errorCode, - Optional parameter) : +EDAMUserExceptionData::EDAMUserExceptionData( + QString error, + EDAMErrorCode errorCode, + Optional parameter) : EvernoteExceptionData(error), m_errorCode(errorCode), m_parameter(parameter) diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 656ec743..04ee8c53 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -45,13 +45,11 @@ void ReplyFetcher::start( QNetworkAccessManager * nam, QNetworkRequest request, qint64 timeoutMsec, QByteArray postData) { - m_httpStatusCode= 0; + m_httpStatusCode = 0; + m_errorType = QNetworkReply::NoError; m_errorText.clear(); m_receivedData.clear(); - // NOTE: onFinished slot might not be called so initializing to true - m_success = true; - m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); m_timeoutMsec = timeoutMsec; m_ticker->start(1000); @@ -90,7 +88,7 @@ void ReplyFetcher::checkForTimeout() } if ((QDateTime::currentMSecsSinceEpoch() - m_lastNetworkTime) > m_timeoutMsec) { - setError(QStringLiteral("Connection timeout.")); + setError(QNetworkReply::TimeoutError, QStringLiteral("Connection timeout.")); } } @@ -98,7 +96,7 @@ void ReplyFetcher::onFinished() { m_ticker->stop(); - if (!m_success) { + if (m_errorType != QNetworkReply::NoError) { return; } @@ -112,8 +110,7 @@ void ReplyFetcher::onFinished() void ReplyFetcher::onError(QNetworkReply::NetworkError error) { - Q_UNUSED(error) - setError(m_reply->errorString()); + setError(error, m_reply->errorString()); } void ReplyFetcher::onSslErrors(QList errors) @@ -125,12 +122,12 @@ void ReplyFetcher::onSslErrors(QList errors) errorText += error.errorString().append(QStringLiteral("\n")); } - setError(errorText); + setError(QNetworkReply::SslHandshakeFailedError, errorText); } -void ReplyFetcher::setError(QString errorText) +void ReplyFetcher::setError( + QNetworkReply::NetworkError errorType, QString errorText) { - m_success = false; m_ticker->stop(); m_errorText = errorText; QObject::disconnect(m_reply.data()); @@ -181,9 +178,10 @@ QByteArray simpleDownload( } if (fetcher->isError()) { + auto errorType = fetcher->errorType(); QString errorText = fetcher->errorText(); fetcher->deleteLater(); - throw EverCloudException(errorText); + throw NetworkException(errorType, errorText); } QByteArray receivedData = fetcher->receivedData(); diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index b623e01f..180bc48d 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -44,13 +44,15 @@ class ReplyFetcher: public QObject void start(QNetworkAccessManager * nam, QNetworkRequest request, qint64 timeoutMsec, QByteArray postData = QByteArray()); - bool isError() { return !m_success; } + bool isError() const { return m_errorType != QNetworkReply::NoError; } - QString errorText() { return m_errorText; } + QNetworkReply::NetworkError errorType() const { return m_errorType; } - QByteArray receivedData() { return m_receivedData; } + QString errorText() const { return m_errorText; } - int httpStatusCode() { return m_httpStatusCode; } + QByteArray receivedData() const { return m_receivedData; } + + int httpStatusCode() const { return m_httpStatusCode; } Q_SIGNALS: void replyFetched(QObject * self); // sends itself @@ -63,12 +65,12 @@ private Q_SLOTS: void checkForTimeout(); private: - void setError(QString errorText); + void setError(QNetworkReply::NetworkError errorType, QString errorText); private: QSharedPointer m_reply; - bool m_success = false; + QNetworkReply::NetworkError m_errorType = QNetworkReply::NoError; QString m_errorText; QByteArray m_receivedData; int m_httpStatusCode = 0; diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 01c8f324..57d1941c 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -128,7 +128,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() { QSharedPointer data; try { - throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + throw NetworkException(QNetworkReply::TimeoutError); } catch(const EverCloudException & e) { data = e.exceptionData(); @@ -173,7 +173,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() { QSharedPointer data; try { - throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + throw NetworkException(QNetworkReply::TimeoutError); } catch(const EverCloudException & e) { data = e.exceptionData(); @@ -225,7 +225,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() ++serviceCallCounter; QSharedPointer data; try { - throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + throw NetworkException(QNetworkReply::TimeoutError); } catch(const EverCloudException & e) { data = e.exceptionData(); @@ -244,9 +244,9 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() try { result.second->throwException(); } - catch(const ThriftException & e) { + catch(const NetworkException & e) { exceptionCaught = true; - QVERIFY(e.type() == ThriftException::Type::INTERNAL_ERROR); + QVERIFY(e.type() == QNetworkReply::TimeoutError); } QVERIFY(exceptionCaught); } @@ -273,7 +273,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() ++serviceCallCounter; QSharedPointer data; try { - throw ThriftException(ThriftException::Type::INTERNAL_ERROR); + throw NetworkException(QNetworkReply::TimeoutError); } catch(const EverCloudException & e) { data = e.exceptionData(); @@ -303,9 +303,9 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() try { valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) { + catch(const NetworkException & e) { exceptionCaught = true; - QVERIFY(e.type() == ThriftException::Type::INTERNAL_ERROR); + QVERIFY(e.type() == QNetworkReply::TimeoutError); } QVERIFY(exceptionCaught); } From 57a8a0f6f182092c3c60b0ca551450caf68eff21 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 29 Oct 2019 22:20:02 +0300 Subject: [PATCH 052/188] Migrate from using QSharedPointer to using std::shared_ptr across the codebase --- QEverCloud/headers/AsyncResult.h | 32 +++--- QEverCloud/headers/DurableService.h | 4 +- QEverCloud/headers/EverCloudException.h | 105 ++++++++++++-------- QEverCloud/headers/Exceptions.h | 9 +- QEverCloud/headers/generated/Types.h | 9 +- QEverCloud/src/AsyncResult.cpp | 4 +- QEverCloud/src/AsyncResult_p.cpp | 39 ++++---- QEverCloud/src/AsyncResult_p.h | 6 +- QEverCloud/src/DurableService.cpp | 10 +- QEverCloud/src/EverCloudException.cpp | 11 +- QEverCloud/src/Exceptions.cpp | 67 ++++++------- QEverCloud/src/Globals.cpp | 20 ++-- QEverCloud/src/Http.cpp | 23 +++-- QEverCloud/src/Http.h | 5 +- QEverCloud/src/Thumbnail.cpp | 6 +- QEverCloud/src/tests/TestDurableService.cpp | 38 ++++--- QEverCloud/src/tests/TestDurableService.h | 2 + 17 files changed, 212 insertions(+), 178 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index df421053..2ce16c37 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -33,16 +33,15 @@ NoteStore* ns; Note note; ... QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, - [ns](QVariant result, - QSharedPointer error) + [ns](QVariant result, EverCloudExceptionDataPtr error) { - if(!error.isNull()) { - // do something in case of an error - } - else { - Note note = result.value(); - // process returned result - } + if (error) { + // do something in case of an error + } + else { + Note note = result.value(); + // process returned result + } }); @endcode */ @@ -67,7 +66,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * Constructor accepting already prepared value and/or exception, * for use in tests */ - AsyncResult(QVariant result, QSharedPointer error, + AsyncResult(QVariant result, EverCloudExceptionDataPtr error, bool autoDelete = true, QObject * parent = nullptr); ~AsyncResult(); @@ -85,14 +84,23 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * @brief Emitted upon asyncronous call completition. * @param result * @param error - * error.isNull() != true in case of an error. See EverCloudExceptionData + * error != nullptr in case of an error. See EverCloudExceptionData * for more details. * * AsyncResult deletes itself after emitting this signal (if autoDelete * parameter passed to its constructor was set to true). You don't have to * manage it's lifetime explicitly. + * + * NOTE: in order to use this signal with queued connections (either via + * explicit specification of Qt::QueuedConnection connection type or just + * via connecting signals and slots of objects living in different threads), + * you must make this call before creating any such connection: + * + * @code + * qRegisterMetaType("EverCloudExceptionDataPtr"); + * @endcode */ - void finished(QVariant result, QSharedPointer error); + void finished(QVariant result, EverCloudExceptionDataPtr error); private: friend class DurableService; diff --git a/QEverCloud/headers/DurableService.h b/QEverCloud/headers/DurableService.h index e4227e8c..7b2a3c42 100644 --- a/QEverCloud/headers/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -26,7 +26,7 @@ namespace qevercloud { struct QEVERCLOUD_EXPORT IRetryPolicy { virtual bool shouldRetry( - QSharedPointer exceptionData) = 0; + EverCloudExceptionDataPtr exceptionData) = 0; }; using IRetryPolicyPtr = std::shared_ptr; @@ -38,7 +38,7 @@ QT_FORWARD_DECLARE_CLASS(DurableServicePrivate) class QEVERCLOUD_EXPORT IDurableService { public: - using SyncResult = std::pair>; + using SyncResult = std::pair; using SyncServiceCall = std::function; using AsyncServiceCall = std::function; diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index d853ac0e..e27d4bf6 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -14,14 +14,20 @@ #include #include -#include #include +#include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + class QEVERCLOUD_EXPORT EverCloudExceptionData; +using EverCloudExceptionDataPtr = std::shared_ptr; + +//////////////////////////////////////////////////////////////////////////////// + /** * All exceptions thrown by the library are of this class or its descendants. */ @@ -40,9 +46,11 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception const char * what() const noexcept; - virtual QSharedPointer exceptionData() const; + virtual EverCloudExceptionDataPtr exceptionData() const; }; +//////////////////////////////////////////////////////////////////////////////// + /** * @brief EverCloudException counterpart for asynchronous API. * @@ -63,47 +71,54 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception NoteStore* ns; ... QObject::connect(ns->getNotebook(notebookGuid), &AsyncResult::finished, - [](QVariant result, - QSharedPointer error) + [](QVariant result, EverCloudExceptionDataPtr error) { - if(!error.isNull()) { - QSharedPointer errorNotFound = - error.objectCast(); - QSharedPointer errorUser = - error.objectCast(); - QSharedPointer errorSystem = - error.objectCast(); - if(!errorNotFound.isNull()) { - qDebug() << "notebook not found" - << errorNotFound.identifier << errorNotFound.key; - } - else if(!errorUser.isNull()) { - qDebug() << errorUser.errorMessage; - } - else if(!errorSystem.isNull()) { - if(errorSystem.errorCode == - EDAMErrorCode::RATE_LIMIT_REACHED) - { - qDebug() << "Evernote API rate limits are reached"; - } - else if(errorSystem.errorCode == - EDAMErrorCode::AUTH_EXPIRED) - { - qDebug() << "Authorization token is inspired"; - } - else { - // some other Evernote trouble - qDebug() << errorSystem.errorMessage; - } - } - else { - // some unexpected error - qDebug() << error.errorMessage; - } - } - else { - // success - } + if (error) + { + std::shared_ptr errorNotFound = + error.objectCast(); + std::shared_ptr errorUser = + error.objectCast(); + std::shared_ptr errorSystem = + error.objectCast(); + + if (!errorNotFound.isNull()) + { + qDebug() << "notebook not found" + << errorNotFound.identifier << errorNotFound.key; + } + else if (!errorUser.isNull()) + { + qDebug() << errorUser.errorMessage; + } + else if (!errorSystem.isNull()) + { + if (errorSystem.errorCode == + EDAMErrorCode::RATE_LIMIT_REACHED) + { + qDebug() << "Evernote API rate limits are reached"; + } + else if (errorSystem.errorCode == + EDAMErrorCode::AUTH_EXPIRED) + { + qDebug() << "Authorization token is inspired"; + } + else + { + // some other Evernote trouble + qDebug() << errorSystem.errorMessage; + } + } + else + { + // some unexpected error + qDebug() << error.errorMessage; + } + } + else + { + // success + } }); @endcode @@ -128,6 +143,8 @@ class QEVERCLOUD_EXPORT EverCloudExceptionData: public QObject virtual void throwException() const; }; +//////////////////////////////////////////////////////////////////////////////// + /** * All exception sent by Evernote servers (as opposed to other error conditions, * for example http errors) are descendants of this class. @@ -140,9 +157,11 @@ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException explicit EvernoteException(const std::string & error); explicit EvernoteException(const char * error); - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + virtual EverCloudExceptionDataPtr exceptionData() const Q_DECL_OVERRIDE; }; +//////////////////////////////////////////////////////////////////////////////// + /** * Asynchronous API conterpart of EvernoteException. See EverCloudExceptionData * for more details. diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index 96cfe782..7a6d6ac9 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -17,7 +17,6 @@ #include #include -#include #include namespace qevercloud { @@ -38,7 +37,7 @@ class QEVERCLOUD_EXPORT NetworkException: public EverCloudException const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; protected: QNetworkReply::NetworkError m_type; @@ -89,7 +88,7 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; protected: Type m_type; @@ -209,7 +208,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// @@ -239,7 +238,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpired: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 7b5f5a68..868c00ea 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -24,7 +24,6 @@ #include #include #include -#include #include namespace qevercloud { @@ -4800,7 +4799,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin EDAMUserException(const EDAMUserException & other); const char * what() const throw() override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4844,7 +4843,7 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr EDAMSystemException(const EDAMSystemException & other); const char * what() const throw() override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4887,7 +4886,7 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public EDAMNotFoundException(const EDAMNotFoundException & other); const char * what() const throw() override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4939,7 +4938,7 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, EDAMInvalidContactsException(const EDAMInvalidContactsException & other); const char * what() const throw() override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 5c3f92f7..57840b58 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -49,7 +49,7 @@ AsyncResult::AsyncResult( QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } -AsyncResult::AsyncResult(QVariant result, QSharedPointer error, +AsyncResult::AsyncResult(QVariant result, EverCloudExceptionDataPtr error, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate(result, error, autoDelete, this)) @@ -64,7 +64,7 @@ bool AsyncResult::waitForFinished(int timeout) { QEventLoop loop; QObject::connect(this, - SIGNAL(finished(QVariant,QSharedPointer)), + SIGNAL(finished(QVariant,EverCloudExceptionDataPtr)), &loop, SLOT(quit())); if(timeout >= 0) { diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index e674c55e..9668ac9c 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -36,14 +36,14 @@ AsyncResultPrivate::AsyncResultPrivate( {} AsyncResultPrivate::AsyncResultPrivate( - QVariant result, QSharedPointer error, + QVariant result, EverCloudExceptionDataPtr error, bool autoDelete, AsyncResult * q) : m_autoDelete(autoDelete), q_ptr(q) { QMetaObject::invokeMethod(this, "setValue", Qt::QueuedConnection, Q_ARG(QVariant, result), - Q_ARG(QSharedPointer, error)); + Q_ARG(EverCloudExceptionDataPtr, error)); } AsyncResultPrivate::~AsyncResultPrivate() @@ -66,22 +66,24 @@ void AsyncResultPrivate::start() void AsyncResultPrivate::onReplyFetched(QObject * rp) { ReplyFetcher * reply = qobject_cast(rp); - QSharedPointer error; + EverCloudExceptionDataPtr error; QVariant result; try { - if (reply->isError()) { - error = QSharedPointer( - new EverCloudExceptionData(reply->errorText())); + if (reply->isError()) + { + error = std::make_shared( + reply->errorText()); } - else if(reply->httpStatusCode() != 200) { - error = QSharedPointer( - new EverCloudExceptionData( - QString::fromUtf8("HTTP Status Code = %1") - .arg(reply->httpStatusCode()))); + else if (reply->httpStatusCode() != 200) + { + error = std::make_shared( + QString::fromUtf8("HTTP Status Code = %1") + .arg(reply->httpStatusCode())); } - else { + else + { result = m_readFunction(reply->receivedData()); } } @@ -91,22 +93,21 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } catch(const std::exception & e) { - error = QSharedPointer( - new EverCloudExceptionData( - QString::fromUtf8("Exception of type \"%1\" with the message: %2") - .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what())))); + error = std::make_shared( + QString::fromUtf8("Exception of type \"%1\" with the message: %2") + .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what()))); } catch(...) { - error = QSharedPointer( - new EverCloudExceptionData(QStringLiteral("Unknown exception"))); + error = std::make_shared( + QStringLiteral("Unknown exception")); } setValue(result, error); } void AsyncResultPrivate::setValue( - QVariant result, QSharedPointer error) + QVariant result, EverCloudExceptionDataPtr error) { Q_Q(AsyncResult); QObject::connect(this, &AsyncResultPrivate::finished, diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 4649fe03..dcd4acfc 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -28,20 +28,20 @@ class AsyncResultPrivate: public QObject AsyncResult * q); explicit AsyncResultPrivate( - QVariant result, QSharedPointer error, + QVariant result, EverCloudExceptionDataPtr error, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); Q_SIGNALS: - void finished(QVariant result, QSharedPointer error); + void finished(QVariant result, EverCloudExceptionDataPtr error); public Q_SLOTS: void start(); void onReplyFetched(QObject * rp); - void setValue(QVariant result, QSharedPointer error); + void setValue(QVariant result, EverCloudExceptionDataPtr error); public: QNetworkRequest m_request; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 1176d475..8ff15c60 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -40,9 +40,9 @@ quint64 exponentiallyIncreasedTimeoutMsec( struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy { virtual bool shouldRetry( - QSharedPointer exceptionData) override + EverCloudExceptionDataPtr exceptionData) override { - if (Q_UNLIKELY(exceptionData.isNull())) { + if (Q_UNLIKELY(!exceptionData)) { return true; } @@ -166,8 +166,8 @@ DurableService::SyncResult DurableService::executeSyncRequest( result.second = e.exceptionData(); } catch(const std::exception & e) { - result.second = QSharedPointer( - new EverCloudExceptionData(QString::fromLocal8Bit(e.what()))); + result.second = std::make_shared( + QString::fromLocal8Bit(e.what())); return result; } @@ -252,7 +252,7 @@ void DurableService::doExecuteAsyncRequest( result, [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( QVariant value, - QSharedPointer exceptionData) mutable + EverCloudExceptionDataPtr exceptionData) mutable { if (!exceptionData) { QEC_DEBUG("durable_service", "Successfully executed async " diff --git a/QEverCloud/src/EverCloudException.cpp b/QEverCloud/src/EverCloudException.cpp index 4b25c2a5..00e6f222 100644 --- a/QEverCloud/src/EverCloudException.cpp +++ b/QEverCloud/src/EverCloudException.cpp @@ -35,11 +35,9 @@ const char * EverCloudException::what() const throw() return m_error.constData(); } -QSharedPointer -QEVERCLOUD_EXPORT EverCloudException::exceptionData() const +EverCloudExceptionDataPtr EverCloudException::exceptionData() const { - return QSharedPointer( - new EverCloudExceptionData(QString::fromUtf8(what()))); + return std::make_shared(QString::fromUtf8(what())); } EverCloudExceptionData::EverCloudExceptionData(QString error) : @@ -67,10 +65,9 @@ EvernoteException::EvernoteException(const char * error) : EverCloudException(error) {} -QSharedPointer EvernoteException::exceptionData() const +EverCloudExceptionDataPtr EvernoteException::exceptionData() const { - return QSharedPointer( - new EvernoteExceptionData(QString::fromUtf8(what()))); + return std::make_shared(QString::fromUtf8(what())); } EvernoteExceptionData::EvernoteExceptionData(QString error) : diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index d4f2372e..fb0d3c22 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -126,10 +126,10 @@ const char * NetworkException::what() const noexcept } } -QSharedPointer NetworkException::exceptionData() const +EverCloudExceptionDataPtr NetworkException::exceptionData() const { - return QSharedPointer( - new NetworkExceptionData(QString::fromUtf8(what()), type())); + return std::make_shared( + QString::fromUtf8(what()), type()); } NetworkExceptionData::NetworkExceptionData( @@ -196,10 +196,10 @@ const char * ThriftException::what() const noexcept } } -QSharedPointer ThriftException::exceptionData() const +EverCloudExceptionDataPtr ThriftException::exceptionData() const { - return QSharedPointer( - new ThriftExceptionData(QString::fromUtf8(what()), type())); + return std::make_shared( + QString::fromUtf8(what()), type()); } ThriftExceptionData::ThriftExceptionData( @@ -320,11 +320,10 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) return ThriftException(type, error); } -QSharedPointer -EDAMInvalidContactsException::exceptionData() const +EverCloudExceptionDataPtr EDAMInvalidContactsException::exceptionData() const { - return QSharedPointer( - new EDAMInvalidContactsExceptionData(contacts, parameter, reasons)); + return std::make_shared( + contacts, parameter, reasons); } EDAMInvalidContactsExceptionData::EDAMInvalidContactsExceptionData( @@ -351,10 +350,10 @@ void EDAMInvalidContactsExceptionData::throwException() const throw e; } -QSharedPointer EDAMUserException::exceptionData() const +EverCloudExceptionDataPtr EDAMUserException::exceptionData() const { - return QSharedPointer( - new EDAMUserExceptionData(QString::fromUtf8(what()), errorCode, parameter)); + return std::make_shared( + QString::fromUtf8(what()), errorCode, parameter); } void EDAMUserExceptionData::throwException() const @@ -365,12 +364,10 @@ void EDAMUserExceptionData::throwException() const throw e; } -QSharedPointer EDAMSystemException::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemException::exceptionData() const { - return QSharedPointer( - new EDAMSystemExceptionData( - QString::fromUtf8(what()), errorCode, message, - rateLimitDuration)); + return std::make_shared( + QString::fromUtf8(what()), errorCode, message, rateLimitDuration); } EDAMSystemExceptionData::EDAMSystemExceptionData( @@ -409,10 +406,10 @@ void EDAMSystemExceptionRateLimitReachedData::throwException() const throw e; } -QSharedPointer EDAMNotFoundException::exceptionData() const +EverCloudExceptionDataPtr EDAMNotFoundException::exceptionData() const { - return QSharedPointer( - new EDAMNotFoundExceptionData(QString::fromUtf8(what()), identifier, key)); + return std::make_shared( + QString::fromUtf8(what()), identifier, key); } EDAMNotFoundExceptionData::EDAMNotFoundExceptionData( @@ -453,26 +450,22 @@ void throwEDAMSystemException(const EDAMSystemException & baseException) throw baseException; } -QSharedPointer -EDAMSystemExceptionRateLimitReached::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemExceptionRateLimitReached::exceptionData() const { - return QSharedPointer( - new EDAMSystemExceptionRateLimitReachedData( - QString::fromUtf8(what()), - errorCode, - message, - rateLimitDuration)); + return std::make_shared( + QString::fromUtf8(what()), + errorCode, + message, + rateLimitDuration); } -QSharedPointer -EDAMSystemExceptionAuthExpired::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemExceptionAuthExpired::exceptionData() const { - return QSharedPointer( - new EDAMSystemExceptionAuthExpiredData( - QString::fromUtf8(what()), - errorCode, - message, - rateLimitDuration)); + return std::make_shared( + QString::fromUtf8(what()), + errorCode, + message, + rateLimitDuration); } EDAMSystemExceptionAuthExpiredData::EDAMSystemExceptionAuthExpiredData( diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 2dcac313..9a294b9e 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -8,25 +8,31 @@ */ #include +#include +#include #include #include -#include + +#include namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + QNetworkAccessManager * evernoteNetworkAccessManager() { - static QSharedPointer pNetworkAccessManager; + static std::shared_ptr pNetworkAccessManager; static QMutex networkAccessManagerMutex; QMutexLocker mutexLocker(&networkAccessManagerMutex); - if (pNetworkAccessManager.isNull()) { - pNetworkAccessManager = QSharedPointer( - new QNetworkAccessManager); + if (Q_UNLIKELY(!pNetworkAccessManager)) { + pNetworkAccessManager = std::make_shared(); } - return pNetworkAccessManager.data(); + return pNetworkAccessManager.get(); } +//////////////////////////////////////////////////////////////////////////////// + static int qevercloudRequestTimeout = 180000; int requestTimeout() @@ -39,6 +45,8 @@ void setRequestTimeout(int timeout) qevercloudRequestTimeout = timeout; } +//////////////////////////////////////////////////////////////////////////////// + int libraryVersion() { return 5*10000 + 0*100 + 0; diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 04ee8c53..a214a1c3 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -15,7 +15,6 @@ #include #include -#include #include /** @cond HIDDEN_SYMBOLS */ @@ -55,21 +54,23 @@ void ReplyFetcher::start( m_ticker->start(1000); if (postData.isNull()) { - m_reply = QSharedPointer( - nam->get(request), &QObject::deleteLater); + m_reply = std::shared_ptr( + nam->get(request), + [] (QNetworkReply * reply) { reply->deleteLater(); }); } else { - m_reply = QSharedPointer( - nam->post(request, postData), &QObject::deleteLater); + m_reply = std::shared_ptr( + nam->post(request, postData), + [] (QNetworkReply * reply) { reply->deleteLater(); }); } - QObject::connect(m_reply.data(), &QNetworkReply::finished, + QObject::connect(m_reply.get(), &QNetworkReply::finished, this, &ReplyFetcher::onFinished); - QObject::connect(m_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), + QObject::connect(m_reply.get(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onError(QNetworkReply::NetworkError))); - QObject::connect(m_reply.data(), &QNetworkReply::sslErrors, + QObject::connect(m_reply.get(), &QNetworkReply::sslErrors, this, &ReplyFetcher::onSslErrors); - QObject::connect(m_reply.data(), &QNetworkReply::downloadProgress, + QObject::connect(m_reply.get(), &QNetworkReply::downloadProgress, this, &ReplyFetcher::onDownloadProgress); } @@ -104,7 +105,7 @@ void ReplyFetcher::onFinished() m_httpStatusCode = m_reply->attribute( QNetworkRequest::HttpStatusCodeAttribute).toInt(); - QObject::disconnect(m_reply.data()); + QObject::disconnect(m_reply.get()); emit replyFetched(this); } @@ -130,7 +131,7 @@ void ReplyFetcher::setError( { m_ticker->stop(); m_errorText = errorText; - QObject::disconnect(m_reply.data()); + QObject::disconnect(m_reply.get()); emit replyFetched(this); } diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index 180bc48d..f7d7594d 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -16,13 +16,14 @@ #include #include #include -#include #include #include #include #include #include +#include + /** @cond HIDDEN_SYMBOLS */ namespace qevercloud { @@ -68,7 +69,7 @@ private Q_SLOTS: void setError(QNetworkReply::NetworkError errorType, QString errorText); private: - QSharedPointer m_reply; + std::shared_ptr m_reply; QNetworkReply::NetworkError m_errorType = QNetworkReply::NoError; QString m_errorText; diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 4361f81a..98679b61 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -123,11 +123,11 @@ AsyncResult * Thumbnail::downloadAsync( auto res = new AsyncResult(pair.first, pair.second, timeoutMsec); QObject::connect(res, &AsyncResult::finished, [=] (const QVariant & value, - const QSharedPointer data) + const EverCloudExceptionDataPtr error) { Q_UNUSED(value) - if (data.isNull()) { + if (!error) { QEC_DEBUG("thumbnail", "Finished async download " << "for guid " << guid); return; @@ -135,7 +135,7 @@ AsyncResult * Thumbnail::downloadAsync( QEC_WARNING("thumbnail", "Async download for guid " << guid << " finished with error: " - << data->errorMessage); + << error->errorMessage); }); return res; } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 57d1941c..b60eb81c 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -12,6 +12,7 @@ #include #include +#include #include namespace qevercloud { @@ -27,13 +28,13 @@ class ValueFetcher: public QObject {} QVariant m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished(QVariant value, EverCloudExceptionDataPtr data) { m_value = value; m_exceptionData = data; @@ -47,6 +48,11 @@ DurableServiceTester::DurableServiceTester(QObject * parent) : QObject(parent) {} +void DurableServiceTester::initTestCase() +{ + qRegisterMetaType("EverCloudExceptionDataPtr"); +} + void DurableServiceTester::shouldExecuteSyncServiceCall() { auto durableService = newDurableService(); @@ -67,7 +73,7 @@ void DurableServiceTester::shouldExecuteSyncServiceCall() QVERIFY(serviceCallDetected); QVERIFY(result.first == value); - QVERIFY(result.second.isNull()); + QVERIFY(!result.second); } void DurableServiceTester::shouldExecuteAsyncServiceCall() @@ -99,7 +105,7 @@ void DurableServiceTester::shouldExecuteAsyncServiceCall() QVERIFY(serviceCallDetected); QVERIFY(valueFetcher.m_value == value); - QVERIFY(valueFetcher.m_exceptionData.isNull()); + QVERIFY(!valueFetcher.m_exceptionData); } void DurableServiceTester::shouldRetrySyncServiceCalls() @@ -126,7 +132,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -144,7 +150,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(result.first == value); - QVERIFY(result.second.isNull()); + QVERIFY(!result.second); } void DurableServiceTester::shouldRetryAsyncServiceCalls() @@ -171,7 +177,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -200,7 +206,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(valueFetcher.m_value == value); - QVERIFY(valueFetcher.m_exceptionData.isNull()); + QVERIFY(!valueFetcher.m_exceptionData); } void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() @@ -223,7 +229,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -238,7 +244,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!result.first.isValid()); - QVERIFY(!result.second.isNull()); + QVERIFY(result.second); bool exceptionCaught = false; try { @@ -271,7 +277,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -297,7 +303,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!valueFetcher.m_value.isValid()); - QVERIFY(!valueFetcher.m_exceptionData.isNull()); + QVERIFY(valueFetcher.m_exceptionData); bool exceptionCaught = false; try { @@ -330,7 +336,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; @@ -347,7 +353,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError QVERIFY(serviceCallCounter == 1); QVERIFY(!result.first.isValid()); - QVERIFY(!result.second.isNull()); + QVERIFY(result.second); bool exceptionCaught = false; try { @@ -380,7 +386,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; @@ -408,7 +414,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro QVERIFY(serviceCallCounter == 1); QVERIFY(!valueFetcher.m_value.isValid()); - QVERIFY(!valueFetcher.m_exceptionData.isNull()); + QVERIFY(valueFetcher.m_exceptionData); bool exceptionCaught = false; try { diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index 219fe25a..f32394ac 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -22,6 +22,8 @@ class DurableServiceTester: public QObject explicit DurableServiceTester(QObject * parent = nullptr); private Q_SLOTS: + void initTestCase(); + void shouldExecuteSyncServiceCall(); void shouldExecuteAsyncServiceCall(); void shouldRetrySyncServiceCalls(); From 33d3772e06f9100076b38da075e686e4354f5fab Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 29 Oct 2019 22:25:39 +0300 Subject: [PATCH 053/188] Use Q_GLOBAL_STATIC for Evernote network access manager instead of hacky customary solution --- QEverCloud/src/Globals.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 9a294b9e..c86b6153 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -8,27 +8,18 @@ */ #include -#include -#include -#include -#include - -#include +#include namespace qevercloud { +Q_GLOBAL_STATIC(QNetworkAccessManager, globalEvernoteNetworkAccessManager) + //////////////////////////////////////////////////////////////////////////////// QNetworkAccessManager * evernoteNetworkAccessManager() { - static std::shared_ptr pNetworkAccessManager; - static QMutex networkAccessManagerMutex; - QMutexLocker mutexLocker(&networkAccessManagerMutex); - if (Q_UNLIKELY(!pNetworkAccessManager)) { - pNetworkAccessManager = std::make_shared(); - } - return pNetworkAccessManager.get(); + return globalEvernoteNetworkAccessManager; } //////////////////////////////////////////////////////////////////////////////// From 6747fb9a11ac6819ba8ea37548f910f1e2ac1468 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 29 Oct 2019 22:37:44 +0300 Subject: [PATCH 054/188] Make ThriftFieldType and ThriftMessageType strong typed enums --- QEverCloud/src/Exceptions.cpp | 2 +- QEverCloud/src/Thrift.h | 235 ++++++++-------- QEverCloud/src/generated/Services.cpp | 378 +++++++++++++------------- QEverCloud/src/generated/Types.cpp | 290 ++++++++++---------- 4 files changed, 463 insertions(+), 442 deletions(-) diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index fb0d3c22..bfde56bf 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -271,7 +271,7 @@ const char * EDAMNotFoundException::what() const noexcept ThriftException readThriftException(ThriftBinaryBufferReader & reader) { QString name; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; reader.readStructBegin(name); diff --git a/QEverCloud/src/Thrift.h b/QEverCloud/src/Thrift.h index e6e4370e..cfeb24ab 100644 --- a/QEverCloud/src/Thrift.h +++ b/QEverCloud/src/Thrift.h @@ -21,6 +21,8 @@ namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + // Use this to get around strict aliasing rules. // For example, uint64_t i = bitwise_cast(returns_double()); // The most obvious implementation is to just cast a pointer, @@ -64,45 +66,47 @@ static inline To bitwise_cast(From from) return u.t; } -struct ThriftFieldType +//////////////////////////////////////////////////////////////////////////////// + +enum class ThriftFieldType { - enum type - { - T_STOP = 0, - T_VOID = 1, - T_BOOL = 2, - T_BYTE = 3, - T_I08 = 3, - T_I16 = 6, - T_I32 = 8, - T_U64 = 9, - T_I64 = 10, - T_DOUBLE = 4, - T_STRING = 11, - T_UTF7 = 11, - T_STRUCT = 12, - T_MAP = 13, - T_SET = 14, - T_LIST = 15, - T_UTF8 = 16, - T_UTF16 = 17 - }; + T_STOP = 0, + T_VOID = 1, + T_BOOL = 2, + T_BYTE = 3, + T_I08 = 3, + T_I16 = 6, + T_I32 = 8, + T_U64 = 9, + T_I64 = 10, + T_DOUBLE = 4, + T_STRING = 11, + T_UTF7 = 11, + T_STRUCT = 12, + T_MAP = 13, + T_SET = 14, + T_LIST = 15, + T_UTF8 = 16, + T_UTF16 = 17 }; -struct ThriftMessageType +//////////////////////////////////////////////////////////////////////////////// + +enum class ThriftMessageType { - enum type - { - T_CALL = 1, - T_REPLY = 2, - T_EXCEPTION = 3, - T_ONEWAY = 4 - }; + T_CALL = 1, + T_REPLY = 2, + T_EXCEPTION = 3, + T_ONEWAY = 4 }; +//////////////////////////////////////////////////////////////////////////////// + static const qint32 VERSION_1 = ((qint32)0x80010000); static const qint32 VERSION_MASK = ((qint32)0xffff0000); +//////////////////////////////////////////////////////////////////////////////// + class ThriftBinaryBufferWriter { private: @@ -123,9 +127,9 @@ class ThriftBinaryBufferWriter QByteArray buffer() { return m_buf; } - quint32 writeMessageBegin(QString name, - const ThriftMessageType::type messageType, - const qint32 seqid) + quint32 writeMessageBegin( + QString name, const ThriftMessageType messageType, + const qint32 seqid) { if (m_strict) { @@ -156,9 +160,9 @@ class ThriftBinaryBufferWriter inline quint32 writeStructEnd() { return 0; } - inline quint32 writeFieldBegin(QString name, - const ThriftFieldType::type fieldType, - const qint16 fieldId) + inline quint32 writeFieldBegin( + QString name, const ThriftFieldType fieldType, + const qint16 fieldId) { Q_UNUSED(name); quint32 wsize = 0; @@ -174,9 +178,9 @@ class ThriftBinaryBufferWriter return writeByte((qint8)ThriftFieldType::T_STOP); } - inline quint32 writeMapBegin(const ThriftFieldType::type keyType, - const ThriftFieldType::type valType, - const qint32 size) + inline quint32 writeMapBegin( + const ThriftFieldType keyType, const ThriftFieldType valType, + const qint32 size) { quint32 wsize = 0; wsize += writeByte(static_cast(keyType)); @@ -187,8 +191,8 @@ class ThriftBinaryBufferWriter inline quint32 writeMapEnd() { return 0; } - inline quint32 writeListBegin(const ThriftFieldType::type elemType, - const qint32 size) + inline quint32 writeListBegin( + const ThriftFieldType elemType, const qint32 size) { quint32 wsize = 0; wsize += writeByte(static_cast(elemType)); @@ -198,8 +202,8 @@ class ThriftBinaryBufferWriter inline quint32 writeListEnd() { return 0; } - inline quint32 writeSetBegin(const ThriftFieldType::type elemType, - const qint32 size) + inline quint32 writeSetBegin( + const ThriftFieldType elemType, const qint32 size) { return writeListBegin(elemType, size); } @@ -245,9 +249,10 @@ class ThriftBinaryBufferWriter inline quint32 writeDouble(const double dub) { - Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && - std::numeric_limits::is_iec559, - "incompatible double type"); + Q_STATIC_ASSERT_X( + sizeof(double) == sizeof(qint64) && + std::numeric_limits::is_iec559, + "incompatible double type"); quint64 bits = bitwise_cast(dub); qToBigEndian(bits, reinterpret_cast(&bits)); @@ -265,8 +270,9 @@ class ThriftBinaryBufferWriter { qint32 size = static_cast(bytes.length()); if (size > std::numeric_limits::max()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("The data is too big")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The data is too big")); } quint32 result = writeI32(static_cast(size)); @@ -276,9 +282,9 @@ class ThriftBinaryBufferWriter return result + static_cast(size); } - }; +//////////////////////////////////////////////////////////////////////////////// class ThriftBinaryBufferReader { @@ -291,17 +297,22 @@ class ThriftBinaryBufferReader void read(quint8 * dest, qint32 bytesCount) { if (Q_UNLIKELY((m_pos + bytesCount) > m_buf.length())) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Unexpected end of data")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } if (Q_UNLIKELY(bytesCount < 0)) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Negative bytes count")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative bytes count")); } - std::memcpy(dest, m_buf.mid(m_pos, bytesCount).constData(), - static_cast(bytesCount)); + std::memcpy( + dest, + m_buf.mid(m_pos, bytesCount).constData(), + static_cast(bytesCount)); + m_pos += bytesCount; } @@ -315,9 +326,8 @@ class ThriftBinaryBufferReader void setStringLimit(qint32 limit) { m_stringLimit = limit; } void setStrictMode(bool on) { m_strict = on; } - quint32 readMessageBegin(QString & name, - ThriftMessageType::type & messageType, - qint32 & seqid) + quint32 readMessageBegin( + QString & name, ThriftMessageType & messageType, qint32 & seqid) { quint32 result = 0; qint32 sz; @@ -328,21 +338,23 @@ class ThriftBinaryBufferReader // Check for correct version number qint32 version = sz & VERSION_MASK; if (version != VERSION_1) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Bad version identifier")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Bad version identifier")); } - messageType = static_cast(sz & 0x000000ff); + messageType = static_cast(sz & 0x000000ff); result += readString(name); result += readI32(seqid); } else { if (m_strict) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("No version identifier... " - "old protocol client in " - "strict mode?")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral( + "No version identifier... old protocol client in " + "strict mode?")); } else { // Handle pre-versioned input @@ -350,7 +362,7 @@ class ThriftBinaryBufferReader m_pos -= 4; result += readString(name); result += readByte(type); - messageType = static_cast(type); + messageType = static_cast(type); result += readI32(seqid); } } @@ -363,16 +375,15 @@ class ThriftBinaryBufferReader inline quint32 readStructBegin(QString & name) { name.clear(); return 0; } inline quint32 readStructEnd() { return 0; } - inline quint32 readFieldBegin(QString & name, - ThriftFieldType::type & fieldType, - qint16 & fieldId) + inline quint32 readFieldBegin( + QString & name, ThriftFieldType & fieldType, qint16 & fieldId) { Q_UNUSED(name) quint32 result = 0; qint8 type; result += readByte(type); - fieldType = static_cast(type); + fieldType = static_cast(type); if (fieldType == ThriftFieldType::T_STOP) { fieldId = 0; return result; @@ -384,25 +395,26 @@ class ThriftBinaryBufferReader inline quint32 readFieldEnd() { return 0; } - inline quint32 readMapBegin(ThriftFieldType::type & keyType, - ThriftFieldType::type & valType, - qint32 & size) + inline quint32 readMapBegin( + ThriftFieldType & keyType, ThriftFieldType & valType, qint32 & size) { qint8 k, v; quint32 result = 0; qint32 sizei; result += readByte(k); - keyType = static_cast(k); + keyType = static_cast(k); result += readByte(v); - valType = static_cast(v); + valType = static_cast(v); result += readI32(sizei); if (sizei < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Negative size!")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } else if (m_stringLimit > 0 && sizei > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("The size limit is exceeded.")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } size = sizei; return result; @@ -410,21 +422,23 @@ class ThriftBinaryBufferReader inline quint32 readMapEnd() {return 0;} - inline quint32 readListBegin(ThriftFieldType::type & elemType, qint32 & size) + inline quint32 readListBegin(ThriftFieldType & elemType, qint32 & size) { qint8 e; quint32 result = 0; qint32 sizei; result += readByte(e); - elemType = static_cast(e); + elemType = static_cast(e); result += readI32(sizei); if (sizei < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Negative size!")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } else if (m_stringLimit > 0 && sizei > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("The size limit is exceeded.")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } size = sizei; return result; @@ -432,7 +446,7 @@ class ThriftBinaryBufferReader inline quint32 readListEnd() { return 0; } - inline quint32 readSetBegin(ThriftFieldType::type & elemType, qint32 & size) + inline quint32 readSetBegin(ThriftFieldType & elemType, qint32 & size) { return readListBegin(elemType, size); } @@ -493,9 +507,10 @@ class ThriftBinaryBufferReader inline quint32 readDouble(double & dub) { - Q_STATIC_ASSERT_X(sizeof(double) == sizeof(qint64) && - std::numeric_limits::is_iec559, - "incompatible double type"); + Q_STATIC_ASSERT_X( + sizeof(double) == sizeof(qint64) && + std::numeric_limits::is_iec559, + "incompatible double type"); union bytes { quint8 b[8]; @@ -515,13 +530,15 @@ class ThriftBinaryBufferReader result = readI32(size); if (size < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Negative size!")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } if (m_stringLimit > 0 && size > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("The size limit is exceeded.")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } // Catch empty string case @@ -531,8 +548,9 @@ class ThriftBinaryBufferReader } if ((m_pos + size) > m_buf.length()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Unexpected end of data")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } str = QString::fromUtf8(m_buf.constData() + m_pos, size); @@ -549,13 +567,15 @@ class ThriftBinaryBufferReader result = readI32(size); if (size < 0) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Negative size!")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Negative size!")); } if (m_stringLimit > 0 && size > m_stringLimit) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("The size limit is exceeded.")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("The size limit is exceeded.")); } // Catch empty string case @@ -565,8 +585,9 @@ class ThriftBinaryBufferReader } if ((m_pos + size) > m_buf.length()) { - throw ThriftException(ThriftException::Type::PROTOCOL_ERROR, - QStringLiteral("Unexpected end of data")); + throw ThriftException( + ThriftException::Type::PROTOCOL_ERROR, + QStringLiteral("Unexpected end of data")); } str = m_buf.mid(m_pos, size); @@ -576,7 +597,7 @@ class ThriftBinaryBufferReader return result; } - inline quint32 skip(ThriftFieldType::type type) + inline quint32 skip(ThriftFieldType type) { switch (type) { case ThriftFieldType::T_BOOL: @@ -619,7 +640,7 @@ class ThriftBinaryBufferReader quint32 result = 0; QString name; qint16 fid; - ThriftFieldType::type ftype; + ThriftFieldType ftype; result += readStructBegin(name); while (true) { @@ -637,8 +658,8 @@ class ThriftBinaryBufferReader case ThriftFieldType::T_MAP: { quint32 result = 0; - ThriftFieldType::type keyType; - ThriftFieldType::type valType; + ThriftFieldType keyType; + ThriftFieldType valType; qint32 i, size; result += readMapBegin(keyType, valType, size); for(i = 0; i < size; i++) { @@ -651,7 +672,7 @@ class ThriftBinaryBufferReader case ThriftFieldType::T_SET: { quint32 result = 0; - ThriftFieldType::type elemType; + ThriftFieldType elemType; qint32 i, size; result += readSetBegin(elemType, size); for(i = 0; i < size; i++) { @@ -663,7 +684,7 @@ class ThriftBinaryBufferReader case ThriftFieldType::T_LIST: { quint32 result = 0; - ThriftFieldType::type elemType; + ThriftFieldType elemType; qint32 i, size; result += readListBegin(elemType, size); for(i = 0; i < size; i++) { diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index e3939055..60d1a356 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -758,7 +758,7 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -776,7 +776,7 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -929,7 +929,7 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -947,7 +947,7 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1106,7 +1106,7 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -1124,7 +1124,7 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1302,7 +1302,7 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -1320,7 +1320,7 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1488,7 +1488,7 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -1506,7 +1506,7 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1517,7 +1517,7 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -1652,7 +1652,7 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -1670,7 +1670,7 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1681,7 +1681,7 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -1823,7 +1823,7 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -1841,7 +1841,7 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -1991,7 +1991,7 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2009,7 +2009,7 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2148,7 +2148,7 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2166,7 +2166,7 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2323,7 +2323,7 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2341,7 +2341,7 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2498,7 +2498,7 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2516,7 +2516,7 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2666,7 +2666,7 @@ QList NoteStore_listTags_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2684,7 +2684,7 @@ QList NoteStore_listTags_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2695,7 +2695,7 @@ QList NoteStore_listTags_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -2837,7 +2837,7 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -2855,7 +2855,7 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -2866,7 +2866,7 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -3026,7 +3026,7 @@ Tag NoteStore_getTag_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3044,7 +3044,7 @@ Tag NoteStore_getTag_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3201,7 +3201,7 @@ Tag NoteStore_createTag_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3219,7 +3219,7 @@ Tag NoteStore_createTag_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3376,7 +3376,7 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3394,7 +3394,7 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3549,7 +3549,7 @@ void NoteStore_untagAll_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3567,7 +3567,7 @@ void NoteStore_untagAll_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3709,7 +3709,7 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3727,7 +3727,7 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3877,7 +3877,7 @@ QList NoteStore_listSearches_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -3895,7 +3895,7 @@ QList NoteStore_listSearches_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -3906,7 +3906,7 @@ QList NoteStore_listSearches_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4048,7 +4048,7 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4066,7 +4066,7 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -4223,7 +4223,7 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4241,7 +4241,7 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -4388,7 +4388,7 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4406,7 +4406,7 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -4563,7 +4563,7 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4581,7 +4581,7 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -4745,7 +4745,7 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4763,7 +4763,7 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -4947,7 +4947,7 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -4965,7 +4965,7 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -5147,7 +5147,7 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -5165,7 +5165,7 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -5335,7 +5335,7 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -5353,7 +5353,7 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -5544,7 +5544,7 @@ Note NoteStore_getNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -5562,7 +5562,7 @@ Note NoteStore_getNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -5743,7 +5743,7 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -5761,7 +5761,7 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -5925,7 +5925,7 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -5943,7 +5943,7 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -6120,7 +6120,7 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -6138,7 +6138,7 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -6314,7 +6314,7 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -6332,7 +6332,7 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -6495,7 +6495,7 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -6513,7 +6513,7 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -6684,7 +6684,7 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -6702,7 +6702,7 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -6871,7 +6871,7 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -6889,7 +6889,7 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7046,7 +7046,7 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7064,7 +7064,7 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7075,7 +7075,7 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) resultIsSet = true; QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -7235,7 +7235,7 @@ Note NoteStore_createNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7253,7 +7253,7 @@ Note NoteStore_createNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7410,7 +7410,7 @@ Note NoteStore_updateNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7428,7 +7428,7 @@ Note NoteStore_updateNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7585,7 +7585,7 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7603,7 +7603,7 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7760,7 +7760,7 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7778,7 +7778,7 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -7942,7 +7942,7 @@ Note NoteStore_copyNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -7960,7 +7960,7 @@ Note NoteStore_copyNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -8123,7 +8123,7 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -8141,7 +8141,7 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -8152,7 +8152,7 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -8340,7 +8340,7 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -8358,7 +8358,7 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -8567,7 +8567,7 @@ Resource NoteStore_getResource_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -8585,7 +8585,7 @@ Resource NoteStore_getResource_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -8766,7 +8766,7 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -8784,7 +8784,7 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -8948,7 +8948,7 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -8966,7 +8966,7 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -9143,7 +9143,7 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -9161,7 +9161,7 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -9337,7 +9337,7 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -9355,7 +9355,7 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -9518,7 +9518,7 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -9536,7 +9536,7 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -9693,7 +9693,7 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -9711,7 +9711,7 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -9896,7 +9896,7 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -9914,7 +9914,7 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10095,7 +10095,7 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10113,7 +10113,7 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10270,7 +10270,7 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10288,7 +10288,7 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10445,7 +10445,7 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10463,7 +10463,7 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10620,7 +10620,7 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10638,7 +10638,7 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10796,7 +10796,7 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10814,7 +10814,7 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -10977,7 +10977,7 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -10995,7 +10995,7 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -11162,7 +11162,7 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -11180,7 +11180,7 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -11344,7 +11344,7 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -11362,7 +11362,7 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -11518,7 +11518,7 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -11536,7 +11536,7 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -11547,7 +11547,7 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -11699,7 +11699,7 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -11717,7 +11717,7 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -11874,7 +11874,7 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -11892,7 +11892,7 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12042,7 +12042,7 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12060,7 +12060,7 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12071,7 +12071,7 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -12223,7 +12223,7 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12241,7 +12241,7 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12398,7 +12398,7 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12416,7 +12416,7 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12566,7 +12566,7 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12584,7 +12584,7 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12731,7 +12731,7 @@ void NoteStore_emailNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12749,7 +12749,7 @@ void NoteStore_emailNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -12891,7 +12891,7 @@ QString NoteStore_shareNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -12909,7 +12909,7 @@ QString NoteStore_shareNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13064,7 +13064,7 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13082,7 +13082,7 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13231,7 +13231,7 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13249,7 +13249,7 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13419,7 +13419,7 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13437,7 +13437,7 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13600,7 +13600,7 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13618,7 +13618,7 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13775,7 +13775,7 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13793,7 +13793,7 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -13950,7 +13950,7 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -13968,7 +13968,7 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -14294,7 +14294,7 @@ bool UserStore_checkVersion_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -14312,7 +14312,7 @@ bool UserStore_checkVersion_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -14442,7 +14442,7 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -14460,7 +14460,7 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -14620,7 +14620,7 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -14638,7 +14638,7 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -14827,7 +14827,7 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -14845,7 +14845,7 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -14993,7 +14993,7 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15011,7 +15011,7 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15128,7 +15128,7 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15146,7 +15146,7 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15278,7 +15278,7 @@ User UserStore_getUser_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15296,7 +15296,7 @@ User UserStore_getUser_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15428,7 +15428,7 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15446,7 +15446,7 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15594,7 +15594,7 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15612,7 +15612,7 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15749,7 +15749,7 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15767,7 +15767,7 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -15897,7 +15897,7 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -15915,7 +15915,7 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -16062,7 +16062,7 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -16080,7 +16080,7 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -16221,7 +16221,7 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -16239,7 +16239,7 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -16250,7 +16250,7 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -16392,7 +16392,7 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -16410,7 +16410,7 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { @@ -16421,7 +16421,7 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray resultIsSet = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -16564,7 +16564,7 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) ThriftBinaryBufferReader r(reply); qint32 rseqid = 0; QString fname; - ThriftMessageType::type mtype; + ThriftMessageType mtype; r.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { ThriftException e = readThriftException(r); @@ -16582,7 +16582,7 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) { diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index f4acb2ba..974b7bc9 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -437,7 +437,7 @@ void readSyncState( SyncState & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool currentTime_isset = false; bool fullSyncBefore_isset = false; @@ -720,7 +720,7 @@ void readSyncChunk( SyncChunk & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool currentTime_isset = false; bool updateCount_isset = false; @@ -762,7 +762,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -785,7 +785,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -808,7 +808,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -831,7 +831,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -854,7 +854,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -877,7 +877,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -900,7 +900,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -923,7 +923,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -946,7 +946,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -969,7 +969,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -992,7 +992,7 @@ void readSyncChunk( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -1321,7 +1321,7 @@ void readSyncChunkFilter( SyncChunkFilter & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -1467,7 +1467,7 @@ void readSyncChunkFilter( if (fieldType == ThriftFieldType::T_SET) { QSet v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -1757,7 +1757,7 @@ void readNoteFilter( NoteFilter & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -1804,7 +1804,7 @@ void readNoteFilter( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -2104,7 +2104,7 @@ void readNoteList( NoteList & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool startIndex_isset = false; bool totalNotes_isset = false; @@ -2139,7 +2139,7 @@ void readNoteList( notes_isset = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -2162,7 +2162,7 @@ void readNoteList( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -2185,7 +2185,7 @@ void readNoteList( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -2421,7 +2421,7 @@ void readNoteMetadata( NoteMetadata & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool guid_isset = false; r.readStructBegin(fname); @@ -2506,7 +2506,7 @@ void readNoteMetadata( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -2748,7 +2748,7 @@ void readNotesMetadataList( NotesMetadataList & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool startIndex_isset = false; bool totalNotes_isset = false; @@ -2783,7 +2783,7 @@ void readNotesMetadataList( notes_isset = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -2806,7 +2806,7 @@ void readNotesMetadataList( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -2829,7 +2829,7 @@ void readNotesMetadataList( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -3055,7 +3055,7 @@ void readNotesMetadataResultSpec( NotesMetadataResultSpec & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -3314,7 +3314,7 @@ void readNoteCollectionCounts( NoteCollectionCounts & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -3325,8 +3325,8 @@ void readNoteCollectionCounts( if (fieldType == ThriftFieldType::T_MAP) { QMap v; qint32 size; - ThriftFieldType::type keyType; - ThriftFieldType::type elemType; + ThriftFieldType keyType; + ThriftFieldType elemType; r.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteCollectionCounts.notebookCounts)")); if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteCollectionCounts.notebookCounts)")); @@ -3347,8 +3347,8 @@ void readNoteCollectionCounts( if (fieldType == ThriftFieldType::T_MAP) { QMap v; qint32 size; - ThriftFieldType::type keyType; - ThriftFieldType::type elemType; + ThriftFieldType keyType; + ThriftFieldType elemType; r.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteCollectionCounts.tagCounts)")); if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteCollectionCounts.tagCounts)")); @@ -3501,7 +3501,7 @@ void readNoteResultSpec( NoteResultSpec & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -3731,7 +3731,7 @@ void readNoteEmailParameters( NoteEmailParameters & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -3760,7 +3760,7 @@ void readNoteEmailParameters( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -3783,7 +3783,7 @@ void readNoteEmailParameters( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -3939,7 +3939,7 @@ void readNoteVersionId( NoteVersionId & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool updateSequenceNum_isset = false; bool updated_isset = false; @@ -4098,7 +4098,7 @@ void readRelatedQuery( RelatedQuery & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -4334,7 +4334,7 @@ void readRelatedResult( RelatedResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -4345,7 +4345,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4368,7 +4368,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4391,7 +4391,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4414,7 +4414,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4446,7 +4446,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4469,7 +4469,7 @@ void readRelatedResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -4709,7 +4709,7 @@ void readRelatedResultSpec( RelatedResultSpec & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -4792,7 +4792,7 @@ void readRelatedResultSpec( if (fieldType == ThriftFieldType::T_SET) { QSet v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { @@ -4934,7 +4934,7 @@ void readUpdateNoteIfUsnMatchesResult( UpdateNoteIfUsnMatchesResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5038,7 +5038,7 @@ void readShareRelationshipRestrictions( ShareRelationshipRestrictions & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5176,7 +5176,7 @@ void readInvitationShareRelationship( InvitationShareRelationship & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5330,7 +5330,7 @@ void readMemberShareRelationship( MemberShareRelationship & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5502,7 +5502,7 @@ void readShareRelationships( ShareRelationships & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5513,7 +5513,7 @@ void readShareRelationships( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -5536,7 +5536,7 @@ void readShareRelationships( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -5679,7 +5679,7 @@ void readManageNotebookSharesParameters( ManageNotebookSharesParameters & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5708,7 +5708,7 @@ void readManageNotebookSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -5731,7 +5731,7 @@ void readManageNotebookSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -5754,7 +5754,7 @@ void readManageNotebookSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -5880,7 +5880,7 @@ void readManageNotebookSharesError( ManageNotebookSharesError & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5981,7 +5981,7 @@ void readManageNotebookSharesResult( ManageNotebookSharesResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -5992,7 +5992,7 @@ void readManageNotebookSharesResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -6090,7 +6090,7 @@ void readSharedNoteTemplate( SharedNoteTemplate & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6119,7 +6119,7 @@ void readSharedNoteTemplate( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -6250,7 +6250,7 @@ void readNotebookShareTemplate( NotebookShareTemplate & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6279,7 +6279,7 @@ void readNotebookShareTemplate( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -6394,7 +6394,7 @@ void readCreateOrUpdateNotebookSharesResult( CreateOrUpdateNotebookSharesResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6414,7 +6414,7 @@ void readCreateOrUpdateNotebookSharesResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -6508,7 +6508,7 @@ void readNoteShareRelationshipRestrictions( NoteShareRelationshipRestrictions & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6637,7 +6637,7 @@ void readNoteMemberShareRelationship( NoteMemberShareRelationship & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6792,7 +6792,7 @@ void readNoteInvitationShareRelationship( NoteInvitationShareRelationship & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6930,7 +6930,7 @@ void readNoteShareRelationships( NoteShareRelationships & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -6941,7 +6941,7 @@ void readNoteShareRelationships( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -6964,7 +6964,7 @@ void readNoteShareRelationships( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -7111,7 +7111,7 @@ void readManageNoteSharesParameters( ManageNoteSharesParameters & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -7131,7 +7131,7 @@ void readManageNoteSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -7154,7 +7154,7 @@ void readManageNoteSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -7177,7 +7177,7 @@ void readManageNoteSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { @@ -7200,7 +7200,7 @@ void readManageNoteSharesParameters( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I64) { @@ -7338,7 +7338,7 @@ void readManageNoteSharesError( ManageNoteSharesError & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -7456,7 +7456,7 @@ void readManageNoteSharesResult( ManageNoteSharesResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -7467,7 +7467,7 @@ void readManageNoteSharesResult( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -7553,7 +7553,7 @@ void readData( Data & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -7930,7 +7930,7 @@ void readUserAttributes( UserAttributes & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -7977,7 +7977,7 @@ void readUserAttributes( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -8009,7 +8009,7 @@ void readUserAttributes( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -8655,7 +8655,7 @@ void readBusinessUserAttributes( BusinessUserAttributes & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -8996,7 +8996,7 @@ void readAccounting( Accounting & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -9465,7 +9465,7 @@ void readBusinessUserInfo( BusinessUserInfo & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -9676,7 +9676,7 @@ void readAccountLimits( AccountLimits & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -10045,7 +10045,7 @@ void readUser( User & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -10445,7 +10445,7 @@ void readContact( Contact & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -10664,7 +10664,7 @@ void readIdentity( Identity & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool id_isset = false; r.readStructBegin(fname); @@ -10867,7 +10867,7 @@ void readTag( Tag & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -10998,7 +10998,7 @@ void readLazyMap( LazyMap & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -11009,7 +11009,7 @@ void readLazyMap( if (fieldType == ThriftFieldType::T_SET) { QSet v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -11032,8 +11032,8 @@ void readLazyMap( if (fieldType == ThriftFieldType::T_MAP) { QMap v; qint32 size; - ThriftFieldType::type keyType; - ThriftFieldType::type elemType; + ThriftFieldType keyType; + ThriftFieldType elemType; r.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (LazyMap.fullMap)")); if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (LazyMap.fullMap)")); @@ -11201,7 +11201,7 @@ void readResourceAttributes( ResourceAttributes & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -11539,7 +11539,7 @@ void readResource( Resource & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -11962,7 +11962,7 @@ void readNoteAttributes( NoteAttributes & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -12117,8 +12117,8 @@ void readNoteAttributes( if (fieldType == ThriftFieldType::T_MAP) { QMap v; qint32 size; - ThriftFieldType::type keyType; - ThriftFieldType::type elemType; + ThriftFieldType keyType; + ThriftFieldType elemType; r.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteAttributes.classifications)")); if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteAttributes.classifications)")); @@ -12439,7 +12439,7 @@ void readSharedNote( SharedNote & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -12619,7 +12619,7 @@ void readNoteRestrictions( NoteRestrictions & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -12782,7 +12782,7 @@ void readNoteLimits( NoteLimits & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -13065,7 +13065,7 @@ void readNote( Note & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -13175,7 +13175,7 @@ void readNote( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -13198,7 +13198,7 @@ void readNote( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -13230,7 +13230,7 @@ void readNote( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -13253,7 +13253,7 @@ void readNote( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -13513,7 +13513,7 @@ void readPublishing( Publishing & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -13643,7 +13643,7 @@ void readBusinessNotebook( BusinessNotebook & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -13756,7 +13756,7 @@ void readSavedSearchScope( SavedSearchScope & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -13893,7 +13893,7 @@ void readSavedSearch( SavedSearch & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -14049,7 +14049,7 @@ void readSharedNotebookRecipientSettings( SharedNotebookRecipientSettings & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -14161,7 +14161,7 @@ void readNotebookRecipientSettings( NotebookRecipientSettings & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -14412,7 +14412,7 @@ void readSharedNotebook( SharedNotebook & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -14730,7 +14730,7 @@ void readCanMoveToContainerRestrictions( CanMoveToContainerRestrictions & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -15017,7 +15017,7 @@ void readNotebookRestrictions( NotebookRestrictions & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -15676,7 +15676,7 @@ void readNotebook( Notebook & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -15768,7 +15768,7 @@ void readNotebook( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I64) { @@ -15791,7 +15791,7 @@ void readNotebook( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -16093,7 +16093,7 @@ void readLinkedNotebook( LinkedNotebook & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -16358,7 +16358,7 @@ void readNotebookDescriptor( NotebookDescriptor & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -16561,7 +16561,7 @@ void readUserProfile( UserProfile & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -16809,7 +16809,7 @@ void readRelatedContentImage( RelatedContentImage & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -17068,7 +17068,7 @@ void readRelatedContent( RelatedContent & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -17160,7 +17160,7 @@ void readRelatedContent( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -17228,7 +17228,7 @@ void readRelatedContent( if (fieldType == ThriftFieldType::T_LIST) { QStringList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { @@ -17478,7 +17478,7 @@ void readBusinessInvitation( BusinessInvitation & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -17676,7 +17676,7 @@ void readUserIdentity( UserIdentity & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -17803,7 +17803,7 @@ void readPublicUserInfo( PublicUserInfo & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool userId_isset = false; r.readStructBegin(fname); @@ -17971,7 +17971,7 @@ void readUserUrls( UserUrls & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -18185,7 +18185,7 @@ void readAuthenticationResult( AuthenticationResult & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool currentTime_isset = false; bool authenticationToken_isset = false; @@ -18488,7 +18488,7 @@ void readBootstrapSettings( BootstrapSettings & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool serviceHost_isset = false; bool marketingUrl_isset = false; @@ -18764,7 +18764,7 @@ void readBootstrapProfile( BootstrapProfile & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool name_isset = false; bool settings_isset = false; @@ -18839,7 +18839,7 @@ void readBootstrapInfo( BootstrapInfo & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool profiles_isset = false; r.readStructBegin(fname); @@ -18852,7 +18852,7 @@ void readBootstrapInfo( profiles_isset = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -18929,7 +18929,7 @@ void readEDAMUserException( EDAMUserException & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool errorCode_isset = false; r.readStructBegin(fname); @@ -19028,7 +19028,7 @@ void readEDAMSystemException( EDAMSystemException & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool errorCode_isset = false; r.readStructBegin(fname); @@ -19137,7 +19137,7 @@ void readEDAMNotFoundException( EDAMNotFoundException & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); while(true) @@ -19247,7 +19247,7 @@ void readEDAMInvalidContactsException( EDAMInvalidContactsException & s) { QString fname; - ThriftFieldType::type fieldType; + ThriftFieldType fieldType; qint16 fieldId; bool contacts_isset = false; r.readStructBegin(fname); @@ -19260,7 +19260,7 @@ void readEDAMInvalidContactsException( contacts_isset = true; QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { @@ -19292,7 +19292,7 @@ void readEDAMInvalidContactsException( if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; - ThriftFieldType::type elemType; + ThriftFieldType elemType; r.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { From 8819b39f366b73536eec2b2b52172a3f8ec9ad98 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 31 Oct 2019 07:18:54 +0300 Subject: [PATCH 055/188] Convert Thumbnail::ImageType to enum class from old C++98 style scoped enum --- QEverCloud/headers/Thumbnail.h | 18 +++++++++--- QEverCloud/src/Thumbnail.cpp | 53 ++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/QEverCloud/headers/Thumbnail.h b/QEverCloud/headers/Thumbnail.h index 37cca786..e559cf2b 100644 --- a/QEverCloud/headers/Thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -49,10 +49,20 @@ class QEVERCLOUD_EXPORT Thumbnail * * Can be PNG, JPEG, GIF or BMP. */ - struct ImageType { - enum type {PNG, JPEG, GIF, BMP}; + enum class ImageType + { + PNG, + JPEG, + GIF, + BMP }; + friend QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & strm, const ImageType imageType); + + friend QEVERCLOUD_EXPORT QDebug & operator<<( + QDebug & dbg, const ImageType imageType); + /** * @brief Default constructor. * @@ -79,7 +89,7 @@ class QEVERCLOUD_EXPORT Thumbnail * Thumbnail image type. See ImageType. By default PNG is used. */ Thumbnail(QString host, QString shardId, QString authenticationToken, - int size = 300, ImageType::type imageType = ImageType::PNG); + int size = 300, ImageType imageType = ImageType::PNG); virtual ~Thumbnail(); @@ -115,7 +125,7 @@ class QEVERCLOUD_EXPORT Thumbnail * @param imageType * Thumbnail image type. See ImageType. By default PNG is used. */ - Thumbnail & setImageType(ImageType::type imageType); + Thumbnail & setImageType(ImageType imageType); /** * @brief Downloads the thumbnail for a resource or a note. diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 98679b61..09850f82 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -14,6 +14,8 @@ namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + class ThumbnailPrivate { public: @@ -21,9 +23,11 @@ class ThumbnailPrivate QString m_shardId; QString m_authenticationToken; int m_size; - Thumbnail::ImageType::type m_imageType; + Thumbnail::ImageType m_imageType; }; +//////////////////////////////////////////////////////////////////////////////// + Thumbnail::Thumbnail(): d_ptr(new ThumbnailPrivate) { @@ -33,7 +37,7 @@ Thumbnail::Thumbnail(): Thumbnail::Thumbnail(QString host, QString shardId, QString authenticationToken, - int size, Thumbnail::ImageType::type imageType) : + int size, Thumbnail::ImageType imageType) : d_ptr(new ThumbnailPrivate) { d_ptr->m_host = host; @@ -72,7 +76,7 @@ Thumbnail & Thumbnail::setSize(int size) return *this; } -Thumbnail & Thumbnail::setImageType(ImageType::type imageType) +Thumbnail & Thumbnail::setImageType(ImageType imageType) { d_ptr->m_imageType = imageType; return *this; @@ -194,4 +198,47 @@ QPair Thumbnail::createPostRequest( return qMakePair(request, postData); } +//////////////////////////////////////////////////////////////////////////////// + +namespace { + +template +void printImageType(T & strm, const Thumbnail::ImageType imageType) +{ + switch(imageType) + { + case Thumbnail::ImageType::PNG: + strm << "PNG"; + break; + case Thumbnail::ImageType::JPEG: + strm << "JPEG"; + break; + case Thumbnail::ImageType::GIF: + strm << "GIF"; + break; + case Thumbnail::ImageType::BMP: + strm << "BMP"; + break; + default: + strm << "Unknown (" << static_cast(imageType) << ")"; + break; + } +} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + +QTextStream & operator<<(QTextStream & strm, const Thumbnail::ImageType imageType) +{ + printImageType(strm, imageType); + return strm; +} + +QDebug & operator<<(QDebug & dbg, const Thumbnail::ImageType imageType) +{ + printImageType(dbg, imageType); + return dbg; +} + } // namespace qevercloud From bd0bd58c6fa752a4f4197ec74c047bdf7a8592bb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 31 Oct 2019 07:28:25 +0300 Subject: [PATCH 056/188] Migrate from using QPair to using std::pair --- QEverCloud/headers/Thumbnail.h | 4 +++- QEverCloud/src/InkNoteImageDownloader.cpp | 16 +++++++++------- QEverCloud/src/Thumbnail.cpp | 10 ++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/QEverCloud/headers/Thumbnail.h b/QEverCloud/headers/Thumbnail.h index e559cf2b..0bbd9e87 100644 --- a/QEverCloud/headers/Thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -17,6 +17,8 @@ #include #include +#include + namespace qevercloud { /** @cond HIDDEN_SYMBOLS */ @@ -162,7 +164,7 @@ class QEVERCLOUD_EXPORT Thumbnail * @return a pair of QNetworkRequest for the POST request and data that must * be posted with the request. */ - QPair createPostRequest( + std::pair createPostRequest( qevercloud::Guid guid, bool isPublic = false, bool isResourceGuid = false); private: diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index 765a389d..585de34d 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -17,14 +17,16 @@ #include #include +#include + namespace qevercloud { class InkNoteImageDownloaderPrivate { public: - QPair createPostRequest(const QString & urlPart, - const int sliceNumber, - const bool isPublic = false); + std::pair createPostRequest( + const QString & urlPart, const int sliceNumber, + const bool isPublic = false); QString m_host; QString m_shardId; @@ -104,8 +106,7 @@ QByteArray InkNoteImageDownloader::download( while(true) { int httpStatusCode = 0; - QPair postRequest = - d->createPostRequest(urlPart, sliceCounter, isPublic); + auto postRequest = d->createPostRequest(urlPart, sliceCounter, isPublic); QEC_DEBUG("ink_note_image", "Sending download request to url: " << postRequest.first.url()); @@ -170,7 +171,8 @@ QByteArray InkNoteImageDownloader::download( return imageData; } -QPair InkNoteImageDownloaderPrivate::createPostRequest( +std::pair +InkNoteImageDownloaderPrivate::createPostRequest( const QString & urlPart, const int sliceNumber, const bool isPublic) { QNetworkRequest request; @@ -183,7 +185,7 @@ QPair InkNoteImageDownloaderPrivate::createPostRequ postData = QByteArray("auth=")+ QUrl::toPercentEncoding(m_authenticationToken); } - return qMakePair(request, postData); + return std::make_pair(request, postData); } } // namespace qevercloud diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 09850f82..fe919122 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -91,8 +91,7 @@ QByteArray Thumbnail::download( << (isResourceGuid ? "resource guid" : "not a resource guid")); int httpStatusCode = 0; - QPair request = - createPostRequest(guid, isPublic, isResourceGuid); + auto request = createPostRequest(guid, isPublic, isResourceGuid); QByteArray reply = simpleDownload( evernoteNetworkAccessManager(), @@ -122,8 +121,7 @@ AsyncResult * Thumbnail::downloadAsync( << (isPublic ? "public" : "non-public") << ", " << (isResourceGuid ? "resource guid" : "not a resource guid")); - QPair pair = - createPostRequest(guid, isPublic, isResourceGuid); + auto pair = createPostRequest(guid, isPublic, isResourceGuid); auto res = new AsyncResult(pair.first, pair.second, timeoutMsec); QObject::connect(res, &AsyncResult::finished, [=] (const QVariant & value, @@ -144,7 +142,7 @@ AsyncResult * Thumbnail::downloadAsync( return res; } -QPair Thumbnail::createPostRequest( +std::pair Thumbnail::createPostRequest( Guid guid, bool isPublic, bool isResourceGuid) { Q_D(Thumbnail); @@ -195,7 +193,7 @@ QPair Thumbnail::createPostRequest( QByteArray("auth=") + QUrl::toPercentEncoding(d->m_authenticationToken); } - return qMakePair(request, postData); + return std::make_pair(request, postData); } //////////////////////////////////////////////////////////////////////////////// From 4419dfa895bd4c80d942850819c21fdb4c26fbd7 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 1 Nov 2019 07:19:36 +0300 Subject: [PATCH 057/188] Formatting improvements --- QEverCloud/src/generated/Services.cpp | 2546 ++++++++++++++++++------- 1 file changed, 1873 insertions(+), 673 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 60d1a356..177ef4bf 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -779,20 +779,27 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; readSyncState(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -802,7 +809,8 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -812,18 +820,23 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getSyncState: missing result")); } + return result; } @@ -950,20 +963,27 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; readSyncChunk(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -973,7 +993,8 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -983,18 +1004,23 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getFilteredSyncChunk: missing result")); } + return result; } @@ -1127,20 +1153,27 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; readSyncState(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -1150,7 +1183,8 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -1160,7 +1194,8 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -1170,18 +1205,23 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getLinkedNotebookSyncState: missing result")); } + return result; } @@ -1323,20 +1363,27 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; readSyncChunk(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -1346,7 +1393,8 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -1356,7 +1404,8 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -1366,18 +1415,23 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getLinkedNotebookSyncChunk: missing result")); } + return result; } @@ -1509,10 +1563,15 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -1532,11 +1591,13 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -1546,7 +1607,8 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -1556,18 +1618,23 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listNotebooks: missing result")); } + return result; } @@ -1673,10 +1740,15 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -1696,11 +1768,13 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -1710,7 +1784,8 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -1720,18 +1795,23 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listAccessibleBusinessNotebooks: missing result")); } + return result; } @@ -1844,20 +1924,27 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -1867,7 +1954,8 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -1877,7 +1965,8 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -1887,18 +1976,23 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNotebook: missing result")); } + return result; } @@ -2012,20 +2106,27 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2035,7 +2136,8 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2045,18 +2147,23 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getDefaultNotebook: missing result")); } + return result; } @@ -2169,20 +2276,27 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2192,7 +2306,8 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2202,7 +2317,8 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -2212,18 +2328,23 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createNotebook: missing result")); } + return result; } @@ -2344,20 +2465,27 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2367,7 +2495,8 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2377,7 +2506,8 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -2387,18 +2517,23 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNotebook: missing result")); } + return result; } @@ -2519,20 +2654,27 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2542,7 +2684,8 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2552,7 +2695,8 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -2562,18 +2706,23 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeNotebook: missing result")); } + return result; } @@ -2687,10 +2836,15 @@ QList NoteStore_listTags_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -2710,11 +2864,13 @@ QList NoteStore_listTags_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2724,7 +2880,8 @@ QList NoteStore_listTags_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2734,18 +2891,23 @@ QList NoteStore_listTags_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listTags: missing result")); } + return result; } @@ -2858,10 +3020,15 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -2881,11 +3048,13 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -2895,7 +3064,8 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -2905,7 +3075,8 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -2915,18 +3086,23 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listTagsByNotebook: missing result")); } + return result; } @@ -3047,20 +3223,27 @@ Tag NoteStore_getTag_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; readTag(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3070,7 +3253,8 @@ Tag NoteStore_getTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3080,7 +3264,8 @@ Tag NoteStore_getTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -3090,18 +3275,23 @@ Tag NoteStore_getTag_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getTag: missing result")); } + return result; } @@ -3222,20 +3412,27 @@ Tag NoteStore_createTag_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; readTag(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3245,7 +3442,8 @@ Tag NoteStore_createTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3255,7 +3453,8 @@ Tag NoteStore_createTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -3265,18 +3464,23 @@ Tag NoteStore_createTag_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createTag: missing result")); } + return result; } @@ -3397,20 +3601,27 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3420,7 +3631,8 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3430,7 +3642,8 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -3440,18 +3653,23 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateTag: missing result")); } + return result; } @@ -3570,10 +3788,15 @@ void NoteStore_untagAll_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3583,7 +3806,8 @@ void NoteStore_untagAll_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3593,7 +3817,8 @@ void NoteStore_untagAll_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -3603,13 +3828,17 @@ void NoteStore_untagAll_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant NoteStore_untagAll_readReplyAsync(QByteArray reply) @@ -3730,20 +3959,27 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3753,7 +3989,8 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3763,7 +4000,8 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -3773,18 +4011,23 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeTag: missing result")); } + return result; } @@ -3898,10 +4141,15 @@ QList NoteStore_listSearches_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -3921,11 +4169,13 @@ QList NoteStore_listSearches_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -3935,7 +4185,8 @@ QList NoteStore_listSearches_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -3945,18 +4196,23 @@ QList NoteStore_listSearches_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listSearches: missing result")); } + return result; } @@ -4069,20 +4325,27 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; readSavedSearch(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4092,7 +4355,8 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -4102,7 +4366,8 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -4112,18 +4377,23 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getSearch: missing result")); } + return result; } @@ -4244,20 +4514,27 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; readSavedSearch(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4267,7 +4544,8 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -4277,18 +4555,23 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createSearch: missing result")); } + return result; } @@ -4409,20 +4692,27 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4432,7 +4722,8 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -4442,7 +4733,8 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -4452,18 +4744,23 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateSearch: missing result")); } + return result; } @@ -4584,20 +4881,27 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4607,7 +4911,8 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -4617,7 +4922,8 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -4627,18 +4933,23 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeSearch: missing result")); } + return result; } @@ -4766,20 +5077,27 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4789,7 +5107,8 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -4799,7 +5118,8 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -4809,18 +5129,23 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("findNoteOffset: missing result")); } + return result; } @@ -4968,20 +5293,27 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NotesMetadataList v; readNotesMetadataList(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -4991,7 +5323,8 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5001,7 +5334,8 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5011,18 +5345,23 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("findNotesMetadata: missing result")); } + return result; } @@ -5168,20 +5507,27 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NoteCollectionCounts v; readNoteCollectionCounts(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -5191,7 +5537,8 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5201,7 +5548,8 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5211,18 +5559,23 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("findNoteCounts: missing result")); } + return result; } @@ -5356,20 +5709,27 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -5379,7 +5739,8 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5389,7 +5750,8 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5399,18 +5761,23 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteWithResultSpec: missing result")); } + return result; } @@ -5565,20 +5932,27 @@ Note NoteStore_getNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -5588,7 +5962,8 @@ Note NoteStore_getNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5598,7 +5973,8 @@ Note NoteStore_getNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5608,18 +5984,23 @@ Note NoteStore_getNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNote: missing result")); } + return result; } @@ -5764,20 +6145,27 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; readLazyMap(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -5787,7 +6175,8 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5797,7 +6186,8 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5807,18 +6197,23 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteApplicationData: missing result")); } + return result; } @@ -5946,20 +6341,27 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -5969,7 +6371,8 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -5979,7 +6382,8 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -5989,18 +6393,23 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteApplicationDataEntry: missing result")); } + return result; } @@ -6141,20 +6550,27 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -6164,7 +6580,8 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -6174,7 +6591,8 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -6184,18 +6602,23 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("setNoteApplicationDataEntry: missing result")); } + return result; } @@ -6335,20 +6758,27 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -6358,7 +6788,8 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -6368,7 +6799,8 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -6378,18 +6810,23 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("unsetNoteApplicationDataEntry: missing result")); } + return result; } @@ -6516,20 +6953,27 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -6539,7 +6983,8 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -6549,7 +6994,8 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -6559,18 +7005,23 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteContent: missing result")); } + return result; } @@ -6705,20 +7156,27 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -6728,7 +7186,8 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -6738,7 +7197,8 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -6748,18 +7208,23 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteSearchText: missing result")); } + return result; } @@ -6892,20 +7357,27 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -6915,7 +7387,8 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -6925,7 +7398,8 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -6935,18 +7409,23 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceSearchText: missing result")); } + return result; } @@ -7067,10 +7546,15 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QStringList v; @@ -7090,11 +7574,13 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7104,7 +7590,8 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7114,7 +7601,8 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -7124,18 +7612,23 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteTagNames: missing result")); } + return result; } @@ -7256,20 +7749,27 @@ Note NoteStore_createNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7279,7 +7779,8 @@ Note NoteStore_createNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7289,7 +7790,8 @@ Note NoteStore_createNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -7299,18 +7801,23 @@ Note NoteStore_createNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createNote: missing result")); } + return result; } @@ -7431,20 +7938,27 @@ Note NoteStore_updateNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7454,7 +7968,8 @@ Note NoteStore_updateNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7464,7 +7979,8 @@ Note NoteStore_updateNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -7474,18 +7990,23 @@ Note NoteStore_updateNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNote: missing result")); } + return result; } @@ -7606,20 +8127,27 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7629,7 +8157,8 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7639,7 +8168,8 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -7649,18 +8179,23 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("deleteNote: missing result")); } + return result; } @@ -7781,20 +8316,27 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7804,7 +8346,8 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7814,7 +8357,8 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -7824,18 +8368,23 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeNote: missing result")); } + return result; } @@ -7963,20 +8512,27 @@ Note NoteStore_copyNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -7986,7 +8542,8 @@ Note NoteStore_copyNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -7996,7 +8553,8 @@ Note NoteStore_copyNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -8006,18 +8564,23 @@ Note NoteStore_copyNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("copyNote: missing result")); } + return result; } @@ -8144,10 +8707,15 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -8167,11 +8735,13 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -8181,7 +8751,8 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -8191,7 +8762,8 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -8201,18 +8773,23 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listNoteVersions: missing result")); } + return result; } @@ -8361,20 +8938,27 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; readNote(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -8384,7 +8968,8 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -8394,7 +8979,8 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -8404,18 +8990,23 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNoteVersion: missing result")); } + return result; } @@ -8588,20 +9179,27 @@ Resource NoteStore_getResource_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; readResource(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -8611,7 +9209,8 @@ Resource NoteStore_getResource_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -8621,7 +9220,8 @@ Resource NoteStore_getResource_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -8631,18 +9231,23 @@ Resource NoteStore_getResource_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResource: missing result")); } + return result; } @@ -8787,20 +9392,27 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; readLazyMap(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -8810,7 +9422,8 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -8820,7 +9433,8 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -8830,18 +9444,23 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceApplicationData: missing result")); } + return result; } @@ -8969,20 +9588,27 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -8992,7 +9618,8 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9002,7 +9629,8 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9012,18 +9640,23 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceApplicationDataEntry: missing result")); } + return result; } @@ -9164,20 +9797,27 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -9187,7 +9827,8 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9197,7 +9838,8 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9207,18 +9849,23 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("setResourceApplicationDataEntry: missing result")); } + return result; } @@ -9358,20 +10005,27 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -9381,7 +10035,8 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9391,7 +10046,8 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9401,18 +10057,23 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("unsetResourceApplicationDataEntry: missing result")); } + return result; } @@ -9539,20 +10200,27 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -9562,7 +10230,8 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9572,7 +10241,8 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9582,18 +10252,23 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateResource: missing result")); } + return result; } @@ -9714,20 +10389,27 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -9737,7 +10419,8 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9747,7 +10430,8 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9757,18 +10441,23 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceData: missing result")); } + return result; } @@ -9917,20 +10606,27 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; readResource(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -9940,7 +10636,8 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -9950,7 +10647,8 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -9960,18 +10658,23 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceByHash: missing result")); } + return result; } @@ -10116,20 +10819,27 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -10139,7 +10849,8 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -10149,7 +10860,8 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -10159,18 +10871,23 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceRecognition: missing result")); } + return result; } @@ -10291,20 +11008,27 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; r.readBinary(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -10314,7 +11038,8 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -10324,7 +11049,8 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -10334,18 +11060,23 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceAlternateData: missing result")); } + return result; } @@ -10466,20 +11197,27 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ResourceAttributes v; readResourceAttributes(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -10489,7 +11227,8 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -10499,7 +11238,8 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -10509,18 +11249,23 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getResourceAttributes: missing result")); } + return result; } @@ -10641,20 +11386,27 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -10664,7 +11416,8 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -10674,18 +11427,23 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getPublicNotebook: missing result")); } + return result; } @@ -10817,20 +11575,27 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; readSharedNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -10840,7 +11605,8 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -10850,7 +11616,8 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -10860,18 +11627,23 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("shareNotebook: missing result")); } + return result; } @@ -10998,20 +11770,27 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; CreateOrUpdateNotebookSharesResult v; readCreateOrUpdateNotebookSharesResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11021,7 +11800,8 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11031,7 +11811,8 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11041,7 +11822,8 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.skip(fieldType); } } - else if (fieldId == 4) { + else if (fieldId == 4) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMInvalidContactsException e; readEDAMInvalidContactsException(r, e); @@ -11051,18 +11833,23 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createOrUpdateNotebookShares: missing result")); } + return result; } @@ -11183,20 +11970,27 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11206,7 +12000,8 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11216,7 +12011,8 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11226,18 +12022,23 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateSharedNotebook: missing result")); } + return result; } @@ -11365,20 +12166,27 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; readNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11388,7 +12196,8 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11398,7 +12207,8 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11408,18 +12218,23 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("setNotebookRecipientSettings: missing result")); } + return result; } @@ -11539,10 +12354,15 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -11562,11 +12382,13 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11576,7 +12398,8 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11586,7 +12409,8 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11596,18 +12420,23 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listSharedNotebooks: missing result")); } + return result; } @@ -11720,20 +12549,27 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LinkedNotebook v; readLinkedNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11743,7 +12579,8 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11753,7 +12590,8 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11763,18 +12601,23 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("createLinkedNotebook: missing result")); } + return result; } @@ -11895,20 +12738,27 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -11918,7 +12768,8 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -11928,7 +12779,8 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -11938,18 +12790,23 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateLinkedNotebook: missing result")); } + return result; } @@ -12063,10 +12920,15 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -12086,11 +12948,13 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12100,7 +12964,8 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12110,7 +12975,8 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12120,18 +12986,23 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listLinkedNotebooks: missing result")); } + return result; } @@ -12244,20 +13115,27 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; r.readI32(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12267,7 +13145,8 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12277,7 +13156,8 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12287,18 +13167,23 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("expungeLinkedNotebook: missing result")); } + return result; } @@ -12419,20 +13304,27 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12442,7 +13334,8 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12452,7 +13345,8 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12462,18 +13356,23 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToSharedNotebook: missing result")); } + return result; } @@ -12587,20 +13486,27 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; readSharedNotebook(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12610,7 +13516,8 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12620,7 +13527,8 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12630,18 +13538,23 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getSharedNotebookByAuth: missing result")); } + return result; } @@ -12752,10 +13665,15 @@ void NoteStore_emailNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12765,7 +13683,8 @@ void NoteStore_emailNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12775,7 +13694,8 @@ void NoteStore_emailNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12785,13 +13705,17 @@ void NoteStore_emailNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant NoteStore_emailNote_readReplyAsync(QByteArray reply) @@ -12912,20 +13836,27 @@ QString NoteStore_shareNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; r.readString(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -12935,7 +13866,8 @@ QString NoteStore_shareNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -12945,7 +13877,8 @@ QString NoteStore_shareNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -12955,18 +13888,23 @@ QString NoteStore_shareNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("shareNote: missing result")); } + return result; } @@ -13085,10 +14023,15 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13098,7 +14041,8 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -13108,7 +14052,8 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -13118,13 +14063,17 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant NoteStore_stopSharingNote_readReplyAsync(QByteArray reply) @@ -13252,20 +14201,27 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13275,7 +14231,8 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -13285,7 +14242,8 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -13295,18 +14253,23 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToSharedNote: missing result")); } + return result; } @@ -13440,20 +14403,27 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; RelatedResult v; readRelatedResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13463,7 +14433,8 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -13473,7 +14444,8 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -13483,18 +14455,23 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("findRelated: missing result")); } + return result; } @@ -13621,20 +14598,27 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UpdateNoteIfUsnMatchesResult v; readUpdateNoteIfUsnMatchesResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13644,7 +14628,8 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -13654,7 +14639,8 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -13664,18 +14650,23 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("updateNoteIfUsnMatches: missing result")); } + return result; } @@ -13796,20 +14787,27 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ManageNotebookSharesResult v; readManageNotebookSharesResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13819,7 +14817,8 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -13829,7 +14828,8 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -13839,18 +14839,23 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("manageNotebookShares: missing result")); } + return result; } @@ -13971,20 +14976,27 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ShareRelationships v; readShareRelationships(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -13994,7 +15006,8 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -14004,7 +15017,8 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -14014,18 +15028,23 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getNotebookShares: missing result")); } + return result; } @@ -14315,31 +15334,42 @@ bool UserStore_checkVersion_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_BOOL) { resultIsSet = true; bool v; r.readBool(v); result = v; - } else { + } + else { r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("checkVersion: missing result")); } + return result; } @@ -14463,31 +15493,42 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; BootstrapInfo v; readBootstrapInfo(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getBootstrapInfo: missing result")); } + return result; } @@ -14641,20 +15682,27 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -14664,7 +15712,8 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -14674,18 +15723,23 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateLongSession: missing result")); } + return result; } @@ -14848,20 +15902,27 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -14871,7 +15932,8 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -14881,18 +15943,23 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("completeTwoFactorAuthentication: missing result")); } + return result; } @@ -15014,10 +16081,15 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15027,7 +16099,8 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15037,13 +16110,17 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) @@ -15149,20 +16226,27 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; readAuthenticationResult(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15172,7 +16256,8 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15182,18 +16267,23 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("authenticateToBusiness: missing result")); } + return result; } @@ -15299,20 +16389,27 @@ User UserStore_getUser_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; User v; readUser(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15322,7 +16419,8 @@ User UserStore_getUser_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15332,18 +16430,23 @@ User UserStore_getUser_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getUser: missing result")); } + return result; } @@ -15449,20 +16552,27 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; PublicUserInfo v; readPublicUserInfo(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -15472,7 +16582,8 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15482,7 +16593,8 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15492,18 +16604,23 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getPublicUserInfo: missing result")); } + return result; } @@ -15615,20 +16732,27 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UserUrls v; readUserUrls(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15638,7 +16762,8 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15648,18 +16773,23 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getUserUrls: missing result")); } + return result; } @@ -15770,10 +16900,15 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15783,7 +16918,8 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15793,13 +16929,17 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant UserStore_inviteToBusiness_readReplyAsync(QByteArray reply) @@ -15918,10 +17058,15 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -15931,7 +17076,8 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -15941,7 +17087,8 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -15951,13 +17098,17 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant UserStore_removeFromBusiness_readReplyAsync(QByteArray reply) @@ -16083,10 +17234,15 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 1) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -16096,7 +17252,8 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -16106,7 +17263,8 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 3) { + else if (fieldId == 3) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; readEDAMNotFoundException(r, e); @@ -16116,13 +17274,17 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + } QVariant UserStore_updateBusinessUserIdentifier_readReplyAsync(QByteArray reply) @@ -16242,10 +17404,15 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -16265,11 +17432,13 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -16279,7 +17448,8 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -16289,18 +17459,23 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listBusinessUsers: missing result")); } + return result; } @@ -16413,10 +17588,15 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_LIST) { resultIsSet = true; QList v; @@ -16436,11 +17616,13 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray } r.readListEnd(); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -16450,7 +17632,8 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray r.skip(fieldType); } } - else if (fieldId == 2) { + else if (fieldId == 2) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; readEDAMSystemException(r, e); @@ -16460,18 +17643,23 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("listBusinessInvitations: missing result")); } + return result; } @@ -16585,20 +17773,27 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) ThriftFieldType fieldType; qint16 fieldId; r.readStructBegin(fname); - while(true) { + while(true) + { r.readFieldBegin(fname, fieldType, fieldId); - if (fieldType == ThriftFieldType::T_STOP) break; - if (fieldId == 0) { + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 0) + { if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AccountLimits v; readAccountLimits(r, v); result = v; - } else { + } + else { r.skip(fieldType); } } - else if (fieldId == 1) { + else if (fieldId == 1) + { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; readEDAMUserException(r, e); @@ -16608,18 +17803,23 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) r.skip(fieldType); } } - else { + else + { r.skip(fieldType); } + r.readFieldEnd(); } + r.readStructEnd(); r.readMessageEnd(); + if (!resultIsSet) { throw ThriftException( ThriftException::Type::MISSING_RESULT, QStringLiteral("getAccountLimits: missing result")); } + return result; } From 8e1d1a625860571f9f34495b8bd5bc3dcbddf29f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 2 Nov 2019 13:36:48 +0300 Subject: [PATCH 058/188] Use QSharedPointer consistently across the code instead of std::shared_ptr --- QEverCloud/headers/AsyncResult.h | 15 ++-------- QEverCloud/headers/DurableService.h | 10 +++---- QEverCloud/headers/EverCloudException.h | 18 ++++++------ QEverCloud/headers/Exceptions.h | 8 +++--- QEverCloud/headers/Log.h | 5 ++-- QEverCloud/headers/RequestContext.h | 5 ++-- QEverCloud/headers/generated/Services.h | 4 +-- QEverCloud/headers/generated/Types.h | 8 +++--- QEverCloud/src/AsyncResult.cpp | 4 +-- QEverCloud/src/AsyncResult_p.cpp | 16 +++++------ QEverCloud/src/AsyncResult_p.h | 6 ++-- QEverCloud/src/DurableService.cpp | 11 ++++--- QEverCloud/src/EverCloudException.cpp | 10 ++++--- QEverCloud/src/Exceptions.cpp | 32 ++++++++++----------- QEverCloud/src/Http.cpp | 8 ++---- QEverCloud/src/Http.h | 12 +++++++- QEverCloud/src/Log.cpp | 6 ++-- QEverCloud/src/RequestContext.cpp | 2 +- QEverCloud/src/Thumbnail.cpp | 2 +- QEverCloud/src/tests/TestDurableService.cpp | 22 ++++++-------- QEverCloud/src/tests/TestDurableService.h | 2 -- 21 files changed, 96 insertions(+), 110 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 2ce16c37..af44353a 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -33,7 +33,7 @@ NoteStore* ns; Note note; ... QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, - [ns](QVariant result, EverCloudExceptionDataPtr error) + [ns](QVariant result, QSharedPointer error) { if (error) { // do something in case of an error @@ -66,7 +66,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * Constructor accepting already prepared value and/or exception, * for use in tests */ - AsyncResult(QVariant result, EverCloudExceptionDataPtr error, + AsyncResult(QVariant result, QSharedPointer error, bool autoDelete = true, QObject * parent = nullptr); ~AsyncResult(); @@ -90,17 +90,8 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * AsyncResult deletes itself after emitting this signal (if autoDelete * parameter passed to its constructor was set to true). You don't have to * manage it's lifetime explicitly. - * - * NOTE: in order to use this signal with queued connections (either via - * explicit specification of Qt::QueuedConnection connection type or just - * via connecting signals and slots of objects living in different threads), - * you must make this call before creating any such connection: - * - * @code - * qRegisterMetaType("EverCloudExceptionDataPtr"); - * @endcode */ - void finished(QVariant result, EverCloudExceptionDataPtr error); + void finished(QVariant result, QSharedPointer error); private: friend class DurableService; diff --git a/QEverCloud/headers/DurableService.h b/QEverCloud/headers/DurableService.h index 7b2a3c42..3f5ababf 100644 --- a/QEverCloud/headers/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -13,10 +13,10 @@ #include "RequestContext.h" #include +#include #include #include -#include #include namespace qevercloud { @@ -26,10 +26,10 @@ namespace qevercloud { struct QEVERCLOUD_EXPORT IRetryPolicy { virtual bool shouldRetry( - EverCloudExceptionDataPtr exceptionData) = 0; + QSharedPointer exceptionData) = 0; }; -using IRetryPolicyPtr = std::shared_ptr; +using IRetryPolicyPtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// @@ -38,7 +38,7 @@ QT_FORWARD_DECLARE_CLASS(DurableServicePrivate) class QEVERCLOUD_EXPORT IDurableService { public: - using SyncResult = std::pair; + using SyncResult = std::pair>; using SyncServiceCall = std::function; using AsyncServiceCall = std::function; @@ -78,7 +78,7 @@ class QEVERCLOUD_EXPORT IDurableService AsyncRequest && asyncRequest, IRequestContextPtr ctx) = 0; }; -using IDurableServicePtr = std::shared_ptr; +using IDurableServicePtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index e27d4bf6..a8e7efba 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -13,10 +13,10 @@ #include "Helpers.h" #include +#include #include #include -#include namespace qevercloud { @@ -24,8 +24,6 @@ namespace qevercloud { class QEVERCLOUD_EXPORT EverCloudExceptionData; -using EverCloudExceptionDataPtr = std::shared_ptr; - //////////////////////////////////////////////////////////////////////////////// /** @@ -46,7 +44,7 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception const char * what() const noexcept; - virtual EverCloudExceptionDataPtr exceptionData() const; + virtual QSharedPointer exceptionData() const; }; //////////////////////////////////////////////////////////////////////////////// @@ -71,15 +69,15 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception NoteStore* ns; ... QObject::connect(ns->getNotebook(notebookGuid), &AsyncResult::finished, - [](QVariant result, EverCloudExceptionDataPtr error) + [](QVariant result, EverCloudExceptionData error) { - if (error) + if (!error.isNull()) { - std::shared_ptr errorNotFound = + QSharedPointer errorNotFound = error.objectCast(); - std::shared_ptr errorUser = + QSharedPointer errorUser = error.objectCast(); - std::shared_ptr errorSystem = + QSharedPointer errorSystem = error.objectCast(); if (!errorNotFound.isNull()) @@ -157,7 +155,7 @@ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException explicit EvernoteException(const std::string & error); explicit EvernoteException(const char * error); - virtual EverCloudExceptionDataPtr exceptionData() const Q_DECL_OVERRIDE; + virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index 7a6d6ac9..7fcdb7f0 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -37,7 +37,7 @@ class QEVERCLOUD_EXPORT NetworkException: public EverCloudException const char * what() const noexcept override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; protected: QNetworkReply::NetworkError m_type; @@ -88,7 +88,7 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException const char * what() const noexcept override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; protected: Type m_type; @@ -208,7 +208,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: public EDAMSystemException { public: - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// @@ -238,7 +238,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpired: public EDAMSystemException { public: - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 42c50d0e..919ca9d5 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -12,10 +12,9 @@ #include #include +#include #include -#include - namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// @@ -53,7 +52,7 @@ class QEVERCLOUD_EXPORT ILogger virtual LogLevel level() const = 0; }; -using ILoggerPtr = std::shared_ptr; +using ILoggerPtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index d2421674..8e6f79b1 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -11,10 +11,9 @@ #include "Export.h" #include +#include #include -#include - namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// @@ -61,7 +60,7 @@ class QEVERCLOUD_EXPORT IRequestContext QDebug & dbg, const IRequestContext & ctx); }; -using IRequestContextPtr = std::shared_ptr; +using IRequestContextPtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index cadc49e7..10a35342 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -2729,7 +2729,7 @@ class QEVERCLOUD_EXPORT INoteStore: public QObject }; -using INoteStorePtr = std::shared_ptr; +using INoteStorePtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// @@ -3299,7 +3299,7 @@ class QEVERCLOUD_EXPORT IUserStore: public QObject }; -using IUserStorePtr = std::shared_ptr; +using IUserStorePtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 868c00ea..27589949 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -4799,7 +4799,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin EDAMUserException(const EDAMUserException & other); const char * what() const throw() override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4843,7 +4843,7 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr EDAMSystemException(const EDAMSystemException & other); const char * what() const throw() override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4886,7 +4886,7 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public EDAMNotFoundException(const EDAMNotFoundException & other); const char * what() const throw() override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4938,7 +4938,7 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, EDAMInvalidContactsException(const EDAMInvalidContactsException & other); const char * what() const throw() override; - virtual EverCloudExceptionDataPtr exceptionData() const override; + virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 57840b58..5c3f92f7 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -49,7 +49,7 @@ AsyncResult::AsyncResult( QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } -AsyncResult::AsyncResult(QVariant result, EverCloudExceptionDataPtr error, +AsyncResult::AsyncResult(QVariant result, QSharedPointer error, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate(result, error, autoDelete, this)) @@ -64,7 +64,7 @@ bool AsyncResult::waitForFinished(int timeout) { QEventLoop loop; QObject::connect(this, - SIGNAL(finished(QVariant,EverCloudExceptionDataPtr)), + SIGNAL(finished(QVariant,QSharedPointer)), &loop, SLOT(quit())); if(timeout >= 0) { diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 9668ac9c..f73d5eaa 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -36,14 +36,14 @@ AsyncResultPrivate::AsyncResultPrivate( {} AsyncResultPrivate::AsyncResultPrivate( - QVariant result, EverCloudExceptionDataPtr error, + QVariant result, QSharedPointer error, bool autoDelete, AsyncResult * q) : m_autoDelete(autoDelete), q_ptr(q) { QMetaObject::invokeMethod(this, "setValue", Qt::QueuedConnection, Q_ARG(QVariant, result), - Q_ARG(EverCloudExceptionDataPtr, error)); + Q_ARG(QSharedPointer, error)); } AsyncResultPrivate::~AsyncResultPrivate() @@ -66,19 +66,19 @@ void AsyncResultPrivate::start() void AsyncResultPrivate::onReplyFetched(QObject * rp) { ReplyFetcher * reply = qobject_cast(rp); - EverCloudExceptionDataPtr error; + QSharedPointer error; QVariant result; try { if (reply->isError()) { - error = std::make_shared( + error = QSharedPointer::create( reply->errorText()); } else if (reply->httpStatusCode() != 200) { - error = std::make_shared( + error = QSharedPointer::create( QString::fromUtf8("HTTP Status Code = %1") .arg(reply->httpStatusCode())); } @@ -93,13 +93,13 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } catch(const std::exception & e) { - error = std::make_shared( + error = QSharedPointer::create( QString::fromUtf8("Exception of type \"%1\" with the message: %2") .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what()))); } catch(...) { - error = std::make_shared( + error = QSharedPointer::create( QStringLiteral("Unknown exception")); } @@ -107,7 +107,7 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } void AsyncResultPrivate::setValue( - QVariant result, EverCloudExceptionDataPtr error) + QVariant result, QSharedPointer error) { Q_Q(AsyncResult); QObject::connect(this, &AsyncResultPrivate::finished, diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index dcd4acfc..4649fe03 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -28,20 +28,20 @@ class AsyncResultPrivate: public QObject AsyncResult * q); explicit AsyncResultPrivate( - QVariant result, EverCloudExceptionDataPtr error, + QVariant result, QSharedPointer error, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); Q_SIGNALS: - void finished(QVariant result, EverCloudExceptionDataPtr error); + void finished(QVariant result, QSharedPointer error); public Q_SLOTS: void start(); void onReplyFetched(QObject * rp); - void setValue(QVariant result, EverCloudExceptionDataPtr error); + void setValue(QVariant result, QSharedPointer error); public: QNetworkRequest m_request; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 8ff15c60..46e469c8 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -40,7 +40,7 @@ quint64 exponentiallyIncreasedTimeoutMsec( struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy { virtual bool shouldRetry( - EverCloudExceptionDataPtr exceptionData) override + QSharedPointer exceptionData) override { if (Q_UNLIKELY(!exceptionData)) { return true; @@ -166,7 +166,7 @@ DurableService::SyncResult DurableService::executeSyncRequest( result.second = e.exceptionData(); } catch(const std::exception & e) { - result.second = std::make_shared( + result.second = QSharedPointer::create( QString::fromLocal8Bit(e.what())); return result; } @@ -252,7 +252,7 @@ void DurableService::doExecuteAsyncRequest( result, [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( QVariant value, - EverCloudExceptionDataPtr exceptionData) mutable + QSharedPointer exceptionData) mutable { if (!exceptionData) { QEC_DEBUG("durable_service", "Successfully executed async " @@ -305,15 +305,14 @@ void DurableService::doExecuteAsyncRequest( IRetryPolicyPtr newRetryPolicy() { - return std::make_shared(); + return QSharedPointer::create(); } IDurableServicePtr newDurableService( IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) { - return std::make_shared( - retryPolicy, ctx); + return QSharedPointer::create(retryPolicy, ctx); } } // namespace qevercloud diff --git a/QEverCloud/src/EverCloudException.cpp b/QEverCloud/src/EverCloudException.cpp index 00e6f222..60330031 100644 --- a/QEverCloud/src/EverCloudException.cpp +++ b/QEverCloud/src/EverCloudException.cpp @@ -35,9 +35,10 @@ const char * EverCloudException::what() const throw() return m_error.constData(); } -EverCloudExceptionDataPtr EverCloudException::exceptionData() const +QSharedPointer EverCloudException::exceptionData() const { - return std::make_shared(QString::fromUtf8(what())); + return QSharedPointer::create( + QString::fromUtf8(what())); } EverCloudExceptionData::EverCloudExceptionData(QString error) : @@ -65,9 +66,10 @@ EvernoteException::EvernoteException(const char * error) : EverCloudException(error) {} -EverCloudExceptionDataPtr EvernoteException::exceptionData() const +QSharedPointer EvernoteException::exceptionData() const { - return std::make_shared(QString::fromUtf8(what())); + return QSharedPointer::create( + QString::fromUtf8(what())); } EvernoteExceptionData::EvernoteExceptionData(QString error) : diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index bfde56bf..b5e6afa8 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -126,9 +126,9 @@ const char * NetworkException::what() const noexcept } } -EverCloudExceptionDataPtr NetworkException::exceptionData() const +QSharedPointer NetworkException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), type()); } @@ -196,9 +196,9 @@ const char * ThriftException::what() const noexcept } } -EverCloudExceptionDataPtr ThriftException::exceptionData() const +QSharedPointer ThriftException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), type()); } @@ -320,9 +320,9 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) return ThriftException(type, error); } -EverCloudExceptionDataPtr EDAMInvalidContactsException::exceptionData() const +QSharedPointer EDAMInvalidContactsException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( contacts, parameter, reasons); } @@ -350,9 +350,9 @@ void EDAMInvalidContactsExceptionData::throwException() const throw e; } -EverCloudExceptionDataPtr EDAMUserException::exceptionData() const +QSharedPointer EDAMUserException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), errorCode, parameter); } @@ -364,9 +364,9 @@ void EDAMUserExceptionData::throwException() const throw e; } -EverCloudExceptionDataPtr EDAMSystemException::exceptionData() const +QSharedPointer EDAMSystemException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), errorCode, message, rateLimitDuration); } @@ -406,9 +406,9 @@ void EDAMSystemExceptionRateLimitReachedData::throwException() const throw e; } -EverCloudExceptionDataPtr EDAMNotFoundException::exceptionData() const +QSharedPointer EDAMNotFoundException::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), identifier, key); } @@ -450,18 +450,18 @@ void throwEDAMSystemException(const EDAMSystemException & baseException) throw baseException; } -EverCloudExceptionDataPtr EDAMSystemExceptionRateLimitReached::exceptionData() const +QSharedPointer EDAMSystemExceptionRateLimitReached::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), errorCode, message, rateLimitDuration); } -EverCloudExceptionDataPtr EDAMSystemExceptionAuthExpired::exceptionData() const +QSharedPointer EDAMSystemExceptionAuthExpired::exceptionData() const { - return std::make_shared( + return QSharedPointer::create( QString::fromUtf8(what()), errorCode, message, diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index a214a1c3..c117b5d9 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -54,14 +54,10 @@ void ReplyFetcher::start( m_ticker->start(1000); if (postData.isNull()) { - m_reply = std::shared_ptr( - nam->get(request), - [] (QNetworkReply * reply) { reply->deleteLater(); }); + m_reply = QNetworkReplyPtr(nam->get(request)); } else { - m_reply = std::shared_ptr( - nam->post(request, postData), - [] (QNetworkReply * reply) { reply->deleteLater(); }); + m_reply = QNetworkReplyPtr(nam->post(request, postData)); } QObject::connect(m_reply.get(), &QNetworkReply::finished, diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index f7d7594d..507381fa 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -69,7 +69,17 @@ private Q_SLOTS: void setError(QNetworkReply::NetworkError errorType, QString errorText); private: - std::shared_ptr m_reply; + struct QNetworkReplyDeleter + { + void operator()(QNetworkReply * reply) + { + reply->deleteLater(); + } + }; + + using QNetworkReplyPtr = std::unique_ptr; + + QNetworkReplyPtr m_reply; QNetworkReply::NetworkError m_errorType = QNetworkReply::NoError; QString m_errorText; diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 408d527f..3be75323 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -189,7 +189,7 @@ ILoggerPtr logger() { if (globalLogger.exists() && !globalLogger.isDestroyed() && - (globalLogger->get() != nullptr)) + !globalLogger->isNull()) { return *globalLogger; } @@ -206,12 +206,12 @@ void setLogger(ILoggerPtr logger) ILoggerPtr newNullLogger() { - return std::make_shared(); + return QSharedPointer::create(); } ILoggerPtr newStdErrLogger(LogLevel level) { - return std::make_shared(level); + return QSharedPointer::create(level); } QTextStream & operator<<(QTextStream & out, const LogLevel level) diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index 8cbc6b93..e3d62181 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -87,7 +87,7 @@ IRequestContextPtr newRequestContext( qint64 maxRequestTimeout, quint32 maxRequestRetryCount) { - return std::make_shared( + return QSharedPointer::create( std::move(authenticationToken), requestTimeout, increaseRequestTimeoutExponentially, diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index fe919122..9afe2df2 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -125,7 +125,7 @@ AsyncResult * Thumbnail::downloadAsync( auto res = new AsyncResult(pair.first, pair.second, timeoutMsec); QObject::connect(res, &AsyncResult::finished, [=] (const QVariant & value, - const EverCloudExceptionDataPtr error) + const QSharedPointer error) { Q_UNUSED(value) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index b60eb81c..ee09f42d 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -12,7 +12,6 @@ #include #include -#include #include namespace qevercloud { @@ -28,13 +27,13 @@ class ValueFetcher: public QObject {} QVariant m_value; - EverCloudExceptionDataPtr m_exceptionData; + QSharedPointer m_exceptionData; Q_SIGNALS: void finished(); public Q_SLOTS: - void onFinished(QVariant value, EverCloudExceptionDataPtr data) + void onFinished(QVariant value, QSharedPointer data) { m_value = value; m_exceptionData = data; @@ -48,11 +47,6 @@ DurableServiceTester::DurableServiceTester(QObject * parent) : QObject(parent) {} -void DurableServiceTester::initTestCase() -{ - qRegisterMetaType("EverCloudExceptionDataPtr"); -} - void DurableServiceTester::shouldExecuteSyncServiceCall() { auto durableService = newDurableService(); @@ -132,7 +126,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - EverCloudExceptionDataPtr data; + QSharedPointer data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -177,7 +171,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - EverCloudExceptionDataPtr data; + QSharedPointer data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -229,7 +223,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - EverCloudExceptionDataPtr data; + QSharedPointer data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -277,7 +271,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - EverCloudExceptionDataPtr data; + QSharedPointer data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -336,7 +330,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - EverCloudExceptionDataPtr data; + QSharedPointer data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; @@ -386,7 +380,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - EverCloudExceptionDataPtr data; + QSharedPointer data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index f32394ac..219fe25a 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -22,8 +22,6 @@ class DurableServiceTester: public QObject explicit DurableServiceTester(QObject * parent = nullptr); private Q_SLOTS: - void initTestCase(); - void shouldExecuteSyncServiceCall(); void shouldExecuteAsyncServiceCall(); void shouldRetrySyncServiceCalls(); From 4aa624e48592851a55a308b4b6ac933b4140c135 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 3 Nov 2019 21:00:33 +0300 Subject: [PATCH 059/188] Add autogenerated servers code --- QEverCloud/CMakeLists.txt | 2 + QEverCloud/headers/generated/Servers.h | 557 ++++++++++++++++++++++++ QEverCloud/src/generated/Servers.cpp | 568 +++++++++++++++++++++++++ 3 files changed, 1127 insertions(+) create mode 100644 QEverCloud/headers/generated/Servers.h create mode 100644 QEverCloud/src/generated/Servers.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 85cb749c..3b68ff62 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -37,6 +37,7 @@ endif() set(GENERATED_HEADERS headers/generated/Constants.h headers/generated/Services.h + headers/generated/Servers.h headers/generated/Types.h headers/generated/EDAMErrorCode.h) @@ -64,6 +65,7 @@ set(SOURCES src/generated/Constants.cpp src/generated/EDAMErrorCode.cpp src/generated/Services.cpp + src/generated/Servers.cpp src/generated/Types.cpp) if(BUILD_WITH_OAUTH_SUPPORT) diff --git a/QEverCloud/headers/generated/Servers.h b/QEverCloud/headers/generated/Servers.h new file mode 100644 index 00000000..a44a19be --- /dev/null +++ b/QEverCloud/headers/generated/Servers.h @@ -0,0 +1,557 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#ifndef QEVERCLOUD_GENERATED_SERVERS_H +#define QEVERCLOUD_GENERATED_SERVERS_H + +#include "../Export.h" + +#include "../Optional.h" +#include "../RequestContext.h" +#include "Constants.h" +#include "Types.h" +#include +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +/** + * @brief The NoteStoreServer class represents + * customizable server for NoteStore requests. + * It is primarily used for testing of QEverCloud + */ +class QEVERCLOUD_EXPORT NoteStoreServer: public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(NoteStoreServer) +public: + explicit NoteStoreServer(QObject * parent = nullptr); + +Q_SIGNALS: + // Signals notifying listeners about incoming requests + void getSyncStateRequest( + IRequestContextPtr ctx); + + void getFilteredSyncChunkRequest( + qint32 afterUSN, + qint32 maxEntries, + SyncChunkFilter filter, + IRequestContextPtr ctx); + + void getLinkedNotebookSyncStateRequest( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx); + + void getLinkedNotebookSyncChunkRequest( + LinkedNotebook linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx); + + void listNotebooksRequest( + IRequestContextPtr ctx); + + void listAccessibleBusinessNotebooksRequest( + IRequestContextPtr ctx); + + void getNotebookRequest( + Guid guid, + IRequestContextPtr ctx); + + void getDefaultNotebookRequest( + IRequestContextPtr ctx); + + void createNotebookRequest( + Notebook notebook, + IRequestContextPtr ctx); + + void updateNotebookRequest( + Notebook notebook, + IRequestContextPtr ctx); + + void expungeNotebookRequest( + Guid guid, + IRequestContextPtr ctx); + + void listTagsRequest( + IRequestContextPtr ctx); + + void listTagsByNotebookRequest( + Guid notebookGuid, + IRequestContextPtr ctx); + + void getTagRequest( + Guid guid, + IRequestContextPtr ctx); + + void createTagRequest( + Tag tag, + IRequestContextPtr ctx); + + void updateTagRequest( + Tag tag, + IRequestContextPtr ctx); + + void untagAllRequest( + Guid guid, + IRequestContextPtr ctx); + + void expungeTagRequest( + Guid guid, + IRequestContextPtr ctx); + + void listSearchesRequest( + IRequestContextPtr ctx); + + void getSearchRequest( + Guid guid, + IRequestContextPtr ctx); + + void createSearchRequest( + SavedSearch search, + IRequestContextPtr ctx); + + void updateSearchRequest( + SavedSearch search, + IRequestContextPtr ctx); + + void expungeSearchRequest( + Guid guid, + IRequestContextPtr ctx); + + void findNoteOffsetRequest( + NoteFilter filter, + Guid guid, + IRequestContextPtr ctx); + + void findNotesMetadataRequest( + NoteFilter filter, + qint32 offset, + qint32 maxNotes, + NotesMetadataResultSpec resultSpec, + IRequestContextPtr ctx); + + void findNoteCountsRequest( + NoteFilter filter, + bool withTrash, + IRequestContextPtr ctx); + + void getNoteWithResultSpecRequest( + Guid guid, + NoteResultSpec resultSpec, + IRequestContextPtr ctx); + + void getNoteRequest( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx); + + void getNoteApplicationDataRequest( + Guid guid, + IRequestContextPtr ctx); + + void getNoteApplicationDataEntryRequest( + Guid guid, + QString key, + IRequestContextPtr ctx); + + void setNoteApplicationDataEntryRequest( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx); + + void unsetNoteApplicationDataEntryRequest( + Guid guid, + QString key, + IRequestContextPtr ctx); + + void getNoteContentRequest( + Guid guid, + IRequestContextPtr ctx); + + void getNoteSearchTextRequest( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx); + + void getResourceSearchTextRequest( + Guid guid, + IRequestContextPtr ctx); + + void getNoteTagNamesRequest( + Guid guid, + IRequestContextPtr ctx); + + void createNoteRequest( + Note note, + IRequestContextPtr ctx); + + void updateNoteRequest( + Note note, + IRequestContextPtr ctx); + + void deleteNoteRequest( + Guid guid, + IRequestContextPtr ctx); + + void expungeNoteRequest( + Guid guid, + IRequestContextPtr ctx); + + void copyNoteRequest( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx); + + void listNoteVersionsRequest( + Guid noteGuid, + IRequestContextPtr ctx); + + void getNoteVersionRequest( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx); + + void getResourceRequest( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx); + + void getResourceApplicationDataRequest( + Guid guid, + IRequestContextPtr ctx); + + void getResourceApplicationDataEntryRequest( + Guid guid, + QString key, + IRequestContextPtr ctx); + + void setResourceApplicationDataEntryRequest( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx); + + void unsetResourceApplicationDataEntryRequest( + Guid guid, + QString key, + IRequestContextPtr ctx); + + void updateResourceRequest( + Resource resource, + IRequestContextPtr ctx); + + void getResourceDataRequest( + Guid guid, + IRequestContextPtr ctx); + + void getResourceByHashRequest( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx); + + void getResourceRecognitionRequest( + Guid guid, + IRequestContextPtr ctx); + + void getResourceAlternateDataRequest( + Guid guid, + IRequestContextPtr ctx); + + void getResourceAttributesRequest( + Guid guid, + IRequestContextPtr ctx); + + void getPublicNotebookRequest( + UserID userId, + QString publicUri, + IRequestContextPtr ctx); + + void shareNotebookRequest( + SharedNotebook sharedNotebook, + QString message, + IRequestContextPtr ctx); + + void createOrUpdateNotebookSharesRequest( + NotebookShareTemplate shareTemplate, + IRequestContextPtr ctx); + + void updateSharedNotebookRequest( + SharedNotebook sharedNotebook, + IRequestContextPtr ctx); + + void setNotebookRecipientSettingsRequest( + QString notebookGuid, + NotebookRecipientSettings recipientSettings, + IRequestContextPtr ctx); + + void listSharedNotebooksRequest( + IRequestContextPtr ctx); + + void createLinkedNotebookRequest( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx); + + void updateLinkedNotebookRequest( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx); + + void listLinkedNotebooksRequest( + IRequestContextPtr ctx); + + void expungeLinkedNotebookRequest( + Guid guid, + IRequestContextPtr ctx); + + void authenticateToSharedNotebookRequest( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx); + + void getSharedNotebookByAuthRequest( + IRequestContextPtr ctx); + + void emailNoteRequest( + NoteEmailParameters parameters, + IRequestContextPtr ctx); + + void shareNoteRequest( + Guid guid, + IRequestContextPtr ctx); + + void stopSharingNoteRequest( + Guid guid, + IRequestContextPtr ctx); + + void authenticateToSharedNoteRequest( + QString guid, + QString noteKey, + IRequestContextPtr ctx); + + void findRelatedRequest( + RelatedQuery query, + RelatedResultSpec resultSpec, + IRequestContextPtr ctx); + + void updateNoteIfUsnMatchesRequest( + Note note, + IRequestContextPtr ctx); + + void manageNotebookSharesRequest( + ManageNotebookSharesParameters parameters, + IRequestContextPtr ctx); + + void getNotebookSharesRequest( + QString notebookGuid, + IRequestContextPtr ctx); + +public Q_SLOTS: + // Slot used to deliver requests to the server + void onRequest(QByteArray data); + + void onGetSyncStateRequestReady(SyncState value); + void onGetFilteredSyncChunkRequestReady(SyncChunk value); + void onGetLinkedNotebookSyncStateRequestReady(SyncState value); + void onGetLinkedNotebookSyncChunkRequestReady(SyncChunk value); + void onListNotebooksRequestReady(QList value); + void onListAccessibleBusinessNotebooksRequestReady(QList value); + void onGetNotebookRequestReady(Notebook value); + void onGetDefaultNotebookRequestReady(Notebook value); + void onCreateNotebookRequestReady(Notebook value); + void onUpdateNotebookRequestReady(qint32 value); + void onExpungeNotebookRequestReady(qint32 value); + void onListTagsRequestReady(QList value); + void onListTagsByNotebookRequestReady(QList value); + void onGetTagRequestReady(Tag value); + void onCreateTagRequestReady(Tag value); + void onUpdateTagRequestReady(qint32 value); + void onUntagAllRequestReady(); + void onExpungeTagRequestReady(qint32 value); + void onListSearchesRequestReady(QList value); + void onGetSearchRequestReady(SavedSearch value); + void onCreateSearchRequestReady(SavedSearch value); + void onUpdateSearchRequestReady(qint32 value); + void onExpungeSearchRequestReady(qint32 value); + void onFindNoteOffsetRequestReady(qint32 value); + void onFindNotesMetadataRequestReady(NotesMetadataList value); + void onFindNoteCountsRequestReady(NoteCollectionCounts value); + void onGetNoteWithResultSpecRequestReady(Note value); + void onGetNoteRequestReady(Note value); + void onGetNoteApplicationDataRequestReady(LazyMap value); + void onGetNoteApplicationDataEntryRequestReady(QString value); + void onSetNoteApplicationDataEntryRequestReady(qint32 value); + void onUnsetNoteApplicationDataEntryRequestReady(qint32 value); + void onGetNoteContentRequestReady(QString value); + void onGetNoteSearchTextRequestReady(QString value); + void onGetResourceSearchTextRequestReady(QString value); + void onGetNoteTagNamesRequestReady(QStringList value); + void onCreateNoteRequestReady(Note value); + void onUpdateNoteRequestReady(Note value); + void onDeleteNoteRequestReady(qint32 value); + void onExpungeNoteRequestReady(qint32 value); + void onCopyNoteRequestReady(Note value); + void onListNoteVersionsRequestReady(QList value); + void onGetNoteVersionRequestReady(Note value); + void onGetResourceRequestReady(Resource value); + void onGetResourceApplicationDataRequestReady(LazyMap value); + void onGetResourceApplicationDataEntryRequestReady(QString value); + void onSetResourceApplicationDataEntryRequestReady(qint32 value); + void onUnsetResourceApplicationDataEntryRequestReady(qint32 value); + void onUpdateResourceRequestReady(qint32 value); + void onGetResourceDataRequestReady(QByteArray value); + void onGetResourceByHashRequestReady(Resource value); + void onGetResourceRecognitionRequestReady(QByteArray value); + void onGetResourceAlternateDataRequestReady(QByteArray value); + void onGetResourceAttributesRequestReady(ResourceAttributes value); + void onGetPublicNotebookRequestReady(Notebook value); + void onShareNotebookRequestReady(SharedNotebook value); + void onCreateOrUpdateNotebookSharesRequestReady(CreateOrUpdateNotebookSharesResult value); + void onUpdateSharedNotebookRequestReady(qint32 value); + void onSetNotebookRecipientSettingsRequestReady(Notebook value); + void onListSharedNotebooksRequestReady(QList value); + void onCreateLinkedNotebookRequestReady(LinkedNotebook value); + void onUpdateLinkedNotebookRequestReady(qint32 value); + void onListLinkedNotebooksRequestReady(QList value); + void onExpungeLinkedNotebookRequestReady(qint32 value); + void onAuthenticateToSharedNotebookRequestReady(AuthenticationResult value); + void onGetSharedNotebookByAuthRequestReady(SharedNotebook value); + void onEmailNoteRequestReady(); + void onShareNoteRequestReady(QString value); + void onStopSharingNoteRequestReady(); + void onAuthenticateToSharedNoteRequestReady(AuthenticationResult value); + void onFindRelatedRequestReady(RelatedResult value); + void onUpdateNoteIfUsnMatchesRequestReady(UpdateNoteIfUsnMatchesResult value); + void onManageNotebookSharesRequestReady(ManageNotebookSharesResult value); + void onGetNotebookSharesRequestReady(ShareRelationships value); +}; + +//////////////////////////////////////////////////////////////////////////////// + +/** + * @brief The UserStoreServer class represents + * customizable server for UserStore requests. + * It is primarily used for testing of QEverCloud + */ +class QEVERCLOUD_EXPORT UserStoreServer: public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(UserStoreServer) +public: + explicit UserStoreServer(QObject * parent = nullptr); + +Q_SIGNALS: + // Signals notifying listeners about incoming requests + void checkVersionRequest( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor, + IRequestContextPtr ctx); + + void getBootstrapInfoRequest( + QString locale, + IRequestContextPtr ctx); + + void authenticateLongSessionRequest( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx); + + void completeTwoFactorAuthenticationRequest( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx); + + void revokeLongSessionRequest( + IRequestContextPtr ctx); + + void authenticateToBusinessRequest( + IRequestContextPtr ctx); + + void getUserRequest( + IRequestContextPtr ctx); + + void getPublicUserInfoRequest( + QString username, + IRequestContextPtr ctx); + + void getUserUrlsRequest( + IRequestContextPtr ctx); + + void inviteToBusinessRequest( + QString emailAddress, + IRequestContextPtr ctx); + + void removeFromBusinessRequest( + QString emailAddress, + IRequestContextPtr ctx); + + void updateBusinessUserIdentifierRequest( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx); + + void listBusinessUsersRequest( + IRequestContextPtr ctx); + + void listBusinessInvitationsRequest( + bool includeRequestedInvitations, + IRequestContextPtr ctx); + + void getAccountLimitsRequest( + ServiceLevel serviceLevel, + IRequestContextPtr ctx); + +public Q_SLOTS: + // Slot used to deliver requests to the server + void onRequest(QByteArray data); + + void onCheckVersionRequestReady(bool value); + void onGetBootstrapInfoRequestReady(BootstrapInfo value); + void onAuthenticateLongSessionRequestReady(AuthenticationResult value); + void onCompleteTwoFactorAuthenticationRequestReady(AuthenticationResult value); + void onRevokeLongSessionRequestReady(); + void onAuthenticateToBusinessRequestReady(AuthenticationResult value); + void onGetUserRequestReady(User value); + void onGetPublicUserInfoRequestReady(PublicUserInfo value); + void onGetUserUrlsRequestReady(UserUrls value); + void onInviteToBusinessRequestReady(); + void onRemoveFromBusinessRequestReady(); + void onUpdateBusinessUserIdentifierRequestReady(); + void onListBusinessUsersRequestReady(QList value); + void onListBusinessInvitationsRequestReady(QList value); + void onGetAccountLimitsRequestReady(AccountLimits value); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_GENERATED_SERVERS_H diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp new file mode 100644 index 00000000..b7984627 --- /dev/null +++ b/QEverCloud/src/generated/Servers.cpp @@ -0,0 +1,568 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#include +#include "../Impl.h" + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +NoteStoreServer::NoteStoreServer(QObject * parent) : + QObject(parent) +{} + +void NoteStoreServer::onRequest(QByteArray data) +{ + // TODO: implement + Q_UNUSED(data) +} + +void NoteStoreServer::onGetSyncStateRequestReady(SyncState value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetFilteredSyncChunkRequestReady(SyncChunk value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady(SyncState value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady(SyncChunk value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListNotebooksRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNotebookRequestReady(Notebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetDefaultNotebookRequestReady(Notebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateNotebookRequestReady(Notebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateNotebookRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeNotebookRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListTagsRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListTagsByNotebookRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetTagRequestReady(Tag value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateTagRequestReady(Tag value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateTagRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUntagAllRequestReady() +{ + // TODO: implement +} + +void NoteStoreServer::onExpungeTagRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListSearchesRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetSearchRequestReady(SavedSearch value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateSearchRequestReady(SavedSearch value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateSearchRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeSearchRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNoteOffsetRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNotesMetadataRequestReady(NotesMetadataList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNoteCountsRequestReady(NoteCollectionCounts value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteWithResultSpecRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteApplicationDataRequestReady(LazyMap value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteContentRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteSearchTextRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceSearchTextRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteTagNamesRequestReady(QStringList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateNoteRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateNoteRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onDeleteNoteRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeNoteRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCopyNoteRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListNoteVersionsRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteVersionRequestReady(Note value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceRequestReady(Resource value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceApplicationDataRequestReady(LazyMap value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateResourceRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceDataRequestReady(QByteArray value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceByHashRequestReady(Resource value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceRecognitionRequestReady(QByteArray value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceAlternateDataRequestReady(QByteArray value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceAttributesRequestReady(ResourceAttributes value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetPublicNotebookRequestReady(Notebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onShareNotebookRequestReady(SharedNotebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady(CreateOrUpdateNotebookSharesResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateSharedNotebookRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady(Notebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListSharedNotebooksRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateLinkedNotebookRequestReady(LinkedNotebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateLinkedNotebookRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onListLinkedNotebooksRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeLinkedNotebookRequestReady(qint32 value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady(AuthenticationResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetSharedNotebookByAuthRequestReady(SharedNotebook value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onEmailNoteRequestReady() +{ + // TODO: implement +} + +void NoteStoreServer::onShareNoteRequestReady(QString value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onStopSharingNoteRequestReady() +{ + // TODO: implement +} + +void NoteStoreServer::onAuthenticateToSharedNoteRequestReady(AuthenticationResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onFindRelatedRequestReady(RelatedResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady(UpdateNoteIfUsnMatchesResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onManageNotebookSharesRequestReady(ManageNotebookSharesResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNotebookSharesRequestReady(ShareRelationships value) +{ + // TODO: implement + Q_UNUSED(value) +} + +//////////////////////////////////////////////////////////////////////////////// + +UserStoreServer::UserStoreServer(QObject * parent) : + QObject(parent) +{} + +void UserStoreServer::onRequest(QByteArray data) +{ + // TODO: implement + Q_UNUSED(data) +} + +void UserStoreServer::onCheckVersionRequestReady(bool value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onGetBootstrapInfoRequestReady(BootstrapInfo value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onAuthenticateLongSessionRequestReady(AuthenticationResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady(AuthenticationResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onRevokeLongSessionRequestReady() +{ + // TODO: implement +} + +void UserStoreServer::onAuthenticateToBusinessRequestReady(AuthenticationResult value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onGetUserRequestReady(User value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onGetPublicUserInfoRequestReady(PublicUserInfo value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onGetUserUrlsRequestReady(UserUrls value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onInviteToBusinessRequestReady() +{ + // TODO: implement +} + +void UserStoreServer::onRemoveFromBusinessRequestReady() +{ + // TODO: implement +} + +void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady() +{ + // TODO: implement +} + +void UserStoreServer::onListBusinessUsersRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onListBusinessInvitationsRequestReady(QList value) +{ + // TODO: implement + Q_UNUSED(value) +} + +void UserStoreServer::onGetAccountLimitsRequestReady(AccountLimits value) +{ + // TODO: implement + Q_UNUSED(value) +} + +} // namespace qevercloud From 573b643a30ea231a58599ce2ecc9a216956f5514 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 3 Nov 2019 23:34:26 +0300 Subject: [PATCH 060/188] Update generated servers code --- QEverCloud/src/generated/Servers.cpp | 2535 +++++++++++++++++++++++++- 1 file changed, 2531 insertions(+), 4 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index b7984627..f65c2eb9 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -11,9 +11,1251 @@ #include #include "../Impl.h" +#include "../Thrift.h" namespace qevercloud { +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetSyncStateParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetFilteredSyncChunkParams( + ThriftBinaryBufferReader & r, + qint32 & afterUSN, + qint32 & maxEntries, + SyncChunkFilter & filter, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(afterUSN) + Q_UNUSED(maxEntries) + Q_UNUSED(filter) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetLinkedNotebookSyncStateParams( + ThriftBinaryBufferReader & r, + LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(linkedNotebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetLinkedNotebookSyncChunkParams( + ThriftBinaryBufferReader & r, + LinkedNotebook & linkedNotebook, + qint32 & afterUSN, + qint32 & maxEntries, + bool & fullSyncOnly, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(linkedNotebook) + Q_UNUSED(afterUSN) + Q_UNUSED(maxEntries) + Q_UNUSED(fullSyncOnly) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListNotebooksParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListAccessibleBusinessNotebooksParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNotebookParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetDefaultNotebookParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateNotebookParams( + ThriftBinaryBufferReader & r, + Notebook & notebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(notebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateNotebookParams( + ThriftBinaryBufferReader & r, + Notebook & notebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(notebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreExpungeNotebookParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListTagsParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListTagsByNotebookParams( + ThriftBinaryBufferReader & r, + Guid & notebookGuid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(notebookGuid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetTagParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateTagParams( + ThriftBinaryBufferReader & r, + Tag & tag, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(tag) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateTagParams( + ThriftBinaryBufferReader & r, + Tag & tag, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(tag) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUntagAllParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreExpungeTagParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListSearchesParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetSearchParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateSearchParams( + ThriftBinaryBufferReader & r, + SavedSearch & search, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(search) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateSearchParams( + ThriftBinaryBufferReader & r, + SavedSearch & search, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(search) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreExpungeSearchParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreFindNoteOffsetParams( + ThriftBinaryBufferReader & r, + NoteFilter & filter, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(filter) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreFindNotesMetadataParams( + ThriftBinaryBufferReader & r, + NoteFilter & filter, + qint32 & offset, + qint32 & maxNotes, + NotesMetadataResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(filter) + Q_UNUSED(offset) + Q_UNUSED(maxNotes) + Q_UNUSED(resultSpec) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreFindNoteCountsParams( + ThriftBinaryBufferReader & r, + NoteFilter & filter, + bool & withTrash, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(filter) + Q_UNUSED(withTrash) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteWithResultSpecParams( + ThriftBinaryBufferReader & r, + Guid & guid, + NoteResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(resultSpec) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteParams( + ThriftBinaryBufferReader & r, + Guid & guid, + bool & withContent, + bool & withResourcesData, + bool & withResourcesRecognition, + bool & withResourcesAlternateData, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(withContent) + Q_UNUSED(withResourcesData) + Q_UNUSED(withResourcesRecognition) + Q_UNUSED(withResourcesAlternateData) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteApplicationDataParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreSetNoteApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + QString & value, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(value) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUnsetNoteApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteContentParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteSearchTextParams( + ThriftBinaryBufferReader & r, + Guid & guid, + bool & noteOnly, + bool & tokenizeForIndexing, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(noteOnly) + Q_UNUSED(tokenizeForIndexing) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceSearchTextParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteTagNamesParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateNoteParams( + ThriftBinaryBufferReader & r, + Note & note, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(note) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateNoteParams( + ThriftBinaryBufferReader & r, + Note & note, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(note) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreDeleteNoteParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreExpungeNoteParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCopyNoteParams( + ThriftBinaryBufferReader & r, + Guid & noteGuid, + Guid & toNotebookGuid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(noteGuid) + Q_UNUSED(toNotebookGuid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListNoteVersionsParams( + ThriftBinaryBufferReader & r, + Guid & noteGuid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(noteGuid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNoteVersionParams( + ThriftBinaryBufferReader & r, + Guid & noteGuid, + qint32 & updateSequenceNum, + bool & withResourcesData, + bool & withResourcesRecognition, + bool & withResourcesAlternateData, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(noteGuid) + Q_UNUSED(updateSequenceNum) + Q_UNUSED(withResourcesData) + Q_UNUSED(withResourcesRecognition) + Q_UNUSED(withResourcesAlternateData) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceParams( + ThriftBinaryBufferReader & r, + Guid & guid, + bool & withData, + bool & withRecognition, + bool & withAttributes, + bool & withAlternateData, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(withData) + Q_UNUSED(withRecognition) + Q_UNUSED(withAttributes) + Q_UNUSED(withAlternateData) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceApplicationDataParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreSetResourceApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + QString & value, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(value) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUnsetResourceApplicationDataEntryParams( + ThriftBinaryBufferReader & r, + Guid & guid, + QString & key, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(key) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateResourceParams( + ThriftBinaryBufferReader & r, + Resource & resource, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(resource) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceDataParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceByHashParams( + ThriftBinaryBufferReader & r, + Guid & noteGuid, + QByteArray & contentHash, + bool & withData, + bool & withRecognition, + bool & withAlternateData, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(noteGuid) + Q_UNUSED(contentHash) + Q_UNUSED(withData) + Q_UNUSED(withRecognition) + Q_UNUSED(withAlternateData) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceRecognitionParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceAlternateDataParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetResourceAttributesParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetPublicNotebookParams( + ThriftBinaryBufferReader & r, + UserID & userId, + QString & publicUri, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(userId) + Q_UNUSED(publicUri) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreShareNotebookParams( + ThriftBinaryBufferReader & r, + SharedNotebook & sharedNotebook, + QString & message, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(sharedNotebook) + Q_UNUSED(message) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateOrUpdateNotebookSharesParams( + ThriftBinaryBufferReader & r, + NotebookShareTemplate & shareTemplate, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(shareTemplate) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateSharedNotebookParams( + ThriftBinaryBufferReader & r, + SharedNotebook & sharedNotebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(sharedNotebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreSetNotebookRecipientSettingsParams( + ThriftBinaryBufferReader & r, + QString & notebookGuid, + NotebookRecipientSettings & recipientSettings, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(notebookGuid) + Q_UNUSED(recipientSettings) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListSharedNotebooksParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreCreateLinkedNotebookParams( + ThriftBinaryBufferReader & r, + LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(linkedNotebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateLinkedNotebookParams( + ThriftBinaryBufferReader & r, + LinkedNotebook & linkedNotebook, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(linkedNotebook) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreListLinkedNotebooksParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreExpungeLinkedNotebookParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreAuthenticateToSharedNotebookParams( + ThriftBinaryBufferReader & r, + QString & shareKeyOrGlobalId, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(shareKeyOrGlobalId) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetSharedNotebookByAuthParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreEmailNoteParams( + ThriftBinaryBufferReader & r, + NoteEmailParameters & parameters, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(parameters) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreShareNoteParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreStopSharingNoteParams( + ThriftBinaryBufferReader & r, + Guid & guid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreAuthenticateToSharedNoteParams( + ThriftBinaryBufferReader & r, + QString & guid, + QString & noteKey, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(guid) + Q_UNUSED(noteKey) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreFindRelatedParams( + ThriftBinaryBufferReader & r, + RelatedQuery & query, + RelatedResultSpec & resultSpec, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(query) + Q_UNUSED(resultSpec) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreUpdateNoteIfUsnMatchesParams( + ThriftBinaryBufferReader & r, + Note & note, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(note) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreManageNotebookSharesParams( + ThriftBinaryBufferReader & r, + ManageNotebookSharesParameters & parameters, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(parameters) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseNoteStoreGetNotebookSharesParams( + ThriftBinaryBufferReader & r, + QString & notebookGuid, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(notebookGuid) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreCheckVersionParams( + ThriftBinaryBufferReader & r, + QString & clientName, + qint16 & edamVersionMajor, + qint16 & edamVersionMinor, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(clientName) + Q_UNUSED(edamVersionMajor) + Q_UNUSED(edamVersionMinor) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreGetBootstrapInfoParams( + ThriftBinaryBufferReader & r, + QString & locale, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(locale) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreAuthenticateLongSessionParams( + ThriftBinaryBufferReader & r, + QString & username, + QString & password, + QString & consumerKey, + QString & consumerSecret, + QString & deviceIdentifier, + QString & deviceDescription, + bool & supportsTwoFactor, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(username) + Q_UNUSED(password) + Q_UNUSED(consumerKey) + Q_UNUSED(consumerSecret) + Q_UNUSED(deviceIdentifier) + Q_UNUSED(deviceDescription) + Q_UNUSED(supportsTwoFactor) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreCompleteTwoFactorAuthenticationParams( + ThriftBinaryBufferReader & r, + QString & oneTimeCode, + QString & deviceIdentifier, + QString & deviceDescription, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(oneTimeCode) + Q_UNUSED(deviceIdentifier) + Q_UNUSED(deviceDescription) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreRevokeLongSessionParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreAuthenticateToBusinessParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreGetUserParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreGetPublicUserInfoParams( + ThriftBinaryBufferReader & r, + QString & username, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(username) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreGetUserUrlsParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreInviteToBusinessParams( + ThriftBinaryBufferReader & r, + QString & emailAddress, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(emailAddress) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreRemoveFromBusinessParams( + ThriftBinaryBufferReader & r, + QString & emailAddress, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(emailAddress) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreUpdateBusinessUserIdentifierParams( + ThriftBinaryBufferReader & r, + QString & oldEmailAddress, + QString & newEmailAddress, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(oldEmailAddress) + Q_UNUSED(newEmailAddress) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreListBusinessUsersParams( + ThriftBinaryBufferReader & r, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreListBusinessInvitationsParams( + ThriftBinaryBufferReader & r, + bool & includeRequestedInvitations, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(includeRequestedInvitations) + Q_UNUSED(ctx) +} + +//////////////////////////////////////////////////////////////////////////////// + +void parseUserStoreGetAccountLimitsParams( + ThriftBinaryBufferReader & r, + ServiceLevel & serviceLevel, + IRequestContextPtr ctx) +{ + // TODO: implement + Q_UNUSED(r) + Q_UNUSED(serviceLevel) + Q_UNUSED(ctx) +} + +} // namespace + //////////////////////////////////////////////////////////////////////////////// NoteStoreServer::NoteStoreServer(QObject * parent) : @@ -22,8 +1264,1076 @@ NoteStoreServer::NoteStoreServer(QObject * parent) : void NoteStoreServer::onRequest(QByteArray data) { - // TODO: implement - Q_UNUSED(data) + ThriftBinaryBufferReader r(data); + qint32 rseqid = 0; + QString fname; + ThriftMessageType mtype; + r.readMessageBegin(fname, mtype, rseqid); + + if (fname == QStringLiteral("getSyncState")) + { + IRequestContextPtr ctx; + parseNoteStoreGetSyncStateParams( + r, + ctx); + + Q_EMIT getSyncStateRequest( + ctx); + } + else if (fname == QStringLiteral("getFilteredSyncChunk")) + { + qint32 afterUSN; + qint32 maxEntries; + SyncChunkFilter filter; + IRequestContextPtr ctx; + parseNoteStoreGetFilteredSyncChunkParams( + r, + afterUSN, + maxEntries, + filter, + ctx); + + Q_EMIT getFilteredSyncChunkRequest( + afterUSN, + maxEntries, + filter, + ctx); + } + else if (fname == QStringLiteral("getLinkedNotebookSyncState")) + { + LinkedNotebook linkedNotebook; + IRequestContextPtr ctx; + parseNoteStoreGetLinkedNotebookSyncStateParams( + r, + linkedNotebook, + ctx); + + Q_EMIT getLinkedNotebookSyncStateRequest( + linkedNotebook, + ctx); + } + else if (fname == QStringLiteral("getLinkedNotebookSyncChunk")) + { + LinkedNotebook linkedNotebook; + qint32 afterUSN; + qint32 maxEntries; + bool fullSyncOnly; + IRequestContextPtr ctx; + parseNoteStoreGetLinkedNotebookSyncChunkParams( + r, + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + Q_EMIT getLinkedNotebookSyncChunkRequest( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + } + else if (fname == QStringLiteral("listNotebooks")) + { + IRequestContextPtr ctx; + parseNoteStoreListNotebooksParams( + r, + ctx); + + Q_EMIT listNotebooksRequest( + ctx); + } + else if (fname == QStringLiteral("listAccessibleBusinessNotebooks")) + { + IRequestContextPtr ctx; + parseNoteStoreListAccessibleBusinessNotebooksParams( + r, + ctx); + + Q_EMIT listAccessibleBusinessNotebooksRequest( + ctx); + } + else if (fname == QStringLiteral("getNotebook")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetNotebookParams( + r, + guid, + ctx); + + Q_EMIT getNotebookRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getDefaultNotebook")) + { + IRequestContextPtr ctx; + parseNoteStoreGetDefaultNotebookParams( + r, + ctx); + + Q_EMIT getDefaultNotebookRequest( + ctx); + } + else if (fname == QStringLiteral("createNotebook")) + { + Notebook notebook; + IRequestContextPtr ctx; + parseNoteStoreCreateNotebookParams( + r, + notebook, + ctx); + + Q_EMIT createNotebookRequest( + notebook, + ctx); + } + else if (fname == QStringLiteral("updateNotebook")) + { + Notebook notebook; + IRequestContextPtr ctx; + parseNoteStoreUpdateNotebookParams( + r, + notebook, + ctx); + + Q_EMIT updateNotebookRequest( + notebook, + ctx); + } + else if (fname == QStringLiteral("expungeNotebook")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreExpungeNotebookParams( + r, + guid, + ctx); + + Q_EMIT expungeNotebookRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("listTags")) + { + IRequestContextPtr ctx; + parseNoteStoreListTagsParams( + r, + ctx); + + Q_EMIT listTagsRequest( + ctx); + } + else if (fname == QStringLiteral("listTagsByNotebook")) + { + Guid notebookGuid; + IRequestContextPtr ctx; + parseNoteStoreListTagsByNotebookParams( + r, + notebookGuid, + ctx); + + Q_EMIT listTagsByNotebookRequest( + notebookGuid, + ctx); + } + else if (fname == QStringLiteral("getTag")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetTagParams( + r, + guid, + ctx); + + Q_EMIT getTagRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("createTag")) + { + Tag tag; + IRequestContextPtr ctx; + parseNoteStoreCreateTagParams( + r, + tag, + ctx); + + Q_EMIT createTagRequest( + tag, + ctx); + } + else if (fname == QStringLiteral("updateTag")) + { + Tag tag; + IRequestContextPtr ctx; + parseNoteStoreUpdateTagParams( + r, + tag, + ctx); + + Q_EMIT updateTagRequest( + tag, + ctx); + } + else if (fname == QStringLiteral("untagAll")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreUntagAllParams( + r, + guid, + ctx); + + Q_EMIT untagAllRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("expungeTag")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreExpungeTagParams( + r, + guid, + ctx); + + Q_EMIT expungeTagRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("listSearches")) + { + IRequestContextPtr ctx; + parseNoteStoreListSearchesParams( + r, + ctx); + + Q_EMIT listSearchesRequest( + ctx); + } + else if (fname == QStringLiteral("getSearch")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetSearchParams( + r, + guid, + ctx); + + Q_EMIT getSearchRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("createSearch")) + { + SavedSearch search; + IRequestContextPtr ctx; + parseNoteStoreCreateSearchParams( + r, + search, + ctx); + + Q_EMIT createSearchRequest( + search, + ctx); + } + else if (fname == QStringLiteral("updateSearch")) + { + SavedSearch search; + IRequestContextPtr ctx; + parseNoteStoreUpdateSearchParams( + r, + search, + ctx); + + Q_EMIT updateSearchRequest( + search, + ctx); + } + else if (fname == QStringLiteral("expungeSearch")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreExpungeSearchParams( + r, + guid, + ctx); + + Q_EMIT expungeSearchRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("findNoteOffset")) + { + NoteFilter filter; + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreFindNoteOffsetParams( + r, + filter, + guid, + ctx); + + Q_EMIT findNoteOffsetRequest( + filter, + guid, + ctx); + } + else if (fname == QStringLiteral("findNotesMetadata")) + { + NoteFilter filter; + qint32 offset; + qint32 maxNotes; + NotesMetadataResultSpec resultSpec; + IRequestContextPtr ctx; + parseNoteStoreFindNotesMetadataParams( + r, + filter, + offset, + maxNotes, + resultSpec, + ctx); + + Q_EMIT findNotesMetadataRequest( + filter, + offset, + maxNotes, + resultSpec, + ctx); + } + else if (fname == QStringLiteral("findNoteCounts")) + { + NoteFilter filter; + bool withTrash; + IRequestContextPtr ctx; + parseNoteStoreFindNoteCountsParams( + r, + filter, + withTrash, + ctx); + + Q_EMIT findNoteCountsRequest( + filter, + withTrash, + ctx); + } + else if (fname == QStringLiteral("getNoteWithResultSpec")) + { + Guid guid; + NoteResultSpec resultSpec; + IRequestContextPtr ctx; + parseNoteStoreGetNoteWithResultSpecParams( + r, + guid, + resultSpec, + ctx); + + Q_EMIT getNoteWithResultSpecRequest( + guid, + resultSpec, + ctx); + } + else if (fname == QStringLiteral("getNote")) + { + Guid guid; + bool withContent; + bool withResourcesData; + bool withResourcesRecognition; + bool withResourcesAlternateData; + IRequestContextPtr ctx; + parseNoteStoreGetNoteParams( + r, + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + Q_EMIT getNoteRequest( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + } + else if (fname == QStringLiteral("getNoteApplicationData")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetNoteApplicationDataParams( + r, + guid, + ctx); + + Q_EMIT getNoteApplicationDataRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getNoteApplicationDataEntry")) + { + Guid guid; + QString key; + IRequestContextPtr ctx; + parseNoteStoreGetNoteApplicationDataEntryParams( + r, + guid, + key, + ctx); + + Q_EMIT getNoteApplicationDataEntryRequest( + guid, + key, + ctx); + } + else if (fname == QStringLiteral("setNoteApplicationDataEntry")) + { + Guid guid; + QString key; + QString value; + IRequestContextPtr ctx; + parseNoteStoreSetNoteApplicationDataEntryParams( + r, + guid, + key, + value, + ctx); + + Q_EMIT setNoteApplicationDataEntryRequest( + guid, + key, + value, + ctx); + } + else if (fname == QStringLiteral("unsetNoteApplicationDataEntry")) + { + Guid guid; + QString key; + IRequestContextPtr ctx; + parseNoteStoreUnsetNoteApplicationDataEntryParams( + r, + guid, + key, + ctx); + + Q_EMIT unsetNoteApplicationDataEntryRequest( + guid, + key, + ctx); + } + else if (fname == QStringLiteral("getNoteContent")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetNoteContentParams( + r, + guid, + ctx); + + Q_EMIT getNoteContentRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getNoteSearchText")) + { + Guid guid; + bool noteOnly; + bool tokenizeForIndexing; + IRequestContextPtr ctx; + parseNoteStoreGetNoteSearchTextParams( + r, + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + Q_EMIT getNoteSearchTextRequest( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + } + else if (fname == QStringLiteral("getResourceSearchText")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceSearchTextParams( + r, + guid, + ctx); + + Q_EMIT getResourceSearchTextRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getNoteTagNames")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetNoteTagNamesParams( + r, + guid, + ctx); + + Q_EMIT getNoteTagNamesRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("createNote")) + { + Note note; + IRequestContextPtr ctx; + parseNoteStoreCreateNoteParams( + r, + note, + ctx); + + Q_EMIT createNoteRequest( + note, + ctx); + } + else if (fname == QStringLiteral("updateNote")) + { + Note note; + IRequestContextPtr ctx; + parseNoteStoreUpdateNoteParams( + r, + note, + ctx); + + Q_EMIT updateNoteRequest( + note, + ctx); + } + else if (fname == QStringLiteral("deleteNote")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreDeleteNoteParams( + r, + guid, + ctx); + + Q_EMIT deleteNoteRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("expungeNote")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreExpungeNoteParams( + r, + guid, + ctx); + + Q_EMIT expungeNoteRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("copyNote")) + { + Guid noteGuid; + Guid toNotebookGuid; + IRequestContextPtr ctx; + parseNoteStoreCopyNoteParams( + r, + noteGuid, + toNotebookGuid, + ctx); + + Q_EMIT copyNoteRequest( + noteGuid, + toNotebookGuid, + ctx); + } + else if (fname == QStringLiteral("listNoteVersions")) + { + Guid noteGuid; + IRequestContextPtr ctx; + parseNoteStoreListNoteVersionsParams( + r, + noteGuid, + ctx); + + Q_EMIT listNoteVersionsRequest( + noteGuid, + ctx); + } + else if (fname == QStringLiteral("getNoteVersion")) + { + Guid noteGuid; + qint32 updateSequenceNum; + bool withResourcesData; + bool withResourcesRecognition; + bool withResourcesAlternateData; + IRequestContextPtr ctx; + parseNoteStoreGetNoteVersionParams( + r, + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + Q_EMIT getNoteVersionRequest( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + } + else if (fname == QStringLiteral("getResource")) + { + Guid guid; + bool withData; + bool withRecognition; + bool withAttributes; + bool withAlternateData; + IRequestContextPtr ctx; + parseNoteStoreGetResourceParams( + r, + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + + Q_EMIT getResourceRequest( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + } + else if (fname == QStringLiteral("getResourceApplicationData")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceApplicationDataParams( + r, + guid, + ctx); + + Q_EMIT getResourceApplicationDataRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getResourceApplicationDataEntry")) + { + Guid guid; + QString key; + IRequestContextPtr ctx; + parseNoteStoreGetResourceApplicationDataEntryParams( + r, + guid, + key, + ctx); + + Q_EMIT getResourceApplicationDataEntryRequest( + guid, + key, + ctx); + } + else if (fname == QStringLiteral("setResourceApplicationDataEntry")) + { + Guid guid; + QString key; + QString value; + IRequestContextPtr ctx; + parseNoteStoreSetResourceApplicationDataEntryParams( + r, + guid, + key, + value, + ctx); + + Q_EMIT setResourceApplicationDataEntryRequest( + guid, + key, + value, + ctx); + } + else if (fname == QStringLiteral("unsetResourceApplicationDataEntry")) + { + Guid guid; + QString key; + IRequestContextPtr ctx; + parseNoteStoreUnsetResourceApplicationDataEntryParams( + r, + guid, + key, + ctx); + + Q_EMIT unsetResourceApplicationDataEntryRequest( + guid, + key, + ctx); + } + else if (fname == QStringLiteral("updateResource")) + { + Resource resource; + IRequestContextPtr ctx; + parseNoteStoreUpdateResourceParams( + r, + resource, + ctx); + + Q_EMIT updateResourceRequest( + resource, + ctx); + } + else if (fname == QStringLiteral("getResourceData")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceDataParams( + r, + guid, + ctx); + + Q_EMIT getResourceDataRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getResourceByHash")) + { + Guid noteGuid; + QByteArray contentHash; + bool withData; + bool withRecognition; + bool withAlternateData; + IRequestContextPtr ctx; + parseNoteStoreGetResourceByHashParams( + r, + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + + Q_EMIT getResourceByHashRequest( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + } + else if (fname == QStringLiteral("getResourceRecognition")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceRecognitionParams( + r, + guid, + ctx); + + Q_EMIT getResourceRecognitionRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getResourceAlternateData")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceAlternateDataParams( + r, + guid, + ctx); + + Q_EMIT getResourceAlternateDataRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getResourceAttributes")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreGetResourceAttributesParams( + r, + guid, + ctx); + + Q_EMIT getResourceAttributesRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("getPublicNotebook")) + { + UserID userId; + QString publicUri; + IRequestContextPtr ctx; + parseNoteStoreGetPublicNotebookParams( + r, + userId, + publicUri, + ctx); + + Q_EMIT getPublicNotebookRequest( + userId, + publicUri, + ctx); + } + else if (fname == QStringLiteral("shareNotebook")) + { + SharedNotebook sharedNotebook; + QString message; + IRequestContextPtr ctx; + parseNoteStoreShareNotebookParams( + r, + sharedNotebook, + message, + ctx); + + Q_EMIT shareNotebookRequest( + sharedNotebook, + message, + ctx); + } + else if (fname == QStringLiteral("createOrUpdateNotebookShares")) + { + NotebookShareTemplate shareTemplate; + IRequestContextPtr ctx; + parseNoteStoreCreateOrUpdateNotebookSharesParams( + r, + shareTemplate, + ctx); + + Q_EMIT createOrUpdateNotebookSharesRequest( + shareTemplate, + ctx); + } + else if (fname == QStringLiteral("updateSharedNotebook")) + { + SharedNotebook sharedNotebook; + IRequestContextPtr ctx; + parseNoteStoreUpdateSharedNotebookParams( + r, + sharedNotebook, + ctx); + + Q_EMIT updateSharedNotebookRequest( + sharedNotebook, + ctx); + } + else if (fname == QStringLiteral("setNotebookRecipientSettings")) + { + QString notebookGuid; + NotebookRecipientSettings recipientSettings; + IRequestContextPtr ctx; + parseNoteStoreSetNotebookRecipientSettingsParams( + r, + notebookGuid, + recipientSettings, + ctx); + + Q_EMIT setNotebookRecipientSettingsRequest( + notebookGuid, + recipientSettings, + ctx); + } + else if (fname == QStringLiteral("listSharedNotebooks")) + { + IRequestContextPtr ctx; + parseNoteStoreListSharedNotebooksParams( + r, + ctx); + + Q_EMIT listSharedNotebooksRequest( + ctx); + } + else if (fname == QStringLiteral("createLinkedNotebook")) + { + LinkedNotebook linkedNotebook; + IRequestContextPtr ctx; + parseNoteStoreCreateLinkedNotebookParams( + r, + linkedNotebook, + ctx); + + Q_EMIT createLinkedNotebookRequest( + linkedNotebook, + ctx); + } + else if (fname == QStringLiteral("updateLinkedNotebook")) + { + LinkedNotebook linkedNotebook; + IRequestContextPtr ctx; + parseNoteStoreUpdateLinkedNotebookParams( + r, + linkedNotebook, + ctx); + + Q_EMIT updateLinkedNotebookRequest( + linkedNotebook, + ctx); + } + else if (fname == QStringLiteral("listLinkedNotebooks")) + { + IRequestContextPtr ctx; + parseNoteStoreListLinkedNotebooksParams( + r, + ctx); + + Q_EMIT listLinkedNotebooksRequest( + ctx); + } + else if (fname == QStringLiteral("expungeLinkedNotebook")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreExpungeLinkedNotebookParams( + r, + guid, + ctx); + + Q_EMIT expungeLinkedNotebookRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("authenticateToSharedNotebook")) + { + QString shareKeyOrGlobalId; + IRequestContextPtr ctx; + parseNoteStoreAuthenticateToSharedNotebookParams( + r, + shareKeyOrGlobalId, + ctx); + + Q_EMIT authenticateToSharedNotebookRequest( + shareKeyOrGlobalId, + ctx); + } + else if (fname == QStringLiteral("getSharedNotebookByAuth")) + { + IRequestContextPtr ctx; + parseNoteStoreGetSharedNotebookByAuthParams( + r, + ctx); + + Q_EMIT getSharedNotebookByAuthRequest( + ctx); + } + else if (fname == QStringLiteral("emailNote")) + { + NoteEmailParameters parameters; + IRequestContextPtr ctx; + parseNoteStoreEmailNoteParams( + r, + parameters, + ctx); + + Q_EMIT emailNoteRequest( + parameters, + ctx); + } + else if (fname == QStringLiteral("shareNote")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreShareNoteParams( + r, + guid, + ctx); + + Q_EMIT shareNoteRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("stopSharingNote")) + { + Guid guid; + IRequestContextPtr ctx; + parseNoteStoreStopSharingNoteParams( + r, + guid, + ctx); + + Q_EMIT stopSharingNoteRequest( + guid, + ctx); + } + else if (fname == QStringLiteral("authenticateToSharedNote")) + { + QString guid; + QString noteKey; + IRequestContextPtr ctx; + parseNoteStoreAuthenticateToSharedNoteParams( + r, + guid, + noteKey, + ctx); + + Q_EMIT authenticateToSharedNoteRequest( + guid, + noteKey, + ctx); + } + else if (fname == QStringLiteral("findRelated")) + { + RelatedQuery query; + RelatedResultSpec resultSpec; + IRequestContextPtr ctx; + parseNoteStoreFindRelatedParams( + r, + query, + resultSpec, + ctx); + + Q_EMIT findRelatedRequest( + query, + resultSpec, + ctx); + } + else if (fname == QStringLiteral("updateNoteIfUsnMatches")) + { + Note note; + IRequestContextPtr ctx; + parseNoteStoreUpdateNoteIfUsnMatchesParams( + r, + note, + ctx); + + Q_EMIT updateNoteIfUsnMatchesRequest( + note, + ctx); + } + else if (fname == QStringLiteral("manageNotebookShares")) + { + ManageNotebookSharesParameters parameters; + IRequestContextPtr ctx; + parseNoteStoreManageNotebookSharesParams( + r, + parameters, + ctx); + + Q_EMIT manageNotebookSharesRequest( + parameters, + ctx); + } + else if (fname == QStringLiteral("getNotebookShares")) + { + QString notebookGuid; + IRequestContextPtr ctx; + parseNoteStoreGetNotebookSharesParams( + r, + notebookGuid, + ctx); + + Q_EMIT getNotebookSharesRequest( + notebookGuid, + ctx); + } } void NoteStoreServer::onGetSyncStateRequestReady(SyncState value) @@ -475,8 +2785,225 @@ UserStoreServer::UserStoreServer(QObject * parent) : void UserStoreServer::onRequest(QByteArray data) { - // TODO: implement - Q_UNUSED(data) + ThriftBinaryBufferReader r(data); + qint32 rseqid = 0; + QString fname; + ThriftMessageType mtype; + r.readMessageBegin(fname, mtype, rseqid); + + if (fname == QStringLiteral("checkVersion")) + { + QString clientName; + qint16 edamVersionMajor; + qint16 edamVersionMinor; + IRequestContextPtr ctx; + parseUserStoreCheckVersionParams( + r, + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + + Q_EMIT checkVersionRequest( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + } + else if (fname == QStringLiteral("getBootstrapInfo")) + { + QString locale; + IRequestContextPtr ctx; + parseUserStoreGetBootstrapInfoParams( + r, + locale, + ctx); + + Q_EMIT getBootstrapInfoRequest( + locale, + ctx); + } + else if (fname == QStringLiteral("authenticateLongSession")) + { + QString username; + QString password; + QString consumerKey; + QString consumerSecret; + QString deviceIdentifier; + QString deviceDescription; + bool supportsTwoFactor; + IRequestContextPtr ctx; + parseUserStoreAuthenticateLongSessionParams( + r, + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + + Q_EMIT authenticateLongSessionRequest( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + } + else if (fname == QStringLiteral("completeTwoFactorAuthentication")) + { + QString oneTimeCode; + QString deviceIdentifier; + QString deviceDescription; + IRequestContextPtr ctx; + parseUserStoreCompleteTwoFactorAuthenticationParams( + r, + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + + Q_EMIT completeTwoFactorAuthenticationRequest( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + } + else if (fname == QStringLiteral("revokeLongSession")) + { + IRequestContextPtr ctx; + parseUserStoreRevokeLongSessionParams( + r, + ctx); + + Q_EMIT revokeLongSessionRequest( + ctx); + } + else if (fname == QStringLiteral("authenticateToBusiness")) + { + IRequestContextPtr ctx; + parseUserStoreAuthenticateToBusinessParams( + r, + ctx); + + Q_EMIT authenticateToBusinessRequest( + ctx); + } + else if (fname == QStringLiteral("getUser")) + { + IRequestContextPtr ctx; + parseUserStoreGetUserParams( + r, + ctx); + + Q_EMIT getUserRequest( + ctx); + } + else if (fname == QStringLiteral("getPublicUserInfo")) + { + QString username; + IRequestContextPtr ctx; + parseUserStoreGetPublicUserInfoParams( + r, + username, + ctx); + + Q_EMIT getPublicUserInfoRequest( + username, + ctx); + } + else if (fname == QStringLiteral("getUserUrls")) + { + IRequestContextPtr ctx; + parseUserStoreGetUserUrlsParams( + r, + ctx); + + Q_EMIT getUserUrlsRequest( + ctx); + } + else if (fname == QStringLiteral("inviteToBusiness")) + { + QString emailAddress; + IRequestContextPtr ctx; + parseUserStoreInviteToBusinessParams( + r, + emailAddress, + ctx); + + Q_EMIT inviteToBusinessRequest( + emailAddress, + ctx); + } + else if (fname == QStringLiteral("removeFromBusiness")) + { + QString emailAddress; + IRequestContextPtr ctx; + parseUserStoreRemoveFromBusinessParams( + r, + emailAddress, + ctx); + + Q_EMIT removeFromBusinessRequest( + emailAddress, + ctx); + } + else if (fname == QStringLiteral("updateBusinessUserIdentifier")) + { + QString oldEmailAddress; + QString newEmailAddress; + IRequestContextPtr ctx; + parseUserStoreUpdateBusinessUserIdentifierParams( + r, + oldEmailAddress, + newEmailAddress, + ctx); + + Q_EMIT updateBusinessUserIdentifierRequest( + oldEmailAddress, + newEmailAddress, + ctx); + } + else if (fname == QStringLiteral("listBusinessUsers")) + { + IRequestContextPtr ctx; + parseUserStoreListBusinessUsersParams( + r, + ctx); + + Q_EMIT listBusinessUsersRequest( + ctx); + } + else if (fname == QStringLiteral("listBusinessInvitations")) + { + bool includeRequestedInvitations; + IRequestContextPtr ctx; + parseUserStoreListBusinessInvitationsParams( + r, + includeRequestedInvitations, + ctx); + + Q_EMIT listBusinessInvitationsRequest( + includeRequestedInvitations, + ctx); + } + else if (fname == QStringLiteral("getAccountLimits")) + { + ServiceLevel serviceLevel; + IRequestContextPtr ctx; + parseUserStoreGetAccountLimitsParams( + r, + serviceLevel, + ctx); + + Q_EMIT getAccountLimitsRequest( + serviceLevel, + ctx); + } } void UserStoreServer::onCheckVersionRequestReady(bool value) From 89897bd5ac47749463d20b88d455ca334d60f5e5 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 4 Nov 2019 15:02:14 +0300 Subject: [PATCH 061/188] Update generated code --- QEverCloud/src/generated/Servers.cpp | 5769 +++++++++++++-- QEverCloud/src/generated/Services.cpp | 9088 +++++++++++++----------- QEverCloud/src/generated/Types.cpp | 9315 ++++++++++++++----------- QEverCloud/src/generated/Types_io.h | 358 +- 4 files changed, 15494 insertions(+), 9036 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index f65c2eb9..b1220a67 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -12,6 +12,7 @@ #include #include "../Impl.h" #include "../Thrift.h" +#include "Types_io.h" namespace qevercloud { @@ -20,1067 +21,4811 @@ namespace { //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetSyncStateParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getSyncState_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetFilteredSyncChunkParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, qint32 & afterUSN, qint32 & maxEntries, SyncChunkFilter & filter, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(afterUSN) - Q_UNUSED(maxEntries) - Q_UNUSED(filter) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getFilteredSyncChunk_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + afterUSN = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + maxEntries = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + SyncChunkFilter v; + readSyncChunkFilter(reader, v); + filter = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetLinkedNotebookSyncStateParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(linkedNotebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getLinkedNotebookSyncState_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + LinkedNotebook v; + readLinkedNotebook(reader, v); + linkedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetLinkedNotebookSyncChunkParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LinkedNotebook & linkedNotebook, qint32 & afterUSN, qint32 & maxEntries, bool & fullSyncOnly, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(linkedNotebook) - Q_UNUSED(afterUSN) - Q_UNUSED(maxEntries) - Q_UNUSED(fullSyncOnly) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getLinkedNotebookSyncChunk_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + LinkedNotebook v; + readLinkedNotebook(reader, v); + linkedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + afterUSN = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + maxEntries = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + fullSyncOnly = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListNotebooksParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listNotebooks_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListAccessibleBusinessNotebooksParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listAccessibleBusinessNotebooks_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetDefaultNotebookParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getDefaultNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Notebook & notebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(notebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Notebook v; + readNotebook(reader, v); + notebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Notebook & notebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(notebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Notebook v; + readNotebook(reader, v); + notebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreExpungeNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_expungeNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListTagsParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listTags_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListTagsByNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & notebookGuid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(notebookGuid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listTagsByNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + notebookGuid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetTagParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getTag_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateTagParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Tag & tag, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(tag) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createTag_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Tag v; + readTag(reader, v); + tag = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateTagParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Tag & tag, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(tag) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateTag_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Tag v; + readTag(reader, v); + tag = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUntagAllParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_untagAll_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreExpungeTagParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_expungeTag_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListSearchesParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listSearches_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetSearchParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getSearch_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateSearchParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SavedSearch & search, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(search) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createSearch_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + SavedSearch v; + readSavedSearch(reader, v); + search = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateSearchParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SavedSearch & search, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(search) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateSearch_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + SavedSearch v; + readSavedSearch(reader, v); + search = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreExpungeSearchParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_expungeSearch_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreFindNoteOffsetParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteFilter & filter, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(filter) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_findNoteOffset_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NoteFilter v; + readNoteFilter(reader, v); + filter = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreFindNotesMetadataParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteFilter & filter, qint32 & offset, qint32 & maxNotes, NotesMetadataResultSpec & resultSpec, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(filter) - Q_UNUSED(offset) - Q_UNUSED(maxNotes) - Q_UNUSED(resultSpec) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_findNotesMetadata_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NoteFilter v; + readNoteFilter(reader, v); + filter = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + offset = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + maxNotes = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NotesMetadataResultSpec v; + readNotesMetadataResultSpec(reader, v); + resultSpec = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreFindNoteCountsParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteFilter & filter, bool & withTrash, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(filter) - Q_UNUSED(withTrash) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_findNoteCounts_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NoteFilter v; + readNoteFilter(reader, v); + filter = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withTrash = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteWithResultSpecParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, NoteResultSpec & resultSpec, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(resultSpec) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteWithResultSpec_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NoteResultSpec v; + readNoteResultSpec(reader, v); + resultSpec = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, bool & withContent, bool & withResourcesData, bool & withResourcesRecognition, bool & withResourcesAlternateData, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(withContent) - Q_UNUSED(withResourcesData) - Q_UNUSED(withResourcesRecognition) - Q_UNUSED(withResourcesAlternateData) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withContent = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesData = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesRecognition = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 6) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesAlternateData = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteApplicationDataParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteApplicationData_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreSetNoteApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, QString & value, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(value) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_setNoteApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + value = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUnsetNoteApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_unsetNoteApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteContentParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteContent_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteSearchTextParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, bool & noteOnly, bool & tokenizeForIndexing, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(noteOnly) - Q_UNUSED(tokenizeForIndexing) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteSearchText_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + noteOnly = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + tokenizeForIndexing = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceSearchTextParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceSearchText_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteTagNamesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteTagNames_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Note & note, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(note) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Note v; + readNote(reader, v); + note = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Note & note, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(note) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Note v; + readNote(reader, v); + note = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreDeleteNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_deleteNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreExpungeNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_expungeNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCopyNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & noteGuid, Guid & toNotebookGuid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(noteGuid) - Q_UNUSED(toNotebookGuid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_copyNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + noteGuid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + toNotebookGuid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListNoteVersionsParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & noteGuid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(noteGuid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listNoteVersions_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + noteGuid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNoteVersionParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & noteGuid, qint32 & updateSequenceNum, bool & withResourcesData, bool & withResourcesRecognition, bool & withResourcesAlternateData, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(noteGuid) - Q_UNUSED(updateSequenceNum) - Q_UNUSED(withResourcesData) - Q_UNUSED(withResourcesRecognition) - Q_UNUSED(withResourcesAlternateData) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNoteVersion_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + noteGuid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_I32) { + qint32 v; + reader.readI32(v); + updateSequenceNum = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesData = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesRecognition = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 6) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withResourcesAlternateData = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, bool & withData, bool & withRecognition, bool & withAttributes, bool & withAlternateData, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(withData) - Q_UNUSED(withRecognition) - Q_UNUSED(withAttributes) - Q_UNUSED(withAlternateData) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResource_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withData = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withRecognition = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withAttributes = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 6) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withAlternateData = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceApplicationDataParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceApplicationData_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreSetResourceApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, QString & value, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(value) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_setResourceApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + value = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUnsetResourceApplicationDataEntryParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, QString & key, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(key) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_unsetResourceApplicationDataEntry_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + key = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateResourceParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Resource & resource, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(resource) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateResource_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Resource v; + readResource(reader, v); + resource = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceDataParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceData_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceByHashParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & noteGuid, QByteArray & contentHash, bool & withData, bool & withRecognition, bool & withAlternateData, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(noteGuid) - Q_UNUSED(contentHash) - Q_UNUSED(withData) - Q_UNUSED(withRecognition) - Q_UNUSED(withAlternateData) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceByHash_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + noteGuid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QByteArray v; + reader.readBinary(v); + contentHash = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withData = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withRecognition = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 6) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + withAlternateData = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceRecognitionParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceRecognition_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceAlternateDataParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceAlternateData_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetResourceAttributesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getResourceAttributes_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetPublicNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserID & userId, QString & publicUri, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(userId) - Q_UNUSED(publicUri) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("NoteStore_getPublicNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_I32) { + UserID v; + reader.readI32(v); + userId = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + publicUri = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreShareNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebook & sharedNotebook, QString & message, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(sharedNotebook) - Q_UNUSED(message) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_shareNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + SharedNotebook v; + readSharedNotebook(reader, v); + sharedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + message = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateOrUpdateNotebookSharesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotebookShareTemplate & shareTemplate, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(shareTemplate) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createOrUpdateNotebookShares_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NotebookShareTemplate v; + readNotebookShareTemplate(reader, v); + shareTemplate = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateSharedNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebook & sharedNotebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(sharedNotebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateSharedNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + SharedNotebook v; + readSharedNotebook(reader, v); + sharedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreSetNotebookRecipientSettingsParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & notebookGuid, NotebookRecipientSettings & recipientSettings, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(notebookGuid) - Q_UNUSED(recipientSettings) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_setNotebookRecipientSettings_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + notebookGuid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NotebookRecipientSettings v; + readNotebookRecipientSettings(reader, v); + recipientSettings = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListSharedNotebooksParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listSharedNotebooks_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreCreateLinkedNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(linkedNotebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_createLinkedNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + LinkedNotebook v; + readLinkedNotebook(reader, v); + linkedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateLinkedNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LinkedNotebook & linkedNotebook, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(linkedNotebook) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateLinkedNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + LinkedNotebook v; + readLinkedNotebook(reader, v); + linkedNotebook = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreListLinkedNotebooksParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_listLinkedNotebooks_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreExpungeLinkedNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_expungeLinkedNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreAuthenticateToSharedNotebookParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & shareKeyOrGlobalId, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(shareKeyOrGlobalId) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_authenticateToSharedNotebook_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + shareKeyOrGlobalId = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetSharedNotebookByAuthParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getSharedNotebookByAuth_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreEmailNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteEmailParameters & parameters, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(parameters) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_emailNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + NoteEmailParameters v; + readNoteEmailParameters(reader, v); + parameters = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreShareNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_shareNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreStopSharingNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Guid & guid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_stopSharingNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + Guid v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreAuthenticateToSharedNoteParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & guid, QString & noteKey, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(guid) - Q_UNUSED(noteKey) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_authenticateToSharedNote_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + guid = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + noteKey = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreFindRelatedParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedQuery & query, RelatedResultSpec & resultSpec, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(query) - Q_UNUSED(resultSpec) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_findRelated_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + RelatedQuery v; + readRelatedQuery(reader, v); + query = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + RelatedResultSpec v; + readRelatedResultSpec(reader, v); + resultSpec = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreUpdateNoteIfUsnMatchesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Note & note, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(note) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_updateNoteIfUsnMatches_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + Note v; + readNote(reader, v); + note = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreManageNotebookSharesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNotebookSharesParameters & parameters, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(parameters) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_manageNotebookShares_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRUCT) { + ManageNotebookSharesParameters v; + readManageNotebookSharesParameters(reader, v); + parameters = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseNoteStoreGetNotebookSharesParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & notebookGuid, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(notebookGuid) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("NoteStore_getNotebookShares_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + notebookGuid = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreCheckVersionParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & clientName, qint16 & edamVersionMajor, qint16 & edamVersionMinor, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(clientName) - Q_UNUSED(edamVersionMajor) - Q_UNUSED(edamVersionMinor) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("UserStore_checkVersion_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + clientName = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_I16) { + qint16 v; + reader.readI16(v); + edamVersionMajor = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_I16) { + qint16 v; + reader.readI16(v); + edamVersionMinor = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreGetBootstrapInfoParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & locale, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(locale) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("UserStore_getBootstrapInfo_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + locale = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreAuthenticateLongSessionParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & username, QString & password, QString & consumerKey, @@ -1088,170 +4833,759 @@ void parseUserStoreAuthenticateLongSessionParams( QString & deviceIdentifier, QString & deviceDescription, bool & supportsTwoFactor, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(username) - Q_UNUSED(password) - Q_UNUSED(consumerKey) - Q_UNUSED(consumerSecret) - Q_UNUSED(deviceIdentifier) - Q_UNUSED(deviceDescription) - Q_UNUSED(supportsTwoFactor) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("UserStore_authenticateLongSession_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + username = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + password = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + consumerKey = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + consumerSecret = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 5) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + deviceIdentifier = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 6) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + deviceDescription = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 7) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + supportsTwoFactor = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreCompleteTwoFactorAuthenticationParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & oneTimeCode, QString & deviceIdentifier, QString & deviceDescription, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(oneTimeCode) - Q_UNUSED(deviceIdentifier) - Q_UNUSED(deviceDescription) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_completeTwoFactorAuthentication_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + oneTimeCode = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + deviceIdentifier = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 4) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + deviceDescription = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreRevokeLongSessionParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_revokeLongSession_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreAuthenticateToBusinessParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_authenticateToBusiness_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreGetUserParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_getUser_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreGetPublicUserInfoParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & username, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(username) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("UserStore_getPublicUserInfo_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + username = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreGetUserUrlsParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_getUserUrls_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreInviteToBusinessParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & emailAddress, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(emailAddress) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_inviteToBusiness_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + emailAddress = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreRemoveFromBusinessParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & emailAddress, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(emailAddress) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_removeFromBusiness_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + emailAddress = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreUpdateBusinessUserIdentifierParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QString & oldEmailAddress, QString & newEmailAddress, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(oldEmailAddress) - Q_UNUSED(newEmailAddress) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_updateBusinessUserIdentifier_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + oldEmailAddress = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 3) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + newEmailAddress = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreListBusinessUsersParams( - ThriftBinaryBufferReader & r, - IRequestContextPtr ctx) + ThriftBinaryBufferReader & reader, + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_listBusinessUsers_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreListBusinessInvitationsParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, bool & includeRequestedInvitations, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(includeRequestedInvitations) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + QString authenticationToken; + + QString fname = + QStringLiteral("UserStore_listBusinessInvitations_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_STRING) { + QString v; + reader.readString(v); + authenticationToken = v; + } + else { + reader.skip(fieldType); + } + } + else if (fieldId == 2) + { + if (fieldType == ThriftFieldType::T_BOOL) { + bool v; + reader.readBool(v); + includeRequestedInvitations = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(authenticationToken); } //////////////////////////////////////////////////////////////////////////////// void parseUserStoreGetAccountLimitsParams( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ServiceLevel & serviceLevel, - IRequestContextPtr ctx) + IRequestContextPtr & ctx) { - // TODO: implement - Q_UNUSED(r) - Q_UNUSED(serviceLevel) - Q_UNUSED(ctx) + ThriftFieldType fieldType; + qint16 fieldId; + + QString fname = + QStringLiteral("UserStore_getAccountLimits_pargs"); + + reader.readStructBegin(fname); + while(true) + { + reader.readFieldBegin(fname, fieldType, fieldId); + if (fieldType == ThriftFieldType::T_STOP) { + break; + } + + if (fieldId == 1) + { + if (fieldType == ThriftFieldType::T_I32) { + ServiceLevel v; + readEnumServiceLevel(reader, v); + serviceLevel = v; + } + else { + reader.skip(fieldType); + } + } + else + { + reader.skip(fieldType); + } + + reader.readFieldEnd(); + } + + reader.readStructEnd(); + reader.readMessageEnd(); + + ctx = newRequestContext(); } } // namespace @@ -1264,17 +5598,24 @@ NoteStoreServer::NoteStoreServer(QObject * parent) : void NoteStoreServer::onRequest(QByteArray data) { - ThriftBinaryBufferReader r(data); + ThriftBinaryBufferReader reader(data); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); + + if (mtype != ThriftMessageType::T_CALL) { + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + } if (fname == QStringLiteral("getSyncState")) { IRequestContextPtr ctx; + parseNoteStoreGetSyncStateParams( - r, + reader, ctx); Q_EMIT getSyncStateRequest( @@ -1286,8 +5627,9 @@ void NoteStoreServer::onRequest(QByteArray data) qint32 maxEntries; SyncChunkFilter filter; IRequestContextPtr ctx; + parseNoteStoreGetFilteredSyncChunkParams( - r, + reader, afterUSN, maxEntries, filter, @@ -1303,8 +5645,9 @@ void NoteStoreServer::onRequest(QByteArray data) { LinkedNotebook linkedNotebook; IRequestContextPtr ctx; + parseNoteStoreGetLinkedNotebookSyncStateParams( - r, + reader, linkedNotebook, ctx); @@ -1319,8 +5662,9 @@ void NoteStoreServer::onRequest(QByteArray data) qint32 maxEntries; bool fullSyncOnly; IRequestContextPtr ctx; + parseNoteStoreGetLinkedNotebookSyncChunkParams( - r, + reader, linkedNotebook, afterUSN, maxEntries, @@ -1337,8 +5681,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listNotebooks")) { IRequestContextPtr ctx; + parseNoteStoreListNotebooksParams( - r, + reader, ctx); Q_EMIT listNotebooksRequest( @@ -1347,8 +5692,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listAccessibleBusinessNotebooks")) { IRequestContextPtr ctx; + parseNoteStoreListAccessibleBusinessNotebooksParams( - r, + reader, ctx); Q_EMIT listAccessibleBusinessNotebooksRequest( @@ -1358,8 +5704,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetNotebookParams( - r, + reader, guid, ctx); @@ -1370,8 +5717,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("getDefaultNotebook")) { IRequestContextPtr ctx; + parseNoteStoreGetDefaultNotebookParams( - r, + reader, ctx); Q_EMIT getDefaultNotebookRequest( @@ -1381,8 +5729,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Notebook notebook; IRequestContextPtr ctx; + parseNoteStoreCreateNotebookParams( - r, + reader, notebook, ctx); @@ -1394,8 +5743,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Notebook notebook; IRequestContextPtr ctx; + parseNoteStoreUpdateNotebookParams( - r, + reader, notebook, ctx); @@ -1407,8 +5757,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreExpungeNotebookParams( - r, + reader, guid, ctx); @@ -1419,8 +5770,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listTags")) { IRequestContextPtr ctx; + parseNoteStoreListTagsParams( - r, + reader, ctx); Q_EMIT listTagsRequest( @@ -1430,8 +5782,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid notebookGuid; IRequestContextPtr ctx; + parseNoteStoreListTagsByNotebookParams( - r, + reader, notebookGuid, ctx); @@ -1443,8 +5796,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetTagParams( - r, + reader, guid, ctx); @@ -1456,8 +5810,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Tag tag; IRequestContextPtr ctx; + parseNoteStoreCreateTagParams( - r, + reader, tag, ctx); @@ -1469,8 +5824,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Tag tag; IRequestContextPtr ctx; + parseNoteStoreUpdateTagParams( - r, + reader, tag, ctx); @@ -1482,8 +5838,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreUntagAllParams( - r, + reader, guid, ctx); @@ -1495,8 +5852,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreExpungeTagParams( - r, + reader, guid, ctx); @@ -1507,8 +5865,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listSearches")) { IRequestContextPtr ctx; + parseNoteStoreListSearchesParams( - r, + reader, ctx); Q_EMIT listSearchesRequest( @@ -1518,8 +5877,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetSearchParams( - r, + reader, guid, ctx); @@ -1531,8 +5891,9 @@ void NoteStoreServer::onRequest(QByteArray data) { SavedSearch search; IRequestContextPtr ctx; + parseNoteStoreCreateSearchParams( - r, + reader, search, ctx); @@ -1544,8 +5905,9 @@ void NoteStoreServer::onRequest(QByteArray data) { SavedSearch search; IRequestContextPtr ctx; + parseNoteStoreUpdateSearchParams( - r, + reader, search, ctx); @@ -1557,8 +5919,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreExpungeSearchParams( - r, + reader, guid, ctx); @@ -1571,8 +5934,9 @@ void NoteStoreServer::onRequest(QByteArray data) NoteFilter filter; Guid guid; IRequestContextPtr ctx; + parseNoteStoreFindNoteOffsetParams( - r, + reader, filter, guid, ctx); @@ -1589,8 +5953,9 @@ void NoteStoreServer::onRequest(QByteArray data) qint32 maxNotes; NotesMetadataResultSpec resultSpec; IRequestContextPtr ctx; + parseNoteStoreFindNotesMetadataParams( - r, + reader, filter, offset, maxNotes, @@ -1609,8 +5974,9 @@ void NoteStoreServer::onRequest(QByteArray data) NoteFilter filter; bool withTrash; IRequestContextPtr ctx; + parseNoteStoreFindNoteCountsParams( - r, + reader, filter, withTrash, ctx); @@ -1625,8 +5991,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid guid; NoteResultSpec resultSpec; IRequestContextPtr ctx; + parseNoteStoreGetNoteWithResultSpecParams( - r, + reader, guid, resultSpec, ctx); @@ -1644,8 +6011,9 @@ void NoteStoreServer::onRequest(QByteArray data) bool withResourcesRecognition; bool withResourcesAlternateData; IRequestContextPtr ctx; + parseNoteStoreGetNoteParams( - r, + reader, guid, withContent, withResourcesData, @@ -1665,8 +6033,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetNoteApplicationDataParams( - r, + reader, guid, ctx); @@ -1679,8 +6048,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid guid; QString key; IRequestContextPtr ctx; + parseNoteStoreGetNoteApplicationDataEntryParams( - r, + reader, guid, key, ctx); @@ -1696,8 +6066,9 @@ void NoteStoreServer::onRequest(QByteArray data) QString key; QString value; IRequestContextPtr ctx; + parseNoteStoreSetNoteApplicationDataEntryParams( - r, + reader, guid, key, value, @@ -1714,8 +6085,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid guid; QString key; IRequestContextPtr ctx; + parseNoteStoreUnsetNoteApplicationDataEntryParams( - r, + reader, guid, key, ctx); @@ -1729,8 +6101,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetNoteContentParams( - r, + reader, guid, ctx); @@ -1744,8 +6117,9 @@ void NoteStoreServer::onRequest(QByteArray data) bool noteOnly; bool tokenizeForIndexing; IRequestContextPtr ctx; + parseNoteStoreGetNoteSearchTextParams( - r, + reader, guid, noteOnly, tokenizeForIndexing, @@ -1761,8 +6135,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceSearchTextParams( - r, + reader, guid, ctx); @@ -1774,8 +6149,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetNoteTagNamesParams( - r, + reader, guid, ctx); @@ -1787,8 +6163,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Note note; IRequestContextPtr ctx; + parseNoteStoreCreateNoteParams( - r, + reader, note, ctx); @@ -1800,8 +6177,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Note note; IRequestContextPtr ctx; + parseNoteStoreUpdateNoteParams( - r, + reader, note, ctx); @@ -1813,8 +6191,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreDeleteNoteParams( - r, + reader, guid, ctx); @@ -1826,8 +6205,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreExpungeNoteParams( - r, + reader, guid, ctx); @@ -1840,8 +6220,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid noteGuid; Guid toNotebookGuid; IRequestContextPtr ctx; + parseNoteStoreCopyNoteParams( - r, + reader, noteGuid, toNotebookGuid, ctx); @@ -1855,8 +6236,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid noteGuid; IRequestContextPtr ctx; + parseNoteStoreListNoteVersionsParams( - r, + reader, noteGuid, ctx); @@ -1872,8 +6254,9 @@ void NoteStoreServer::onRequest(QByteArray data) bool withResourcesRecognition; bool withResourcesAlternateData; IRequestContextPtr ctx; + parseNoteStoreGetNoteVersionParams( - r, + reader, noteGuid, updateSequenceNum, withResourcesData, @@ -1897,8 +6280,9 @@ void NoteStoreServer::onRequest(QByteArray data) bool withAttributes; bool withAlternateData; IRequestContextPtr ctx; + parseNoteStoreGetResourceParams( - r, + reader, guid, withData, withRecognition, @@ -1918,8 +6302,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceApplicationDataParams( - r, + reader, guid, ctx); @@ -1932,8 +6317,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid guid; QString key; IRequestContextPtr ctx; + parseNoteStoreGetResourceApplicationDataEntryParams( - r, + reader, guid, key, ctx); @@ -1949,8 +6335,9 @@ void NoteStoreServer::onRequest(QByteArray data) QString key; QString value; IRequestContextPtr ctx; + parseNoteStoreSetResourceApplicationDataEntryParams( - r, + reader, guid, key, value, @@ -1967,8 +6354,9 @@ void NoteStoreServer::onRequest(QByteArray data) Guid guid; QString key; IRequestContextPtr ctx; + parseNoteStoreUnsetResourceApplicationDataEntryParams( - r, + reader, guid, key, ctx); @@ -1982,8 +6370,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Resource resource; IRequestContextPtr ctx; + parseNoteStoreUpdateResourceParams( - r, + reader, resource, ctx); @@ -1995,8 +6384,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceDataParams( - r, + reader, guid, ctx); @@ -2012,8 +6402,9 @@ void NoteStoreServer::onRequest(QByteArray data) bool withRecognition; bool withAlternateData; IRequestContextPtr ctx; + parseNoteStoreGetResourceByHashParams( - r, + reader, noteGuid, contentHash, withData, @@ -2033,8 +6424,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceRecognitionParams( - r, + reader, guid, ctx); @@ -2046,8 +6438,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceAlternateDataParams( - r, + reader, guid, ctx); @@ -2059,8 +6452,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreGetResourceAttributesParams( - r, + reader, guid, ctx); @@ -2073,8 +6467,9 @@ void NoteStoreServer::onRequest(QByteArray data) UserID userId; QString publicUri; IRequestContextPtr ctx; + parseNoteStoreGetPublicNotebookParams( - r, + reader, userId, publicUri, ctx); @@ -2089,8 +6484,9 @@ void NoteStoreServer::onRequest(QByteArray data) SharedNotebook sharedNotebook; QString message; IRequestContextPtr ctx; + parseNoteStoreShareNotebookParams( - r, + reader, sharedNotebook, message, ctx); @@ -2104,8 +6500,9 @@ void NoteStoreServer::onRequest(QByteArray data) { NotebookShareTemplate shareTemplate; IRequestContextPtr ctx; + parseNoteStoreCreateOrUpdateNotebookSharesParams( - r, + reader, shareTemplate, ctx); @@ -2117,8 +6514,9 @@ void NoteStoreServer::onRequest(QByteArray data) { SharedNotebook sharedNotebook; IRequestContextPtr ctx; + parseNoteStoreUpdateSharedNotebookParams( - r, + reader, sharedNotebook, ctx); @@ -2131,8 +6529,9 @@ void NoteStoreServer::onRequest(QByteArray data) QString notebookGuid; NotebookRecipientSettings recipientSettings; IRequestContextPtr ctx; + parseNoteStoreSetNotebookRecipientSettingsParams( - r, + reader, notebookGuid, recipientSettings, ctx); @@ -2145,8 +6544,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listSharedNotebooks")) { IRequestContextPtr ctx; + parseNoteStoreListSharedNotebooksParams( - r, + reader, ctx); Q_EMIT listSharedNotebooksRequest( @@ -2156,8 +6556,9 @@ void NoteStoreServer::onRequest(QByteArray data) { LinkedNotebook linkedNotebook; IRequestContextPtr ctx; + parseNoteStoreCreateLinkedNotebookParams( - r, + reader, linkedNotebook, ctx); @@ -2169,8 +6570,9 @@ void NoteStoreServer::onRequest(QByteArray data) { LinkedNotebook linkedNotebook; IRequestContextPtr ctx; + parseNoteStoreUpdateLinkedNotebookParams( - r, + reader, linkedNotebook, ctx); @@ -2181,8 +6583,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listLinkedNotebooks")) { IRequestContextPtr ctx; + parseNoteStoreListLinkedNotebooksParams( - r, + reader, ctx); Q_EMIT listLinkedNotebooksRequest( @@ -2192,8 +6595,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreExpungeLinkedNotebookParams( - r, + reader, guid, ctx); @@ -2205,8 +6609,9 @@ void NoteStoreServer::onRequest(QByteArray data) { QString shareKeyOrGlobalId; IRequestContextPtr ctx; + parseNoteStoreAuthenticateToSharedNotebookParams( - r, + reader, shareKeyOrGlobalId, ctx); @@ -2217,8 +6622,9 @@ void NoteStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("getSharedNotebookByAuth")) { IRequestContextPtr ctx; + parseNoteStoreGetSharedNotebookByAuthParams( - r, + reader, ctx); Q_EMIT getSharedNotebookByAuthRequest( @@ -2228,8 +6634,9 @@ void NoteStoreServer::onRequest(QByteArray data) { NoteEmailParameters parameters; IRequestContextPtr ctx; + parseNoteStoreEmailNoteParams( - r, + reader, parameters, ctx); @@ -2241,8 +6648,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreShareNoteParams( - r, + reader, guid, ctx); @@ -2254,8 +6662,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Guid guid; IRequestContextPtr ctx; + parseNoteStoreStopSharingNoteParams( - r, + reader, guid, ctx); @@ -2268,8 +6677,9 @@ void NoteStoreServer::onRequest(QByteArray data) QString guid; QString noteKey; IRequestContextPtr ctx; + parseNoteStoreAuthenticateToSharedNoteParams( - r, + reader, guid, noteKey, ctx); @@ -2284,8 +6694,9 @@ void NoteStoreServer::onRequest(QByteArray data) RelatedQuery query; RelatedResultSpec resultSpec; IRequestContextPtr ctx; + parseNoteStoreFindRelatedParams( - r, + reader, query, resultSpec, ctx); @@ -2299,8 +6710,9 @@ void NoteStoreServer::onRequest(QByteArray data) { Note note; IRequestContextPtr ctx; + parseNoteStoreUpdateNoteIfUsnMatchesParams( - r, + reader, note, ctx); @@ -2312,8 +6724,9 @@ void NoteStoreServer::onRequest(QByteArray data) { ManageNotebookSharesParameters parameters; IRequestContextPtr ctx; + parseNoteStoreManageNotebookSharesParams( - r, + reader, parameters, ctx); @@ -2325,8 +6738,9 @@ void NoteStoreServer::onRequest(QByteArray data) { QString notebookGuid; IRequestContextPtr ctx; + parseNoteStoreGetNotebookSharesParams( - r, + reader, notebookGuid, ctx); @@ -2785,11 +7199,17 @@ UserStoreServer::UserStoreServer(QObject * parent) : void UserStoreServer::onRequest(QByteArray data) { - ThriftBinaryBufferReader r(data); + ThriftBinaryBufferReader reader(data); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); + + if (mtype != ThriftMessageType::T_CALL) { + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); + throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); + } if (fname == QStringLiteral("checkVersion")) { @@ -2797,8 +7217,9 @@ void UserStoreServer::onRequest(QByteArray data) qint16 edamVersionMajor; qint16 edamVersionMinor; IRequestContextPtr ctx; + parseUserStoreCheckVersionParams( - r, + reader, clientName, edamVersionMajor, edamVersionMinor, @@ -2814,8 +7235,9 @@ void UserStoreServer::onRequest(QByteArray data) { QString locale; IRequestContextPtr ctx; + parseUserStoreGetBootstrapInfoParams( - r, + reader, locale, ctx); @@ -2833,8 +7255,9 @@ void UserStoreServer::onRequest(QByteArray data) QString deviceDescription; bool supportsTwoFactor; IRequestContextPtr ctx; + parseUserStoreAuthenticateLongSessionParams( - r, + reader, username, password, consumerKey, @@ -2860,8 +7283,9 @@ void UserStoreServer::onRequest(QByteArray data) QString deviceIdentifier; QString deviceDescription; IRequestContextPtr ctx; + parseUserStoreCompleteTwoFactorAuthenticationParams( - r, + reader, oneTimeCode, deviceIdentifier, deviceDescription, @@ -2876,8 +7300,9 @@ void UserStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("revokeLongSession")) { IRequestContextPtr ctx; + parseUserStoreRevokeLongSessionParams( - r, + reader, ctx); Q_EMIT revokeLongSessionRequest( @@ -2886,8 +7311,9 @@ void UserStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("authenticateToBusiness")) { IRequestContextPtr ctx; + parseUserStoreAuthenticateToBusinessParams( - r, + reader, ctx); Q_EMIT authenticateToBusinessRequest( @@ -2896,8 +7322,9 @@ void UserStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("getUser")) { IRequestContextPtr ctx; + parseUserStoreGetUserParams( - r, + reader, ctx); Q_EMIT getUserRequest( @@ -2907,8 +7334,9 @@ void UserStoreServer::onRequest(QByteArray data) { QString username; IRequestContextPtr ctx; + parseUserStoreGetPublicUserInfoParams( - r, + reader, username, ctx); @@ -2919,8 +7347,9 @@ void UserStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("getUserUrls")) { IRequestContextPtr ctx; + parseUserStoreGetUserUrlsParams( - r, + reader, ctx); Q_EMIT getUserUrlsRequest( @@ -2930,8 +7359,9 @@ void UserStoreServer::onRequest(QByteArray data) { QString emailAddress; IRequestContextPtr ctx; + parseUserStoreInviteToBusinessParams( - r, + reader, emailAddress, ctx); @@ -2943,8 +7373,9 @@ void UserStoreServer::onRequest(QByteArray data) { QString emailAddress; IRequestContextPtr ctx; + parseUserStoreRemoveFromBusinessParams( - r, + reader, emailAddress, ctx); @@ -2957,8 +7388,9 @@ void UserStoreServer::onRequest(QByteArray data) QString oldEmailAddress; QString newEmailAddress; IRequestContextPtr ctx; + parseUserStoreUpdateBusinessUserIdentifierParams( - r, + reader, oldEmailAddress, newEmailAddress, ctx); @@ -2971,8 +7403,9 @@ void UserStoreServer::onRequest(QByteArray data) else if (fname == QStringLiteral("listBusinessUsers")) { IRequestContextPtr ctx; + parseUserStoreListBusinessUsersParams( - r, + reader, ctx); Q_EMIT listBusinessUsersRequest( @@ -2982,8 +7415,9 @@ void UserStoreServer::onRequest(QByteArray data) { bool includeRequestedInvitations; IRequestContextPtr ctx; + parseUserStoreListBusinessInvitationsParams( - r, + reader, includeRequestedInvitations, ctx); @@ -2995,8 +7429,9 @@ void UserStoreServer::onRequest(QByteArray data) { ServiceLevel serviceLevel; IRequestContextPtr ctx; + parseUserStoreGetAccountLimitsParams( - r, + reader, serviceLevel, ctx); diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 177ef4bf..8a7ab72b 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -726,62 +726,68 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore namespace { -QByteArray NoteStore_getSyncState_prepareParams( +QByteArray NoteStoreGetSyncStatePrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_getSyncState_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetSyncStatePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getSyncState"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getSyncState"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getSyncState_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SyncState NoteStore_getSyncState_readReply(QByteArray reply) +SyncState NoteStoreGetSyncStateReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getSyncState_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetSyncStateReadReply"); bool resultIsSet = false; SyncState result = SyncState(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSyncState")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -791,45 +797,45 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; - readSyncState(r, v); + readSyncState(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -840,9 +846,9 @@ SyncState NoteStore_getSyncState_readReply(QByteArray reply) return result; } -QVariant NoteStore_getSyncState_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetSyncStateReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getSyncState_readReply(reply)); + return QVariant::fromValue(NoteStoreGetSyncStateReadReply(reply)); } } // namespace @@ -855,7 +861,7 @@ SyncState NoteStore::getSyncState( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getSyncState_prepareParams( + QByteArray params = NoteStoreGetSyncStatePrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -863,7 +869,7 @@ SyncState NoteStore::getSyncState( params, ctx->requestTimeout()); - return NoteStore_getSyncState_readReply(reply); + return NoteStoreGetSyncStateReadReply(reply); } AsyncResult * NoteStore::getSyncStateAsync( @@ -875,97 +881,109 @@ AsyncResult * NoteStore::getSyncStateAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getSyncState_prepareParams( + QByteArray params = NoteStoreGetSyncStatePrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_getSyncState_readReplyAsync); + NoteStoreGetSyncStateReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getFilteredSyncChunk_prepareParams( +QByteArray NoteStoreGetFilteredSyncChunkPrepareParams( QString authenticationToken, qint32 afterUSN, qint32 maxEntries, const SyncChunkFilter & filter) { - QEC_DEBUG("note_store", "NoteStore_getFilteredSyncChunk_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetFilteredSyncChunkPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getFilteredSyncChunk"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getFilteredSyncChunk"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getFilteredSyncChunk_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("afterUSN"), ThriftFieldType::T_I32, 2); - w.writeI32(afterUSN); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(afterUSN); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("maxEntries"), ThriftFieldType::T_I32, 3); - w.writeI32(maxEntries); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(maxEntries); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 4); - writeSyncChunkFilter(w, filter); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeSyncChunkFilter(writer, filter); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) +SyncChunk NoteStoreGetFilteredSyncChunkReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getFilteredSyncChunk_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetFilteredSyncChunkReadReply"); bool resultIsSet = false; SyncChunk result = SyncChunk(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getFilteredSyncChunk")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -975,45 +993,45 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; - readSyncChunk(r, v); + readSyncChunk(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1024,9 +1042,9 @@ SyncChunk NoteStore_getFilteredSyncChunk_readReply(QByteArray reply) return result; } -QVariant NoteStore_getFilteredSyncChunk_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetFilteredSyncChunkReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getFilteredSyncChunk_readReply(reply)); + return QVariant::fromValue(NoteStoreGetFilteredSyncChunkReadReply(reply)); } } // namespace @@ -1046,7 +1064,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( + QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( ctx->authenticationToken(), afterUSN, maxEntries, @@ -1057,7 +1075,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( params, ctx->requestTimeout()); - return NoteStore_getFilteredSyncChunk_readReply(reply); + return NoteStoreGetFilteredSyncChunkReadReply(reply); } AsyncResult * NoteStore::getFilteredSyncChunkAsync( @@ -1076,7 +1094,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getFilteredSyncChunk_prepareParams( + QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( ctx->authenticationToken(), afterUSN, maxEntries, @@ -1086,76 +1104,84 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getFilteredSyncChunk_readReplyAsync); + NoteStoreGetFilteredSyncChunkReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getLinkedNotebookSyncState_prepareParams( +QByteArray NoteStoreGetLinkedNotebookSyncStatePrepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { - QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncState_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncStatePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getLinkedNotebookSyncState"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncState"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getLinkedNotebookSyncState_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeLinkedNotebook(w, linkedNotebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeLinkedNotebook(writer, linkedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) +SyncState NoteStoreGetLinkedNotebookSyncStateReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncState_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncStateReadReply"); bool resultIsSet = false; SyncState result = SyncState(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getLinkedNotebookSyncState")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -1165,56 +1191,56 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncState v; - readSyncState(r, v); + readSyncState(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1225,9 +1251,9 @@ SyncState NoteStore_getLinkedNotebookSyncState_readReply(QByteArray reply) return result; } -QVariant NoteStore_getLinkedNotebookSyncState_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetLinkedNotebookSyncStateReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getLinkedNotebookSyncState_readReply(reply)); + return QVariant::fromValue(NoteStoreGetLinkedNotebookSyncStateReadReply(reply)); } } // namespace @@ -1243,7 +1269,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( + QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -1252,7 +1278,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( params, ctx->requestTimeout()); - return NoteStore_getLinkedNotebookSyncState_readReply(reply); + return NoteStoreGetLinkedNotebookSyncStateReadReply(reply); } AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( @@ -1267,7 +1293,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getLinkedNotebookSyncState_prepareParams( + QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -1275,97 +1301,111 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getLinkedNotebookSyncState_readReplyAsync); + NoteStoreGetLinkedNotebookSyncStateReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getLinkedNotebookSyncChunk_prepareParams( +QByteArray NoteStoreGetLinkedNotebookSyncChunkPrepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook, qint32 afterUSN, qint32 maxEntries, bool fullSyncOnly) { - QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncChunk_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncChunkPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getLinkedNotebookSyncChunk"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncChunk"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getLinkedNotebookSyncChunk_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeLinkedNotebook(w, linkedNotebook); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeLinkedNotebook(writer, linkedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("afterUSN"), ThriftFieldType::T_I32, 3); - w.writeI32(afterUSN); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(afterUSN); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("maxEntries"), ThriftFieldType::T_I32, 4); - w.writeI32(maxEntries); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(maxEntries); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("fullSyncOnly"), ThriftFieldType::T_BOOL, 5); - w.writeBool(fullSyncOnly); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(fullSyncOnly); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) +SyncChunk NoteStoreGetLinkedNotebookSyncChunkReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getLinkedNotebookSyncChunk_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncChunkReadReply"); bool resultIsSet = false; SyncChunk result = SyncChunk(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getLinkedNotebookSyncChunk")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -1375,56 +1415,56 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SyncChunk v; - readSyncChunk(r, v); + readSyncChunk(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1435,9 +1475,9 @@ SyncChunk NoteStore_getLinkedNotebookSyncChunk_readReply(QByteArray reply) return result; } -QVariant NoteStore_getLinkedNotebookSyncChunk_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetLinkedNotebookSyncChunkReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getLinkedNotebookSyncChunk_readReply(reply)); + return QVariant::fromValue(NoteStoreGetLinkedNotebookSyncChunkReadReply(reply)); } } // namespace @@ -1459,7 +1499,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( + QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( ctx->authenticationToken(), linkedNotebook, afterUSN, @@ -1471,7 +1511,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( params, ctx->requestTimeout()); - return NoteStore_getLinkedNotebookSyncChunk_readReply(reply); + return NoteStoreGetLinkedNotebookSyncChunkReadReply(reply); } AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( @@ -1492,7 +1532,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getLinkedNotebookSyncChunk_prepareParams( + QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( ctx->authenticationToken(), linkedNotebook, afterUSN, @@ -1503,69 +1543,75 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getLinkedNotebookSyncChunk_readReplyAsync); + NoteStoreGetLinkedNotebookSyncChunkReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listNotebooks_prepareParams( +QByteArray NoteStoreListNotebooksPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listNotebooks_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListNotebooksPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listNotebooks"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listNotebooks_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listNotebooks_readReply(QByteArray reply) +QList NoteStoreListNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listNotebooks_readReply"); + QEC_DEBUG("note_store", "NoteStoreListNotebooksReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -1577,7 +1623,7 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -1586,48 +1632,48 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { Notebook elem; - readNotebook(r, elem); + readNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1638,9 +1684,9 @@ QList NoteStore_listNotebooks_readReply(QByteArray reply) return result; } -QVariant NoteStore_listNotebooks_readReplyAsync(QByteArray reply) +QVariant NoteStoreListNotebooksReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listNotebooks_readReply(reply)); + return QVariant::fromValue(NoteStoreListNotebooksReadReply(reply)); } } // namespace @@ -1653,7 +1699,7 @@ QList NoteStore::listNotebooks( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listNotebooks_prepareParams( + QByteArray params = NoteStoreListNotebooksPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -1661,7 +1707,7 @@ QList NoteStore::listNotebooks( params, ctx->requestTimeout()); - return NoteStore_listNotebooks_readReply(reply); + return NoteStoreListNotebooksReadReply(reply); } AsyncResult * NoteStore::listNotebooksAsync( @@ -1673,76 +1719,82 @@ AsyncResult * NoteStore::listNotebooksAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listNotebooks_prepareParams( + QByteArray params = NoteStoreListNotebooksPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listNotebooks_readReplyAsync); + NoteStoreListNotebooksReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listAccessibleBusinessNotebooks_prepareParams( +QByteArray NoteStoreListAccessibleBusinessNotebooksPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listAccessibleBusinessNotebooks_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListAccessibleBusinessNotebooksPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listAccessibleBusinessNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listAccessibleBusinessNotebooks"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listAccessibleBusinessNotebooks_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray reply) +QList NoteStoreListAccessibleBusinessNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listAccessibleBusinessNotebooks_readReply"); + QEC_DEBUG("note_store", "NoteStoreListAccessibleBusinessNotebooksReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listAccessibleBusinessNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -1754,7 +1806,7 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -1763,48 +1815,48 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r } for(qint32 i = 0; i < size; i++) { Notebook elem; - readNotebook(r, elem); + readNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1815,9 +1867,9 @@ QList NoteStore_listAccessibleBusinessNotebooks_readReply(QByteArray r return result; } -QVariant NoteStore_listAccessibleBusinessNotebooks_readReplyAsync(QByteArray reply) +QVariant NoteStoreListAccessibleBusinessNotebooksReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listAccessibleBusinessNotebooks_readReply(reply)); + return QVariant::fromValue(NoteStoreListAccessibleBusinessNotebooksReadReply(reply)); } } // namespace @@ -1830,7 +1882,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( + QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -1838,7 +1890,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( params, ctx->requestTimeout()); - return NoteStore_listAccessibleBusinessNotebooks_readReply(reply); + return NoteStoreListAccessibleBusinessNotebooksReadReply(reply); } AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( @@ -1850,83 +1902,91 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listAccessibleBusinessNotebooks_prepareParams( + QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listAccessibleBusinessNotebooks_readReplyAsync); + NoteStoreListAccessibleBusinessNotebooksReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNotebook_prepareParams( +QByteArray NoteStoreGetNotebookPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Notebook NoteStore_getNotebook_readReply(QByteArray reply) +Notebook NoteStoreGetNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNotebookReadReply"); bool resultIsSet = false; Notebook result = Notebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -1936,56 +1996,56 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; - readNotebook(r, v); + readNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -1996,9 +2056,9 @@ Notebook NoteStore_getNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNotebookReadReply(reply)); } } // namespace @@ -2014,7 +2074,7 @@ Notebook NoteStore::getNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNotebook_prepareParams( + QByteArray params = NoteStoreGetNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2023,7 +2083,7 @@ Notebook NoteStore::getNotebook( params, ctx->requestTimeout()); - return NoteStore_getNotebook_readReply(reply); + return NoteStoreGetNotebookReadReply(reply); } AsyncResult * NoteStore::getNotebookAsync( @@ -2038,7 +2098,7 @@ AsyncResult * NoteStore::getNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNotebook_prepareParams( + QByteArray params = NoteStoreGetNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2046,69 +2106,75 @@ AsyncResult * NoteStore::getNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNotebook_readReplyAsync); + NoteStoreGetNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getDefaultNotebook_prepareParams( +QByteArray NoteStoreGetDefaultNotebookPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_getDefaultNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetDefaultNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getDefaultNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getDefaultNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getDefaultNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) +Notebook NoteStoreGetDefaultNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getDefaultNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetDefaultNotebookReadReply"); bool resultIsSet = false; Notebook result = Notebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getDefaultNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -2118,45 +2184,45 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; - readNotebook(r, v); + readNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -2167,9 +2233,9 @@ Notebook NoteStore_getDefaultNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_getDefaultNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetDefaultNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getDefaultNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreGetDefaultNotebookReadReply(reply)); } } // namespace @@ -2182,7 +2248,7 @@ Notebook NoteStore::getDefaultNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getDefaultNotebook_prepareParams( + QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -2190,7 +2256,7 @@ Notebook NoteStore::getDefaultNotebook( params, ctx->requestTimeout()); - return NoteStore_getDefaultNotebook_readReply(reply); + return NoteStoreGetDefaultNotebookReadReply(reply); } AsyncResult * NoteStore::getDefaultNotebookAsync( @@ -2202,83 +2268,91 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getDefaultNotebook_prepareParams( + QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_getDefaultNotebook_readReplyAsync); + NoteStoreGetDefaultNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createNotebook_prepareParams( +QByteArray NoteStoreCreateNotebookPrepareParams( QString authenticationToken, const Notebook & notebook) { - QEC_DEBUG("note_store", "NoteStore_createNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notebook"), ThriftFieldType::T_STRUCT, 2); - writeNotebook(w, notebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNotebook(writer, notebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Notebook NoteStore_createNotebook_readReply(QByteArray reply) +Notebook NoteStoreCreateNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateNotebookReadReply"); bool resultIsSet = false; Notebook result = Notebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -2288,56 +2362,56 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; - readNotebook(r, v); + readNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -2348,9 +2422,9 @@ Notebook NoteStore_createNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_createNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateNotebookReadReply(reply)); } } // namespace @@ -2366,7 +2440,7 @@ Notebook NoteStore::createNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createNotebook_prepareParams( + QByteArray params = NoteStoreCreateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2375,7 +2449,7 @@ Notebook NoteStore::createNotebook( params, ctx->requestTimeout()); - return NoteStore_createNotebook_readReply(reply); + return NoteStoreCreateNotebookReadReply(reply); } AsyncResult * NoteStore::createNotebookAsync( @@ -2390,7 +2464,7 @@ AsyncResult * NoteStore::createNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createNotebook_prepareParams( + QByteArray params = NoteStoreCreateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2398,76 +2472,84 @@ AsyncResult * NoteStore::createNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createNotebook_readReplyAsync); + NoteStoreCreateNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateNotebook_prepareParams( +QByteArray NoteStoreUpdateNotebookPrepareParams( QString authenticationToken, const Notebook & notebook) { - QEC_DEBUG("note_store", "NoteStore_updateNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notebook"), ThriftFieldType::T_STRUCT, 2); - writeNotebook(w, notebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNotebook(writer, notebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateNotebook_readReply(QByteArray reply) +qint32 NoteStoreUpdateNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateNotebookReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -2477,56 +2559,56 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -2537,9 +2619,9 @@ qint32 NoteStore_updateNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateNotebookReadReply(reply)); } } // namespace @@ -2555,7 +2637,7 @@ qint32 NoteStore::updateNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateNotebook_prepareParams( + QByteArray params = NoteStoreUpdateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2564,7 +2646,7 @@ qint32 NoteStore::updateNotebook( params, ctx->requestTimeout()); - return NoteStore_updateNotebook_readReply(reply); + return NoteStoreUpdateNotebookReadReply(reply); } AsyncResult * NoteStore::updateNotebookAsync( @@ -2579,7 +2661,7 @@ AsyncResult * NoteStore::updateNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateNotebook_prepareParams( + QByteArray params = NoteStoreUpdateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2587,76 +2669,84 @@ AsyncResult * NoteStore::updateNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateNotebook_readReplyAsync); + NoteStoreUpdateNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_expungeNotebook_prepareParams( +QByteArray NoteStoreExpungeNotebookPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_expungeNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreExpungeNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("expungeNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("expungeNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_expungeNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) +qint32 NoteStoreExpungeNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_expungeNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreExpungeNotebookReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -2666,56 +2756,56 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -2726,9 +2816,9 @@ qint32 NoteStore_expungeNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_expungeNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreExpungeNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_expungeNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreExpungeNotebookReadReply(reply)); } } // namespace @@ -2744,7 +2834,7 @@ qint32 NoteStore::expungeNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_expungeNotebook_prepareParams( + QByteArray params = NoteStoreExpungeNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2753,7 +2843,7 @@ qint32 NoteStore::expungeNotebook( params, ctx->requestTimeout()); - return NoteStore_expungeNotebook_readReply(reply); + return NoteStoreExpungeNotebookReadReply(reply); } AsyncResult * NoteStore::expungeNotebookAsync( @@ -2768,7 +2858,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_expungeNotebook_prepareParams( + QByteArray params = NoteStoreExpungeNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2776,69 +2866,75 @@ AsyncResult * NoteStore::expungeNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_expungeNotebook_readReplyAsync); + NoteStoreExpungeNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listTags_prepareParams( +QByteArray NoteStoreListTagsPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listTags_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListTagsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listTags"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listTags"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listTags_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listTags_readReply(QByteArray reply) +QList NoteStoreListTagsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listTags_readReply"); + QEC_DEBUG("note_store", "NoteStoreListTagsReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listTags")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -2850,7 +2946,7 @@ QList NoteStore_listTags_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -2859,48 +2955,48 @@ QList NoteStore_listTags_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { Tag elem; - readTag(r, elem); + readTag(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -2911,9 +3007,9 @@ QList NoteStore_listTags_readReply(QByteArray reply) return result; } -QVariant NoteStore_listTags_readReplyAsync(QByteArray reply) +QVariant NoteStoreListTagsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listTags_readReply(reply)); + return QVariant::fromValue(NoteStoreListTagsReadReply(reply)); } } // namespace @@ -2926,7 +3022,7 @@ QList NoteStore::listTags( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listTags_prepareParams( + QByteArray params = NoteStoreListTagsPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -2934,7 +3030,7 @@ QList NoteStore::listTags( params, ctx->requestTimeout()); - return NoteStore_listTags_readReply(reply); + return NoteStoreListTagsReadReply(reply); } AsyncResult * NoteStore::listTagsAsync( @@ -2946,83 +3042,91 @@ AsyncResult * NoteStore::listTagsAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listTags_prepareParams( + QByteArray params = NoteStoreListTagsPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listTags_readReplyAsync); + NoteStoreListTagsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listTagsByNotebook_prepareParams( +QByteArray NoteStoreListTagsByNotebookPrepareParams( QString authenticationToken, Guid notebookGuid) { - QEC_DEBUG("note_store", "NoteStore_listTagsByNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListTagsByNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listTagsByNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listTagsByNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listTagsByNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(notebookGuid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(notebookGuid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) +QList NoteStoreListTagsByNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listTagsByNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreListTagsByNotebookReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listTagsByNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3034,7 +3138,7 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -3043,59 +3147,59 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { Tag elem; - readTag(r, elem); + readTag(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -3106,9 +3210,9 @@ QList NoteStore_listTagsByNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_listTagsByNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreListTagsByNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listTagsByNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreListTagsByNotebookReadReply(reply)); } } // namespace @@ -3124,7 +3228,7 @@ QList NoteStore::listTagsByNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listTagsByNotebook_prepareParams( + QByteArray params = NoteStoreListTagsByNotebookPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -3133,7 +3237,7 @@ QList NoteStore::listTagsByNotebook( params, ctx->requestTimeout()); - return NoteStore_listTagsByNotebook_readReply(reply); + return NoteStoreListTagsByNotebookReadReply(reply); } AsyncResult * NoteStore::listTagsByNotebookAsync( @@ -3148,7 +3252,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listTagsByNotebook_prepareParams( + QByteArray params = NoteStoreListTagsByNotebookPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -3156,76 +3260,84 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_listTagsByNotebook_readReplyAsync); + NoteStoreListTagsByNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getTag_prepareParams( +QByteArray NoteStoreGetTagPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getTag_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetTagPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getTag"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getTag_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Tag NoteStore_getTag_readReply(QByteArray reply) +Tag NoteStoreGetTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getTag_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetTagReadReply"); bool resultIsSet = false; Tag result = Tag(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3235,56 +3347,56 @@ Tag NoteStore_getTag_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; - readTag(r, v); + readTag(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -3295,9 +3407,9 @@ Tag NoteStore_getTag_readReply(QByteArray reply) return result; } -QVariant NoteStore_getTag_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetTagReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getTag_readReply(reply)); + return QVariant::fromValue(NoteStoreGetTagReadReply(reply)); } } // namespace @@ -3313,7 +3425,7 @@ Tag NoteStore::getTag( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getTag_prepareParams( + QByteArray params = NoteStoreGetTagPrepareParams( ctx->authenticationToken(), guid); @@ -3322,7 +3434,7 @@ Tag NoteStore::getTag( params, ctx->requestTimeout()); - return NoteStore_getTag_readReply(reply); + return NoteStoreGetTagReadReply(reply); } AsyncResult * NoteStore::getTagAsync( @@ -3337,7 +3449,7 @@ AsyncResult * NoteStore::getTagAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getTag_prepareParams( + QByteArray params = NoteStoreGetTagPrepareParams( ctx->authenticationToken(), guid); @@ -3345,76 +3457,84 @@ AsyncResult * NoteStore::getTagAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getTag_readReplyAsync); + NoteStoreGetTagReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createTag_prepareParams( +QByteArray NoteStoreCreateTagPrepareParams( QString authenticationToken, const Tag & tag) { - QEC_DEBUG("note_store", "NoteStore_createTag_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateTagPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createTag"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createTag_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("tag"), ThriftFieldType::T_STRUCT, 2); - writeTag(w, tag); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeTag(writer, tag); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Tag NoteStore_createTag_readReply(QByteArray reply) +Tag NoteStoreCreateTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createTag_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateTagReadReply"); bool resultIsSet = false; Tag result = Tag(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3424,56 +3544,56 @@ Tag NoteStore_createTag_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Tag v; - readTag(r, v); + readTag(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -3484,9 +3604,9 @@ Tag NoteStore_createTag_readReply(QByteArray reply) return result; } -QVariant NoteStore_createTag_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateTagReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createTag_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateTagReadReply(reply)); } } // namespace @@ -3502,7 +3622,7 @@ Tag NoteStore::createTag( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createTag_prepareParams( + QByteArray params = NoteStoreCreateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3511,7 +3631,7 @@ Tag NoteStore::createTag( params, ctx->requestTimeout()); - return NoteStore_createTag_readReply(reply); + return NoteStoreCreateTagReadReply(reply); } AsyncResult * NoteStore::createTagAsync( @@ -3526,7 +3646,7 @@ AsyncResult * NoteStore::createTagAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createTag_prepareParams( + QByteArray params = NoteStoreCreateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3534,76 +3654,84 @@ AsyncResult * NoteStore::createTagAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createTag_readReplyAsync); + NoteStoreCreateTagReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateTag_prepareParams( +QByteArray NoteStoreUpdateTagPrepareParams( QString authenticationToken, const Tag & tag) { - QEC_DEBUG("note_store", "NoteStore_updateTag_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateTagPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateTag"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateTag_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("tag"), ThriftFieldType::T_STRUCT, 2); - writeTag(w, tag); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeTag(writer, tag); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateTag_readReply(QByteArray reply) +qint32 NoteStoreUpdateTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateTag_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateTagReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3613,56 +3741,56 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -3673,9 +3801,9 @@ qint32 NoteStore_updateTag_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateTag_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateTagReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateTag_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateTagReadReply(reply)); } } // namespace @@ -3691,7 +3819,7 @@ qint32 NoteStore::updateTag( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateTag_prepareParams( + QByteArray params = NoteStoreUpdateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3700,7 +3828,7 @@ qint32 NoteStore::updateTag( params, ctx->requestTimeout()); - return NoteStore_updateTag_readReply(reply); + return NoteStoreUpdateTagReadReply(reply); } AsyncResult * NoteStore::updateTagAsync( @@ -3715,7 +3843,7 @@ AsyncResult * NoteStore::updateTagAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateTag_prepareParams( + QByteArray params = NoteStoreUpdateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3723,74 +3851,82 @@ AsyncResult * NoteStore::updateTagAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateTag_readReplyAsync); + NoteStoreUpdateTagReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_untagAll_prepareParams( +QByteArray NoteStoreUntagAllPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_untagAll_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUntagAllPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("untagAll"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("untagAll"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_untagAll_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void NoteStore_untagAll_readReply(QByteArray reply) +void NoteStoreUntagAllReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_untagAll_readReply"); + QEC_DEBUG("note_store", "NoteStoreUntagAllReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("untagAll")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3799,51 +3935,51 @@ void NoteStore_untagAll_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant NoteStore_untagAll_readReplyAsync(QByteArray reply) +QVariant NoteStoreUntagAllReadReplyAsync(QByteArray reply) { - NoteStore_untagAll_readReply(reply); + NoteStoreUntagAllReadReply(reply); return QVariant(); } @@ -3860,7 +3996,7 @@ void NoteStore::untagAll( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_untagAll_prepareParams( + QByteArray params = NoteStoreUntagAllPrepareParams( ctx->authenticationToken(), guid); @@ -3869,7 +4005,7 @@ void NoteStore::untagAll( params, ctx->requestTimeout()); - NoteStore_untagAll_readReply(reply); + NoteStoreUntagAllReadReply(reply); } AsyncResult * NoteStore::untagAllAsync( @@ -3884,7 +4020,7 @@ AsyncResult * NoteStore::untagAllAsync( ctx = m_ctx; } - QByteArray params = NoteStore_untagAll_prepareParams( + QByteArray params = NoteStoreUntagAllPrepareParams( ctx->authenticationToken(), guid); @@ -3892,76 +4028,84 @@ AsyncResult * NoteStore::untagAllAsync( m_url, params, ctx->requestTimeout(), - NoteStore_untagAll_readReplyAsync); + NoteStoreUntagAllReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_expungeTag_prepareParams( +QByteArray NoteStoreExpungeTagPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_expungeTag_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreExpungeTagPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("expungeTag"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("expungeTag"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_expungeTag_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_expungeTag_readReply(QByteArray reply) +qint32 NoteStoreExpungeTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_expungeTag_readReply"); + QEC_DEBUG("note_store", "NoteStoreExpungeTagReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeTag")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -3971,56 +4115,56 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4031,9 +4175,9 @@ qint32 NoteStore_expungeTag_readReply(QByteArray reply) return result; } -QVariant NoteStore_expungeTag_readReplyAsync(QByteArray reply) +QVariant NoteStoreExpungeTagReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_expungeTag_readReply(reply)); + return QVariant::fromValue(NoteStoreExpungeTagReadReply(reply)); } } // namespace @@ -4049,7 +4193,7 @@ qint32 NoteStore::expungeTag( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_expungeTag_prepareParams( + QByteArray params = NoteStoreExpungeTagPrepareParams( ctx->authenticationToken(), guid); @@ -4058,7 +4202,7 @@ qint32 NoteStore::expungeTag( params, ctx->requestTimeout()); - return NoteStore_expungeTag_readReply(reply); + return NoteStoreExpungeTagReadReply(reply); } AsyncResult * NoteStore::expungeTagAsync( @@ -4073,7 +4217,7 @@ AsyncResult * NoteStore::expungeTagAsync( ctx = m_ctx; } - QByteArray params = NoteStore_expungeTag_prepareParams( + QByteArray params = NoteStoreExpungeTagPrepareParams( ctx->authenticationToken(), guid); @@ -4081,69 +4225,75 @@ AsyncResult * NoteStore::expungeTagAsync( m_url, params, ctx->requestTimeout(), - NoteStore_expungeTag_readReplyAsync); + NoteStoreExpungeTagReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listSearches_prepareParams( +QByteArray NoteStoreListSearchesPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listSearches_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListSearchesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listSearches"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listSearches"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listSearches_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listSearches_readReply(QByteArray reply) +QList NoteStoreListSearchesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listSearches_readReply"); + QEC_DEBUG("note_store", "NoteStoreListSearchesReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listSearches")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -4155,7 +4305,7 @@ QList NoteStore_listSearches_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4164,48 +4314,48 @@ QList NoteStore_listSearches_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { SavedSearch elem; - readSavedSearch(r, elem); + readSavedSearch(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4216,9 +4366,9 @@ QList NoteStore_listSearches_readReply(QByteArray reply) return result; } -QVariant NoteStore_listSearches_readReplyAsync(QByteArray reply) +QVariant NoteStoreListSearchesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listSearches_readReply(reply)); + return QVariant::fromValue(NoteStoreListSearchesReadReply(reply)); } } // namespace @@ -4231,7 +4381,7 @@ QList NoteStore::listSearches( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listSearches_prepareParams( + QByteArray params = NoteStoreListSearchesPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -4239,7 +4389,7 @@ QList NoteStore::listSearches( params, ctx->requestTimeout()); - return NoteStore_listSearches_readReply(reply); + return NoteStoreListSearchesReadReply(reply); } AsyncResult * NoteStore::listSearchesAsync( @@ -4251,83 +4401,91 @@ AsyncResult * NoteStore::listSearchesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listSearches_prepareParams( + QByteArray params = NoteStoreListSearchesPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listSearches_readReplyAsync); + NoteStoreListSearchesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getSearch_prepareParams( +QByteArray NoteStoreGetSearchPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getSearch_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetSearchPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getSearch"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getSearch_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SavedSearch NoteStore_getSearch_readReply(QByteArray reply) +SavedSearch NoteStoreGetSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getSearch_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetSearchReadReply"); bool resultIsSet = false; SavedSearch result = SavedSearch(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -4337,56 +4495,56 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; - readSavedSearch(r, v); + readSavedSearch(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4397,9 +4555,9 @@ SavedSearch NoteStore_getSearch_readReply(QByteArray reply) return result; } -QVariant NoteStore_getSearch_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetSearchReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getSearch_readReply(reply)); + return QVariant::fromValue(NoteStoreGetSearchReadReply(reply)); } } // namespace @@ -4415,7 +4573,7 @@ SavedSearch NoteStore::getSearch( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getSearch_prepareParams( + QByteArray params = NoteStoreGetSearchPrepareParams( ctx->authenticationToken(), guid); @@ -4424,7 +4582,7 @@ SavedSearch NoteStore::getSearch( params, ctx->requestTimeout()); - return NoteStore_getSearch_readReply(reply); + return NoteStoreGetSearchReadReply(reply); } AsyncResult * NoteStore::getSearchAsync( @@ -4439,7 +4597,7 @@ AsyncResult * NoteStore::getSearchAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getSearch_prepareParams( + QByteArray params = NoteStoreGetSearchPrepareParams( ctx->authenticationToken(), guid); @@ -4447,76 +4605,84 @@ AsyncResult * NoteStore::getSearchAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getSearch_readReplyAsync); + NoteStoreGetSearchReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createSearch_prepareParams( +QByteArray NoteStoreCreateSearchPrepareParams( QString authenticationToken, const SavedSearch & search) { - QEC_DEBUG("note_store", "NoteStore_createSearch_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateSearchPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createSearch"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createSearch_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("search"), ThriftFieldType::T_STRUCT, 2); - writeSavedSearch(w, search); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeSavedSearch(writer, search); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SavedSearch NoteStore_createSearch_readReply(QByteArray reply) +SavedSearch NoteStoreCreateSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createSearch_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateSearchReadReply"); bool resultIsSet = false; SavedSearch result = SavedSearch(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -4526,45 +4692,45 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SavedSearch v; - readSavedSearch(r, v); + readSavedSearch(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4575,9 +4741,9 @@ SavedSearch NoteStore_createSearch_readReply(QByteArray reply) return result; } -QVariant NoteStore_createSearch_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateSearchReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createSearch_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateSearchReadReply(reply)); } } // namespace @@ -4593,7 +4759,7 @@ SavedSearch NoteStore::createSearch( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createSearch_prepareParams( + QByteArray params = NoteStoreCreateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4602,7 +4768,7 @@ SavedSearch NoteStore::createSearch( params, ctx->requestTimeout()); - return NoteStore_createSearch_readReply(reply); + return NoteStoreCreateSearchReadReply(reply); } AsyncResult * NoteStore::createSearchAsync( @@ -4617,7 +4783,7 @@ AsyncResult * NoteStore::createSearchAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createSearch_prepareParams( + QByteArray params = NoteStoreCreateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4625,76 +4791,84 @@ AsyncResult * NoteStore::createSearchAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createSearch_readReplyAsync); + NoteStoreCreateSearchReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateSearch_prepareParams( +QByteArray NoteStoreUpdateSearchPrepareParams( QString authenticationToken, const SavedSearch & search) { - QEC_DEBUG("note_store", "NoteStore_updateSearch_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateSearchPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateSearch"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateSearch_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("search"), ThriftFieldType::T_STRUCT, 2); - writeSavedSearch(w, search); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeSavedSearch(writer, search); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateSearch_readReply(QByteArray reply) +qint32 NoteStoreUpdateSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateSearch_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateSearchReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -4704,56 +4878,56 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4764,9 +4938,9 @@ qint32 NoteStore_updateSearch_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateSearch_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateSearchReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateSearch_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateSearchReadReply(reply)); } } // namespace @@ -4782,7 +4956,7 @@ qint32 NoteStore::updateSearch( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateSearch_prepareParams( + QByteArray params = NoteStoreUpdateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4791,7 +4965,7 @@ qint32 NoteStore::updateSearch( params, ctx->requestTimeout()); - return NoteStore_updateSearch_readReply(reply); + return NoteStoreUpdateSearchReadReply(reply); } AsyncResult * NoteStore::updateSearchAsync( @@ -4806,7 +4980,7 @@ AsyncResult * NoteStore::updateSearchAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateSearch_prepareParams( + QByteArray params = NoteStoreUpdateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4814,76 +4988,84 @@ AsyncResult * NoteStore::updateSearchAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateSearch_readReplyAsync); + NoteStoreUpdateSearchReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_expungeSearch_prepareParams( +QByteArray NoteStoreExpungeSearchPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_expungeSearch_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreExpungeSearchPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("expungeSearch"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("expungeSearch"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_expungeSearch_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_expungeSearch_readReply(QByteArray reply) +qint32 NoteStoreExpungeSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_expungeSearch_readReply"); + QEC_DEBUG("note_store", "NoteStoreExpungeSearchReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeSearch")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -4893,56 +5075,56 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -4953,9 +5135,9 @@ qint32 NoteStore_expungeSearch_readReply(QByteArray reply) return result; } -QVariant NoteStore_expungeSearch_readReplyAsync(QByteArray reply) +QVariant NoteStoreExpungeSearchReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_expungeSearch_readReply(reply)); + return QVariant::fromValue(NoteStoreExpungeSearchReadReply(reply)); } } // namespace @@ -4971,7 +5153,7 @@ qint32 NoteStore::expungeSearch( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_expungeSearch_prepareParams( + QByteArray params = NoteStoreExpungeSearchPrepareParams( ctx->authenticationToken(), guid); @@ -4980,7 +5162,7 @@ qint32 NoteStore::expungeSearch( params, ctx->requestTimeout()); - return NoteStore_expungeSearch_readReply(reply); + return NoteStoreExpungeSearchReadReply(reply); } AsyncResult * NoteStore::expungeSearchAsync( @@ -4995,7 +5177,7 @@ AsyncResult * NoteStore::expungeSearchAsync( ctx = m_ctx; } - QByteArray params = NoteStore_expungeSearch_prepareParams( + QByteArray params = NoteStoreExpungeSearchPrepareParams( ctx->authenticationToken(), guid); @@ -5003,83 +5185,93 @@ AsyncResult * NoteStore::expungeSearchAsync( m_url, params, ctx->requestTimeout(), - NoteStore_expungeSearch_readReplyAsync); + NoteStoreExpungeSearchReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_findNoteOffset_prepareParams( +QByteArray NoteStoreFindNoteOffsetPrepareParams( QString authenticationToken, const NoteFilter & filter, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_findNoteOffset_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreFindNoteOffsetPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("findNoteOffset"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("findNoteOffset"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_findNoteOffset_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); - writeNoteFilter(w, filter); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeNoteFilter(writer, filter); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 3); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) +qint32 NoteStoreFindNoteOffsetReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_findNoteOffset_readReply"); + QEC_DEBUG("note_store", "NoteStoreFindNoteOffsetReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNoteOffset")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -5089,56 +5281,56 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -5149,9 +5341,9 @@ qint32 NoteStore_findNoteOffset_readReply(QByteArray reply) return result; } -QVariant NoteStore_findNoteOffset_readReplyAsync(QByteArray reply) +QVariant NoteStoreFindNoteOffsetReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_findNoteOffset_readReply(reply)); + return QVariant::fromValue(NoteStoreFindNoteOffsetReadReply(reply)); } } // namespace @@ -5169,7 +5361,7 @@ qint32 NoteStore::findNoteOffset( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_findNoteOffset_prepareParams( + QByteArray params = NoteStoreFindNoteOffsetPrepareParams( ctx->authenticationToken(), filter, guid); @@ -5179,7 +5371,7 @@ qint32 NoteStore::findNoteOffset( params, ctx->requestTimeout()); - return NoteStore_findNoteOffset_readReply(reply); + return NoteStoreFindNoteOffsetReadReply(reply); } AsyncResult * NoteStore::findNoteOffsetAsync( @@ -5196,7 +5388,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( ctx = m_ctx; } - QByteArray params = NoteStore_findNoteOffset_prepareParams( + QByteArray params = NoteStoreFindNoteOffsetPrepareParams( ctx->authenticationToken(), filter, guid); @@ -5205,97 +5397,111 @@ AsyncResult * NoteStore::findNoteOffsetAsync( m_url, params, ctx->requestTimeout(), - NoteStore_findNoteOffset_readReplyAsync); + NoteStoreFindNoteOffsetReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_findNotesMetadata_prepareParams( +QByteArray NoteStoreFindNotesMetadataPrepareParams( QString authenticationToken, const NoteFilter & filter, qint32 offset, qint32 maxNotes, const NotesMetadataResultSpec & resultSpec) { - QEC_DEBUG("note_store", "NoteStore_findNotesMetadata_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreFindNotesMetadataPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("findNotesMetadata"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("findNotesMetadata"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_findNotesMetadata_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); - writeNoteFilter(w, filter); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeNoteFilter(writer, filter); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("offset"), ThriftFieldType::T_I32, 3); - w.writeI32(offset); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(offset); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("maxNotes"), ThriftFieldType::T_I32, 4); - w.writeI32(maxNotes); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(maxNotes); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 5); - writeNotesMetadataResultSpec(w, resultSpec); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNotesMetadataResultSpec(writer, resultSpec); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) +NotesMetadataList NoteStoreFindNotesMetadataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_findNotesMetadata_readReply"); + QEC_DEBUG("note_store", "NoteStoreFindNotesMetadataReadReply"); bool resultIsSet = false; NotesMetadataList result = NotesMetadataList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNotesMetadata")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -5305,56 +5511,56 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NotesMetadataList v; - readNotesMetadataList(r, v); + readNotesMetadataList(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -5365,9 +5571,9 @@ NotesMetadataList NoteStore_findNotesMetadata_readReply(QByteArray reply) return result; } -QVariant NoteStore_findNotesMetadata_readReplyAsync(QByteArray reply) +QVariant NoteStoreFindNotesMetadataReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_findNotesMetadata_readReply(reply)); + return QVariant::fromValue(NoteStoreFindNotesMetadataReadReply(reply)); } } // namespace @@ -5389,7 +5595,7 @@ NotesMetadataList NoteStore::findNotesMetadata( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_findNotesMetadata_prepareParams( + QByteArray params = NoteStoreFindNotesMetadataPrepareParams( ctx->authenticationToken(), filter, offset, @@ -5401,7 +5607,7 @@ NotesMetadataList NoteStore::findNotesMetadata( params, ctx->requestTimeout()); - return NoteStore_findNotesMetadata_readReply(reply); + return NoteStoreFindNotesMetadataReadReply(reply); } AsyncResult * NoteStore::findNotesMetadataAsync( @@ -5422,7 +5628,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( ctx = m_ctx; } - QByteArray params = NoteStore_findNotesMetadata_prepareParams( + QByteArray params = NoteStoreFindNotesMetadataPrepareParams( ctx->authenticationToken(), filter, offset, @@ -5433,83 +5639,93 @@ AsyncResult * NoteStore::findNotesMetadataAsync( m_url, params, ctx->requestTimeout(), - NoteStore_findNotesMetadata_readReplyAsync); + NoteStoreFindNotesMetadataReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_findNoteCounts_prepareParams( +QByteArray NoteStoreFindNoteCountsPrepareParams( QString authenticationToken, const NoteFilter & filter, bool withTrash) { - QEC_DEBUG("note_store", "NoteStore_findNoteCounts_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreFindNoteCountsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("findNoteCounts"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("findNoteCounts"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_findNoteCounts_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 2); - writeNoteFilter(w, filter); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeNoteFilter(writer, filter); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withTrash"), ThriftFieldType::T_BOOL, 3); - w.writeBool(withTrash); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(withTrash); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) +NoteCollectionCounts NoteStoreFindNoteCountsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_findNoteCounts_readReply"); + QEC_DEBUG("note_store", "NoteStoreFindNoteCountsReadReply"); bool resultIsSet = false; NoteCollectionCounts result = NoteCollectionCounts(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findNoteCounts")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -5519,56 +5735,56 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; NoteCollectionCounts v; - readNoteCollectionCounts(r, v); + readNoteCollectionCounts(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -5579,9 +5795,9 @@ NoteCollectionCounts NoteStore_findNoteCounts_readReply(QByteArray reply) return result; } -QVariant NoteStore_findNoteCounts_readReplyAsync(QByteArray reply) +QVariant NoteStoreFindNoteCountsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_findNoteCounts_readReply(reply)); + return QVariant::fromValue(NoteStoreFindNoteCountsReadReply(reply)); } } // namespace @@ -5599,7 +5815,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_findNoteCounts_prepareParams( + QByteArray params = NoteStoreFindNoteCountsPrepareParams( ctx->authenticationToken(), filter, withTrash); @@ -5609,7 +5825,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( params, ctx->requestTimeout()); - return NoteStore_findNoteCounts_readReply(reply); + return NoteStoreFindNoteCountsReadReply(reply); } AsyncResult * NoteStore::findNoteCountsAsync( @@ -5626,7 +5842,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( ctx = m_ctx; } - QByteArray params = NoteStore_findNoteCounts_prepareParams( + QByteArray params = NoteStoreFindNoteCountsPrepareParams( ctx->authenticationToken(), filter, withTrash); @@ -5635,83 +5851,93 @@ AsyncResult * NoteStore::findNoteCountsAsync( m_url, params, ctx->requestTimeout(), - NoteStore_findNoteCounts_readReplyAsync); + NoteStoreFindNoteCountsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteWithResultSpec_prepareParams( +QByteArray NoteStoreGetNoteWithResultSpecPrepareParams( QString authenticationToken, Guid guid, const NoteResultSpec & resultSpec) { - QEC_DEBUG("note_store", "NoteStore_getNoteWithResultSpec_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteWithResultSpecPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteWithResultSpec"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteWithResultSpec"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteWithResultSpec_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 3); - writeNoteResultSpec(w, resultSpec); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNoteResultSpec(writer, resultSpec); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) +Note NoteStoreGetNoteWithResultSpecReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteWithResultSpec_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteWithResultSpecReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteWithResultSpec")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -5721,56 +5947,56 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -5781,9 +6007,9 @@ Note NoteStore_getNoteWithResultSpec_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteWithResultSpec_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteWithResultSpecReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteWithResultSpec_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteWithResultSpecReadReply(reply)); } } // namespace @@ -5801,7 +6027,7 @@ Note NoteStore::getNoteWithResultSpec( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( + QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( ctx->authenticationToken(), guid, resultSpec); @@ -5811,7 +6037,7 @@ Note NoteStore::getNoteWithResultSpec( params, ctx->requestTimeout()); - return NoteStore_getNoteWithResultSpec_readReply(reply); + return NoteStoreGetNoteWithResultSpecReadReply(reply); } AsyncResult * NoteStore::getNoteWithResultSpecAsync( @@ -5828,7 +6054,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteWithResultSpec_prepareParams( + QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( ctx->authenticationToken(), guid, resultSpec); @@ -5837,14 +6063,14 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteWithResultSpec_readReplyAsync); + NoteStoreGetNoteWithResultSpecReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNote_prepareParams( +QByteArray NoteStoreGetNotePrepareParams( QString authenticationToken, Guid guid, bool withContent, @@ -5852,89 +6078,105 @@ QByteArray NoteStore_getNote_prepareParams( bool withResourcesRecognition, bool withResourcesAlternateData) { - QEC_DEBUG("note_store", "NoteStore_getNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withContent"), ThriftFieldType::T_BOOL, 3); - w.writeBool(withContent); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withContent); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesData"), ThriftFieldType::T_BOOL, 4); - w.writeBool(withResourcesData); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withResourcesData); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesRecognition"), ThriftFieldType::T_BOOL, 5); - w.writeBool(withResourcesRecognition); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withResourcesRecognition); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesAlternateData"), ThriftFieldType::T_BOOL, 6); - w.writeBool(withResourcesAlternateData); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(withResourcesAlternateData); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_getNote_readReply(QByteArray reply) +Note NoteStoreGetNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -5944,56 +6186,56 @@ Note NoteStore_getNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -6004,9 +6246,9 @@ Note NoteStore_getNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNote_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteReadReply(reply)); } } // namespace @@ -6030,7 +6272,7 @@ Note NoteStore::getNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNote_prepareParams( + QByteArray params = NoteStoreGetNotePrepareParams( ctx->authenticationToken(), guid, withContent, @@ -6043,7 +6285,7 @@ Note NoteStore::getNote( params, ctx->requestTimeout()); - return NoteStore_getNote_readReply(reply); + return NoteStoreGetNoteReadReply(reply); } AsyncResult * NoteStore::getNoteAsync( @@ -6066,7 +6308,7 @@ AsyncResult * NoteStore::getNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNote_prepareParams( + QByteArray params = NoteStoreGetNotePrepareParams( ctx->authenticationToken(), guid, withContent, @@ -6078,76 +6320,84 @@ AsyncResult * NoteStore::getNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNote_readReplyAsync); + NoteStoreGetNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteApplicationData_prepareParams( +QByteArray NoteStoreGetNoteApplicationDataPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getNoteApplicationData_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteApplicationData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationData"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteApplicationData_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) +LazyMap NoteStoreGetNoteApplicationDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteApplicationData_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataReadReply"); bool resultIsSet = false; LazyMap result = LazyMap(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteApplicationData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -6157,56 +6407,56 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; - readLazyMap(r, v); + readLazyMap(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -6217,9 +6467,9 @@ LazyMap NoteStore_getNoteApplicationData_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteApplicationData_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteApplicationDataReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteApplicationData_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteApplicationDataReadReply(reply)); } } // namespace @@ -6235,7 +6485,7 @@ LazyMap NoteStore::getNoteApplicationData( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteApplicationData_prepareParams( + QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -6244,7 +6494,7 @@ LazyMap NoteStore::getNoteApplicationData( params, ctx->requestTimeout()); - return NoteStore_getNoteApplicationData_readReply(reply); + return NoteStoreGetNoteApplicationDataReadReply(reply); } AsyncResult * NoteStore::getNoteApplicationDataAsync( @@ -6259,7 +6509,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteApplicationData_prepareParams( + QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -6267,83 +6517,93 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteApplicationData_readReplyAsync); + NoteStoreGetNoteApplicationDataReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteApplicationDataEntry_prepareParams( +QByteArray NoteStoreGetNoteApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key) { - QEC_DEBUG("note_store", "NoteStore_getNoteApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) +QString NoteStoreGetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataEntryReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -6353,56 +6613,56 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -6413,9 +6673,9 @@ QString NoteStore_getNoteApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteApplicationDataEntryReadReply(reply)); } } // namespace @@ -6433,7 +6693,7 @@ QString NoteStore::getNoteApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -6443,7 +6703,7 @@ QString NoteStore::getNoteApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_getNoteApplicationDataEntry_readReply(reply); + return NoteStoreGetNoteApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( @@ -6460,7 +6720,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -6469,90 +6729,102 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteApplicationDataEntry_readReplyAsync); + NoteStoreGetNoteApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_setNoteApplicationDataEntry_prepareParams( +QByteArray NoteStoreSetNoteApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key, QString value) { - QEC_DEBUG("note_store", "NoteStore_setNoteApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreSetNoteApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("setNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("setNoteApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_setNoteApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("value"), ThriftFieldType::T_STRING, 4); - w.writeString(value); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(value); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) +qint32 NoteStoreSetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_setNoteApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreSetNoteApplicationDataEntryReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -6562,56 +6834,56 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -6622,9 +6894,9 @@ qint32 NoteStore_setNoteApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_setNoteApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreSetNoteApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_setNoteApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreSetNoteApplicationDataEntryReadReply(reply)); } } // namespace @@ -6644,7 +6916,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key, @@ -6655,7 +6927,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_setNoteApplicationDataEntry_readReply(reply); + return NoteStoreSetNoteApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( @@ -6674,7 +6946,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_setNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key, @@ -6684,83 +6956,93 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_setNoteApplicationDataEntry_readReplyAsync); + NoteStoreSetNoteApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_unsetNoteApplicationDataEntry_prepareParams( +QByteArray NoteStoreUnsetNoteApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key) { - QEC_DEBUG("note_store", "NoteStore_unsetNoteApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUnsetNoteApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("unsetNoteApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("unsetNoteApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_unsetNoteApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) +qint32 NoteStoreUnsetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_unsetNoteApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreUnsetNoteApplicationDataEntryReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("unsetNoteApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -6770,56 +7052,56 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -6830,9 +7112,9 @@ qint32 NoteStore_unsetNoteApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_unsetNoteApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreUnsetNoteApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_unsetNoteApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreUnsetNoteApplicationDataEntryReadReply(reply)); } } // namespace @@ -6850,7 +7132,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -6860,7 +7142,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_unsetNoteApplicationDataEntry_readReply(reply); + return NoteStoreUnsetNoteApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( @@ -6877,7 +7159,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_unsetNoteApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -6886,76 +7168,84 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_unsetNoteApplicationDataEntry_readReplyAsync); + NoteStoreUnsetNoteApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteContent_prepareParams( +QByteArray NoteStoreGetNoteContentPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getNoteContent_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteContentPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteContent"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteContent"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteContent_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_getNoteContent_readReply(QByteArray reply) +QString NoteStoreGetNoteContentReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteContent_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteContentReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteContent")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -6965,56 +7255,56 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -7025,9 +7315,9 @@ QString NoteStore_getNoteContent_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteContent_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteContentReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteContent_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteContentReadReply(reply)); } } // namespace @@ -7043,7 +7333,7 @@ QString NoteStore::getNoteContent( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteContent_prepareParams( + QByteArray params = NoteStoreGetNoteContentPrepareParams( ctx->authenticationToken(), guid); @@ -7052,7 +7342,7 @@ QString NoteStore::getNoteContent( params, ctx->requestTimeout()); - return NoteStore_getNoteContent_readReply(reply); + return NoteStoreGetNoteContentReadReply(reply); } AsyncResult * NoteStore::getNoteContentAsync( @@ -7067,7 +7357,7 @@ AsyncResult * NoteStore::getNoteContentAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteContent_prepareParams( + QByteArray params = NoteStoreGetNoteContentPrepareParams( ctx->authenticationToken(), guid); @@ -7075,90 +7365,102 @@ AsyncResult * NoteStore::getNoteContentAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteContent_readReplyAsync); + NoteStoreGetNoteContentReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteSearchText_prepareParams( +QByteArray NoteStoreGetNoteSearchTextPrepareParams( QString authenticationToken, Guid guid, bool noteOnly, bool tokenizeForIndexing) { - QEC_DEBUG("note_store", "NoteStore_getNoteSearchText_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteSearchTextPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteSearchText"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteSearchText"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteSearchText_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteOnly"), ThriftFieldType::T_BOOL, 3); - w.writeBool(noteOnly); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(noteOnly); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("tokenizeForIndexing"), ThriftFieldType::T_BOOL, 4); - w.writeBool(tokenizeForIndexing); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(tokenizeForIndexing); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_getNoteSearchText_readReply(QByteArray reply) +QString NoteStoreGetNoteSearchTextReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteSearchText_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteSearchTextReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteSearchText")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -7168,56 +7470,56 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -7228,9 +7530,9 @@ QString NoteStore_getNoteSearchText_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteSearchText_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteSearchTextReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteSearchText_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteSearchTextReadReply(reply)); } } // namespace @@ -7250,7 +7552,7 @@ QString NoteStore::getNoteSearchText( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteSearchText_prepareParams( + QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( ctx->authenticationToken(), guid, noteOnly, @@ -7261,7 +7563,7 @@ QString NoteStore::getNoteSearchText( params, ctx->requestTimeout()); - return NoteStore_getNoteSearchText_readReply(reply); + return NoteStoreGetNoteSearchTextReadReply(reply); } AsyncResult * NoteStore::getNoteSearchTextAsync( @@ -7280,7 +7582,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteSearchText_prepareParams( + QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( ctx->authenticationToken(), guid, noteOnly, @@ -7290,76 +7592,84 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteSearchText_readReplyAsync); + NoteStoreGetNoteSearchTextReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceSearchText_prepareParams( +QByteArray NoteStoreGetResourceSearchTextPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceSearchText_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceSearchTextPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceSearchText"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceSearchText"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceSearchText_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_getResourceSearchText_readReply(QByteArray reply) +QString NoteStoreGetResourceSearchTextReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceSearchText_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceSearchTextReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceSearchText")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -7369,56 +7679,56 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -7429,9 +7739,9 @@ QString NoteStore_getResourceSearchText_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceSearchText_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceSearchTextReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceSearchText_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceSearchTextReadReply(reply)); } } // namespace @@ -7447,7 +7757,7 @@ QString NoteStore::getResourceSearchText( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceSearchText_prepareParams( + QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( ctx->authenticationToken(), guid); @@ -7456,7 +7766,7 @@ QString NoteStore::getResourceSearchText( params, ctx->requestTimeout()); - return NoteStore_getResourceSearchText_readReply(reply); + return NoteStoreGetResourceSearchTextReadReply(reply); } AsyncResult * NoteStore::getResourceSearchTextAsync( @@ -7471,7 +7781,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceSearchText_prepareParams( + QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( ctx->authenticationToken(), guid); @@ -7479,76 +7789,84 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceSearchText_readReplyAsync); + NoteStoreGetResourceSearchTextReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteTagNames_prepareParams( +QByteArray NoteStoreGetNoteTagNamesPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getNoteTagNames_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteTagNamesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteTagNames"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteTagNames"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteTagNames_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) +QStringList NoteStoreGetNoteTagNamesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteTagNames_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteTagNamesReadReply"); bool resultIsSet = false; QStringList result = QStringList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteTagNames")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -7560,7 +7878,7 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -7569,59 +7887,59 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -7632,9 +7950,9 @@ QStringList NoteStore_getNoteTagNames_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteTagNames_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteTagNamesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteTagNames_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteTagNamesReadReply(reply)); } } // namespace @@ -7650,7 +7968,7 @@ QStringList NoteStore::getNoteTagNames( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteTagNames_prepareParams( + QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( ctx->authenticationToken(), guid); @@ -7659,7 +7977,7 @@ QStringList NoteStore::getNoteTagNames( params, ctx->requestTimeout()); - return NoteStore_getNoteTagNames_readReply(reply); + return NoteStoreGetNoteTagNamesReadReply(reply); } AsyncResult * NoteStore::getNoteTagNamesAsync( @@ -7674,7 +7992,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteTagNames_prepareParams( + QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( ctx->authenticationToken(), guid); @@ -7682,76 +8000,84 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteTagNames_readReplyAsync); + NoteStoreGetNoteTagNamesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createNote_prepareParams( +QByteArray NoteStoreCreateNotePrepareParams( QString authenticationToken, const Note & note) { - QEC_DEBUG("note_store", "NoteStore_createNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); - writeNote(w, note); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNote(writer, note); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_createNote_readReply(QByteArray reply) +Note NoteStoreCreateNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateNoteReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -7761,56 +8087,56 @@ Note NoteStore_createNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -7821,9 +8147,9 @@ Note NoteStore_createNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_createNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createNote_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateNoteReadReply(reply)); } } // namespace @@ -7839,7 +8165,7 @@ Note NoteStore::createNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createNote_prepareParams( + QByteArray params = NoteStoreCreateNotePrepareParams( ctx->authenticationToken(), note); @@ -7848,7 +8174,7 @@ Note NoteStore::createNote( params, ctx->requestTimeout()); - return NoteStore_createNote_readReply(reply); + return NoteStoreCreateNoteReadReply(reply); } AsyncResult * NoteStore::createNoteAsync( @@ -7863,7 +8189,7 @@ AsyncResult * NoteStore::createNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createNote_prepareParams( + QByteArray params = NoteStoreCreateNotePrepareParams( ctx->authenticationToken(), note); @@ -7871,76 +8197,84 @@ AsyncResult * NoteStore::createNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createNote_readReplyAsync); + NoteStoreCreateNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateNote_prepareParams( +QByteArray NoteStoreUpdateNotePrepareParams( QString authenticationToken, const Note & note) { - QEC_DEBUG("note_store", "NoteStore_updateNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); - writeNote(w, note); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNote(writer, note); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_updateNote_readReply(QByteArray reply) +Note NoteStoreUpdateNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateNoteReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -7950,56 +8284,56 @@ Note NoteStore_updateNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -8010,9 +8344,9 @@ Note NoteStore_updateNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateNote_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateNoteReadReply(reply)); } } // namespace @@ -8028,7 +8362,7 @@ Note NoteStore::updateNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateNote_prepareParams( + QByteArray params = NoteStoreUpdateNotePrepareParams( ctx->authenticationToken(), note); @@ -8037,7 +8371,7 @@ Note NoteStore::updateNote( params, ctx->requestTimeout()); - return NoteStore_updateNote_readReply(reply); + return NoteStoreUpdateNoteReadReply(reply); } AsyncResult * NoteStore::updateNoteAsync( @@ -8052,7 +8386,7 @@ AsyncResult * NoteStore::updateNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateNote_prepareParams( + QByteArray params = NoteStoreUpdateNotePrepareParams( ctx->authenticationToken(), note); @@ -8060,76 +8394,84 @@ AsyncResult * NoteStore::updateNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateNote_readReplyAsync); + NoteStoreUpdateNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_deleteNote_prepareParams( +QByteArray NoteStoreDeleteNotePrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_deleteNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreDeleteNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("deleteNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("deleteNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_deleteNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_deleteNote_readReply(QByteArray reply) +qint32 NoteStoreDeleteNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_deleteNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreDeleteNoteReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("deleteNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -8139,56 +8481,56 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -8199,9 +8541,9 @@ qint32 NoteStore_deleteNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_deleteNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreDeleteNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_deleteNote_readReply(reply)); + return QVariant::fromValue(NoteStoreDeleteNoteReadReply(reply)); } } // namespace @@ -8217,7 +8559,7 @@ qint32 NoteStore::deleteNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_deleteNote_prepareParams( + QByteArray params = NoteStoreDeleteNotePrepareParams( ctx->authenticationToken(), guid); @@ -8226,7 +8568,7 @@ qint32 NoteStore::deleteNote( params, ctx->requestTimeout()); - return NoteStore_deleteNote_readReply(reply); + return NoteStoreDeleteNoteReadReply(reply); } AsyncResult * NoteStore::deleteNoteAsync( @@ -8241,7 +8583,7 @@ AsyncResult * NoteStore::deleteNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_deleteNote_prepareParams( + QByteArray params = NoteStoreDeleteNotePrepareParams( ctx->authenticationToken(), guid); @@ -8249,76 +8591,84 @@ AsyncResult * NoteStore::deleteNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_deleteNote_readReplyAsync); + NoteStoreDeleteNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_expungeNote_prepareParams( +QByteArray NoteStoreExpungeNotePrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_expungeNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreExpungeNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("expungeNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("expungeNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_expungeNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_expungeNote_readReply(QByteArray reply) +qint32 NoteStoreExpungeNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_expungeNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreExpungeNoteReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -8328,56 +8678,56 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -8388,9 +8738,9 @@ qint32 NoteStore_expungeNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_expungeNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreExpungeNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_expungeNote_readReply(reply)); + return QVariant::fromValue(NoteStoreExpungeNoteReadReply(reply)); } } // namespace @@ -8406,7 +8756,7 @@ qint32 NoteStore::expungeNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_expungeNote_prepareParams( + QByteArray params = NoteStoreExpungeNotePrepareParams( ctx->authenticationToken(), guid); @@ -8415,7 +8765,7 @@ qint32 NoteStore::expungeNote( params, ctx->requestTimeout()); - return NoteStore_expungeNote_readReply(reply); + return NoteStoreExpungeNoteReadReply(reply); } AsyncResult * NoteStore::expungeNoteAsync( @@ -8430,7 +8780,7 @@ AsyncResult * NoteStore::expungeNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_expungeNote_prepareParams( + QByteArray params = NoteStoreExpungeNotePrepareParams( ctx->authenticationToken(), guid); @@ -8438,83 +8788,93 @@ AsyncResult * NoteStore::expungeNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_expungeNote_readReplyAsync); + NoteStoreExpungeNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_copyNote_prepareParams( +QByteArray NoteStoreCopyNotePrepareParams( QString authenticationToken, Guid noteGuid, Guid toNotebookGuid) { - QEC_DEBUG("note_store", "NoteStore_copyNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCopyNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("copyNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("copyNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_copyNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(noteGuid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(noteGuid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("toNotebookGuid"), ThriftFieldType::T_STRING, 3); - w.writeString(toNotebookGuid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(toNotebookGuid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_copyNote_readReply(QByteArray reply) +Note NoteStoreCopyNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_copyNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreCopyNoteReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("copyNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -8524,56 +8884,56 @@ Note NoteStore_copyNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -8584,9 +8944,9 @@ Note NoteStore_copyNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_copyNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreCopyNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_copyNote_readReply(reply)); + return QVariant::fromValue(NoteStoreCopyNoteReadReply(reply)); } } // namespace @@ -8604,7 +8964,7 @@ Note NoteStore::copyNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_copyNote_prepareParams( + QByteArray params = NoteStoreCopyNotePrepareParams( ctx->authenticationToken(), noteGuid, toNotebookGuid); @@ -8614,7 +8974,7 @@ Note NoteStore::copyNote( params, ctx->requestTimeout()); - return NoteStore_copyNote_readReply(reply); + return NoteStoreCopyNoteReadReply(reply); } AsyncResult * NoteStore::copyNoteAsync( @@ -8631,7 +8991,7 @@ AsyncResult * NoteStore::copyNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_copyNote_prepareParams( + QByteArray params = NoteStoreCopyNotePrepareParams( ctx->authenticationToken(), noteGuid, toNotebookGuid); @@ -8640,76 +9000,84 @@ AsyncResult * NoteStore::copyNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_copyNote_readReplyAsync); + NoteStoreCopyNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listNoteVersions_prepareParams( +QByteArray NoteStoreListNoteVersionsPrepareParams( QString authenticationToken, Guid noteGuid) { - QEC_DEBUG("note_store", "NoteStore_listNoteVersions_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListNoteVersionsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listNoteVersions"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listNoteVersions"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listNoteVersions_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(noteGuid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(noteGuid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listNoteVersions_readReply(QByteArray reply) +QList NoteStoreListNoteVersionsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listNoteVersions_readReply"); + QEC_DEBUG("note_store", "NoteStoreListNoteVersionsReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listNoteVersions")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -8721,7 +9089,7 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -8730,59 +9098,59 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { NoteVersionId elem; - readNoteVersionId(r, elem); + readNoteVersionId(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -8793,9 +9161,9 @@ QList NoteStore_listNoteVersions_readReply(QByteArray reply) return result; } -QVariant NoteStore_listNoteVersions_readReplyAsync(QByteArray reply) +QVariant NoteStoreListNoteVersionsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listNoteVersions_readReply(reply)); + return QVariant::fromValue(NoteStoreListNoteVersionsReadReply(reply)); } } // namespace @@ -8811,7 +9179,7 @@ QList NoteStore::listNoteVersions( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listNoteVersions_prepareParams( + QByteArray params = NoteStoreListNoteVersionsPrepareParams( ctx->authenticationToken(), noteGuid); @@ -8820,7 +9188,7 @@ QList NoteStore::listNoteVersions( params, ctx->requestTimeout()); - return NoteStore_listNoteVersions_readReply(reply); + return NoteStoreListNoteVersionsReadReply(reply); } AsyncResult * NoteStore::listNoteVersionsAsync( @@ -8835,7 +9203,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listNoteVersions_prepareParams( + QByteArray params = NoteStoreListNoteVersionsPrepareParams( ctx->authenticationToken(), noteGuid); @@ -8843,14 +9211,14 @@ AsyncResult * NoteStore::listNoteVersionsAsync( m_url, params, ctx->requestTimeout(), - NoteStore_listNoteVersions_readReplyAsync); + NoteStoreListNoteVersionsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNoteVersion_prepareParams( +QByteArray NoteStoreGetNoteVersionPrepareParams( QString authenticationToken, Guid noteGuid, qint32 updateSequenceNum, @@ -8858,89 +9226,105 @@ QByteArray NoteStore_getNoteVersion_prepareParams( bool withResourcesRecognition, bool withResourcesAlternateData) { - QEC_DEBUG("note_store", "NoteStore_getNoteVersion_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNoteVersionPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNoteVersion"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNoteVersion"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNoteVersion_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(noteGuid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(noteGuid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 3); - w.writeI32(updateSequenceNum); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(updateSequenceNum); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesData"), ThriftFieldType::T_BOOL, 4); - w.writeBool(withResourcesData); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withResourcesData); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesRecognition"), ThriftFieldType::T_BOOL, 5); - w.writeBool(withResourcesRecognition); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withResourcesRecognition); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withResourcesAlternateData"), ThriftFieldType::T_BOOL, 6); - w.writeBool(withResourcesAlternateData); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(withResourcesAlternateData); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Note NoteStore_getNoteVersion_readReply(QByteArray reply) +Note NoteStoreGetNoteVersionReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNoteVersion_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNoteVersionReadReply"); bool resultIsSet = false; Note result = Note(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNoteVersion")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -8950,56 +9334,56 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Note v; - readNote(r, v); + readNote(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -9010,9 +9394,9 @@ Note NoteStore_getNoteVersion_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNoteVersion_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNoteVersionReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNoteVersion_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNoteVersionReadReply(reply)); } } // namespace @@ -9036,7 +9420,7 @@ Note NoteStore::getNoteVersion( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNoteVersion_prepareParams( + QByteArray params = NoteStoreGetNoteVersionPrepareParams( ctx->authenticationToken(), noteGuid, updateSequenceNum, @@ -9049,7 +9433,7 @@ Note NoteStore::getNoteVersion( params, ctx->requestTimeout()); - return NoteStore_getNoteVersion_readReply(reply); + return NoteStoreGetNoteVersionReadReply(reply); } AsyncResult * NoteStore::getNoteVersionAsync( @@ -9072,7 +9456,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNoteVersion_prepareParams( + QByteArray params = NoteStoreGetNoteVersionPrepareParams( ctx->authenticationToken(), noteGuid, updateSequenceNum, @@ -9084,14 +9468,14 @@ AsyncResult * NoteStore::getNoteVersionAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNoteVersion_readReplyAsync); + NoteStoreGetNoteVersionReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResource_prepareParams( +QByteArray NoteStoreGetResourcePrepareParams( QString authenticationToken, Guid guid, bool withData, @@ -9099,89 +9483,105 @@ QByteArray NoteStore_getResource_prepareParams( bool withAttributes, bool withAlternateData) { - QEC_DEBUG("note_store", "NoteStore_getResource_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourcePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResource"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResource"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResource_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withData"), ThriftFieldType::T_BOOL, 3); - w.writeBool(withData); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withData); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withRecognition"), ThriftFieldType::T_BOOL, 4); - w.writeBool(withRecognition); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withRecognition); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withAttributes"), ThriftFieldType::T_BOOL, 5); - w.writeBool(withAttributes); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withAttributes); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withAlternateData"), ThriftFieldType::T_BOOL, 6); - w.writeBool(withAlternateData); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(withAlternateData); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Resource NoteStore_getResource_readReply(QByteArray reply) +Resource NoteStoreGetResourceReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResource_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceReadReply"); bool resultIsSet = false; Resource result = Resource(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResource")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -9191,56 +9591,56 @@ Resource NoteStore_getResource_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; - readResource(r, v); + readResource(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -9251,9 +9651,9 @@ Resource NoteStore_getResource_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResource_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResource_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceReadReply(reply)); } } // namespace @@ -9277,7 +9677,7 @@ Resource NoteStore::getResource( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResource_prepareParams( + QByteArray params = NoteStoreGetResourcePrepareParams( ctx->authenticationToken(), guid, withData, @@ -9290,7 +9690,7 @@ Resource NoteStore::getResource( params, ctx->requestTimeout()); - return NoteStore_getResource_readReply(reply); + return NoteStoreGetResourceReadReply(reply); } AsyncResult * NoteStore::getResourceAsync( @@ -9313,7 +9713,7 @@ AsyncResult * NoteStore::getResourceAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResource_prepareParams( + QByteArray params = NoteStoreGetResourcePrepareParams( ctx->authenticationToken(), guid, withData, @@ -9325,76 +9725,84 @@ AsyncResult * NoteStore::getResourceAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResource_readReplyAsync); + NoteStoreGetResourceReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceApplicationData_prepareParams( +QByteArray NoteStoreGetResourceApplicationDataPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceApplicationData_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceApplicationData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationData"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceApplicationData_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) +LazyMap NoteStoreGetResourceApplicationDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceApplicationData_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataReadReply"); bool resultIsSet = false; LazyMap result = LazyMap(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceApplicationData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -9404,56 +9812,56 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LazyMap v; - readLazyMap(r, v); + readLazyMap(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -9464,9 +9872,9 @@ LazyMap NoteStore_getResourceApplicationData_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceApplicationData_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceApplicationDataReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceApplicationData_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceApplicationDataReadReply(reply)); } } // namespace @@ -9482,7 +9890,7 @@ LazyMap NoteStore::getResourceApplicationData( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceApplicationData_prepareParams( + QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -9491,7 +9899,7 @@ LazyMap NoteStore::getResourceApplicationData( params, ctx->requestTimeout()); - return NoteStore_getResourceApplicationData_readReply(reply); + return NoteStoreGetResourceApplicationDataReadReply(reply); } AsyncResult * NoteStore::getResourceApplicationDataAsync( @@ -9506,7 +9914,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceApplicationData_prepareParams( + QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -9514,83 +9922,93 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceApplicationData_readReplyAsync); + NoteStoreGetResourceApplicationDataReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceApplicationDataEntry_prepareParams( +QByteArray NoteStoreGetResourceApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key) { - QEC_DEBUG("note_store", "NoteStore_getResourceApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) +QString NoteStoreGetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataEntryReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -9600,56 +10018,56 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -9660,9 +10078,9 @@ QString NoteStore_getResourceApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceApplicationDataEntryReadReply(reply)); } } // namespace @@ -9680,7 +10098,7 @@ QString NoteStore::getResourceApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -9690,7 +10108,7 @@ QString NoteStore::getResourceApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_getResourceApplicationDataEntry_readReply(reply); + return NoteStoreGetResourceApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( @@ -9707,7 +10125,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -9716,90 +10134,102 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceApplicationDataEntry_readReplyAsync); + NoteStoreGetResourceApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_setResourceApplicationDataEntry_prepareParams( +QByteArray NoteStoreSetResourceApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key, QString value) { - QEC_DEBUG("note_store", "NoteStore_setResourceApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreSetResourceApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("setResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("setResourceApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_setResourceApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("value"), ThriftFieldType::T_STRING, 4); - w.writeString(value); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(value); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) +qint32 NoteStoreSetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_setResourceApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreSetResourceApplicationDataEntryReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -9809,56 +10239,56 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -9869,9 +10299,9 @@ qint32 NoteStore_setResourceApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_setResourceApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreSetResourceApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_setResourceApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreSetResourceApplicationDataEntryReadReply(reply)); } } // namespace @@ -9891,7 +10321,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key, @@ -9902,7 +10332,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_setResourceApplicationDataEntry_readReply(reply); + return NoteStoreSetResourceApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( @@ -9921,7 +10351,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_setResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key, @@ -9931,83 +10361,93 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_setResourceApplicationDataEntry_readReplyAsync); + NoteStoreSetResourceApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_unsetResourceApplicationDataEntry_prepareParams( +QByteArray NoteStoreUnsetResourceApplicationDataEntryPrepareParams( QString authenticationToken, Guid guid, QString key) { - QEC_DEBUG("note_store", "NoteStore_unsetResourceApplicationDataEntry_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUnsetResourceApplicationDataEntryPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("unsetResourceApplicationDataEntry"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("unsetResourceApplicationDataEntry"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_unsetResourceApplicationDataEntry_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 3); - w.writeString(key); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(key); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) +qint32 NoteStoreUnsetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_unsetResourceApplicationDataEntry_readReply"); + QEC_DEBUG("note_store", "NoteStoreUnsetResourceApplicationDataEntryReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("unsetResourceApplicationDataEntry")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -10017,56 +10457,56 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -10077,9 +10517,9 @@ qint32 NoteStore_unsetResourceApplicationDataEntry_readReply(QByteArray reply) return result; } -QVariant NoteStore_unsetResourceApplicationDataEntry_readReplyAsync(QByteArray reply) +QVariant NoteStoreUnsetResourceApplicationDataEntryReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_unsetResourceApplicationDataEntry_readReply(reply)); + return QVariant::fromValue(NoteStoreUnsetResourceApplicationDataEntryReadReply(reply)); } } // namespace @@ -10097,7 +10537,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -10107,7 +10547,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( params, ctx->requestTimeout()); - return NoteStore_unsetResourceApplicationDataEntry_readReply(reply); + return NoteStoreUnsetResourceApplicationDataEntryReadReply(reply); } AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( @@ -10124,7 +10564,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( ctx = m_ctx; } - QByteArray params = NoteStore_unsetResourceApplicationDataEntry_prepareParams( + QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, key); @@ -10133,76 +10573,84 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), - NoteStore_unsetResourceApplicationDataEntry_readReplyAsync); + NoteStoreUnsetResourceApplicationDataEntryReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateResource_prepareParams( +QByteArray NoteStoreUpdateResourcePrepareParams( QString authenticationToken, const Resource & resource) { - QEC_DEBUG("note_store", "NoteStore_updateResource_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateResourcePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateResource"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateResource"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateResource_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("resource"), ThriftFieldType::T_STRUCT, 2); - writeResource(w, resource); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeResource(writer, resource); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateResource_readReply(QByteArray reply) +qint32 NoteStoreUpdateResourceReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateResource_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateResourceReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateResource")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -10212,56 +10660,56 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -10272,9 +10720,9 @@ qint32 NoteStore_updateResource_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateResource_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateResourceReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateResource_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateResourceReadReply(reply)); } } // namespace @@ -10290,7 +10738,7 @@ qint32 NoteStore::updateResource( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateResource_prepareParams( + QByteArray params = NoteStoreUpdateResourcePrepareParams( ctx->authenticationToken(), resource); @@ -10299,7 +10747,7 @@ qint32 NoteStore::updateResource( params, ctx->requestTimeout()); - return NoteStore_updateResource_readReply(reply); + return NoteStoreUpdateResourceReadReply(reply); } AsyncResult * NoteStore::updateResourceAsync( @@ -10314,7 +10762,7 @@ AsyncResult * NoteStore::updateResourceAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateResource_prepareParams( + QByteArray params = NoteStoreUpdateResourcePrepareParams( ctx->authenticationToken(), resource); @@ -10322,76 +10770,84 @@ AsyncResult * NoteStore::updateResourceAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateResource_readReplyAsync); + NoteStoreUpdateResourceReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceData_prepareParams( +QByteArray NoteStoreGetResourceDataPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceData_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceDataPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceData"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceData_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QByteArray NoteStore_getResourceData_readReply(QByteArray reply) +QByteArray NoteStoreGetResourceDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceData_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceDataReadReply"); bool resultIsSet = false; QByteArray result = QByteArray(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -10401,56 +10857,56 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; - r.readBinary(v); + reader.readBinary(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -10461,9 +10917,9 @@ QByteArray NoteStore_getResourceData_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceData_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceDataReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceData_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceDataReadReply(reply)); } } // namespace @@ -10479,7 +10935,7 @@ QByteArray NoteStore::getResourceData( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceData_prepareParams( + QByteArray params = NoteStoreGetResourceDataPrepareParams( ctx->authenticationToken(), guid); @@ -10488,7 +10944,7 @@ QByteArray NoteStore::getResourceData( params, ctx->requestTimeout()); - return NoteStore_getResourceData_readReply(reply); + return NoteStoreGetResourceDataReadReply(reply); } AsyncResult * NoteStore::getResourceDataAsync( @@ -10503,7 +10959,7 @@ AsyncResult * NoteStore::getResourceDataAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceData_prepareParams( + QByteArray params = NoteStoreGetResourceDataPrepareParams( ctx->authenticationToken(), guid); @@ -10511,14 +10967,14 @@ AsyncResult * NoteStore::getResourceDataAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceData_readReplyAsync); + NoteStoreGetResourceDataReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceByHash_prepareParams( +QByteArray NoteStoreGetResourceByHashPrepareParams( QString authenticationToken, Guid noteGuid, QByteArray contentHash, @@ -10526,89 +10982,105 @@ QByteArray NoteStore_getResourceByHash_prepareParams( bool withRecognition, bool withAlternateData) { - QEC_DEBUG("note_store", "NoteStore_getResourceByHash_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceByHashPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceByHash"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceByHash"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceByHash_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(noteGuid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(noteGuid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("contentHash"), ThriftFieldType::T_STRING, 3); - w.writeBinary(contentHash); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBinary(contentHash); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withData"), ThriftFieldType::T_BOOL, 4); - w.writeBool(withData); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withData); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withRecognition"), ThriftFieldType::T_BOOL, 5); - w.writeBool(withRecognition); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeBool(withRecognition); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("withAlternateData"), ThriftFieldType::T_BOOL, 6); - w.writeBool(withAlternateData); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(withAlternateData); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Resource NoteStore_getResourceByHash_readReply(QByteArray reply) +Resource NoteStoreGetResourceByHashReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceByHash_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceByHashReadReply"); bool resultIsSet = false; Resource result = Resource(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceByHash")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -10618,56 +11090,56 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Resource v; - readResource(r, v); + readResource(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -10678,9 +11150,9 @@ Resource NoteStore_getResourceByHash_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceByHash_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceByHashReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceByHash_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceByHashReadReply(reply)); } } // namespace @@ -10704,7 +11176,7 @@ Resource NoteStore::getResourceByHash( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceByHash_prepareParams( + QByteArray params = NoteStoreGetResourceByHashPrepareParams( ctx->authenticationToken(), noteGuid, contentHash, @@ -10717,7 +11189,7 @@ Resource NoteStore::getResourceByHash( params, ctx->requestTimeout()); - return NoteStore_getResourceByHash_readReply(reply); + return NoteStoreGetResourceByHashReadReply(reply); } AsyncResult * NoteStore::getResourceByHashAsync( @@ -10740,7 +11212,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceByHash_prepareParams( + QByteArray params = NoteStoreGetResourceByHashPrepareParams( ctx->authenticationToken(), noteGuid, contentHash, @@ -10752,76 +11224,84 @@ AsyncResult * NoteStore::getResourceByHashAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceByHash_readReplyAsync); + NoteStoreGetResourceByHashReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceRecognition_prepareParams( +QByteArray NoteStoreGetResourceRecognitionPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceRecognition_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceRecognitionPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceRecognition"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceRecognition"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceRecognition_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) +QByteArray NoteStoreGetResourceRecognitionReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceRecognition_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceRecognitionReadReply"); bool resultIsSet = false; QByteArray result = QByteArray(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceRecognition")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -10831,56 +11311,56 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; - r.readBinary(v); + reader.readBinary(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -10891,9 +11371,9 @@ QByteArray NoteStore_getResourceRecognition_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceRecognition_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceRecognitionReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceRecognition_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceRecognitionReadReply(reply)); } } // namespace @@ -10909,7 +11389,7 @@ QByteArray NoteStore::getResourceRecognition( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceRecognition_prepareParams( + QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( ctx->authenticationToken(), guid); @@ -10918,7 +11398,7 @@ QByteArray NoteStore::getResourceRecognition( params, ctx->requestTimeout()); - return NoteStore_getResourceRecognition_readReply(reply); + return NoteStoreGetResourceRecognitionReadReply(reply); } AsyncResult * NoteStore::getResourceRecognitionAsync( @@ -10933,7 +11413,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceRecognition_prepareParams( + QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( ctx->authenticationToken(), guid); @@ -10941,76 +11421,84 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceRecognition_readReplyAsync); + NoteStoreGetResourceRecognitionReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceAlternateData_prepareParams( +QByteArray NoteStoreGetResourceAlternateDataPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceAlternateData_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceAlternateDataPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceAlternateData"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceAlternateData"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceAlternateData_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) +QByteArray NoteStoreGetResourceAlternateDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceAlternateData_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceAlternateDataReadReply"); bool resultIsSet = false; QByteArray result = QByteArray(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceAlternateData")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11020,56 +11508,56 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QByteArray v; - r.readBinary(v); + reader.readBinary(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -11080,9 +11568,9 @@ QByteArray NoteStore_getResourceAlternateData_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceAlternateData_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceAlternateDataReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceAlternateData_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceAlternateDataReadReply(reply)); } } // namespace @@ -11098,7 +11586,7 @@ QByteArray NoteStore::getResourceAlternateData( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceAlternateData_prepareParams( + QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( ctx->authenticationToken(), guid); @@ -11107,7 +11595,7 @@ QByteArray NoteStore::getResourceAlternateData( params, ctx->requestTimeout()); - return NoteStore_getResourceAlternateData_readReply(reply); + return NoteStoreGetResourceAlternateDataReadReply(reply); } AsyncResult * NoteStore::getResourceAlternateDataAsync( @@ -11122,7 +11610,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceAlternateData_prepareParams( + QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( ctx->authenticationToken(), guid); @@ -11130,76 +11618,84 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceAlternateData_readReplyAsync); + NoteStoreGetResourceAlternateDataReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getResourceAttributes_prepareParams( +QByteArray NoteStoreGetResourceAttributesPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_getResourceAttributes_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetResourceAttributesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getResourceAttributes"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getResourceAttributes"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getResourceAttributes_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) +ResourceAttributes NoteStoreGetResourceAttributesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getResourceAttributes_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetResourceAttributesReadReply"); bool resultIsSet = false; ResourceAttributes result = ResourceAttributes(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getResourceAttributes")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11209,56 +11705,56 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ResourceAttributes v; - readResourceAttributes(r, v); + readResourceAttributes(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -11269,9 +11765,9 @@ ResourceAttributes NoteStore_getResourceAttributes_readReply(QByteArray reply) return result; } -QVariant NoteStore_getResourceAttributes_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetResourceAttributesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getResourceAttributes_readReply(reply)); + return QVariant::fromValue(NoteStoreGetResourceAttributesReadReply(reply)); } } // namespace @@ -11287,7 +11783,7 @@ ResourceAttributes NoteStore::getResourceAttributes( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getResourceAttributes_prepareParams( + QByteArray params = NoteStoreGetResourceAttributesPrepareParams( ctx->authenticationToken(), guid); @@ -11296,7 +11792,7 @@ ResourceAttributes NoteStore::getResourceAttributes( params, ctx->requestTimeout()); - return NoteStore_getResourceAttributes_readReply(reply); + return NoteStoreGetResourceAttributesReadReply(reply); } AsyncResult * NoteStore::getResourceAttributesAsync( @@ -11311,7 +11807,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getResourceAttributes_prepareParams( + QByteArray params = NoteStoreGetResourceAttributesPrepareParams( ctx->authenticationToken(), guid); @@ -11319,76 +11815,84 @@ AsyncResult * NoteStore::getResourceAttributesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getResourceAttributes_readReplyAsync); + NoteStoreGetResourceAttributesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getPublicNotebook_prepareParams( +QByteArray NoteStoreGetPublicNotebookPrepareParams( UserID userId, QString publicUri) { - QEC_DEBUG("note_store", "NoteStore_getPublicNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetPublicNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getPublicNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getPublicNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getPublicNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userId"), ThriftFieldType::T_I32, 1); - w.writeI32(userId); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(userId); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("publicUri"), ThriftFieldType::T_STRING, 2); - w.writeString(publicUri); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(publicUri); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) +Notebook NoteStoreGetPublicNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getPublicNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetPublicNotebookReadReply"); bool resultIsSet = false; Notebook result = Notebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getPublicNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11398,45 +11902,45 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; - readNotebook(r, v); + readNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -11447,9 +11951,9 @@ Notebook NoteStore_getPublicNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_getPublicNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetPublicNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getPublicNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreGetPublicNotebookReadReply(reply)); } } // namespace @@ -11467,7 +11971,7 @@ Notebook NoteStore::getPublicNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getPublicNotebook_prepareParams( + QByteArray params = NoteStoreGetPublicNotebookPrepareParams( userId, publicUri); @@ -11476,7 +11980,7 @@ Notebook NoteStore::getPublicNotebook( params, ctx->requestTimeout()); - return NoteStore_getPublicNotebook_readReply(reply); + return NoteStoreGetPublicNotebookReadReply(reply); } AsyncResult * NoteStore::getPublicNotebookAsync( @@ -11493,7 +11997,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getPublicNotebook_prepareParams( + QByteArray params = NoteStoreGetPublicNotebookPrepareParams( userId, publicUri); @@ -11501,83 +12005,93 @@ AsyncResult * NoteStore::getPublicNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getPublicNotebook_readReplyAsync); + NoteStoreGetPublicNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_shareNotebook_prepareParams( +QByteArray NoteStoreShareNotebookPrepareParams( QString authenticationToken, const SharedNotebook & sharedNotebook, QString message) { - QEC_DEBUG("note_store", "NoteStore_shareNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreShareNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("shareNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("shareNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_shareNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("sharedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeSharedNotebook(w, sharedNotebook); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeSharedNotebook(writer, sharedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("message"), ThriftFieldType::T_STRING, 3); - w.writeString(message); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(message); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) +SharedNotebook NoteStoreShareNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_shareNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreShareNotebookReadReply"); bool resultIsSet = false; SharedNotebook result = SharedNotebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("shareNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11587,56 +12101,56 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; - readSharedNotebook(r, v); + readSharedNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -11647,9 +12161,9 @@ SharedNotebook NoteStore_shareNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_shareNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreShareNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_shareNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreShareNotebookReadReply(reply)); } } // namespace @@ -11667,7 +12181,7 @@ SharedNotebook NoteStore::shareNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_shareNotebook_prepareParams( + QByteArray params = NoteStoreShareNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook, message); @@ -11677,7 +12191,7 @@ SharedNotebook NoteStore::shareNotebook( params, ctx->requestTimeout()); - return NoteStore_shareNotebook_readReply(reply); + return NoteStoreShareNotebookReadReply(reply); } AsyncResult * NoteStore::shareNotebookAsync( @@ -11694,7 +12208,7 @@ AsyncResult * NoteStore::shareNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_shareNotebook_prepareParams( + QByteArray params = NoteStoreShareNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook, message); @@ -11703,76 +12217,84 @@ AsyncResult * NoteStore::shareNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_shareNotebook_readReplyAsync); + NoteStoreShareNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createOrUpdateNotebookShares_prepareParams( +QByteArray NoteStoreCreateOrUpdateNotebookSharesPrepareParams( QString authenticationToken, const NotebookShareTemplate & shareTemplate) { - QEC_DEBUG("note_store", "NoteStore_createOrUpdateNotebookShares_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateOrUpdateNotebookSharesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createOrUpdateNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createOrUpdateNotebookShares"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createOrUpdateNotebookShares_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("shareTemplate"), ThriftFieldType::T_STRUCT, 2); - writeNotebookShareTemplate(w, shareTemplate); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNotebookShareTemplate(writer, shareTemplate); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readReply(QByteArray reply) +CreateOrUpdateNotebookSharesResult NoteStoreCreateOrUpdateNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createOrUpdateNotebookShares_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateOrUpdateNotebookSharesReadReply"); bool resultIsSet = false; CreateOrUpdateNotebookSharesResult result = CreateOrUpdateNotebookSharesResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createOrUpdateNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11782,67 +12304,67 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; CreateOrUpdateNotebookSharesResult v; - readCreateOrUpdateNotebookSharesResult(r, v); + readCreateOrUpdateNotebookSharesResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMInvalidContactsException e; - readEDAMInvalidContactsException(r, e); + readEDAMInvalidContactsException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -11853,9 +12375,9 @@ CreateOrUpdateNotebookSharesResult NoteStore_createOrUpdateNotebookShares_readRe return result; } -QVariant NoteStore_createOrUpdateNotebookShares_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateOrUpdateNotebookSharesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createOrUpdateNotebookShares_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateOrUpdateNotebookSharesReadReply(reply)); } } // namespace @@ -11871,7 +12393,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( + QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( ctx->authenticationToken(), shareTemplate); @@ -11880,7 +12402,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( params, ctx->requestTimeout()); - return NoteStore_createOrUpdateNotebookShares_readReply(reply); + return NoteStoreCreateOrUpdateNotebookSharesReadReply(reply); } AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( @@ -11895,7 +12417,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createOrUpdateNotebookShares_prepareParams( + QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( ctx->authenticationToken(), shareTemplate); @@ -11903,76 +12425,84 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createOrUpdateNotebookShares_readReplyAsync); + NoteStoreCreateOrUpdateNotebookSharesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateSharedNotebook_prepareParams( +QByteArray NoteStoreUpdateSharedNotebookPrepareParams( QString authenticationToken, const SharedNotebook & sharedNotebook) { - QEC_DEBUG("note_store", "NoteStore_updateSharedNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateSharedNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateSharedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateSharedNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateSharedNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("sharedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeSharedNotebook(w, sharedNotebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeSharedNotebook(writer, sharedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) +qint32 NoteStoreUpdateSharedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateSharedNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateSharedNotebookReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateSharedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -11982,56 +12512,56 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -12042,9 +12572,9 @@ qint32 NoteStore_updateSharedNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateSharedNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateSharedNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateSharedNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateSharedNotebookReadReply(reply)); } } // namespace @@ -12060,7 +12590,7 @@ qint32 NoteStore::updateSharedNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateSharedNotebook_prepareParams( + QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook); @@ -12069,7 +12599,7 @@ qint32 NoteStore::updateSharedNotebook( params, ctx->requestTimeout()); - return NoteStore_updateSharedNotebook_readReply(reply); + return NoteStoreUpdateSharedNotebookReadReply(reply); } AsyncResult * NoteStore::updateSharedNotebookAsync( @@ -12084,7 +12614,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateSharedNotebook_prepareParams( + QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook); @@ -12092,83 +12622,93 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateSharedNotebook_readReplyAsync); + NoteStoreUpdateSharedNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_setNotebookRecipientSettings_prepareParams( +QByteArray NoteStoreSetNotebookRecipientSettingsPrepareParams( QString authenticationToken, QString notebookGuid, const NotebookRecipientSettings & recipientSettings) { - QEC_DEBUG("note_store", "NoteStore_setNotebookRecipientSettings_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreSetNotebookRecipientSettingsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("setNotebookRecipientSettings"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("setNotebookRecipientSettings"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_setNotebookRecipientSettings_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(notebookGuid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(notebookGuid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 3); - writeNotebookRecipientSettings(w, recipientSettings); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNotebookRecipientSettings(writer, recipientSettings); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) +Notebook NoteStoreSetNotebookRecipientSettingsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_setNotebookRecipientSettings_readReply"); + QEC_DEBUG("note_store", "NoteStoreSetNotebookRecipientSettingsReadReply"); bool resultIsSet = false; Notebook result = Notebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("setNotebookRecipientSettings")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -12178,56 +12718,56 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; Notebook v; - readNotebook(r, v); + readNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -12238,9 +12778,9 @@ Notebook NoteStore_setNotebookRecipientSettings_readReply(QByteArray reply) return result; } -QVariant NoteStore_setNotebookRecipientSettings_readReplyAsync(QByteArray reply) +QVariant NoteStoreSetNotebookRecipientSettingsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_setNotebookRecipientSettings_readReply(reply)); + return QVariant::fromValue(NoteStoreSetNotebookRecipientSettingsReadReply(reply)); } } // namespace @@ -12258,7 +12798,7 @@ Notebook NoteStore::setNotebookRecipientSettings( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( + QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( ctx->authenticationToken(), notebookGuid, recipientSettings); @@ -12268,7 +12808,7 @@ Notebook NoteStore::setNotebookRecipientSettings( params, ctx->requestTimeout()); - return NoteStore_setNotebookRecipientSettings_readReply(reply); + return NoteStoreSetNotebookRecipientSettingsReadReply(reply); } AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( @@ -12285,7 +12825,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( ctx = m_ctx; } - QByteArray params = NoteStore_setNotebookRecipientSettings_prepareParams( + QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( ctx->authenticationToken(), notebookGuid, recipientSettings); @@ -12294,69 +12834,75 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( m_url, params, ctx->requestTimeout(), - NoteStore_setNotebookRecipientSettings_readReplyAsync); + NoteStoreSetNotebookRecipientSettingsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listSharedNotebooks_prepareParams( +QByteArray NoteStoreListSharedNotebooksPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listSharedNotebooks_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListSharedNotebooksPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listSharedNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listSharedNotebooks"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listSharedNotebooks_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) +QList NoteStoreListSharedNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listSharedNotebooks_readReply"); + QEC_DEBUG("note_store", "NoteStoreListSharedNotebooksReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listSharedNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -12368,7 +12914,7 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -12377,59 +12923,59 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; - readSharedNotebook(r, elem); + readSharedNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -12440,9 +12986,9 @@ QList NoteStore_listSharedNotebooks_readReply(QByteArray reply) return result; } -QVariant NoteStore_listSharedNotebooks_readReplyAsync(QByteArray reply) +QVariant NoteStoreListSharedNotebooksReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listSharedNotebooks_readReply(reply)); + return QVariant::fromValue(NoteStoreListSharedNotebooksReadReply(reply)); } } // namespace @@ -12455,7 +13001,7 @@ QList NoteStore::listSharedNotebooks( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listSharedNotebooks_prepareParams( + QByteArray params = NoteStoreListSharedNotebooksPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -12463,7 +13009,7 @@ QList NoteStore::listSharedNotebooks( params, ctx->requestTimeout()); - return NoteStore_listSharedNotebooks_readReply(reply); + return NoteStoreListSharedNotebooksReadReply(reply); } AsyncResult * NoteStore::listSharedNotebooksAsync( @@ -12475,83 +13021,91 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listSharedNotebooks_prepareParams( + QByteArray params = NoteStoreListSharedNotebooksPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listSharedNotebooks_readReplyAsync); + NoteStoreListSharedNotebooksReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_createLinkedNotebook_prepareParams( +QByteArray NoteStoreCreateLinkedNotebookPrepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { - QEC_DEBUG("note_store", "NoteStore_createLinkedNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreCreateLinkedNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("createLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("createLinkedNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_createLinkedNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeLinkedNotebook(w, linkedNotebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeLinkedNotebook(writer, linkedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) +LinkedNotebook NoteStoreCreateLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_createLinkedNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreCreateLinkedNotebookReadReply"); bool resultIsSet = false; LinkedNotebook result = LinkedNotebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("createLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -12561,56 +13115,56 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; LinkedNotebook v; - readLinkedNotebook(r, v); + readLinkedNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -12621,9 +13175,9 @@ LinkedNotebook NoteStore_createLinkedNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_createLinkedNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreCreateLinkedNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_createLinkedNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreCreateLinkedNotebookReadReply(reply)); } } // namespace @@ -12639,7 +13193,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_createLinkedNotebook_prepareParams( + QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -12648,7 +13202,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( params, ctx->requestTimeout()); - return NoteStore_createLinkedNotebook_readReply(reply); + return NoteStoreCreateLinkedNotebookReadReply(reply); } AsyncResult * NoteStore::createLinkedNotebookAsync( @@ -12663,7 +13217,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_createLinkedNotebook_prepareParams( + QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -12671,76 +13225,84 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_createLinkedNotebook_readReplyAsync); + NoteStoreCreateLinkedNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateLinkedNotebook_prepareParams( +QByteArray NoteStoreUpdateLinkedNotebookPrepareParams( QString authenticationToken, const LinkedNotebook & linkedNotebook) { - QEC_DEBUG("note_store", "NoteStore_updateLinkedNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateLinkedNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateLinkedNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateLinkedNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("linkedNotebook"), ThriftFieldType::T_STRUCT, 2); - writeLinkedNotebook(w, linkedNotebook); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeLinkedNotebook(writer, linkedNotebook); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) +qint32 NoteStoreUpdateLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateLinkedNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateLinkedNotebookReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -12750,56 +13312,56 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -12810,9 +13372,9 @@ qint32 NoteStore_updateLinkedNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_updateLinkedNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateLinkedNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateLinkedNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateLinkedNotebookReadReply(reply)); } } // namespace @@ -12828,7 +13390,7 @@ qint32 NoteStore::updateLinkedNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( + QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -12837,7 +13399,7 @@ qint32 NoteStore::updateLinkedNotebook( params, ctx->requestTimeout()); - return NoteStore_updateLinkedNotebook_readReply(reply); + return NoteStoreUpdateLinkedNotebookReadReply(reply); } AsyncResult * NoteStore::updateLinkedNotebookAsync( @@ -12852,7 +13414,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateLinkedNotebook_prepareParams( + QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -12860,69 +13422,75 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateLinkedNotebook_readReplyAsync); + NoteStoreUpdateLinkedNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_listLinkedNotebooks_prepareParams( +QByteArray NoteStoreListLinkedNotebooksPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_listLinkedNotebooks_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreListLinkedNotebooksPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listLinkedNotebooks"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listLinkedNotebooks"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_listLinkedNotebooks_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) +QList NoteStoreListLinkedNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_listLinkedNotebooks_readReply"); + QEC_DEBUG("note_store", "NoteStoreListLinkedNotebooksReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listLinkedNotebooks")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -12934,7 +13502,7 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -12943,59 +13511,59 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { LinkedNotebook elem; - readLinkedNotebook(r, elem); + readLinkedNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -13006,9 +13574,9 @@ QList NoteStore_listLinkedNotebooks_readReply(QByteArray reply) return result; } -QVariant NoteStore_listLinkedNotebooks_readReplyAsync(QByteArray reply) +QVariant NoteStoreListLinkedNotebooksReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_listLinkedNotebooks_readReply(reply)); + return QVariant::fromValue(NoteStoreListLinkedNotebooksReadReply(reply)); } } // namespace @@ -13021,7 +13589,7 @@ QList NoteStore::listLinkedNotebooks( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( + QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -13029,7 +13597,7 @@ QList NoteStore::listLinkedNotebooks( params, ctx->requestTimeout()); - return NoteStore_listLinkedNotebooks_readReply(reply); + return NoteStoreListLinkedNotebooksReadReply(reply); } AsyncResult * NoteStore::listLinkedNotebooksAsync( @@ -13041,83 +13609,91 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( ctx = m_ctx; } - QByteArray params = NoteStore_listLinkedNotebooks_prepareParams( + QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_listLinkedNotebooks_readReplyAsync); + NoteStoreListLinkedNotebooksReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_expungeLinkedNotebook_prepareParams( +QByteArray NoteStoreExpungeLinkedNotebookPrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_expungeLinkedNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreExpungeLinkedNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("expungeLinkedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("expungeLinkedNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_expungeLinkedNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) +qint32 NoteStoreExpungeLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_expungeLinkedNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreExpungeLinkedNotebookReadReply"); bool resultIsSet = false; qint32 result = qint32(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("expungeLinkedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -13127,56 +13703,56 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_I32) { resultIsSet = true; qint32 v; - r.readI32(v); + reader.readI32(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -13187,9 +13763,9 @@ qint32 NoteStore_expungeLinkedNotebook_readReply(QByteArray reply) return result; } -QVariant NoteStore_expungeLinkedNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreExpungeLinkedNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_expungeLinkedNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreExpungeLinkedNotebookReadReply(reply)); } } // namespace @@ -13205,7 +13781,7 @@ qint32 NoteStore::expungeLinkedNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( + QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -13214,7 +13790,7 @@ qint32 NoteStore::expungeLinkedNotebook( params, ctx->requestTimeout()); - return NoteStore_expungeLinkedNotebook_readReply(reply); + return NoteStoreExpungeLinkedNotebookReadReply(reply); } AsyncResult * NoteStore::expungeLinkedNotebookAsync( @@ -13229,7 +13805,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_expungeLinkedNotebook_prepareParams( + QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -13237,76 +13813,84 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_expungeLinkedNotebook_readReplyAsync); + NoteStoreExpungeLinkedNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_authenticateToSharedNotebook_prepareParams( +QByteArray NoteStoreAuthenticateToSharedNotebookPrepareParams( QString shareKeyOrGlobalId, QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNotebook_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNotebookPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("authenticateToSharedNotebook"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNotebook"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_authenticateToSharedNotebook_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shareKeyOrGlobalId"), ThriftFieldType::T_STRING, 1); - w.writeString(shareKeyOrGlobalId); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(shareKeyOrGlobalId); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 2); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray reply) +AuthenticationResult NoteStoreAuthenticateToSharedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNotebook_readReply"); + QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNotebookReadReply"); bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToSharedNotebook")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -13316,56 +13900,56 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; - readAuthenticationResult(r, v); + readAuthenticationResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -13376,9 +13960,9 @@ AuthenticationResult NoteStore_authenticateToSharedNotebook_readReply(QByteArray return result; } -QVariant NoteStore_authenticateToSharedNotebook_readReplyAsync(QByteArray reply) +QVariant NoteStoreAuthenticateToSharedNotebookReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_authenticateToSharedNotebook_readReply(reply)); + return QVariant::fromValue(NoteStoreAuthenticateToSharedNotebookReadReply(reply)); } } // namespace @@ -13394,7 +13978,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( + QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( shareKeyOrGlobalId, ctx->authenticationToken()); @@ -13403,7 +13987,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( params, ctx->requestTimeout()); - return NoteStore_authenticateToSharedNotebook_readReply(reply); + return NoteStoreAuthenticateToSharedNotebookReadReply(reply); } AsyncResult * NoteStore::authenticateToSharedNotebookAsync( @@ -13418,7 +14002,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( ctx = m_ctx; } - QByteArray params = NoteStore_authenticateToSharedNotebook_prepareParams( + QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( shareKeyOrGlobalId, ctx->authenticationToken()); @@ -13426,69 +14010,75 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( m_url, params, ctx->requestTimeout(), - NoteStore_authenticateToSharedNotebook_readReplyAsync); + NoteStoreAuthenticateToSharedNotebookReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getSharedNotebookByAuth_prepareParams( +QByteArray NoteStoreGetSharedNotebookByAuthPrepareParams( QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_getSharedNotebookByAuth_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetSharedNotebookByAuthPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getSharedNotebookByAuth"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getSharedNotebookByAuth"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getSharedNotebookByAuth_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) +SharedNotebook NoteStoreGetSharedNotebookByAuthReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getSharedNotebookByAuth_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetSharedNotebookByAuthReadReply"); bool resultIsSet = false; SharedNotebook result = SharedNotebook(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getSharedNotebookByAuth")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -13498,56 +14088,56 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; SharedNotebook v; - readSharedNotebook(r, v); + readSharedNotebook(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -13558,9 +14148,9 @@ SharedNotebook NoteStore_getSharedNotebookByAuth_readReply(QByteArray reply) return result; } -QVariant NoteStore_getSharedNotebookByAuth_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetSharedNotebookByAuthReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getSharedNotebookByAuth_readReply(reply)); + return QVariant::fromValue(NoteStoreGetSharedNotebookByAuthReadReply(reply)); } } // namespace @@ -13573,7 +14163,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( + QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -13581,7 +14171,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( params, ctx->requestTimeout()); - return NoteStore_getSharedNotebookByAuth_readReply(reply); + return NoteStoreGetSharedNotebookByAuthReadReply(reply); } AsyncResult * NoteStore::getSharedNotebookByAuthAsync( @@ -13593,81 +14183,89 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getSharedNotebookByAuth_prepareParams( + QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - NoteStore_getSharedNotebookByAuth_readReplyAsync); + NoteStoreGetSharedNotebookByAuthReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_emailNote_prepareParams( +QByteArray NoteStoreEmailNotePrepareParams( QString authenticationToken, const NoteEmailParameters & parameters) { - QEC_DEBUG("note_store", "NoteStore_emailNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreEmailNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("emailNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("emailNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_emailNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("parameters"), ThriftFieldType::T_STRUCT, 2); - writeNoteEmailParameters(w, parameters); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNoteEmailParameters(writer, parameters); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void NoteStore_emailNote_readReply(QByteArray reply) +void NoteStoreEmailNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_emailNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreEmailNoteReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("emailNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -13676,51 +14274,51 @@ void NoteStore_emailNote_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant NoteStore_emailNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreEmailNoteReadReplyAsync(QByteArray reply) { - NoteStore_emailNote_readReply(reply); + NoteStoreEmailNoteReadReply(reply); return QVariant(); } @@ -13737,7 +14335,7 @@ void NoteStore::emailNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_emailNote_prepareParams( + QByteArray params = NoteStoreEmailNotePrepareParams( ctx->authenticationToken(), parameters); @@ -13746,7 +14344,7 @@ void NoteStore::emailNote( params, ctx->requestTimeout()); - NoteStore_emailNote_readReply(reply); + NoteStoreEmailNoteReadReply(reply); } AsyncResult * NoteStore::emailNoteAsync( @@ -13761,7 +14359,7 @@ AsyncResult * NoteStore::emailNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_emailNote_prepareParams( + QByteArray params = NoteStoreEmailNotePrepareParams( ctx->authenticationToken(), parameters); @@ -13769,76 +14367,84 @@ AsyncResult * NoteStore::emailNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_emailNote_readReplyAsync); + NoteStoreEmailNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_shareNote_prepareParams( +QByteArray NoteStoreShareNotePrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_shareNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreShareNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("shareNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("shareNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_shareNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QString NoteStore_shareNote_readReply(QByteArray reply) +QString NoteStoreShareNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_shareNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreShareNoteReadReply"); bool resultIsSet = false; QString result = QString(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("shareNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -13848,56 +14454,56 @@ QString NoteStore_shareNote_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRING) { resultIsSet = true; QString v; - r.readString(v); + reader.readString(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -13908,9 +14514,9 @@ QString NoteStore_shareNote_readReply(QByteArray reply) return result; } -QVariant NoteStore_shareNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreShareNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_shareNote_readReply(reply)); + return QVariant::fromValue(NoteStoreShareNoteReadReply(reply)); } } // namespace @@ -13926,7 +14532,7 @@ QString NoteStore::shareNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_shareNote_prepareParams( + QByteArray params = NoteStoreShareNotePrepareParams( ctx->authenticationToken(), guid); @@ -13935,7 +14541,7 @@ QString NoteStore::shareNote( params, ctx->requestTimeout()); - return NoteStore_shareNote_readReply(reply); + return NoteStoreShareNoteReadReply(reply); } AsyncResult * NoteStore::shareNoteAsync( @@ -13950,7 +14556,7 @@ AsyncResult * NoteStore::shareNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_shareNote_prepareParams( + QByteArray params = NoteStoreShareNotePrepareParams( ctx->authenticationToken(), guid); @@ -13958,74 +14564,82 @@ AsyncResult * NoteStore::shareNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_shareNote_readReplyAsync); + NoteStoreShareNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_stopSharingNote_prepareParams( +QByteArray NoteStoreStopSharingNotePrepareParams( QString authenticationToken, Guid guid) { - QEC_DEBUG("note_store", "NoteStore_stopSharingNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreStopSharingNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("stopSharingNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("stopSharingNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_stopSharingNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 2); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void NoteStore_stopSharingNote_readReply(QByteArray reply) +void NoteStoreStopSharingNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_stopSharingNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreStopSharingNoteReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("stopSharingNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14034,51 +14648,51 @@ void NoteStore_stopSharingNote_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant NoteStore_stopSharingNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreStopSharingNoteReadReplyAsync(QByteArray reply) { - NoteStore_stopSharingNote_readReply(reply); + NoteStoreStopSharingNoteReadReply(reply); return QVariant(); } @@ -14095,7 +14709,7 @@ void NoteStore::stopSharingNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_stopSharingNote_prepareParams( + QByteArray params = NoteStoreStopSharingNotePrepareParams( ctx->authenticationToken(), guid); @@ -14104,7 +14718,7 @@ void NoteStore::stopSharingNote( params, ctx->requestTimeout()); - NoteStore_stopSharingNote_readReply(reply); + NoteStoreStopSharingNoteReadReply(reply); } AsyncResult * NoteStore::stopSharingNoteAsync( @@ -14119,7 +14733,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_stopSharingNote_prepareParams( + QByteArray params = NoteStoreStopSharingNotePrepareParams( ctx->authenticationToken(), guid); @@ -14127,83 +14741,93 @@ AsyncResult * NoteStore::stopSharingNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_stopSharingNote_readReplyAsync); + NoteStoreStopSharingNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_authenticateToSharedNote_prepareParams( +QByteArray NoteStoreAuthenticateToSharedNotePrepareParams( QString guid, QString noteKey, QString authenticationToken) { - QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNote_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNotePrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("authenticateToSharedNote"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_authenticateToSharedNote_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(guid); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(guid); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("noteKey"), ThriftFieldType::T_STRING, 2); - w.writeString(noteKey); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(noteKey); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 3); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray reply) +AuthenticationResult NoteStoreAuthenticateToSharedNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_authenticateToSharedNote_readReply"); + QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNoteReadReply"); bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToSharedNote")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14213,56 +14837,56 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; - readAuthenticationResult(r, v); + readAuthenticationResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -14273,9 +14897,9 @@ AuthenticationResult NoteStore_authenticateToSharedNote_readReply(QByteArray rep return result; } -QVariant NoteStore_authenticateToSharedNote_readReplyAsync(QByteArray reply) +QVariant NoteStoreAuthenticateToSharedNoteReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_authenticateToSharedNote_readReply(reply)); + return QVariant::fromValue(NoteStoreAuthenticateToSharedNoteReadReply(reply)); } } // namespace @@ -14293,7 +14917,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( + QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( guid, noteKey, ctx->authenticationToken()); @@ -14303,7 +14927,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( params, ctx->requestTimeout()); - return NoteStore_authenticateToSharedNote_readReply(reply); + return NoteStoreAuthenticateToSharedNoteReadReply(reply); } AsyncResult * NoteStore::authenticateToSharedNoteAsync( @@ -14320,7 +14944,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( ctx = m_ctx; } - QByteArray params = NoteStore_authenticateToSharedNote_prepareParams( + QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( guid, noteKey, ctx->authenticationToken()); @@ -14329,83 +14953,93 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( m_url, params, ctx->requestTimeout(), - NoteStore_authenticateToSharedNote_readReplyAsync); + NoteStoreAuthenticateToSharedNoteReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_findRelated_prepareParams( +QByteArray NoteStoreFindRelatedPrepareParams( QString authenticationToken, const RelatedQuery & query, const RelatedResultSpec & resultSpec) { - QEC_DEBUG("note_store", "NoteStore_findRelated_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreFindRelatedPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("findRelated"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("findRelated"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_findRelated_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("query"), ThriftFieldType::T_STRUCT, 2); - writeRelatedQuery(w, query); - w.writeFieldEnd(); - w.writeFieldBegin( + + writeRelatedQuery(writer, query); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("resultSpec"), ThriftFieldType::T_STRUCT, 3); - writeRelatedResultSpec(w, resultSpec); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeRelatedResultSpec(writer, resultSpec); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -RelatedResult NoteStore_findRelated_readReply(QByteArray reply) +RelatedResult NoteStoreFindRelatedReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_findRelated_readReply"); + QEC_DEBUG("note_store", "NoteStoreFindRelatedReadReply"); bool resultIsSet = false; RelatedResult result = RelatedResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("findRelated")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14415,56 +15049,56 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; RelatedResult v; - readRelatedResult(r, v); + readRelatedResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -14475,9 +15109,9 @@ RelatedResult NoteStore_findRelated_readReply(QByteArray reply) return result; } -QVariant NoteStore_findRelated_readReplyAsync(QByteArray reply) +QVariant NoteStoreFindRelatedReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_findRelated_readReply(reply)); + return QVariant::fromValue(NoteStoreFindRelatedReadReply(reply)); } } // namespace @@ -14495,7 +15129,7 @@ RelatedResult NoteStore::findRelated( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_findRelated_prepareParams( + QByteArray params = NoteStoreFindRelatedPrepareParams( ctx->authenticationToken(), query, resultSpec); @@ -14505,7 +15139,7 @@ RelatedResult NoteStore::findRelated( params, ctx->requestTimeout()); - return NoteStore_findRelated_readReply(reply); + return NoteStoreFindRelatedReadReply(reply); } AsyncResult * NoteStore::findRelatedAsync( @@ -14522,7 +15156,7 @@ AsyncResult * NoteStore::findRelatedAsync( ctx = m_ctx; } - QByteArray params = NoteStore_findRelated_prepareParams( + QByteArray params = NoteStoreFindRelatedPrepareParams( ctx->authenticationToken(), query, resultSpec); @@ -14531,76 +15165,84 @@ AsyncResult * NoteStore::findRelatedAsync( m_url, params, ctx->requestTimeout(), - NoteStore_findRelated_readReplyAsync); + NoteStoreFindRelatedReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_updateNoteIfUsnMatches_prepareParams( +QByteArray NoteStoreUpdateNoteIfUsnMatchesPrepareParams( QString authenticationToken, const Note & note) { - QEC_DEBUG("note_store", "NoteStore_updateNoteIfUsnMatches_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreUpdateNoteIfUsnMatchesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateNoteIfUsnMatches"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateNoteIfUsnMatches"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_updateNoteIfUsnMatches_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); - writeNote(w, note); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeNote(writer, note); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArray reply) +UpdateNoteIfUsnMatchesResult NoteStoreUpdateNoteIfUsnMatchesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_updateNoteIfUsnMatches_readReply"); + QEC_DEBUG("note_store", "NoteStoreUpdateNoteIfUsnMatchesReadReply"); bool resultIsSet = false; UpdateNoteIfUsnMatchesResult result = UpdateNoteIfUsnMatchesResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateNoteIfUsnMatches")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14610,56 +15252,56 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UpdateNoteIfUsnMatchesResult v; - readUpdateNoteIfUsnMatchesResult(r, v); + readUpdateNoteIfUsnMatchesResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -14670,9 +15312,9 @@ UpdateNoteIfUsnMatchesResult NoteStore_updateNoteIfUsnMatches_readReply(QByteArr return result; } -QVariant NoteStore_updateNoteIfUsnMatches_readReplyAsync(QByteArray reply) +QVariant NoteStoreUpdateNoteIfUsnMatchesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_updateNoteIfUsnMatches_readReply(reply)); + return QVariant::fromValue(NoteStoreUpdateNoteIfUsnMatchesReadReply(reply)); } } // namespace @@ -14688,7 +15330,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( + QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( ctx->authenticationToken(), note); @@ -14697,7 +15339,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( params, ctx->requestTimeout()); - return NoteStore_updateNoteIfUsnMatches_readReply(reply); + return NoteStoreUpdateNoteIfUsnMatchesReadReply(reply); } AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( @@ -14712,7 +15354,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_updateNoteIfUsnMatches_prepareParams( + QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( ctx->authenticationToken(), note); @@ -14720,76 +15362,84 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_updateNoteIfUsnMatches_readReplyAsync); + NoteStoreUpdateNoteIfUsnMatchesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_manageNotebookShares_prepareParams( +QByteArray NoteStoreManageNotebookSharesPrepareParams( QString authenticationToken, const ManageNotebookSharesParameters & parameters) { - QEC_DEBUG("note_store", "NoteStore_manageNotebookShares_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreManageNotebookSharesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("manageNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("manageNotebookShares"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_manageNotebookShares_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("parameters"), ThriftFieldType::T_STRUCT, 2); - writeManageNotebookSharesParameters(w, parameters); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writeManageNotebookSharesParameters(writer, parameters); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray reply) +ManageNotebookSharesResult NoteStoreManageNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_manageNotebookShares_readReply"); + QEC_DEBUG("note_store", "NoteStoreManageNotebookSharesReadReply"); bool resultIsSet = false; ManageNotebookSharesResult result = ManageNotebookSharesResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("manageNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14799,56 +15449,56 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ManageNotebookSharesResult v; - readManageNotebookSharesResult(r, v); + readManageNotebookSharesResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -14859,9 +15509,9 @@ ManageNotebookSharesResult NoteStore_manageNotebookShares_readReply(QByteArray r return result; } -QVariant NoteStore_manageNotebookShares_readReplyAsync(QByteArray reply) +QVariant NoteStoreManageNotebookSharesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_manageNotebookShares_readReply(reply)); + return QVariant::fromValue(NoteStoreManageNotebookSharesReadReply(reply)); } } // namespace @@ -14877,7 +15527,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_manageNotebookShares_prepareParams( + QByteArray params = NoteStoreManageNotebookSharesPrepareParams( ctx->authenticationToken(), parameters); @@ -14886,7 +15536,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( params, ctx->requestTimeout()); - return NoteStore_manageNotebookShares_readReply(reply); + return NoteStoreManageNotebookSharesReadReply(reply); } AsyncResult * NoteStore::manageNotebookSharesAsync( @@ -14901,7 +15551,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_manageNotebookShares_prepareParams( + QByteArray params = NoteStoreManageNotebookSharesPrepareParams( ctx->authenticationToken(), parameters); @@ -14909,76 +15559,84 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_manageNotebookShares_readReplyAsync); + NoteStoreManageNotebookSharesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray NoteStore_getNotebookShares_prepareParams( +QByteArray NoteStoreGetNotebookSharesPrepareParams( QString authenticationToken, QString notebookGuid) { - QEC_DEBUG("note_store", "NoteStore_getNotebookShares_prepareParams"); + QEC_DEBUG("note_store", "NoteStoreGetNotebookSharesPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getNotebookShares"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getNotebookShares"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("NoteStore_getNotebookShares_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(notebookGuid); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(notebookGuid); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) +ShareRelationships NoteStoreGetNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStore_getNotebookShares_readReply"); + QEC_DEBUG("note_store", "NoteStoreGetNotebookSharesReadReply"); bool resultIsSet = false; ShareRelationships result = ShareRelationships(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getNotebookShares")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -14988,56 +15646,56 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; ShareRelationships v; - readShareRelationships(r, v); + readShareRelationships(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -15048,9 +15706,9 @@ ShareRelationships NoteStore_getNotebookShares_readReply(QByteArray reply) return result; } -QVariant NoteStore_getNotebookShares_readReplyAsync(QByteArray reply) +QVariant NoteStoreGetNotebookSharesReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(NoteStore_getNotebookShares_readReply(reply)); + return QVariant::fromValue(NoteStoreGetNotebookSharesReadReply(reply)); } } // namespace @@ -15066,7 +15724,7 @@ ShareRelationships NoteStore::getNotebookShares( if (!ctx) { ctx = m_ctx; } - QByteArray params = NoteStore_getNotebookShares_prepareParams( + QByteArray params = NoteStoreGetNotebookSharesPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -15075,7 +15733,7 @@ ShareRelationships NoteStore::getNotebookShares( params, ctx->requestTimeout()); - return NoteStore_getNotebookShares_readReply(reply); + return NoteStoreGetNotebookSharesReadReply(reply); } AsyncResult * NoteStore::getNotebookSharesAsync( @@ -15090,7 +15748,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( ctx = m_ctx; } - QByteArray params = NoteStore_getNotebookShares_prepareParams( + QByteArray params = NoteStoreGetNotebookSharesPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -15098,7 +15756,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( m_url, params, ctx->requestTimeout(), - NoteStore_getNotebookShares_readReplyAsync); + NoteStoreGetNotebookSharesReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// @@ -15267,76 +15925,86 @@ class Q_DECL_HIDDEN UserStore: public IUserStore namespace { -QByteArray UserStore_checkVersion_prepareParams( +QByteArray UserStoreCheckVersionPrepareParams( QString clientName, qint16 edamVersionMajor, qint16 edamVersionMinor) { - QEC_DEBUG("user_store", "UserStore_checkVersion_prepareParams"); + QEC_DEBUG("user_store", "UserStoreCheckVersionPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("checkVersion"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("checkVersion"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_checkVersion_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("clientName"), ThriftFieldType::T_STRING, 1); - w.writeString(clientName); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(clientName); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("edamVersionMajor"), ThriftFieldType::T_I16, 2); - w.writeI16(edamVersionMajor); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI16(edamVersionMajor); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("edamVersionMinor"), ThriftFieldType::T_I16, 3); - w.writeI16(edamVersionMinor); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeI16(edamVersionMinor); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -bool UserStore_checkVersion_readReply(QByteArray reply) +bool UserStoreCheckVersionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_checkVersion_readReply"); + QEC_DEBUG("user_store", "UserStoreCheckVersionReadReply"); bool resultIsSet = false; bool result = bool(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("checkVersion")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -15346,23 +16014,23 @@ bool UserStore_checkVersion_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_BOOL) { resultIsSet = true; bool v; - r.readBool(v); + reader.readBool(v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -15373,9 +16041,9 @@ bool UserStore_checkVersion_readReply(QByteArray reply) return result; } -QVariant UserStore_checkVersion_readReplyAsync(QByteArray reply) +QVariant UserStoreCheckVersionReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_checkVersion_readReply(reply)); + return QVariant::fromValue(UserStoreCheckVersionReadReply(reply)); } } // namespace @@ -15395,7 +16063,7 @@ bool UserStore::checkVersion( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_checkVersion_prepareParams( + QByteArray params = UserStoreCheckVersionPrepareParams( clientName, edamVersionMajor, edamVersionMinor); @@ -15405,7 +16073,7 @@ bool UserStore::checkVersion( params, ctx->requestTimeout()); - return UserStore_checkVersion_readReply(reply); + return UserStoreCheckVersionReadReply(reply); } AsyncResult * UserStore::checkVersionAsync( @@ -15424,7 +16092,7 @@ AsyncResult * UserStore::checkVersionAsync( ctx = m_ctx; } - QByteArray params = UserStore_checkVersion_prepareParams( + QByteArray params = UserStoreCheckVersionPrepareParams( clientName, edamVersionMajor, edamVersionMinor); @@ -15433,69 +16101,75 @@ AsyncResult * UserStore::checkVersionAsync( m_url, params, ctx->requestTimeout(), - UserStore_checkVersion_readReplyAsync); + UserStoreCheckVersionReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_getBootstrapInfo_prepareParams( +QByteArray UserStoreGetBootstrapInfoPrepareParams( QString locale) { - QEC_DEBUG("user_store", "UserStore_getBootstrapInfo_prepareParams"); + QEC_DEBUG("user_store", "UserStoreGetBootstrapInfoPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getBootstrapInfo"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getBootstrapInfo"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_getBootstrapInfo_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("locale"), ThriftFieldType::T_STRING, 1); - w.writeString(locale); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(locale); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) +BootstrapInfo UserStoreGetBootstrapInfoReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_getBootstrapInfo_readReply"); + QEC_DEBUG("user_store", "UserStoreGetBootstrapInfoReadReply"); bool resultIsSet = false; BootstrapInfo result = BootstrapInfo(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getBootstrapInfo")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -15505,23 +16179,23 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; BootstrapInfo v; - readBootstrapInfo(r, v); + readBootstrapInfo(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -15532,9 +16206,9 @@ BootstrapInfo UserStore_getBootstrapInfo_readReply(QByteArray reply) return result; } -QVariant UserStore_getBootstrapInfo_readReplyAsync(QByteArray reply) +QVariant UserStoreGetBootstrapInfoReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_getBootstrapInfo_readReply(reply)); + return QVariant::fromValue(UserStoreGetBootstrapInfoReadReply(reply)); } } // namespace @@ -15550,7 +16224,7 @@ BootstrapInfo UserStore::getBootstrapInfo( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_getBootstrapInfo_prepareParams( + QByteArray params = UserStoreGetBootstrapInfoPrepareParams( locale); QByteArray reply = askEvernote( @@ -15558,7 +16232,7 @@ BootstrapInfo UserStore::getBootstrapInfo( params, ctx->requestTimeout()); - return UserStore_getBootstrapInfo_readReply(reply); + return UserStoreGetBootstrapInfoReadReply(reply); } AsyncResult * UserStore::getBootstrapInfoAsync( @@ -15573,21 +16247,21 @@ AsyncResult * UserStore::getBootstrapInfoAsync( ctx = m_ctx; } - QByteArray params = UserStore_getBootstrapInfo_prepareParams( + QByteArray params = UserStoreGetBootstrapInfoPrepareParams( locale); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_getBootstrapInfo_readReplyAsync); + UserStoreGetBootstrapInfoReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_authenticateLongSession_prepareParams( +QByteArray UserStoreAuthenticateLongSessionPrepareParams( QString username, QString password, QString consumerKey, @@ -15596,95 +16270,113 @@ QByteArray UserStore_authenticateLongSession_prepareParams( QString deviceDescription, bool supportsTwoFactor) { - QEC_DEBUG("user_store", "UserStore_authenticateLongSession_prepareParams"); + QEC_DEBUG("user_store", "UserStoreAuthenticateLongSessionPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("authenticateLongSession"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("authenticateLongSession"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_authenticateLongSession_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 1); - w.writeString(username); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(username); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("password"), ThriftFieldType::T_STRING, 2); - w.writeString(password); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(password); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("consumerKey"), ThriftFieldType::T_STRING, 3); - w.writeString(consumerKey); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(consumerKey); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("consumerSecret"), ThriftFieldType::T_STRING, 4); - w.writeString(consumerSecret); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(consumerSecret); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("deviceIdentifier"), ThriftFieldType::T_STRING, 5); - w.writeString(deviceIdentifier); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(deviceIdentifier); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("deviceDescription"), ThriftFieldType::T_STRING, 6); - w.writeString(deviceDescription); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(deviceDescription); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("supportsTwoFactor"), ThriftFieldType::T_BOOL, 7); - w.writeBool(supportsTwoFactor); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(supportsTwoFactor); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray reply) +AuthenticationResult UserStoreAuthenticateLongSessionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_authenticateLongSession_readReply"); + QEC_DEBUG("user_store", "UserStoreAuthenticateLongSessionReadReply"); bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateLongSession")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -15694,45 +16386,45 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; - readAuthenticationResult(r, v); + readAuthenticationResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -15743,9 +16435,9 @@ AuthenticationResult UserStore_authenticateLongSession_readReply(QByteArray repl return result; } -QVariant UserStore_authenticateLongSession_readReplyAsync(QByteArray reply) +QVariant UserStoreAuthenticateLongSessionReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_authenticateLongSession_readReply(reply)); + return QVariant::fromValue(UserStoreAuthenticateLongSessionReadReply(reply)); } } // namespace @@ -15770,7 +16462,7 @@ AuthenticationResult UserStore::authenticateLongSession( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_authenticateLongSession_prepareParams( + QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( username, password, consumerKey, @@ -15784,7 +16476,7 @@ AuthenticationResult UserStore::authenticateLongSession( params, ctx->requestTimeout()); - return UserStore_authenticateLongSession_readReply(reply); + return UserStoreAuthenticateLongSessionReadReply(reply); } AsyncResult * UserStore::authenticateLongSessionAsync( @@ -15808,7 +16500,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( ctx = m_ctx; } - QByteArray params = UserStore_authenticateLongSession_prepareParams( + QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( username, password, consumerKey, @@ -15821,90 +16513,102 @@ AsyncResult * UserStore::authenticateLongSessionAsync( m_url, params, ctx->requestTimeout(), - UserStore_authenticateLongSession_readReplyAsync); + UserStoreAuthenticateLongSessionReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_completeTwoFactorAuthentication_prepareParams( +QByteArray UserStoreCompleteTwoFactorAuthenticationPrepareParams( QString authenticationToken, QString oneTimeCode, QString deviceIdentifier, QString deviceDescription) { - QEC_DEBUG("user_store", "UserStore_completeTwoFactorAuthentication_prepareParams"); + QEC_DEBUG("user_store", "UserStoreCompleteTwoFactorAuthenticationPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("completeTwoFactorAuthentication"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("completeTwoFactorAuthentication"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_completeTwoFactorAuthentication_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("oneTimeCode"), ThriftFieldType::T_STRING, 2); - w.writeString(oneTimeCode); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(oneTimeCode); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("deviceIdentifier"), ThriftFieldType::T_STRING, 3); - w.writeString(deviceIdentifier); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(deviceIdentifier); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("deviceDescription"), ThriftFieldType::T_STRING, 4); - w.writeString(deviceDescription); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(deviceDescription); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteArray reply) +AuthenticationResult UserStoreCompleteTwoFactorAuthenticationReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_completeTwoFactorAuthentication_readReply"); + QEC_DEBUG("user_store", "UserStoreCompleteTwoFactorAuthenticationReadReply"); bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("completeTwoFactorAuthentication")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -15914,45 +16618,45 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; - readAuthenticationResult(r, v); + readAuthenticationResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -15963,9 +16667,9 @@ AuthenticationResult UserStore_completeTwoFactorAuthentication_readReply(QByteAr return result; } -QVariant UserStore_completeTwoFactorAuthentication_readReplyAsync(QByteArray reply) +QVariant UserStoreCompleteTwoFactorAuthenticationReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_completeTwoFactorAuthentication_readReply(reply)); + return QVariant::fromValue(UserStoreCompleteTwoFactorAuthenticationReadReply(reply)); } } // namespace @@ -15984,7 +16688,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( + QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( ctx->authenticationToken(), oneTimeCode, deviceIdentifier, @@ -15995,7 +16699,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( params, ctx->requestTimeout()); - return UserStore_completeTwoFactorAuthentication_readReply(reply); + return UserStoreCompleteTwoFactorAuthenticationReadReply(reply); } AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( @@ -16013,7 +16717,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( ctx = m_ctx; } - QByteArray params = UserStore_completeTwoFactorAuthentication_prepareParams( + QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( ctx->authenticationToken(), oneTimeCode, deviceIdentifier, @@ -16023,67 +16727,73 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( m_url, params, ctx->requestTimeout(), - UserStore_completeTwoFactorAuthentication_readReplyAsync); + UserStoreCompleteTwoFactorAuthenticationReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_revokeLongSession_prepareParams( +QByteArray UserStoreRevokeLongSessionPrepareParams( QString authenticationToken) { - QEC_DEBUG("user_store", "UserStore_revokeLongSession_prepareParams"); + QEC_DEBUG("user_store", "UserStoreRevokeLongSessionPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("revokeLongSession"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("revokeLongSession"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_revokeLongSession_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void UserStore_revokeLongSession_readReply(QByteArray reply) +void UserStoreRevokeLongSessionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_revokeLongSession_readReply"); + QEC_DEBUG("user_store", "UserStoreRevokeLongSessionReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("revokeLongSession")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16092,40 +16802,40 @@ void UserStore_revokeLongSession_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant UserStore_revokeLongSession_readReplyAsync(QByteArray reply) +QVariant UserStoreRevokeLongSessionReadReplyAsync(QByteArray reply) { - UserStore_revokeLongSession_readReply(reply); + UserStoreRevokeLongSessionReadReply(reply); return QVariant(); } @@ -16139,7 +16849,7 @@ void UserStore::revokeLongSession( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_revokeLongSession_prepareParams( + QByteArray params = UserStoreRevokeLongSessionPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -16147,7 +16857,7 @@ void UserStore::revokeLongSession( params, ctx->requestTimeout()); - UserStore_revokeLongSession_readReply(reply); + UserStoreRevokeLongSessionReadReply(reply); } AsyncResult * UserStore::revokeLongSessionAsync( @@ -16159,76 +16869,82 @@ AsyncResult * UserStore::revokeLongSessionAsync( ctx = m_ctx; } - QByteArray params = UserStore_revokeLongSession_prepareParams( + QByteArray params = UserStoreRevokeLongSessionPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_revokeLongSession_readReplyAsync); + UserStoreRevokeLongSessionReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_authenticateToBusiness_prepareParams( +QByteArray UserStoreAuthenticateToBusinessPrepareParams( QString authenticationToken) { - QEC_DEBUG("user_store", "UserStore_authenticateToBusiness_prepareParams"); + QEC_DEBUG("user_store", "UserStoreAuthenticateToBusinessPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("authenticateToBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_authenticateToBusiness_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply) +AuthenticationResult UserStoreAuthenticateToBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_authenticateToBusiness_readReply"); + QEC_DEBUG("user_store", "UserStoreAuthenticateToBusinessReadReply"); bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("authenticateToBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16238,45 +16954,45 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AuthenticationResult v; - readAuthenticationResult(r, v); + readAuthenticationResult(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -16287,9 +17003,9 @@ AuthenticationResult UserStore_authenticateToBusiness_readReply(QByteArray reply return result; } -QVariant UserStore_authenticateToBusiness_readReplyAsync(QByteArray reply) +QVariant UserStoreAuthenticateToBusinessReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_authenticateToBusiness_readReply(reply)); + return QVariant::fromValue(UserStoreAuthenticateToBusinessReadReply(reply)); } } // namespace @@ -16302,7 +17018,7 @@ AuthenticationResult UserStore::authenticateToBusiness( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_authenticateToBusiness_prepareParams( + QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -16310,7 +17026,7 @@ AuthenticationResult UserStore::authenticateToBusiness( params, ctx->requestTimeout()); - return UserStore_authenticateToBusiness_readReply(reply); + return UserStoreAuthenticateToBusinessReadReply(reply); } AsyncResult * UserStore::authenticateToBusinessAsync( @@ -16322,76 +17038,82 @@ AsyncResult * UserStore::authenticateToBusinessAsync( ctx = m_ctx; } - QByteArray params = UserStore_authenticateToBusiness_prepareParams( + QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_authenticateToBusiness_readReplyAsync); + UserStoreAuthenticateToBusinessReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_getUser_prepareParams( +QByteArray UserStoreGetUserPrepareParams( QString authenticationToken) { - QEC_DEBUG("user_store", "UserStore_getUser_prepareParams"); + QEC_DEBUG("user_store", "UserStoreGetUserPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getUser"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getUser"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_getUser_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -User UserStore_getUser_readReply(QByteArray reply) +User UserStoreGetUserReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_getUser_readReply"); + QEC_DEBUG("user_store", "UserStoreGetUserReadReply"); bool resultIsSet = false; User result = User(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getUser")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16401,45 +17123,45 @@ User UserStore_getUser_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; User v; - readUser(r, v); + readUser(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -16450,9 +17172,9 @@ User UserStore_getUser_readReply(QByteArray reply) return result; } -QVariant UserStore_getUser_readReplyAsync(QByteArray reply) +QVariant UserStoreGetUserReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_getUser_readReply(reply)); + return QVariant::fromValue(UserStoreGetUserReadReply(reply)); } } // namespace @@ -16465,7 +17187,7 @@ User UserStore::getUser( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_getUser_prepareParams( + QByteArray params = UserStoreGetUserPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -16473,7 +17195,7 @@ User UserStore::getUser( params, ctx->requestTimeout()); - return UserStore_getUser_readReply(reply); + return UserStoreGetUserReadReply(reply); } AsyncResult * UserStore::getUserAsync( @@ -16485,76 +17207,82 @@ AsyncResult * UserStore::getUserAsync( ctx = m_ctx; } - QByteArray params = UserStore_getUser_prepareParams( + QByteArray params = UserStoreGetUserPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_getUser_readReplyAsync); + UserStoreGetUserReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_getPublicUserInfo_prepareParams( +QByteArray UserStoreGetPublicUserInfoPrepareParams( QString username) { - QEC_DEBUG("user_store", "UserStore_getPublicUserInfo_prepareParams"); + QEC_DEBUG("user_store", "UserStoreGetPublicUserInfoPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getPublicUserInfo"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getPublicUserInfo"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_getPublicUserInfo_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 1); - w.writeString(username); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(username); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) +PublicUserInfo UserStoreGetPublicUserInfoReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_getPublicUserInfo_readReply"); + QEC_DEBUG("user_store", "UserStoreGetPublicUserInfoReadReply"); bool resultIsSet = false; PublicUserInfo result = PublicUserInfo(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getPublicUserInfo")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16564,56 +17292,56 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; PublicUserInfo v; - readPublicUserInfo(r, v); + readPublicUserInfo(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -16624,9 +17352,9 @@ PublicUserInfo UserStore_getPublicUserInfo_readReply(QByteArray reply) return result; } -QVariant UserStore_getPublicUserInfo_readReplyAsync(QByteArray reply) +QVariant UserStoreGetPublicUserInfoReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_getPublicUserInfo_readReply(reply)); + return QVariant::fromValue(UserStoreGetPublicUserInfoReadReply(reply)); } } // namespace @@ -16642,7 +17370,7 @@ PublicUserInfo UserStore::getPublicUserInfo( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_getPublicUserInfo_prepareParams( + QByteArray params = UserStoreGetPublicUserInfoPrepareParams( username); QByteArray reply = askEvernote( @@ -16650,7 +17378,7 @@ PublicUserInfo UserStore::getPublicUserInfo( params, ctx->requestTimeout()); - return UserStore_getPublicUserInfo_readReply(reply); + return UserStoreGetPublicUserInfoReadReply(reply); } AsyncResult * UserStore::getPublicUserInfoAsync( @@ -16665,76 +17393,82 @@ AsyncResult * UserStore::getPublicUserInfoAsync( ctx = m_ctx; } - QByteArray params = UserStore_getPublicUserInfo_prepareParams( + QByteArray params = UserStoreGetPublicUserInfoPrepareParams( username); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_getPublicUserInfo_readReplyAsync); + UserStoreGetPublicUserInfoReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_getUserUrls_prepareParams( +QByteArray UserStoreGetUserUrlsPrepareParams( QString authenticationToken) { - QEC_DEBUG("user_store", "UserStore_getUserUrls_prepareParams"); + QEC_DEBUG("user_store", "UserStoreGetUserUrlsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getUserUrls"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getUserUrls"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_getUserUrls_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -UserUrls UserStore_getUserUrls_readReply(QByteArray reply) +UserUrls UserStoreGetUserUrlsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_getUserUrls_readReply"); + QEC_DEBUG("user_store", "UserStoreGetUserUrlsReadReply"); bool resultIsSet = false; UserUrls result = UserUrls(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getUserUrls")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16744,45 +17478,45 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; UserUrls v; - readUserUrls(r, v); + readUserUrls(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -16793,9 +17527,9 @@ UserUrls UserStore_getUserUrls_readReply(QByteArray reply) return result; } -QVariant UserStore_getUserUrls_readReplyAsync(QByteArray reply) +QVariant UserStoreGetUserUrlsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_getUserUrls_readReply(reply)); + return QVariant::fromValue(UserStoreGetUserUrlsReadReply(reply)); } } // namespace @@ -16808,7 +17542,7 @@ UserUrls UserStore::getUserUrls( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_getUserUrls_prepareParams( + QByteArray params = UserStoreGetUserUrlsPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -16816,7 +17550,7 @@ UserUrls UserStore::getUserUrls( params, ctx->requestTimeout()); - return UserStore_getUserUrls_readReply(reply); + return UserStoreGetUserUrlsReadReply(reply); } AsyncResult * UserStore::getUserUrlsAsync( @@ -16828,81 +17562,89 @@ AsyncResult * UserStore::getUserUrlsAsync( ctx = m_ctx; } - QByteArray params = UserStore_getUserUrls_prepareParams( + QByteArray params = UserStoreGetUserUrlsPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_getUserUrls_readReplyAsync); + UserStoreGetUserUrlsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_inviteToBusiness_prepareParams( +QByteArray UserStoreInviteToBusinessPrepareParams( QString authenticationToken, QString emailAddress) { - QEC_DEBUG("user_store", "UserStore_inviteToBusiness_prepareParams"); + QEC_DEBUG("user_store", "UserStoreInviteToBusinessPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("inviteToBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("inviteToBusiness"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_inviteToBusiness_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("emailAddress"), ThriftFieldType::T_STRING, 2); - w.writeString(emailAddress); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(emailAddress); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void UserStore_inviteToBusiness_readReply(QByteArray reply) +void UserStoreInviteToBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_inviteToBusiness_readReply"); + QEC_DEBUG("user_store", "UserStoreInviteToBusinessReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("inviteToBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -16911,40 +17653,40 @@ void UserStore_inviteToBusiness_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant UserStore_inviteToBusiness_readReplyAsync(QByteArray reply) +QVariant UserStoreInviteToBusinessReadReplyAsync(QByteArray reply) { - UserStore_inviteToBusiness_readReply(reply); + UserStoreInviteToBusinessReadReply(reply); return QVariant(); } @@ -16961,7 +17703,7 @@ void UserStore::inviteToBusiness( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_inviteToBusiness_prepareParams( + QByteArray params = UserStoreInviteToBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -16970,7 +17712,7 @@ void UserStore::inviteToBusiness( params, ctx->requestTimeout()); - UserStore_inviteToBusiness_readReply(reply); + UserStoreInviteToBusinessReadReply(reply); } AsyncResult * UserStore::inviteToBusinessAsync( @@ -16985,7 +17727,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( ctx = m_ctx; } - QByteArray params = UserStore_inviteToBusiness_prepareParams( + QByteArray params = UserStoreInviteToBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -16993,74 +17735,82 @@ AsyncResult * UserStore::inviteToBusinessAsync( m_url, params, ctx->requestTimeout(), - UserStore_inviteToBusiness_readReplyAsync); + UserStoreInviteToBusinessReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_removeFromBusiness_prepareParams( +QByteArray UserStoreRemoveFromBusinessPrepareParams( QString authenticationToken, QString emailAddress) { - QEC_DEBUG("user_store", "UserStore_removeFromBusiness_prepareParams"); + QEC_DEBUG("user_store", "UserStoreRemoveFromBusinessPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("removeFromBusiness"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("removeFromBusiness"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_removeFromBusiness_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("emailAddress"), ThriftFieldType::T_STRING, 2); - w.writeString(emailAddress); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(emailAddress); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void UserStore_removeFromBusiness_readReply(QByteArray reply) +void UserStoreRemoveFromBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_removeFromBusiness_readReply"); + QEC_DEBUG("user_store", "UserStoreRemoveFromBusinessReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("removeFromBusiness")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -17069,51 +17819,51 @@ void UserStore_removeFromBusiness_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant UserStore_removeFromBusiness_readReplyAsync(QByteArray reply) +QVariant UserStoreRemoveFromBusinessReadReplyAsync(QByteArray reply) { - UserStore_removeFromBusiness_readReply(reply); + UserStoreRemoveFromBusinessReadReply(reply); return QVariant(); } @@ -17130,7 +17880,7 @@ void UserStore::removeFromBusiness( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_removeFromBusiness_prepareParams( + QByteArray params = UserStoreRemoveFromBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -17139,7 +17889,7 @@ void UserStore::removeFromBusiness( params, ctx->requestTimeout()); - UserStore_removeFromBusiness_readReply(reply); + UserStoreRemoveFromBusinessReadReply(reply); } AsyncResult * UserStore::removeFromBusinessAsync( @@ -17154,7 +17904,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( ctx = m_ctx; } - QByteArray params = UserStore_removeFromBusiness_prepareParams( + QByteArray params = UserStoreRemoveFromBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -17162,81 +17912,91 @@ AsyncResult * UserStore::removeFromBusinessAsync( m_url, params, ctx->requestTimeout(), - UserStore_removeFromBusiness_readReplyAsync); + UserStoreRemoveFromBusinessReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_updateBusinessUserIdentifier_prepareParams( +QByteArray UserStoreUpdateBusinessUserIdentifierPrepareParams( QString authenticationToken, QString oldEmailAddress, QString newEmailAddress) { - QEC_DEBUG("user_store", "UserStore_updateBusinessUserIdentifier_prepareParams"); + QEC_DEBUG("user_store", "UserStoreUpdateBusinessUserIdentifierPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("updateBusinessUserIdentifier"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("updateBusinessUserIdentifier"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_updateBusinessUserIdentifier_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("oldEmailAddress"), ThriftFieldType::T_STRING, 2); - w.writeString(oldEmailAddress); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(oldEmailAddress); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("newEmailAddress"), ThriftFieldType::T_STRING, 3); - w.writeString(newEmailAddress); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(newEmailAddress); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) +void UserStoreUpdateBusinessUserIdentifierReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_updateBusinessUserIdentifier_readReply"); + QEC_DEBUG("user_store", "UserStoreUpdateBusinessUserIdentifierReadReply"); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("updateBusinessUserIdentifier")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -17245,51 +18005,51 @@ void UserStore_updateBusinessUserIdentifier_readReply(QByteArray reply) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException e; - readEDAMNotFoundException(r, e); + readEDAMNotFoundException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); } -QVariant UserStore_updateBusinessUserIdentifier_readReplyAsync(QByteArray reply) +QVariant UserStoreUpdateBusinessUserIdentifierReadReplyAsync(QByteArray reply) { - UserStore_updateBusinessUserIdentifier_readReply(reply); + UserStoreUpdateBusinessUserIdentifierReadReply(reply); return QVariant(); } @@ -17308,7 +18068,7 @@ void UserStore::updateBusinessUserIdentifier( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( + QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( ctx->authenticationToken(), oldEmailAddress, newEmailAddress); @@ -17318,7 +18078,7 @@ void UserStore::updateBusinessUserIdentifier( params, ctx->requestTimeout()); - UserStore_updateBusinessUserIdentifier_readReply(reply); + UserStoreUpdateBusinessUserIdentifierReadReply(reply); } AsyncResult * UserStore::updateBusinessUserIdentifierAsync( @@ -17335,7 +18095,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( ctx = m_ctx; } - QByteArray params = UserStore_updateBusinessUserIdentifier_prepareParams( + QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( ctx->authenticationToken(), oldEmailAddress, newEmailAddress); @@ -17344,69 +18104,75 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( m_url, params, ctx->requestTimeout(), - UserStore_updateBusinessUserIdentifier_readReplyAsync); + UserStoreUpdateBusinessUserIdentifierReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_listBusinessUsers_prepareParams( +QByteArray UserStoreListBusinessUsersPrepareParams( QString authenticationToken) { - QEC_DEBUG("user_store", "UserStore_listBusinessUsers_prepareParams"); + QEC_DEBUG("user_store", "UserStoreListBusinessUsersPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listBusinessUsers"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listBusinessUsers"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_listBusinessUsers_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList UserStore_listBusinessUsers_readReply(QByteArray reply) +QList UserStoreListBusinessUsersReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_listBusinessUsers_readReply"); + QEC_DEBUG("user_store", "UserStoreListBusinessUsersReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listBusinessUsers")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -17418,7 +18184,7 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -17427,48 +18193,48 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) } for(qint32 i = 0; i < size; i++) { UserProfile elem; - readUserProfile(r, elem); + readUserProfile(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -17479,9 +18245,9 @@ QList UserStore_listBusinessUsers_readReply(QByteArray reply) return result; } -QVariant UserStore_listBusinessUsers_readReplyAsync(QByteArray reply) +QVariant UserStoreListBusinessUsersReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_listBusinessUsers_readReply(reply)); + return QVariant::fromValue(UserStoreListBusinessUsersReadReply(reply)); } } // namespace @@ -17494,7 +18260,7 @@ QList UserStore::listBusinessUsers( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_listBusinessUsers_prepareParams( + QByteArray params = UserStoreListBusinessUsersPrepareParams( ctx->authenticationToken()); QByteArray reply = askEvernote( @@ -17502,7 +18268,7 @@ QList UserStore::listBusinessUsers( params, ctx->requestTimeout()); - return UserStore_listBusinessUsers_readReply(reply); + return UserStoreListBusinessUsersReadReply(reply); } AsyncResult * UserStore::listBusinessUsersAsync( @@ -17514,83 +18280,91 @@ AsyncResult * UserStore::listBusinessUsersAsync( ctx = m_ctx; } - QByteArray params = UserStore_listBusinessUsers_prepareParams( + QByteArray params = UserStoreListBusinessUsersPrepareParams( ctx->authenticationToken()); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_listBusinessUsers_readReplyAsync); + UserStoreListBusinessUsersReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_listBusinessInvitations_prepareParams( +QByteArray UserStoreListBusinessInvitationsPrepareParams( QString authenticationToken, bool includeRequestedInvitations) { - QEC_DEBUG("user_store", "UserStore_listBusinessInvitations_prepareParams"); + QEC_DEBUG("user_store", "UserStoreListBusinessInvitationsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("listBusinessInvitations"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("listBusinessInvitations"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_listBusinessInvitations_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - w.writeString(authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("includeRequestedInvitations"), ThriftFieldType::T_BOOL, 2); - w.writeBool(includeRequestedInvitations); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeBool(includeRequestedInvitations); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -QList UserStore_listBusinessInvitations_readReply(QByteArray reply) +QList UserStoreListBusinessInvitationsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_listBusinessInvitations_readReply"); + QEC_DEBUG("user_store", "UserStoreListBusinessInvitationsReadReply"); bool resultIsSet = false; QList result = QList(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("listBusinessInvitations")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -17602,7 +18376,7 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -17611,48 +18385,48 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray } for(qint32 i = 0; i < size; i++) { BusinessInvitation elem; - readBusinessInvitation(r, elem); + readBusinessInvitation(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMSystemException e; - readEDAMSystemException(r, e); + readEDAMSystemException(reader, e); throwEDAMSystemException(e); } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -17663,9 +18437,9 @@ QList UserStore_listBusinessInvitations_readReply(QByteArray return result; } -QVariant UserStore_listBusinessInvitations_readReplyAsync(QByteArray reply) +QVariant UserStoreListBusinessInvitationsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_listBusinessInvitations_readReply(reply)); + return QVariant::fromValue(UserStoreListBusinessInvitationsReadReply(reply)); } } // namespace @@ -17681,7 +18455,7 @@ QList UserStore::listBusinessInvitations( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_listBusinessInvitations_prepareParams( + QByteArray params = UserStoreListBusinessInvitationsPrepareParams( ctx->authenticationToken(), includeRequestedInvitations); @@ -17690,7 +18464,7 @@ QList UserStore::listBusinessInvitations( params, ctx->requestTimeout()); - return UserStore_listBusinessInvitations_readReply(reply); + return UserStoreListBusinessInvitationsReadReply(reply); } AsyncResult * UserStore::listBusinessInvitationsAsync( @@ -17705,7 +18479,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( ctx = m_ctx; } - QByteArray params = UserStore_listBusinessInvitations_prepareParams( + QByteArray params = UserStoreListBusinessInvitationsPrepareParams( ctx->authenticationToken(), includeRequestedInvitations); @@ -17713,69 +18487,75 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( m_url, params, ctx->requestTimeout(), - UserStore_listBusinessInvitations_readReplyAsync); + UserStoreListBusinessInvitationsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// namespace { -QByteArray UserStore_getAccountLimits_prepareParams( +QByteArray UserStoreGetAccountLimitsPrepareParams( ServiceLevel serviceLevel) { - QEC_DEBUG("user_store", "UserStore_getAccountLimits_prepareParams"); + QEC_DEBUG("user_store", "UserStoreGetAccountLimitsPrepareParams"); - ThriftBinaryBufferWriter w; + ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - w.writeMessageBegin( - QStringLiteral("getAccountLimits"), ThriftMessageType::T_CALL, cseqid); - w.writeStructBegin( + + writer.writeMessageBegin( + QStringLiteral("getAccountLimits"), + ThriftMessageType::T_CALL, + cseqid); + + writer.writeStructBegin( QStringLiteral("UserStore_getAccountLimits_pargs")); - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 1); - w.writeI32(static_cast(serviceLevel)); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); - w.writeMessageEnd(); - return w.buffer(); + + writer.writeI32(static_cast(serviceLevel)); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + return writer.buffer(); } -AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) +AccountLimits UserStoreGetAccountLimitsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStore_getAccountLimits_readReply"); + QEC_DEBUG("user_store", "UserStoreGetAccountLimitsReadReply"); bool resultIsSet = false; AccountLimits result = AccountLimits(); - ThriftBinaryBufferReader r(reply); + ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; ThriftMessageType mtype; - r.readMessageBegin(fname, mtype, rseqid); + reader.readMessageBegin(fname, mtype, rseqid); if (mtype == ThriftMessageType::T_EXCEPTION) { - ThriftException e = readThriftException(r); - r.readMessageEnd(); + ThriftException e = readThriftException(reader); + reader.readMessageEnd(); throw e; } if (mtype != ThriftMessageType::T_REPLY) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::INVALID_MESSAGE_TYPE); } if (fname.compare(QStringLiteral("getAccountLimits")) != 0) { - r.skip(ThriftFieldType::T_STRUCT); - r.readMessageEnd(); + reader.skip(ThriftFieldType::T_STRUCT); + reader.readMessageEnd(); throw ThriftException(ThriftException::Type::WRONG_METHOD_NAME); } ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) { break; } @@ -17785,34 +18565,34 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) if (fieldType == ThriftFieldType::T_STRUCT) { resultIsSet = true; AccountLimits v; - readAccountLimits(r, v); + readAccountLimits(reader, v); result = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException e; - readEDAMUserException(r, e); + readEDAMUserException(reader, e); throw e; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); - r.readMessageEnd(); + reader.readStructEnd(); + reader.readMessageEnd(); if (!resultIsSet) { throw ThriftException( @@ -17823,9 +18603,9 @@ AccountLimits UserStore_getAccountLimits_readReply(QByteArray reply) return result; } -QVariant UserStore_getAccountLimits_readReplyAsync(QByteArray reply) +QVariant UserStoreGetAccountLimitsReadReplyAsync(QByteArray reply) { - return QVariant::fromValue(UserStore_getAccountLimits_readReply(reply)); + return QVariant::fromValue(UserStoreGetAccountLimitsReadReply(reply)); } } // namespace @@ -17841,7 +18621,7 @@ AccountLimits UserStore::getAccountLimits( if (!ctx) { ctx = m_ctx; } - QByteArray params = UserStore_getAccountLimits_prepareParams( + QByteArray params = UserStoreGetAccountLimitsPrepareParams( serviceLevel); QByteArray reply = askEvernote( @@ -17849,7 +18629,7 @@ AccountLimits UserStore::getAccountLimits( params, ctx->requestTimeout()); - return UserStore_getAccountLimits_readReply(reply); + return UserStoreGetAccountLimitsReadReply(reply); } AsyncResult * UserStore::getAccountLimitsAsync( @@ -17864,14 +18644,14 @@ AsyncResult * UserStore::getAccountLimitsAsync( ctx = m_ctx; } - QByteArray params = UserStore_getAccountLimits_prepareParams( + QByteArray params = UserStoreGetAccountLimitsPrepareParams( serviceLevel); return new AsyncResult( m_url, params, ctx->requestTimeout(), - UserStore_getAccountLimits_readReplyAsync); + UserStoreGetAccountLimitsReadReplyAsync); } //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index 974b7bc9..ef132314 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -22,11 +22,11 @@ namespace qevercloud { /** @cond HIDDEN_SYMBOLS */ void readEnumEDAMErrorCode( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMErrorCode & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(EDAMErrorCode::UNKNOWN): e = EDAMErrorCode::UNKNOWN; break; case static_cast(EDAMErrorCode::BAD_DATA_FORMAT): e = EDAMErrorCode::BAD_DATA_FORMAT; break; @@ -61,11 +61,11 @@ void readEnumEDAMErrorCode( } void readEnumEDAMInvalidContactReason( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMInvalidContactReason & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(EDAMInvalidContactReason::BAD_ADDRESS): e = EDAMInvalidContactReason::BAD_ADDRESS; break; case static_cast(EDAMInvalidContactReason::DUPLICATE_CONTACT): e = EDAMInvalidContactReason::DUPLICATE_CONTACT; break; @@ -75,11 +75,11 @@ void readEnumEDAMInvalidContactReason( } void readEnumShareRelationshipPrivilegeLevel( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ShareRelationshipPrivilegeLevel & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(ShareRelationshipPrivilegeLevel::READ_NOTEBOOK): e = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; break; case static_cast(ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY): e = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; break; @@ -90,11 +90,11 @@ void readEnumShareRelationshipPrivilegeLevel( } void readEnumPrivilegeLevel( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, PrivilegeLevel & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(PrivilegeLevel::NORMAL): e = PrivilegeLevel::NORMAL; break; case static_cast(PrivilegeLevel::PREMIUM): e = PrivilegeLevel::PREMIUM; break; @@ -107,11 +107,11 @@ void readEnumPrivilegeLevel( } void readEnumServiceLevel( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ServiceLevel & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(ServiceLevel::BASIC): e = ServiceLevel::BASIC; break; case static_cast(ServiceLevel::PLUS): e = ServiceLevel::PLUS; break; @@ -122,11 +122,11 @@ void readEnumServiceLevel( } void readEnumQueryFormat( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, QueryFormat & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(QueryFormat::USER): e = QueryFormat::USER; break; case static_cast(QueryFormat::SEXP): e = QueryFormat::SEXP; break; @@ -135,11 +135,11 @@ void readEnumQueryFormat( } void readEnumNoteSortOrder( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteSortOrder & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(NoteSortOrder::CREATED): e = NoteSortOrder::CREATED; break; case static_cast(NoteSortOrder::UPDATED): e = NoteSortOrder::UPDATED; break; @@ -151,11 +151,11 @@ void readEnumNoteSortOrder( } void readEnumPremiumOrderStatus( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, PremiumOrderStatus & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(PremiumOrderStatus::NONE): e = PremiumOrderStatus::NONE; break; case static_cast(PremiumOrderStatus::PENDING): e = PremiumOrderStatus::PENDING; break; @@ -168,11 +168,11 @@ void readEnumPremiumOrderStatus( } void readEnumSharedNotebookPrivilegeLevel( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebookPrivilegeLevel & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(SharedNotebookPrivilegeLevel::READ_NOTEBOOK): e = SharedNotebookPrivilegeLevel::READ_NOTEBOOK; break; case static_cast(SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY): e = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; break; @@ -185,11 +185,11 @@ void readEnumSharedNotebookPrivilegeLevel( } void readEnumSharedNotePrivilegeLevel( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotePrivilegeLevel & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(SharedNotePrivilegeLevel::READ_NOTE): e = SharedNotePrivilegeLevel::READ_NOTE; break; case static_cast(SharedNotePrivilegeLevel::MODIFY_NOTE): e = SharedNotePrivilegeLevel::MODIFY_NOTE; break; @@ -199,11 +199,11 @@ void readEnumSharedNotePrivilegeLevel( } void readEnumSponsoredGroupRole( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SponsoredGroupRole & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(SponsoredGroupRole::GROUP_MEMBER): e = SponsoredGroupRole::GROUP_MEMBER; break; case static_cast(SponsoredGroupRole::GROUP_ADMIN): e = SponsoredGroupRole::GROUP_ADMIN; break; @@ -213,11 +213,11 @@ void readEnumSponsoredGroupRole( } void readEnumBusinessUserRole( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessUserRole & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(BusinessUserRole::ADMIN): e = BusinessUserRole::ADMIN; break; case static_cast(BusinessUserRole::NORMAL): e = BusinessUserRole::NORMAL; break; @@ -226,11 +226,11 @@ void readEnumBusinessUserRole( } void readEnumBusinessUserStatus( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessUserStatus & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(BusinessUserStatus::ACTIVE): e = BusinessUserStatus::ACTIVE; break; case static_cast(BusinessUserStatus::DEACTIVATED): e = BusinessUserStatus::DEACTIVATED; break; @@ -239,11 +239,11 @@ void readEnumBusinessUserStatus( } void readEnumSharedNotebookInstanceRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebookInstanceRestrictions & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(SharedNotebookInstanceRestrictions::ASSIGNED): e = SharedNotebookInstanceRestrictions::ASSIGNED; break; case static_cast(SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS): e = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; break; @@ -252,11 +252,11 @@ void readEnumSharedNotebookInstanceRestrictions( } void readEnumReminderEmailConfig( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ReminderEmailConfig & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(ReminderEmailConfig::DO_NOT_SEND): e = ReminderEmailConfig::DO_NOT_SEND; break; case static_cast(ReminderEmailConfig::SEND_DAILY_EMAIL): e = ReminderEmailConfig::SEND_DAILY_EMAIL; break; @@ -265,11 +265,11 @@ void readEnumReminderEmailConfig( } void readEnumBusinessInvitationStatus( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessInvitationStatus & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(BusinessInvitationStatus::APPROVED): e = BusinessInvitationStatus::APPROVED; break; case static_cast(BusinessInvitationStatus::REQUESTED): e = BusinessInvitationStatus::REQUESTED; break; @@ -279,11 +279,11 @@ void readEnumBusinessInvitationStatus( } void readEnumContactType( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ContactType & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(ContactType::EVERNOTE): e = ContactType::EVERNOTE; break; case static_cast(ContactType::SMS): e = ContactType::SMS; break; @@ -296,11 +296,11 @@ void readEnumContactType( } void readEnumEntityType( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EntityType & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(EntityType::NOTE): e = EntityType::NOTE; break; case static_cast(EntityType::NOTEBOOK): e = EntityType::NOTEBOOK; break; @@ -310,11 +310,11 @@ void readEnumEntityType( } void readEnumRecipientStatus( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RecipientStatus & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(RecipientStatus::NOT_IN_MY_LIST): e = RecipientStatus::NOT_IN_MY_LIST; break; case static_cast(RecipientStatus::IN_MY_LIST): e = RecipientStatus::IN_MY_LIST; break; @@ -324,11 +324,11 @@ void readEnumRecipientStatus( } void readEnumCanMoveToContainerStatus( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, CanMoveToContainerStatus & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(CanMoveToContainerStatus::CAN_BE_MOVED): e = CanMoveToContainerStatus::CAN_BE_MOVED; break; case static_cast(CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE): e = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; break; @@ -338,11 +338,11 @@ void readEnumCanMoveToContainerStatus( } void readEnumRelatedContentType( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedContentType & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(RelatedContentType::NEWS_ARTICLE): e = RelatedContentType::NEWS_ARTICLE; break; case static_cast(RelatedContentType::PROFILE_PERSON): e = RelatedContentType::PROFILE_PERSON; break; @@ -353,11 +353,11 @@ void readEnumRelatedContentType( } void readEnumRelatedContentAccess( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedContentAccess & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(RelatedContentAccess::NOT_ACCESSIBLE): e = RelatedContentAccess::NOT_ACCESSIBLE; break; case static_cast(RelatedContentAccess::DIRECT_LINK_ACCESS_OK): e = RelatedContentAccess::DIRECT_LINK_ACCESS_OK; break; @@ -368,11 +368,11 @@ void readEnumRelatedContentAccess( } void readEnumUserIdentityType( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserIdentityType & e) { qint32 i; - r.readI32(i); + reader.readI32(i); switch(i) { case static_cast(UserIdentityType::EVERNOTE_USERID): e = UserIdentityType::EVERNOTE_USERID; break; case static_cast(UserIdentityType::EMAIL): e = UserIdentityType::EMAIL; break; @@ -382,58 +382,70 @@ void readEnumUserIdentityType( } void writeSyncState( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SyncState & s) { - w.writeStructBegin(QStringLiteral("SyncState")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("SyncState")); + writer.writeFieldBegin( QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); - w.writeI64(s.currentTime); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI64(s.currentTime); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("fullSyncBefore"), ThriftFieldType::T_I64, 2); - w.writeI64(s.fullSyncBefore); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI64(s.fullSyncBefore); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); - w.writeI32(s.updateCount); - w.writeFieldEnd(); + + writer.writeI32(s.updateCount); + writer.writeFieldEnd(); + if (s.uploaded.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploaded"), ThriftFieldType::T_I64, 4); - w.writeI64(s.uploaded.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploaded.ref()); + writer.writeFieldEnd(); } + if (s.userLastUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userLastUpdated"), ThriftFieldType::T_I64, 5); - w.writeI64(s.userLastUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.userLastUpdated.ref()); + writer.writeFieldEnd(); } + if (s.userMaxMessageEventId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userMaxMessageEventId"), ThriftFieldType::T_I64, 6); - w.writeI64(s.userMaxMessageEventId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.userMaxMessageEventId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSyncState( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SyncState & s) { QString fname; @@ -442,74 +454,74 @@ void readSyncState( bool currentTime_isset = false; bool fullSyncBefore_isset = false; bool updateCount_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { currentTime_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.currentTime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { fullSyncBefore_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.fullSyncBefore = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { updateCount_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.updateCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploaded = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.userLastUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { MessageEventID v; - r.readI64(v); + reader.readI64(v); s.userMaxMessageEventId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.currentTime has no value")); if (!fullSyncBefore_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.fullSyncBefore has no value")); if (!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncState.updateCount has no value")); @@ -555,168 +567,207 @@ void SyncState::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSyncChunk( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SyncChunk & s) { - w.writeStructBegin(QStringLiteral("SyncChunk")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("SyncChunk")); + writer.writeFieldBegin( QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); - w.writeI64(s.currentTime); - w.writeFieldEnd(); + + writer.writeI64(s.currentTime); + writer.writeFieldEnd(); + if (s.chunkHighUSN.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("chunkHighUSN"), ThriftFieldType::T_I32, 2); - w.writeI32(s.chunkHighUSN.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.chunkHighUSN.ref()); + writer.writeFieldEnd(); } - w.writeFieldBegin( + + writer.writeFieldBegin( QStringLiteral("updateCount"), ThriftFieldType::T_I32, 3); - w.writeI32(s.updateCount); - w.writeFieldEnd(); + + writer.writeI32(s.updateCount); + writer.writeFieldEnd(); + if (s.notes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notes"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); for(const auto & value: qAsConst(s.notes.ref())) { - writeNote(w, value); + writeNote(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.notebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); for(const auto & value: qAsConst(s.notebooks.ref())) { - writeNotebook(w, value); + writeNotebook(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.tags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tags"), ThriftFieldType::T_LIST, 6); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); for(const auto & value: qAsConst(s.tags.ref())) { - writeTag(w, value); + writeTag(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.searches.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searches"), ThriftFieldType::T_LIST, 7); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.searches.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.searches.ref().length()); for(const auto & value: qAsConst(s.searches.ref())) { - writeSavedSearch(w, value); + writeSavedSearch(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.resources.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("resources"), ThriftFieldType::T_LIST, 8); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); for(const auto & value: qAsConst(s.resources.ref())) { - writeResource(w, value); + writeResource(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.expungedNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungedNotes"), ThriftFieldType::T_LIST, 9); - w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotes.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotes.ref().length()); for(const auto & value: qAsConst(s.expungedNotes.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.expungedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungedNotebooks"), ThriftFieldType::T_LIST, 10); - w.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.expungedNotebooks.ref().length()); for(const auto & value: qAsConst(s.expungedNotebooks.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.expungedTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungedTags"), ThriftFieldType::T_LIST, 11); - w.writeListBegin(ThriftFieldType::T_STRING, s.expungedTags.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.expungedTags.ref().length()); for(const auto & value: qAsConst(s.expungedTags.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.expungedSearches.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungedSearches"), ThriftFieldType::T_LIST, 12); - w.writeListBegin(ThriftFieldType::T_STRING, s.expungedSearches.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.expungedSearches.ref().length()); for(const auto & value: qAsConst(s.expungedSearches.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.linkedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("linkedNotebooks"), ThriftFieldType::T_LIST, 13); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.linkedNotebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.linkedNotebooks.ref().length()); for(const auto & value: qAsConst(s.linkedNotebooks.ref())) { - writeLinkedNotebook(w, value); + writeLinkedNotebook(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.expungedLinkedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungedLinkedNotebooks"), ThriftFieldType::T_LIST, 14); - w.writeListBegin(ThriftFieldType::T_STRING, s.expungedLinkedNotebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.expungedLinkedNotebooks.ref().length()); for(const auto & value: qAsConst(s.expungedLinkedNotebooks.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSyncChunk( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SyncChunk & s) { QString fname; @@ -724,38 +775,38 @@ void readSyncChunk( qint16 fieldId; bool currentTime_isset = false; bool updateCount_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { currentTime_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.currentTime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.chunkHighUSN = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { updateCount_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.updateCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -763,7 +814,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -772,13 +823,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Note elem; - readNote(r, elem); + readNote(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -786,7 +837,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -795,13 +846,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Notebook elem; - readNotebook(r, elem); + readNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { @@ -809,7 +860,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -818,13 +869,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Tag elem; - readTag(r, elem); + readTag(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { @@ -832,7 +883,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -841,13 +892,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { SavedSearch elem; - readSavedSearch(r, elem); + readSavedSearch(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.searches = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { @@ -855,7 +906,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -864,13 +915,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Resource elem; - readResource(r, elem); + readResource(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.resources = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { @@ -878,7 +929,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -887,13 +938,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.expungedNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { @@ -901,7 +952,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -910,13 +961,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.expungedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { @@ -924,7 +975,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -933,13 +984,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.expungedTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { @@ -947,7 +998,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -956,13 +1007,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.expungedSearches = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { @@ -970,7 +1021,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -979,13 +1030,13 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { LinkedNotebook elem; - readLinkedNotebook(r, elem); + readLinkedNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.linkedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { @@ -993,7 +1044,7 @@ void readSyncChunk( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -1002,21 +1053,21 @@ void readSyncChunk( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.expungedLinkedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.currentTime has no value")); if (!updateCount_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("SyncChunk.updateCount has no value")); } @@ -1176,291 +1227,324 @@ void SyncChunk::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSyncChunkFilter( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SyncChunkFilter & s) { - w.writeStructBegin(QStringLiteral("SyncChunkFilter")); + writer.writeStructBegin(QStringLiteral("SyncChunkFilter")); if (s.includeNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNotes"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.includeNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNotes.ref()); + writer.writeFieldEnd(); } + if (s.includeNoteResources.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNoteResources"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.includeNoteResources.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNoteResources.ref()); + writer.writeFieldEnd(); } + if (s.includeNoteAttributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNoteAttributes"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.includeNoteAttributes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNoteAttributes.ref()); + writer.writeFieldEnd(); } + if (s.includeNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNotebooks"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.includeNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.includeTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeTags"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.includeTags.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeTags.ref()); + writer.writeFieldEnd(); } + if (s.includeSearches.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeSearches"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.includeSearches.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeSearches.ref()); + writer.writeFieldEnd(); } + if (s.includeResources.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResources"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.includeResources.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResources.ref()); + writer.writeFieldEnd(); } + if (s.includeLinkedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeLinkedNotebooks"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.includeLinkedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeLinkedNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.includeExpunged.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeExpunged"), ThriftFieldType::T_BOOL, 9); - w.writeBool(s.includeExpunged.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeExpunged.ref()); + writer.writeFieldEnd(); } + if (s.includeNoteApplicationDataFullMap.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNoteApplicationDataFullMap"), ThriftFieldType::T_BOOL, 10); - w.writeBool(s.includeNoteApplicationDataFullMap.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNoteApplicationDataFullMap.ref()); + writer.writeFieldEnd(); } + if (s.includeResourceApplicationDataFullMap.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 12); - w.writeBool(s.includeResourceApplicationDataFullMap.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResourceApplicationDataFullMap.ref()); + writer.writeFieldEnd(); } + if (s.includeNoteResourceApplicationDataFullMap.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNoteResourceApplicationDataFullMap"), ThriftFieldType::T_BOOL, 13); - w.writeBool(s.includeNoteResourceApplicationDataFullMap.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNoteResourceApplicationDataFullMap.ref()); + writer.writeFieldEnd(); } + if (s.includeSharedNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 17); - w.writeBool(s.includeSharedNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeSharedNotes.ref()); + writer.writeFieldEnd(); } + if (s.omitSharedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("omitSharedNotebooks"), ThriftFieldType::T_BOOL, 16); - w.writeBool(s.omitSharedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.omitSharedNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.requireNoteContentClass.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("requireNoteContentClass"), ThriftFieldType::T_STRING, 11); - w.writeString(s.requireNoteContentClass.ref()); - w.writeFieldEnd(); + + writer.writeString(s.requireNoteContentClass.ref()); + writer.writeFieldEnd(); } + if (s.notebookGuids.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuids"), ThriftFieldType::T_SET, 15); - w.writeSetBegin(ThriftFieldType::T_STRING, s.notebookGuids.ref().count()); + + writer.writeSetBegin(ThriftFieldType::T_STRING, s.notebookGuids.ref().count()); for(const auto & value: qAsConst(s.notebookGuids.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeSetEnd(); - w.writeFieldEnd(); + writer.writeSetEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSyncChunkFilter( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SyncChunkFilter & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNoteResources = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNoteAttributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeSearches = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResources = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeLinkedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeExpunged = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNoteApplicationDataFullMap = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResourceApplicationDataFullMap = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNoteResourceApplicationDataFullMap = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeSharedNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.omitSharedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.requireNoteContentClass = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { @@ -1468,7 +1552,7 @@ void readSyncChunkFilter( QSet v; qint32 size; ThriftFieldType elemType; - r.readSetBegin(elemType, size); + reader.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -1477,21 +1561,21 @@ void readSyncChunkFilter( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.insert(elem); } - r.readSetEnd(); + reader.readSetEnd(); s.notebookGuids = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SyncChunkFilter::print(QTextStream & strm) const @@ -1636,168 +1720,195 @@ void SyncChunkFilter::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteFilter( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteFilter & s) { - w.writeStructBegin(QStringLiteral("NoteFilter")); + writer.writeStructBegin(QStringLiteral("NoteFilter")); if (s.order.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("order"), ThriftFieldType::T_I32, 1); - w.writeI32(s.order.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.order.ref()); + writer.writeFieldEnd(); } + if (s.ascending.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.ascending.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.ascending.ref()); + writer.writeFieldEnd(); } + if (s.words.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("words"), ThriftFieldType::T_STRING, 3); - w.writeString(s.words.ref()); - w.writeFieldEnd(); + + writer.writeString(s.words.ref()); + writer.writeFieldEnd(); } + if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 4); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.tagGuids.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.timeZone.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("timeZone"), ThriftFieldType::T_STRING, 6); - w.writeString(s.timeZone.ref()); - w.writeFieldEnd(); + + writer.writeString(s.timeZone.ref()); + writer.writeFieldEnd(); } + if (s.inactive.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("inactive"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.inactive.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.inactive.ref()); + writer.writeFieldEnd(); } + if (s.emphasized.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("emphasized"), ThriftFieldType::T_STRING, 8); - w.writeString(s.emphasized.ref()); - w.writeFieldEnd(); + + writer.writeString(s.emphasized.ref()); + writer.writeFieldEnd(); } + if (s.includeAllReadableNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeAllReadableNotebooks"), ThriftFieldType::T_BOOL, 9); - w.writeBool(s.includeAllReadableNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeAllReadableNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.includeAllReadableWorkspaces.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeAllReadableWorkspaces"), ThriftFieldType::T_BOOL, 15); - w.writeBool(s.includeAllReadableWorkspaces.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeAllReadableWorkspaces.ref()); + writer.writeFieldEnd(); } + if (s.context.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("context"), ThriftFieldType::T_STRING, 10); - w.writeString(s.context.ref()); - w.writeFieldEnd(); + + writer.writeString(s.context.ref()); + writer.writeFieldEnd(); } + if (s.rawWords.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("rawWords"), ThriftFieldType::T_STRING, 11); - w.writeString(s.rawWords.ref()); - w.writeFieldEnd(); + + writer.writeString(s.rawWords.ref()); + writer.writeFieldEnd(); } + if (s.searchContextBytes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 12); - w.writeBinary(s.searchContextBytes.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.searchContextBytes.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteFilter( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteFilter & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.order = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.ascending = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.words = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -1805,7 +1916,7 @@ void readNoteFilter( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -1814,93 +1925,93 @@ void readNoteFilter( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tagGuids = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.timeZone = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.inactive = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.emphasized = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeAllReadableNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeAllReadableWorkspaces = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.context = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.rawWords = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.searchContextBytes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteFilter::print(QTextStream & strm) const @@ -2021,86 +2132,105 @@ void NoteFilter::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteList( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteList & s) { - w.writeStructBegin(QStringLiteral("NoteList")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("NoteList")); + writer.writeFieldBegin( QStringLiteral("startIndex"), ThriftFieldType::T_I32, 1); - w.writeI32(s.startIndex); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(s.startIndex); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("totalNotes"), ThriftFieldType::T_I32, 2); - w.writeI32(s.totalNotes); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(s.totalNotes); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); for(const auto & value: qAsConst(s.notes)) { - writeNote(w, value); + writeNote(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); + if (s.stoppedWords.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); for(const auto & value: qAsConst(s.stoppedWords.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.searchedWords.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); for(const auto & value: qAsConst(s.searchedWords.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.updateCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); - w.writeI32(s.updateCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateCount.ref()); + writer.writeFieldEnd(); } + if (s.searchContextBytes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); - w.writeBinary(s.searchContextBytes.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.searchContextBytes.ref()); + writer.writeFieldEnd(); } + if (s.debugInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 8); - w.writeString(s.debugInfo.ref()); - w.writeFieldEnd(); + + writer.writeString(s.debugInfo.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteList( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteList & s) { QString fname; @@ -2109,29 +2239,29 @@ void readNoteList( bool startIndex_isset = false; bool totalNotes_isset = false; bool notes_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { startIndex_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.startIndex = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { totalNotes_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.totalNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -2140,7 +2270,7 @@ void readNoteList( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -2149,13 +2279,13 @@ void readNoteList( } for(qint32 i = 0; i < size; i++) { Note elem; - readNote(r, elem); + readNote(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -2163,7 +2293,7 @@ void readNoteList( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -2172,13 +2302,13 @@ void readNoteList( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.stoppedWords = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -2186,7 +2316,7 @@ void readNoteList( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -2195,48 +2325,48 @@ void readNoteList( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.searchedWords = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.searchContextBytes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.debugInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.startIndex has no value")); if (!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.totalNotes has no value")); if (!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteList.notes has no value")); @@ -2310,196 +2440,221 @@ void NoteList::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteMetadata( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteMetadata & s) { - w.writeStructBegin(QStringLiteral("NoteMetadata")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("NoteMetadata")); + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid); - w.writeFieldEnd(); + + writer.writeString(s.guid); + writer.writeFieldEnd(); + if (s.title.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("title"), ThriftFieldType::T_STRING, 2); - w.writeString(s.title.ref()); - w.writeFieldEnd(); + + writer.writeString(s.title.ref()); + writer.writeFieldEnd(); } + if (s.contentLength.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); - w.writeI32(s.contentLength.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.contentLength.ref()); + writer.writeFieldEnd(); } + if (s.created.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("created"), ThriftFieldType::T_I64, 6); - w.writeI64(s.created.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.created.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 7); - w.writeI64(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.updated.ref()); + writer.writeFieldEnd(); } + if (s.deleted.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); - w.writeI64(s.deleted.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.deleted.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.tagGuids.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); - w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.attributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); - writeNoteAttributes(w, s.attributes.ref()); - w.writeFieldEnd(); + + writeNoteAttributes(writer, s.attributes.ref()); + writer.writeFieldEnd(); } + if (s.largestResourceMime.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("largestResourceMime"), ThriftFieldType::T_STRING, 20); - w.writeString(s.largestResourceMime.ref()); - w.writeFieldEnd(); + + writer.writeString(s.largestResourceMime.ref()); + writer.writeFieldEnd(); } + if (s.largestResourceSize.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("largestResourceSize"), ThriftFieldType::T_I32, 21); - w.writeI32(s.largestResourceSize.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.largestResourceSize.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteMetadata( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteMetadata & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool guid_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { guid_isset = true; Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.title = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.contentLength = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.created = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.deleted = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { @@ -2507,7 +2662,7 @@ void readNoteMetadata( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -2516,48 +2671,48 @@ void readNoteMetadata( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tagGuids = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteAttributes v; - readNoteAttributes(r, v); + readNoteAttributes(reader, v); s.attributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.largestResourceMime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.largestResourceSize = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!guid_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteMetadata.guid has no value")); } @@ -2665,86 +2820,105 @@ void NoteMetadata::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotesMetadataList( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotesMetadataList & s) { - w.writeStructBegin(QStringLiteral("NotesMetadataList")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("NotesMetadataList")); + writer.writeFieldBegin( QStringLiteral("startIndex"), ThriftFieldType::T_I32, 1); - w.writeI32(s.startIndex); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(s.startIndex); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("totalNotes"), ThriftFieldType::T_I32, 2); - w.writeI32(s.totalNotes); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(s.totalNotes); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("notes"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.length()); for(const auto & value: qAsConst(s.notes)) { - writeNoteMetadata(w, value); + writeNoteMetadata(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); + if (s.stoppedWords.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stoppedWords"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.stoppedWords.ref().length()); for(const auto & value: qAsConst(s.stoppedWords.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.searchedWords.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searchedWords"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.searchedWords.ref().length()); for(const auto & value: qAsConst(s.searchedWords.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.updateCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateCount"), ThriftFieldType::T_I32, 6); - w.writeI32(s.updateCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateCount.ref()); + writer.writeFieldEnd(); } + if (s.searchContextBytes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("searchContextBytes"), ThriftFieldType::T_STRING, 7); - w.writeBinary(s.searchContextBytes.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.searchContextBytes.ref()); + writer.writeFieldEnd(); } + if (s.debugInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 9); - w.writeString(s.debugInfo.ref()); - w.writeFieldEnd(); + + writer.writeString(s.debugInfo.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotesMetadataList( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotesMetadataList & s) { QString fname; @@ -2753,29 +2927,29 @@ void readNotesMetadataList( bool startIndex_isset = false; bool totalNotes_isset = false; bool notes_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { startIndex_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.startIndex = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { totalNotes_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.totalNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -2784,7 +2958,7 @@ void readNotesMetadataList( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -2793,13 +2967,13 @@ void readNotesMetadataList( } for(qint32 i = 0; i < size; i++) { NoteMetadata elem; - readNoteMetadata(r, elem); + readNoteMetadata(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -2807,7 +2981,7 @@ void readNotesMetadataList( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -2816,13 +2990,13 @@ void readNotesMetadataList( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.stoppedWords = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -2830,7 +3004,7 @@ void readNotesMetadataList( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -2839,48 +3013,48 @@ void readNotesMetadataList( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.searchedWords = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.searchContextBytes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.debugInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!startIndex_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.startIndex has no value")); if (!totalNotes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.totalNotes has no value")); if (!notes_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NotesMetadataList.notes has no value")); @@ -2954,219 +3128,241 @@ void NotesMetadataList::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotesMetadataResultSpec( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotesMetadataResultSpec & s) { - w.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); + writer.writeStructBegin(QStringLiteral("NotesMetadataResultSpec")); if (s.includeTitle.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeTitle"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.includeTitle.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeTitle.ref()); + writer.writeFieldEnd(); } + if (s.includeContentLength.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeContentLength"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.includeContentLength.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeContentLength.ref()); + writer.writeFieldEnd(); } + if (s.includeCreated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeCreated"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.includeCreated.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeCreated.ref()); + writer.writeFieldEnd(); } + if (s.includeUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeUpdated"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.includeUpdated.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeUpdated.ref()); + writer.writeFieldEnd(); } + if (s.includeDeleted.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeDeleted"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.includeDeleted.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeDeleted.ref()); + writer.writeFieldEnd(); } + if (s.includeUpdateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeUpdateSequenceNum"), ThriftFieldType::T_BOOL, 10); - w.writeBool(s.includeUpdateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeUpdateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.includeNotebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNotebookGuid"), ThriftFieldType::T_BOOL, 11); - w.writeBool(s.includeNotebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNotebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.includeTagGuids.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeTagGuids"), ThriftFieldType::T_BOOL, 12); - w.writeBool(s.includeTagGuids.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeTagGuids.ref()); + writer.writeFieldEnd(); } + if (s.includeAttributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeAttributes"), ThriftFieldType::T_BOOL, 14); - w.writeBool(s.includeAttributes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeAttributes.ref()); + writer.writeFieldEnd(); } + if (s.includeLargestResourceMime.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeLargestResourceMime"), ThriftFieldType::T_BOOL, 20); - w.writeBool(s.includeLargestResourceMime.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeLargestResourceMime.ref()); + writer.writeFieldEnd(); } + if (s.includeLargestResourceSize.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeLargestResourceSize"), ThriftFieldType::T_BOOL, 21); - w.writeBool(s.includeLargestResourceSize.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeLargestResourceSize.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotesMetadataResultSpec( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotesMetadataResultSpec & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeTitle = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeContentLength = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeCreated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeDeleted = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeUpdateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNotebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeTagGuids = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeAttributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeLargestResourceMime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeLargestResourceSize = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NotesMetadataResultSpec::print(QTextStream & strm) const @@ -3267,59 +3463,67 @@ void NotesMetadataResultSpec::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteCollectionCounts( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteCollectionCounts & s) { - w.writeStructBegin(QStringLiteral("NoteCollectionCounts")); + writer.writeStructBegin(QStringLiteral("NoteCollectionCounts")); if (s.notebookCounts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookCounts"), ThriftFieldType::T_MAP, 1); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); + + writer.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.notebookCounts.ref().size()); for(const auto & it: toRange(s.notebookCounts.ref())) { - w.writeString(it.key()); - w.writeI32(it.value()); + writer.writeString(it.key()); + writer.writeI32(it.value()); } - w.writeMapEnd(); - w.writeFieldEnd(); + writer.writeMapEnd(); + + writer.writeFieldEnd(); } + if (s.tagCounts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tagCounts"), ThriftFieldType::T_MAP, 2); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); + + writer.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_I32, s.tagCounts.ref().size()); for(const auto & it: toRange(s.tagCounts.ref())) { - w.writeString(it.key()); - w.writeI32(it.value()); + writer.writeString(it.key()); + writer.writeI32(it.value()); } - w.writeMapEnd(); - w.writeFieldEnd(); + writer.writeMapEnd(); + + writer.writeFieldEnd(); } + if (s.trashCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("trashCount"), ThriftFieldType::T_I32, 3); - w.writeI32(s.trashCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.trashCount.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteCollectionCounts( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteCollectionCounts & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_MAP) { @@ -3327,20 +3531,20 @@ void readNoteCollectionCounts( qint32 size; ThriftFieldType keyType; ThriftFieldType elemType; - r.readMapBegin(keyType, elemType, size); + reader.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteCollectionCounts.notebookCounts)")); if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteCollectionCounts.notebookCounts)")); for(qint32 i = 0; i < size; i++) { Guid key; - r.readString(key); + reader.readString(key); qint32 value; - r.readI32(value); + reader.readI32(value); v[key] = value; } - r.readMapEnd(); + reader.readMapEnd(); s.notebookCounts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -3349,37 +3553,37 @@ void readNoteCollectionCounts( qint32 size; ThriftFieldType keyType; ThriftFieldType elemType; - r.readMapBegin(keyType, elemType, size); + reader.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteCollectionCounts.tagCounts)")); if (elemType != ThriftFieldType::T_I32) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteCollectionCounts.tagCounts)")); for(qint32 i = 0; i < size; i++) { Guid key; - r.readString(key); + reader.readString(key); qint32 value; - r.readI32(value); + reader.readI32(value); v[key] = value; } - r.readMapEnd(); + reader.readMapEnd(); s.tagCounts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.trashCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteCollectionCounts::print(QTextStream & strm) const @@ -3424,168 +3628,184 @@ void NoteCollectionCounts::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteResultSpec( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteResultSpec & s) { - w.writeStructBegin(QStringLiteral("NoteResultSpec")); + writer.writeStructBegin(QStringLiteral("NoteResultSpec")); if (s.includeContent.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeContent"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.includeContent.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeContent.ref()); + writer.writeFieldEnd(); } + if (s.includeResourcesData.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResourcesData"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.includeResourcesData.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResourcesData.ref()); + writer.writeFieldEnd(); } + if (s.includeResourcesRecognition.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResourcesRecognition"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.includeResourcesRecognition.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResourcesRecognition.ref()); + writer.writeFieldEnd(); } + if (s.includeResourcesAlternateData.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResourcesAlternateData"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.includeResourcesAlternateData.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResourcesAlternateData.ref()); + writer.writeFieldEnd(); } + if (s.includeSharedNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeSharedNotes"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.includeSharedNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeSharedNotes.ref()); + writer.writeFieldEnd(); } + if (s.includeNoteAppDataValues.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeNoteAppDataValues"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.includeNoteAppDataValues.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeNoteAppDataValues.ref()); + writer.writeFieldEnd(); } + if (s.includeResourceAppDataValues.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeResourceAppDataValues"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.includeResourceAppDataValues.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeResourceAppDataValues.ref()); + writer.writeFieldEnd(); } + if (s.includeAccountLimits.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeAccountLimits"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.includeAccountLimits.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeAccountLimits.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteResultSpec( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteResultSpec & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeContent = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResourcesData = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResourcesRecognition = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResourcesAlternateData = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeSharedNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeNoteAppDataValues = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeResourceAppDataValues = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeAccountLimits = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteResultSpec::print(QTextStream & strm) const @@ -3662,98 +3882,112 @@ void NoteResultSpec::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteEmailParameters( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteEmailParameters & s) { - w.writeStructBegin(QStringLiteral("NoteEmailParameters")); + writer.writeStructBegin(QStringLiteral("NoteEmailParameters")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.note.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("note"), ThriftFieldType::T_STRUCT, 2); - writeNote(w, s.note.ref()); - w.writeFieldEnd(); + + writeNote(writer, s.note.ref()); + writer.writeFieldEnd(); } + if (s.toAddresses.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("toAddresses"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRING, s.toAddresses.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.toAddresses.ref().length()); for(const auto & value: qAsConst(s.toAddresses.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.ccAddresses.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("ccAddresses"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRING, s.ccAddresses.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.ccAddresses.ref().length()); for(const auto & value: qAsConst(s.ccAddresses.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.subject.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("subject"), ThriftFieldType::T_STRING, 5); - w.writeString(s.subject.ref()); - w.writeFieldEnd(); + + writer.writeString(s.subject.ref()); + writer.writeFieldEnd(); } + if (s.message.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("message"), ThriftFieldType::T_STRING, 6); - w.writeString(s.message.ref()); - w.writeFieldEnd(); + + writer.writeString(s.message.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteEmailParameters( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteEmailParameters & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Note v; - readNote(r, v); + readNote(reader, v); s.note = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -3761,7 +3995,7 @@ void readNoteEmailParameters( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -3770,13 +4004,13 @@ void readNoteEmailParameters( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.toAddresses = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -3784,7 +4018,7 @@ void readNoteEmailParameters( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -3793,39 +4027,39 @@ void readNoteEmailParameters( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.ccAddresses = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.subject = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.message = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteEmailParameters::print(QTextStream & strm) const @@ -3894,48 +4128,58 @@ void NoteEmailParameters::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteVersionId( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteVersionId & s) { - w.writeStructBegin(QStringLiteral("NoteVersionId")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("NoteVersionId")); + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 1); - w.writeI32(s.updateSequenceNum); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI32(s.updateSequenceNum); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 2); - w.writeI64(s.updated); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI64(s.updated); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("saved"), ThriftFieldType::T_I64, 3); - w.writeI64(s.saved); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI64(s.saved); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("title"), ThriftFieldType::T_STRING, 4); - w.writeString(s.title); - w.writeFieldEnd(); + + writer.writeString(s.title); + writer.writeFieldEnd(); + if (s.lastEditorId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 5); - w.writeI32(s.lastEditorId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.lastEditorId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteVersionId( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteVersionId & s) { QString fname; @@ -3945,66 +4189,66 @@ void readNoteVersionId( bool updated_isset = false; bool saved_isset = false; bool title_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { updateSequenceNum_isset = true; qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { updated_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { saved_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.saved = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { title_isset = true; QString v; - r.readString(v); + reader.readString(v); s.title = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.lastEditorId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!updateSequenceNum_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updateSequenceNum has no value")); if (!updated_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.updated has no value")); if (!saved_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("NoteVersionId.saved has no value")); @@ -4037,134 +4281,146 @@ void NoteVersionId::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeRelatedQuery( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const RelatedQuery & s) { - w.writeStructBegin(QStringLiteral("RelatedQuery")); + writer.writeStructBegin(QStringLiteral("RelatedQuery")); if (s.noteGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.noteGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteGuid.ref()); + writer.writeFieldEnd(); } + if (s.plainText.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("plainText"), ThriftFieldType::T_STRING, 2); - w.writeString(s.plainText.ref()); - w.writeFieldEnd(); + + writer.writeString(s.plainText.ref()); + writer.writeFieldEnd(); } + if (s.filter.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("filter"), ThriftFieldType::T_STRUCT, 3); - writeNoteFilter(w, s.filter.ref()); - w.writeFieldEnd(); + + writeNoteFilter(writer, s.filter.ref()); + writer.writeFieldEnd(); } + if (s.referenceUri.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("referenceUri"), ThriftFieldType::T_STRING, 4); - w.writeString(s.referenceUri.ref()); - w.writeFieldEnd(); + + writer.writeString(s.referenceUri.ref()); + writer.writeFieldEnd(); } + if (s.context.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("context"), ThriftFieldType::T_STRING, 5); - w.writeString(s.context.ref()); - w.writeFieldEnd(); + + writer.writeString(s.context.ref()); + writer.writeFieldEnd(); } + if (s.cacheKey.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 6); - w.writeString(s.cacheKey.ref()); - w.writeFieldEnd(); + + writer.writeString(s.cacheKey.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readRelatedQuery( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedQuery & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.plainText = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteFilter v; - readNoteFilter(r, v); + readNoteFilter(reader, v); s.filter = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.referenceUri = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.context = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.cacheKey = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void RelatedQuery::print(QTextStream & strm) const @@ -4225,128 +4481,152 @@ void RelatedQuery::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeRelatedResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const RelatedResult & s) { - w.writeStructBegin(QStringLiteral("RelatedResult")); + writer.writeStructBegin(QStringLiteral("RelatedResult")); if (s.notes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notes"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notes.ref().length()); for(const auto & value: qAsConst(s.notes.ref())) { - writeNote(w, value); + writeNote(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.notebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebooks"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.notebooks.ref().length()); for(const auto & value: qAsConst(s.notebooks.ref())) { - writeNotebook(w, value); + writeNotebook(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.tags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tags"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.tags.ref().length()); for(const auto & value: qAsConst(s.tags.ref())) { - writeTag(w, value); + writeTag(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.containingNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("containingNotebooks"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.containingNotebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.containingNotebooks.ref().length()); for(const auto & value: qAsConst(s.containingNotebooks.ref())) { - writeNotebookDescriptor(w, value); + writeNotebookDescriptor(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.debugInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("debugInfo"), ThriftFieldType::T_STRING, 5); - w.writeString(s.debugInfo.ref()); - w.writeFieldEnd(); + + writer.writeString(s.debugInfo.ref()); + writer.writeFieldEnd(); } + if (s.experts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("experts"), ThriftFieldType::T_LIST, 6); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.experts.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.experts.ref().length()); for(const auto & value: qAsConst(s.experts.ref())) { - writeUserProfile(w, value); + writeUserProfile(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.relatedContent.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("relatedContent"), ThriftFieldType::T_LIST, 7); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.relatedContent.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.relatedContent.ref().length()); for(const auto & value: qAsConst(s.relatedContent.ref())) { - writeRelatedContent(w, value); + writeRelatedContent(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.cacheKey.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("cacheKey"), ThriftFieldType::T_STRING, 8); - w.writeString(s.cacheKey.ref()); - w.writeFieldEnd(); + + writer.writeString(s.cacheKey.ref()); + writer.writeFieldEnd(); } + if (s.cacheExpires.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("cacheExpires"), ThriftFieldType::T_I32, 9); - w.writeI32(s.cacheExpires.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.cacheExpires.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readRelatedResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedResult & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4355,13 +4635,13 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { Note elem; - readNote(r, elem); + readNote(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -4369,7 +4649,7 @@ void readRelatedResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4378,13 +4658,13 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { Notebook elem; - readNotebook(r, elem); + readNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.notebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -4392,7 +4672,7 @@ void readRelatedResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4401,13 +4681,13 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { Tag elem; - readTag(r, elem); + readTag(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -4415,7 +4695,7 @@ void readRelatedResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4424,22 +4704,22 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { NotebookDescriptor elem; - readNotebookDescriptor(r, elem); + readNotebookDescriptor(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.containingNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.debugInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { @@ -4447,7 +4727,7 @@ void readRelatedResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4456,13 +4736,13 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { UserProfile elem; - readUserProfile(r, elem); + readUserProfile(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.experts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { @@ -4470,7 +4750,7 @@ void readRelatedResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -4479,39 +4759,39 @@ void readRelatedResult( } for(qint32 i = 0; i < size; i++) { RelatedContent elem; - readRelatedContent(r, elem); + readRelatedContent(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.relatedContent = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.cacheKey = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.cacheExpires = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void RelatedResult::print(QTextStream & strm) const @@ -4620,172 +4900,191 @@ void RelatedResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeRelatedResultSpec( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const RelatedResultSpec & s) { - w.writeStructBegin(QStringLiteral("RelatedResultSpec")); + writer.writeStructBegin(QStringLiteral("RelatedResultSpec")); if (s.maxNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxNotes"), ThriftFieldType::T_I32, 1); - w.writeI32(s.maxNotes.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxNotes.ref()); + writer.writeFieldEnd(); } + if (s.maxNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxNotebooks"), ThriftFieldType::T_I32, 2); - w.writeI32(s.maxNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.maxTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxTags"), ThriftFieldType::T_I32, 3); - w.writeI32(s.maxTags.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxTags.ref()); + writer.writeFieldEnd(); } + if (s.writableNotebooksOnly.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("writableNotebooksOnly"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.writableNotebooksOnly.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.writableNotebooksOnly.ref()); + writer.writeFieldEnd(); } + if (s.includeContainingNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeContainingNotebooks"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.includeContainingNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeContainingNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.includeDebugInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeDebugInfo"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.includeDebugInfo.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeDebugInfo.ref()); + writer.writeFieldEnd(); } + if (s.maxExperts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxExperts"), ThriftFieldType::T_I32, 7); - w.writeI32(s.maxExperts.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxExperts.ref()); + writer.writeFieldEnd(); } + if (s.maxRelatedContent.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxRelatedContent"), ThriftFieldType::T_I32, 8); - w.writeI32(s.maxRelatedContent.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxRelatedContent.ref()); + writer.writeFieldEnd(); } + if (s.relatedContentTypes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("relatedContentTypes"), ThriftFieldType::T_SET, 9); - w.writeSetBegin(ThriftFieldType::T_I32, s.relatedContentTypes.ref().count()); + + writer.writeSetBegin(ThriftFieldType::T_I32, s.relatedContentTypes.ref().count()); for(const auto & value: qAsConst(s.relatedContentTypes.ref())) { - w.writeI32(static_cast(value)); + writer.writeI32(static_cast(value)); } - w.writeSetEnd(); - w.writeFieldEnd(); + writer.writeSetEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readRelatedResultSpec( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedResultSpec & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.writableNotebooksOnly = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeContainingNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeDebugInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxExperts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxRelatedContent = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { @@ -4793,7 +5092,7 @@ void readRelatedResultSpec( QSet v; qint32 size; ThriftFieldType elemType; - r.readSetBegin(elemType, size); + reader.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { throw ThriftException( @@ -4802,21 +5101,21 @@ void readRelatedResultSpec( } for(qint32 i = 0; i < size; i++) { RelatedContentType elem; - readEnumRelatedContentType(r, elem); + readEnumRelatedContentType(reader, elem); v.insert(elem); } - r.readSetEnd(); + reader.readSetEnd(); s.relatedContentTypes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void RelatedResultSpec::print(QTextStream & strm) const @@ -4905,66 +5204,70 @@ void RelatedResultSpec::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUpdateNoteIfUsnMatchesResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const UpdateNoteIfUsnMatchesResult & s) { - w.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); + writer.writeStructBegin(QStringLiteral("UpdateNoteIfUsnMatchesResult")); if (s.note.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("note"), ThriftFieldType::T_STRUCT, 1); - writeNote(w, s.note.ref()); - w.writeFieldEnd(); + + writeNote(writer, s.note.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.updated.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUpdateNoteIfUsnMatchesResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UpdateNoteIfUsnMatchesResult & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { Note v; - readNote(r, v); + readNote(reader, v); s.note = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void UpdateNoteIfUsnMatchesResult::print(QTextStream & strm) const @@ -4993,100 +5296,108 @@ void UpdateNoteIfUsnMatchesResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeShareRelationshipRestrictions( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ShareRelationshipRestrictions & s) { - w.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); + writer.writeStructBegin(QStringLiteral("ShareRelationshipRestrictions")); if (s.noSetReadOnly.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetReadOnly"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.noSetReadOnly.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetReadOnly.ref()); + writer.writeFieldEnd(); } + if (s.noSetReadPlusActivity.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetReadPlusActivity"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.noSetReadPlusActivity.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetReadPlusActivity.ref()); + writer.writeFieldEnd(); } + if (s.noSetModify.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetModify"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.noSetModify.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetModify.ref()); + writer.writeFieldEnd(); } + if (s.noSetFullAccess.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.noSetFullAccess.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetFullAccess.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readShareRelationshipRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ShareRelationshipRestrictions & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetReadOnly = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetReadPlusActivity = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetModify = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetFullAccess = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ShareRelationshipRestrictions::print(QTextStream & strm) const @@ -5131,100 +5442,108 @@ void ShareRelationshipRestrictions::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeInvitationShareRelationship( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const InvitationShareRelationship & s) { - w.writeStructBegin(QStringLiteral("InvitationShareRelationship")); + writer.writeStructBegin(QStringLiteral("InvitationShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); - w.writeString(s.displayName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.displayName.ref()); + writer.writeFieldEnd(); } + if (s.recipientUserIdentity.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientUserIdentity"), ThriftFieldType::T_STRUCT, 2); - writeUserIdentity(w, s.recipientUserIdentity.ref()); - w.writeFieldEnd(); + + writeUserIdentity(writer, s.recipientUserIdentity.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.sharerUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); - w.writeI32(s.sharerUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readInvitationShareRelationship( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, InvitationShareRelationship & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.displayName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { UserIdentity v; - readUserIdentity(r, v); + readUserIdentity(reader, v); s.recipientUserIdentity = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; - readEnumShareRelationshipPrivilegeLevel(r, v); + readEnumShareRelationshipPrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void InvitationShareRelationship::print(QTextStream & strm) const @@ -5269,134 +5588,146 @@ void InvitationShareRelationship::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeMemberShareRelationship( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const MemberShareRelationship & s) { - w.writeStructBegin(QStringLiteral("MemberShareRelationship")); + writer.writeStructBegin(QStringLiteral("MemberShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); - w.writeString(s.displayName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.displayName.ref()); + writer.writeFieldEnd(); } + if (s.recipientUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); - w.writeI32(s.recipientUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.recipientUserId.ref()); + writer.writeFieldEnd(); } + if (s.bestPrivilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("bestPrivilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.bestPrivilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.bestPrivilege.ref())); + writer.writeFieldEnd(); } + if (s.individualPrivilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("individualPrivilege"), ThriftFieldType::T_I32, 4); - w.writeI32(static_cast(s.individualPrivilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.individualPrivilege.ref())); + writer.writeFieldEnd(); } + if (s.restrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 5); - writeShareRelationshipRestrictions(w, s.restrictions.ref()); - w.writeFieldEnd(); + + writeShareRelationshipRestrictions(writer, s.restrictions.ref()); + writer.writeFieldEnd(); } + if (s.sharerUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 6); - w.writeI32(s.sharerUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readMemberShareRelationship( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, MemberShareRelationship & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.displayName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.recipientUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; - readEnumShareRelationshipPrivilegeLevel(r, v); + readEnumShareRelationshipPrivilegeLevel(reader, v); s.bestPrivilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; - readEnumShareRelationshipPrivilegeLevel(r, v); + readEnumShareRelationshipPrivilegeLevel(reader, v); s.individualPrivilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { ShareRelationshipRestrictions v; - readShareRelationshipRestrictions(r, v); + readShareRelationshipRestrictions(reader, v); s.restrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void MemberShareRelationship::print(QTextStream & strm) const @@ -5457,64 +5788,72 @@ void MemberShareRelationship::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeShareRelationships( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ShareRelationships & s) { - w.writeStructBegin(QStringLiteral("ShareRelationships")); + writer.writeStructBegin(QStringLiteral("ShareRelationships")); if (s.invitations.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); for(const auto & value: qAsConst(s.invitations.ref())) { - writeInvitationShareRelationship(w, value); + writeInvitationShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.memberships.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); for(const auto & value: qAsConst(s.memberships.ref())) { - writeMemberShareRelationship(w, value); + writeMemberShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.invitationRestrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); - writeShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); - w.writeFieldEnd(); + + writeShareRelationshipRestrictions(writer, s.invitationRestrictions.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readShareRelationships( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ShareRelationships & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -5523,13 +5862,13 @@ void readShareRelationships( } for(qint32 i = 0; i < size; i++) { InvitationShareRelationship elem; - readInvitationShareRelationship(r, elem); + readInvitationShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.invitations = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -5537,7 +5876,7 @@ void readShareRelationships( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -5546,30 +5885,30 @@ void readShareRelationships( } for(qint32 i = 0; i < size; i++) { MemberShareRelationship elem; - readMemberShareRelationship(r, elem); + readMemberShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.memberships = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { ShareRelationshipRestrictions v; - readShareRelationshipRestrictions(r, v); + readShareRelationshipRestrictions(reader, v); s.invitationRestrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ShareRelationships::print(QTextStream & strm) const @@ -5614,94 +5953,107 @@ void ShareRelationships::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNotebookSharesParameters( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNotebookSharesParameters & s) { - w.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); + writer.writeStructBegin(QStringLiteral("ManageNotebookSharesParameters")); if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.inviteMessage.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("inviteMessage"), ThriftFieldType::T_STRING, 2); - w.writeString(s.inviteMessage.ref()); - w.writeFieldEnd(); + + writer.writeString(s.inviteMessage.ref()); + writer.writeFieldEnd(); } + if (s.membershipsToUpdate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { - writeMemberShareRelationship(w, value); + writeMemberShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.invitationsToCreateOrUpdate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitationsToCreateOrUpdate"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToCreateOrUpdate.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToCreateOrUpdate.ref().length()); for(const auto & value: qAsConst(s.invitationsToCreateOrUpdate.ref())) { - writeInvitationShareRelationship(w, value); + writeInvitationShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.unshares.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("unshares"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.unshares.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.unshares.ref().length()); for(const auto & value: qAsConst(s.unshares.ref())) { - writeUserIdentity(w, value); + writeUserIdentity(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNotebookSharesParameters( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNotebookSharesParameters & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.inviteMessage = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -5709,7 +6061,7 @@ void readManageNotebookSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -5718,13 +6070,13 @@ void readManageNotebookSharesParameters( } for(qint32 i = 0; i < size; i++) { MemberShareRelationship elem; - readMemberShareRelationship(r, elem); + readMemberShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.membershipsToUpdate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -5732,7 +6084,7 @@ void readManageNotebookSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -5741,13 +6093,13 @@ void readManageNotebookSharesParameters( } for(qint32 i = 0; i < size; i++) { InvitationShareRelationship elem; - readInvitationShareRelationship(r, elem); + readInvitationShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.invitationsToCreateOrUpdate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -5755,7 +6107,7 @@ void readManageNotebookSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -5764,21 +6116,21 @@ void readManageNotebookSharesParameters( } for(qint32 i = 0; i < size; i++) { UserIdentity elem; - readUserIdentity(r, elem); + readUserIdentity(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.unshares = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNotebookSharesParameters::print(QTextStream & strm) const @@ -5843,83 +6195,89 @@ void ManageNotebookSharesParameters::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNotebookSharesError( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNotebookSharesError & s) { - w.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); + writer.writeStructBegin(QStringLiteral("ManageNotebookSharesError")); if (s.userIdentity.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userIdentity"), ThriftFieldType::T_STRUCT, 1); - writeUserIdentity(w, s.userIdentity.ref()); - w.writeFieldEnd(); + + writeUserIdentity(writer, s.userIdentity.ref()); + writer.writeFieldEnd(); } + if (s.userException.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 2); - writeEDAMUserException(w, s.userException.ref()); - w.writeFieldEnd(); + + writeEDAMUserException(writer, s.userException.ref()); + writer.writeFieldEnd(); } + if (s.notFoundException.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 3); - writeEDAMNotFoundException(w, s.notFoundException.ref()); - w.writeFieldEnd(); + + writeEDAMNotFoundException(writer, s.notFoundException.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNotebookSharesError( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNotebookSharesError & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRUCT) { UserIdentity v; - readUserIdentity(r, v); + readUserIdentity(reader, v); s.userIdentity = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException v; - readEDAMUserException(r, v); + readEDAMUserException(reader, v); s.userException = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException v; - readEDAMNotFoundException(r, v); + readEDAMNotFoundException(reader, v); s.notFoundException = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNotebookSharesError::print(QTextStream & strm) const @@ -5956,44 +6314,47 @@ void ManageNotebookSharesError::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNotebookSharesResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNotebookSharesResult & s) { - w.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); + writer.writeStructBegin(QStringLiteral("ManageNotebookSharesResult")); if (s.errors.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); for(const auto & value: qAsConst(s.errors.ref())) { - writeManageNotebookSharesError(w, value); + writeManageNotebookSharesError(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNotebookSharesResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNotebookSharesResult & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6002,21 +6363,21 @@ void readManageNotebookSharesResult( } for(qint32 i = 0; i < size; i++) { ManageNotebookSharesError elem; - readManageNotebookSharesError(r, elem); + readManageNotebookSharesError(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.errors = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNotebookSharesResult::print(QTextStream & strm) const @@ -6041,78 +6402,87 @@ void ManageNotebookSharesResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSharedNoteTemplate( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SharedNoteTemplate & s) { - w.writeStructBegin(QStringLiteral("SharedNoteTemplate")); + writer.writeStructBegin(QStringLiteral("SharedNoteTemplate")); if (s.noteGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.noteGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteGuid.ref()); + writer.writeFieldEnd(); } + if (s.recipientThreadId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); - w.writeI64(s.recipientThreadId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.recipientThreadId.ref()); + writer.writeFieldEnd(); } + if (s.recipientContacts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); for(const auto & value: qAsConst(s.recipientContacts.ref())) { - writeContact(w, value); + writeContact(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSharedNoteTemplate( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNoteTemplate & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.noteGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { MessageThreadID v; - r.readI64(v); + reader.readI64(v); s.recipientThreadId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -6120,7 +6490,7 @@ void readSharedNoteTemplate( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6129,30 +6499,30 @@ void readSharedNoteTemplate( } for(qint32 i = 0; i < size; i++) { Contact elem; - readContact(r, elem); + readContact(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.recipientContacts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; - readEnumSharedNotePrivilegeLevel(r, v); + readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SharedNoteTemplate::print(QTextStream & strm) const @@ -6201,78 +6571,87 @@ void SharedNoteTemplate::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotebookShareTemplate( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotebookShareTemplate & s) { - w.writeStructBegin(QStringLiteral("NotebookShareTemplate")); + writer.writeStructBegin(QStringLiteral("NotebookShareTemplate")); if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.recipientThreadId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientThreadId"), ThriftFieldType::T_I64, 4); - w.writeI64(s.recipientThreadId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.recipientThreadId.ref()); + writer.writeFieldEnd(); } + if (s.recipientContacts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientContacts"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.recipientContacts.ref().length()); for(const auto & value: qAsConst(s.recipientContacts.ref())) { - writeContact(w, value); + writeContact(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotebookShareTemplate( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotebookShareTemplate & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { MessageThreadID v; - r.readI64(v); + reader.readI64(v); s.recipientThreadId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -6280,7 +6659,7 @@ void readNotebookShareTemplate( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6289,30 +6668,30 @@ void readNotebookShareTemplate( } for(qint32 i = 0; i < size; i++) { Contact elem; - readContact(r, elem); + readContact(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.recipientContacts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; - readEnumSharedNotebookPrivilegeLevel(r, v); + readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NotebookShareTemplate::print(QTextStream & strm) const @@ -6361,53 +6740,58 @@ void NotebookShareTemplate::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeCreateOrUpdateNotebookSharesResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const CreateOrUpdateNotebookSharesResult & s) { - w.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); + writer.writeStructBegin(QStringLiteral("CreateOrUpdateNotebookSharesResult")); if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 1); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.matchingShares.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("matchingShares"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.matchingShares.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.matchingShares.ref().length()); for(const auto & value: qAsConst(s.matchingShares.ref())) { - writeSharedNotebook(w, value); + writeSharedNotebook(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readCreateOrUpdateNotebookSharesResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, CreateOrUpdateNotebookSharesResult & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -6415,7 +6799,7 @@ void readCreateOrUpdateNotebookSharesResult( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6424,21 +6808,21 @@ void readCreateOrUpdateNotebookSharesResult( } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; - readSharedNotebook(r, elem); + readSharedNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.matchingShares = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void CreateOrUpdateNotebookSharesResult::print(QTextStream & strm) const @@ -6471,83 +6855,89 @@ void CreateOrUpdateNotebookSharesResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteShareRelationshipRestrictions( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteShareRelationshipRestrictions & s) { - w.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); + writer.writeStructBegin(QStringLiteral("NoteShareRelationshipRestrictions")); if (s.noSetReadNote.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetReadNote"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.noSetReadNote.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetReadNote.ref()); + writer.writeFieldEnd(); } + if (s.noSetModifyNote.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetModifyNote"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.noSetModifyNote.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetModifyNote.ref()); + writer.writeFieldEnd(); } + if (s.noSetFullAccess.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetFullAccess"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.noSetFullAccess.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetFullAccess.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteShareRelationshipRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteShareRelationshipRestrictions & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetReadNote = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetModifyNote = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetFullAccess = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteShareRelationshipRestrictions::print(QTextStream & strm) const @@ -6584,117 +6974,127 @@ void NoteShareRelationshipRestrictions::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteMemberShareRelationship( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteMemberShareRelationship & s) { - w.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); + writer.writeStructBegin(QStringLiteral("NoteMemberShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); - w.writeString(s.displayName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.displayName.ref()); + writer.writeFieldEnd(); } + if (s.recipientUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 2); - w.writeI32(s.recipientUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.recipientUserId.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.restrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 4); - writeNoteShareRelationshipRestrictions(w, s.restrictions.ref()); - w.writeFieldEnd(); + + writeNoteShareRelationshipRestrictions(writer, s.restrictions.ref()); + writer.writeFieldEnd(); } + if (s.sharerUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); - w.writeI32(s.sharerUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteMemberShareRelationship( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteMemberShareRelationship & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.displayName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.recipientUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; - readEnumSharedNotePrivilegeLevel(r, v); + readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteShareRelationshipRestrictions v; - readNoteShareRelationshipRestrictions(r, v); + readNoteShareRelationshipRestrictions(reader, v); s.restrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteMemberShareRelationship::print(QTextStream & strm) const @@ -6747,100 +7147,108 @@ void NoteMemberShareRelationship::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteInvitationShareRelationship( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteInvitationShareRelationship & s) { - w.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); + writer.writeStructBegin(QStringLiteral("NoteInvitationShareRelationship")); if (s.displayName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("displayName"), ThriftFieldType::T_STRING, 1); - w.writeString(s.displayName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.displayName.ref()); + writer.writeFieldEnd(); } + if (s.recipientIdentityId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 2); - w.writeI64(s.recipientIdentityId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.recipientIdentityId.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.sharerUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 5); - w.writeI32(s.sharerUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteInvitationShareRelationship( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteInvitationShareRelationship & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.displayName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { IdentityID v; - r.readI64(v); + reader.readI64(v); s.recipientIdentityId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; - readEnumSharedNotePrivilegeLevel(r, v); + readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteInvitationShareRelationship::print(QTextStream & strm) const @@ -6885,64 +7293,72 @@ void NoteInvitationShareRelationship::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteShareRelationships( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteShareRelationships & s) { - w.writeStructBegin(QStringLiteral("NoteShareRelationships")); + writer.writeStructBegin(QStringLiteral("NoteShareRelationships")); if (s.invitations.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitations"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.invitations.ref().length()); for(const auto & value: qAsConst(s.invitations.ref())) { - writeNoteInvitationShareRelationship(w, value); + writeNoteInvitationShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.memberships.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("memberships"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.memberships.ref().length()); for(const auto & value: qAsConst(s.memberships.ref())) { - writeNoteMemberShareRelationship(w, value); + writeNoteMemberShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.invitationRestrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitationRestrictions"), ThriftFieldType::T_STRUCT, 3); - writeNoteShareRelationshipRestrictions(w, s.invitationRestrictions.ref()); - w.writeFieldEnd(); + + writeNoteShareRelationshipRestrictions(writer, s.invitationRestrictions.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteShareRelationships( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteShareRelationships & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6951,13 +7367,13 @@ void readNoteShareRelationships( } for(qint32 i = 0; i < size; i++) { NoteInvitationShareRelationship elem; - readNoteInvitationShareRelationship(r, elem); + readNoteInvitationShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.invitations = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -6965,7 +7381,7 @@ void readNoteShareRelationships( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -6974,30 +7390,30 @@ void readNoteShareRelationships( } for(qint32 i = 0; i < size; i++) { NoteMemberShareRelationship elem; - readNoteMemberShareRelationship(r, elem); + readNoteMemberShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.memberships = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteShareRelationshipRestrictions v; - readNoteShareRelationshipRestrictions(r, v); + readNoteShareRelationshipRestrictions(reader, v); s.invitationRestrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteShareRelationships::print(QTextStream & strm) const @@ -7042,89 +7458,103 @@ void NoteShareRelationships::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNoteSharesParameters( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNoteSharesParameters & s) { - w.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); + writer.writeStructBegin(QStringLiteral("ManageNoteSharesParameters")); if (s.noteGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.noteGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteGuid.ref()); + writer.writeFieldEnd(); } + if (s.membershipsToUpdate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("membershipsToUpdate"), ThriftFieldType::T_LIST, 2); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.membershipsToUpdate.ref().length()); for(const auto & value: qAsConst(s.membershipsToUpdate.ref())) { - writeNoteMemberShareRelationship(w, value); + writeNoteMemberShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.invitationsToUpdate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitationsToUpdate"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToUpdate.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.invitationsToUpdate.ref().length()); for(const auto & value: qAsConst(s.invitationsToUpdate.ref())) { - writeNoteInvitationShareRelationship(w, value); + writeNoteInvitationShareRelationship(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.membershipsToUnshare.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("membershipsToUnshare"), ThriftFieldType::T_LIST, 4); - w.writeListBegin(ThriftFieldType::T_I32, s.membershipsToUnshare.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_I32, s.membershipsToUnshare.ref().length()); for(const auto & value: qAsConst(s.membershipsToUnshare.ref())) { - w.writeI32(value); + writer.writeI32(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.invitationsToUnshare.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("invitationsToUnshare"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_I64, s.invitationsToUnshare.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_I64, s.invitationsToUnshare.ref().length()); for(const auto & value: qAsConst(s.invitationsToUnshare.ref())) { - w.writeI64(value); + writer.writeI64(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNoteSharesParameters( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNoteSharesParameters & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -7132,7 +7562,7 @@ void readManageNoteSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -7141,13 +7571,13 @@ void readManageNoteSharesParameters( } for(qint32 i = 0; i < size; i++) { NoteMemberShareRelationship elem; - readNoteMemberShareRelationship(r, elem); + readNoteMemberShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.membershipsToUpdate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -7155,7 +7585,7 @@ void readManageNoteSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -7164,13 +7594,13 @@ void readManageNoteSharesParameters( } for(qint32 i = 0; i < size; i++) { NoteInvitationShareRelationship elem; - readNoteInvitationShareRelationship(r, elem); + readNoteInvitationShareRelationship(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.invitationsToUpdate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { @@ -7178,7 +7608,7 @@ void readManageNoteSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { throw ThriftException( @@ -7187,13 +7617,13 @@ void readManageNoteSharesParameters( } for(qint32 i = 0; i < size; i++) { UserID elem; - r.readI32(elem); + reader.readI32(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.membershipsToUnshare = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -7201,7 +7631,7 @@ void readManageNoteSharesParameters( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I64) { throw ThriftException( @@ -7210,21 +7640,21 @@ void readManageNoteSharesParameters( } for(qint32 i = 0; i < size; i++) { IdentityID elem; - r.readI64(elem); + reader.readI64(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.invitationsToUnshare = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNoteSharesParameters::print(QTextStream & strm) const @@ -7293,100 +7723,108 @@ void ManageNoteSharesParameters::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNoteSharesError( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNoteSharesError & s) { - w.writeStructBegin(QStringLiteral("ManageNoteSharesError")); + writer.writeStructBegin(QStringLiteral("ManageNoteSharesError")); if (s.identityID.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("identityID"), ThriftFieldType::T_I64, 1); - w.writeI64(s.identityID.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.identityID.ref()); + writer.writeFieldEnd(); } + if (s.userID.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userID"), ThriftFieldType::T_I32, 2); - w.writeI32(s.userID.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userID.ref()); + writer.writeFieldEnd(); } + if (s.userException.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userException"), ThriftFieldType::T_STRUCT, 3); - writeEDAMUserException(w, s.userException.ref()); - w.writeFieldEnd(); + + writeEDAMUserException(writer, s.userException.ref()); + writer.writeFieldEnd(); } + if (s.notFoundException.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notFoundException"), ThriftFieldType::T_STRUCT, 4); - writeEDAMNotFoundException(w, s.notFoundException.ref()); - w.writeFieldEnd(); + + writeEDAMNotFoundException(writer, s.notFoundException.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNoteSharesError( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNoteSharesError & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { IdentityID v; - r.readI64(v); + reader.readI64(v); s.identityID = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.userID = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException v; - readEDAMUserException(r, v); + readEDAMUserException(reader, v); s.userException = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException v; - readEDAMNotFoundException(r, v); + readEDAMNotFoundException(reader, v); s.notFoundException = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNoteSharesError::print(QTextStream & strm) const @@ -7431,44 +7869,47 @@ void ManageNoteSharesError::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeManageNoteSharesResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ManageNoteSharesResult & s) { - w.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); + writer.writeStructBegin(QStringLiteral("ManageNoteSharesResult")); if (s.errors.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("errors"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.errors.ref().length()); for(const auto & value: qAsConst(s.errors.ref())) { - writeManageNoteSharesError(w, value); + writeManageNoteSharesError(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readManageNoteSharesResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ManageNoteSharesResult & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -7477,21 +7918,21 @@ void readManageNoteSharesResult( } for(qint32 i = 0; i < size; i++) { ManageNoteSharesError elem; - readManageNoteSharesError(r, elem); + readManageNoteSharesError(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.errors = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ManageNoteSharesResult::print(QTextStream & strm) const @@ -7516,83 +7957,89 @@ void ManageNoteSharesResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeData( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Data & s) { - w.writeStructBegin(QStringLiteral("Data")); + writer.writeStructBegin(QStringLiteral("Data")); if (s.bodyHash.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("bodyHash"), ThriftFieldType::T_STRING, 1); - w.writeBinary(s.bodyHash.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.bodyHash.ref()); + writer.writeFieldEnd(); } + if (s.size.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("size"), ThriftFieldType::T_I32, 2); - w.writeI32(s.size.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.size.ref()); + writer.writeFieldEnd(); } + if (s.body.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("body"), ThriftFieldType::T_STRING, 3); - w.writeBinary(s.body.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.body.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readData( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Data & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.bodyHash = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.size = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.body = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Data::print(QTextStream & strm) const @@ -7629,348 +8076,420 @@ void Data::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUserAttributes( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const UserAttributes & s) { - w.writeStructBegin(QStringLiteral("UserAttributes")); + writer.writeStructBegin(QStringLiteral("UserAttributes")); if (s.defaultLocationName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("defaultLocationName"), ThriftFieldType::T_STRING, 1); - w.writeString(s.defaultLocationName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.defaultLocationName.ref()); + writer.writeFieldEnd(); } + if (s.defaultLatitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("defaultLatitude"), ThriftFieldType::T_DOUBLE, 2); - w.writeDouble(s.defaultLatitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.defaultLatitude.ref()); + writer.writeFieldEnd(); } + if (s.defaultLongitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("defaultLongitude"), ThriftFieldType::T_DOUBLE, 3); - w.writeDouble(s.defaultLongitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.defaultLongitude.ref()); + writer.writeFieldEnd(); } + if (s.preactivation.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("preactivation"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.preactivation.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.preactivation.ref()); + writer.writeFieldEnd(); } + if (s.viewedPromotions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("viewedPromotions"), ThriftFieldType::T_LIST, 5); - w.writeListBegin(ThriftFieldType::T_STRING, s.viewedPromotions.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.viewedPromotions.ref().length()); for(const auto & value: qAsConst(s.viewedPromotions.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.incomingEmailAddress.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("incomingEmailAddress"), ThriftFieldType::T_STRING, 6); - w.writeString(s.incomingEmailAddress.ref()); - w.writeFieldEnd(); + + writer.writeString(s.incomingEmailAddress.ref()); + writer.writeFieldEnd(); } + if (s.recentMailedAddresses.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recentMailedAddresses"), ThriftFieldType::T_LIST, 7); - w.writeListBegin(ThriftFieldType::T_STRING, s.recentMailedAddresses.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.recentMailedAddresses.ref().length()); for(const auto & value: qAsConst(s.recentMailedAddresses.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.comments.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("comments"), ThriftFieldType::T_STRING, 9); - w.writeString(s.comments.ref()); - w.writeFieldEnd(); + + writer.writeString(s.comments.ref()); + writer.writeFieldEnd(); } + if (s.dateAgreedToTermsOfService.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("dateAgreedToTermsOfService"), ThriftFieldType::T_I64, 11); - w.writeI64(s.dateAgreedToTermsOfService.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.dateAgreedToTermsOfService.ref()); + writer.writeFieldEnd(); } + if (s.maxReferrals.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("maxReferrals"), ThriftFieldType::T_I32, 12); - w.writeI32(s.maxReferrals.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.maxReferrals.ref()); + writer.writeFieldEnd(); } + if (s.referralCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("referralCount"), ThriftFieldType::T_I32, 13); - w.writeI32(s.referralCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.referralCount.ref()); + writer.writeFieldEnd(); } + if (s.refererCode.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("refererCode"), ThriftFieldType::T_STRING, 14); - w.writeString(s.refererCode.ref()); - w.writeFieldEnd(); + + writer.writeString(s.refererCode.ref()); + writer.writeFieldEnd(); } + if (s.sentEmailDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sentEmailDate"), ThriftFieldType::T_I64, 15); - w.writeI64(s.sentEmailDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.sentEmailDate.ref()); + writer.writeFieldEnd(); } + if (s.sentEmailCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sentEmailCount"), ThriftFieldType::T_I32, 16); - w.writeI32(s.sentEmailCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sentEmailCount.ref()); + writer.writeFieldEnd(); } + if (s.dailyEmailLimit.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("dailyEmailLimit"), ThriftFieldType::T_I32, 17); - w.writeI32(s.dailyEmailLimit.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.dailyEmailLimit.ref()); + writer.writeFieldEnd(); } + if (s.emailOptOutDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("emailOptOutDate"), ThriftFieldType::T_I64, 18); - w.writeI64(s.emailOptOutDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.emailOptOutDate.ref()); + writer.writeFieldEnd(); } + if (s.partnerEmailOptInDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("partnerEmailOptInDate"), ThriftFieldType::T_I64, 19); - w.writeI64(s.partnerEmailOptInDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.partnerEmailOptInDate.ref()); + writer.writeFieldEnd(); } + if (s.preferredLanguage.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("preferredLanguage"), ThriftFieldType::T_STRING, 20); - w.writeString(s.preferredLanguage.ref()); - w.writeFieldEnd(); + + writer.writeString(s.preferredLanguage.ref()); + writer.writeFieldEnd(); } + if (s.preferredCountry.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("preferredCountry"), ThriftFieldType::T_STRING, 21); - w.writeString(s.preferredCountry.ref()); - w.writeFieldEnd(); + + writer.writeString(s.preferredCountry.ref()); + writer.writeFieldEnd(); } + if (s.clipFullPage.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("clipFullPage"), ThriftFieldType::T_BOOL, 22); - w.writeBool(s.clipFullPage.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.clipFullPage.ref()); + writer.writeFieldEnd(); } + if (s.twitterUserName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("twitterUserName"), ThriftFieldType::T_STRING, 23); - w.writeString(s.twitterUserName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.twitterUserName.ref()); + writer.writeFieldEnd(); } + if (s.twitterId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("twitterId"), ThriftFieldType::T_STRING, 24); - w.writeString(s.twitterId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.twitterId.ref()); + writer.writeFieldEnd(); } + if (s.groupName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("groupName"), ThriftFieldType::T_STRING, 25); - w.writeString(s.groupName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.groupName.ref()); + writer.writeFieldEnd(); } + if (s.recognitionLanguage.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recognitionLanguage"), ThriftFieldType::T_STRING, 26); - w.writeString(s.recognitionLanguage.ref()); - w.writeFieldEnd(); + + writer.writeString(s.recognitionLanguage.ref()); + writer.writeFieldEnd(); } + if (s.referralProof.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("referralProof"), ThriftFieldType::T_STRING, 28); - w.writeString(s.referralProof.ref()); - w.writeFieldEnd(); + + writer.writeString(s.referralProof.ref()); + writer.writeFieldEnd(); } + if (s.educationalDiscount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("educationalDiscount"), ThriftFieldType::T_BOOL, 29); - w.writeBool(s.educationalDiscount.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.educationalDiscount.ref()); + writer.writeFieldEnd(); } + if (s.businessAddress.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessAddress"), ThriftFieldType::T_STRING, 30); - w.writeString(s.businessAddress.ref()); - w.writeFieldEnd(); + + writer.writeString(s.businessAddress.ref()); + writer.writeFieldEnd(); } + if (s.hideSponsorBilling.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("hideSponsorBilling"), ThriftFieldType::T_BOOL, 31); - w.writeBool(s.hideSponsorBilling.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.hideSponsorBilling.ref()); + writer.writeFieldEnd(); } + if (s.useEmailAutoFiling.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("useEmailAutoFiling"), ThriftFieldType::T_BOOL, 33); - w.writeBool(s.useEmailAutoFiling.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.useEmailAutoFiling.ref()); + writer.writeFieldEnd(); } + if (s.reminderEmailConfig.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderEmailConfig"), ThriftFieldType::T_I32, 34); - w.writeI32(static_cast(s.reminderEmailConfig.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.reminderEmailConfig.ref())); + writer.writeFieldEnd(); } + if (s.emailAddressLastConfirmed.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("emailAddressLastConfirmed"), ThriftFieldType::T_I64, 35); - w.writeI64(s.emailAddressLastConfirmed.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.emailAddressLastConfirmed.ref()); + writer.writeFieldEnd(); } + if (s.passwordUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("passwordUpdated"), ThriftFieldType::T_I64, 36); - w.writeI64(s.passwordUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.passwordUpdated.ref()); + writer.writeFieldEnd(); } + if (s.salesforcePushEnabled.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("salesforcePushEnabled"), ThriftFieldType::T_BOOL, 37); - w.writeBool(s.salesforcePushEnabled.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.salesforcePushEnabled.ref()); + writer.writeFieldEnd(); } + if (s.shouldLogClientEvent.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shouldLogClientEvent"), ThriftFieldType::T_BOOL, 38); - w.writeBool(s.shouldLogClientEvent.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.shouldLogClientEvent.ref()); + writer.writeFieldEnd(); } + if (s.optOutMachineLearning.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("optOutMachineLearning"), ThriftFieldType::T_BOOL, 39); - w.writeBool(s.optOutMachineLearning.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.optOutMachineLearning.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUserAttributes( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserAttributes & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.defaultLocationName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.defaultLatitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.defaultLongitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.preactivation = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { @@ -7978,7 +8497,7 @@ void readUserAttributes( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -7987,22 +8506,22 @@ void readUserAttributes( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.viewedPromotions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.incomingEmailAddress = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { @@ -8010,7 +8529,7 @@ void readUserAttributes( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -8019,273 +8538,273 @@ void readUserAttributes( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.recentMailedAddresses = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.comments = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.dateAgreedToTermsOfService = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.maxReferrals = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.referralCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.refererCode = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.sentEmailDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.sentEmailCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.dailyEmailLimit = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.emailOptOutDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.partnerEmailOptInDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.preferredLanguage = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.preferredCountry = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.clipFullPage = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.twitterUserName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.twitterId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 25) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.groupName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.recognitionLanguage = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.referralProof = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.educationalDiscount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.businessAddress = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 31) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.hideSponsorBilling = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 33) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.useEmailAutoFiling = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 34) { if (fieldType == ThriftFieldType::T_I32) { ReminderEmailConfig v; - readEnumReminderEmailConfig(r, v); + readEnumReminderEmailConfig(reader, v); s.reminderEmailConfig = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 35) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.emailAddressLastConfirmed = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 36) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.passwordUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 37) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.salesforcePushEnabled = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 38) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.shouldLogClientEvent = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 39) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.optOutMachineLearning = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void UserAttributes::print(QTextStream & strm) const @@ -8586,151 +9105,165 @@ void UserAttributes::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBusinessUserAttributes( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BusinessUserAttributes & s) { - w.writeStructBegin(QStringLiteral("BusinessUserAttributes")); + writer.writeStructBegin(QStringLiteral("BusinessUserAttributes")); if (s.title.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("title"), ThriftFieldType::T_STRING, 1); - w.writeString(s.title.ref()); - w.writeFieldEnd(); + + writer.writeString(s.title.ref()); + writer.writeFieldEnd(); } + if (s.location.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("location"), ThriftFieldType::T_STRING, 2); - w.writeString(s.location.ref()); - w.writeFieldEnd(); + + writer.writeString(s.location.ref()); + writer.writeFieldEnd(); } + if (s.department.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("department"), ThriftFieldType::T_STRING, 3); - w.writeString(s.department.ref()); - w.writeFieldEnd(); + + writer.writeString(s.department.ref()); + writer.writeFieldEnd(); } + if (s.mobilePhone.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("mobilePhone"), ThriftFieldType::T_STRING, 4); - w.writeString(s.mobilePhone.ref()); - w.writeFieldEnd(); + + writer.writeString(s.mobilePhone.ref()); + writer.writeFieldEnd(); } + if (s.linkedInProfileUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("linkedInProfileUrl"), ThriftFieldType::T_STRING, 5); - w.writeString(s.linkedInProfileUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.linkedInProfileUrl.ref()); + writer.writeFieldEnd(); } + if (s.workPhone.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("workPhone"), ThriftFieldType::T_STRING, 6); - w.writeString(s.workPhone.ref()); - w.writeFieldEnd(); + + writer.writeString(s.workPhone.ref()); + writer.writeFieldEnd(); } + if (s.companyStartDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("companyStartDate"), ThriftFieldType::T_I64, 7); - w.writeI64(s.companyStartDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.companyStartDate.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBusinessUserAttributes( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessUserAttributes & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.title = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.location = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.department = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.mobilePhone = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.linkedInProfileUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.workPhone = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.companyStartDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void BusinessUserAttributes::print(QTextStream & strm) const @@ -8799,423 +9332,469 @@ void BusinessUserAttributes::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeAccounting( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Accounting & s) { - w.writeStructBegin(QStringLiteral("Accounting")); + writer.writeStructBegin(QStringLiteral("Accounting")); if (s.uploadLimitEnd.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploadLimitEnd"), ThriftFieldType::T_I64, 2); - w.writeI64(s.uploadLimitEnd.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploadLimitEnd.ref()); + writer.writeFieldEnd(); } + if (s.uploadLimitNextMonth.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploadLimitNextMonth"), ThriftFieldType::T_I64, 3); - w.writeI64(s.uploadLimitNextMonth.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploadLimitNextMonth.ref()); + writer.writeFieldEnd(); } + if (s.premiumServiceStatus.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumServiceStatus"), ThriftFieldType::T_I32, 4); - w.writeI32(static_cast(s.premiumServiceStatus.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.premiumServiceStatus.ref())); + writer.writeFieldEnd(); } + if (s.premiumOrderNumber.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumOrderNumber"), ThriftFieldType::T_STRING, 5); - w.writeString(s.premiumOrderNumber.ref()); - w.writeFieldEnd(); + + writer.writeString(s.premiumOrderNumber.ref()); + writer.writeFieldEnd(); } + if (s.premiumCommerceService.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumCommerceService"), ThriftFieldType::T_STRING, 6); - w.writeString(s.premiumCommerceService.ref()); - w.writeFieldEnd(); + + writer.writeString(s.premiumCommerceService.ref()); + writer.writeFieldEnd(); } + if (s.premiumServiceStart.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumServiceStart"), ThriftFieldType::T_I64, 7); - w.writeI64(s.premiumServiceStart.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.premiumServiceStart.ref()); + writer.writeFieldEnd(); } + if (s.premiumServiceSKU.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumServiceSKU"), ThriftFieldType::T_STRING, 8); - w.writeString(s.premiumServiceSKU.ref()); - w.writeFieldEnd(); + + writer.writeString(s.premiumServiceSKU.ref()); + writer.writeFieldEnd(); } + if (s.lastSuccessfulCharge.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastSuccessfulCharge"), ThriftFieldType::T_I64, 9); - w.writeI64(s.lastSuccessfulCharge.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.lastSuccessfulCharge.ref()); + writer.writeFieldEnd(); } + if (s.lastFailedCharge.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastFailedCharge"), ThriftFieldType::T_I64, 10); - w.writeI64(s.lastFailedCharge.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.lastFailedCharge.ref()); + writer.writeFieldEnd(); } + if (s.lastFailedChargeReason.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastFailedChargeReason"), ThriftFieldType::T_STRING, 11); - w.writeString(s.lastFailedChargeReason.ref()); - w.writeFieldEnd(); + + writer.writeString(s.lastFailedChargeReason.ref()); + writer.writeFieldEnd(); } + if (s.nextPaymentDue.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("nextPaymentDue"), ThriftFieldType::T_I64, 12); - w.writeI64(s.nextPaymentDue.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.nextPaymentDue.ref()); + writer.writeFieldEnd(); } + if (s.premiumLockUntil.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumLockUntil"), ThriftFieldType::T_I64, 13); - w.writeI64(s.premiumLockUntil.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.premiumLockUntil.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 14); - w.writeI64(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.updated.ref()); + writer.writeFieldEnd(); } + if (s.premiumSubscriptionNumber.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("premiumSubscriptionNumber"), ThriftFieldType::T_STRING, 16); - w.writeString(s.premiumSubscriptionNumber.ref()); - w.writeFieldEnd(); + + writer.writeString(s.premiumSubscriptionNumber.ref()); + writer.writeFieldEnd(); } + if (s.lastRequestedCharge.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastRequestedCharge"), ThriftFieldType::T_I64, 17); - w.writeI64(s.lastRequestedCharge.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.lastRequestedCharge.ref()); + writer.writeFieldEnd(); } + if (s.currency.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("currency"), ThriftFieldType::T_STRING, 18); - w.writeString(s.currency.ref()); - w.writeFieldEnd(); + + writer.writeString(s.currency.ref()); + writer.writeFieldEnd(); } + if (s.unitPrice.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("unitPrice"), ThriftFieldType::T_I32, 19); - w.writeI32(s.unitPrice.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.unitPrice.ref()); + writer.writeFieldEnd(); } + if (s.businessId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessId"), ThriftFieldType::T_I32, 20); - w.writeI32(s.businessId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.businessId.ref()); + writer.writeFieldEnd(); } + if (s.businessName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessName"), ThriftFieldType::T_STRING, 21); - w.writeString(s.businessName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.businessName.ref()); + writer.writeFieldEnd(); } + if (s.businessRole.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessRole"), ThriftFieldType::T_I32, 22); - w.writeI32(static_cast(s.businessRole.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.businessRole.ref())); + writer.writeFieldEnd(); } + if (s.unitDiscount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("unitDiscount"), ThriftFieldType::T_I32, 23); - w.writeI32(s.unitDiscount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.unitDiscount.ref()); + writer.writeFieldEnd(); } + if (s.nextChargeDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("nextChargeDate"), ThriftFieldType::T_I64, 24); - w.writeI64(s.nextChargeDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.nextChargeDate.ref()); + writer.writeFieldEnd(); } + if (s.availablePoints.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("availablePoints"), ThriftFieldType::T_I32, 25); - w.writeI32(s.availablePoints.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.availablePoints.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readAccounting( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Accounting & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploadLimitEnd = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploadLimitNextMonth = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { PremiumOrderStatus v; - readEnumPremiumOrderStatus(r, v); + readEnumPremiumOrderStatus(reader, v); s.premiumServiceStatus = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.premiumOrderNumber = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.premiumCommerceService = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.premiumServiceStart = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.premiumServiceSKU = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.lastSuccessfulCharge = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.lastFailedCharge = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.lastFailedChargeReason = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.nextPaymentDue = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.premiumLockUntil = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.premiumSubscriptionNumber = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.lastRequestedCharge = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.currency = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.unitPrice = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.businessId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.businessName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; - readEnumBusinessUserRole(r, v); + readEnumBusinessUserRole(reader, v); s.businessRole = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.unitDiscount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.nextChargeDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 25) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.availablePoints = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Accounting::print(QTextStream & strm) const @@ -9412,117 +9991,127 @@ void Accounting::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBusinessUserInfo( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BusinessUserInfo & s) { - w.writeStructBegin(QStringLiteral("BusinessUserInfo")); + writer.writeStructBegin(QStringLiteral("BusinessUserInfo")); if (s.businessId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); - w.writeI32(s.businessId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.businessId.ref()); + writer.writeFieldEnd(); } + if (s.businessName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessName"), ThriftFieldType::T_STRING, 2); - w.writeString(s.businessName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.businessName.ref()); + writer.writeFieldEnd(); } + if (s.role.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("role"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.role.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.role.ref())); + writer.writeFieldEnd(); } + if (s.email.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("email"), ThriftFieldType::T_STRING, 4); - w.writeString(s.email.ref()); - w.writeFieldEnd(); + + writer.writeString(s.email.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 5); - w.writeI64(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.updated.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBusinessUserInfo( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessUserInfo & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.businessId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.businessName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; - readEnumBusinessUserRole(r, v); + readEnumBusinessUserRole(reader, v); s.role = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.email = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void BusinessUserInfo::print(QTextStream & strm) const @@ -9575,219 +10164,241 @@ void BusinessUserInfo::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeAccountLimits( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const AccountLimits & s) { - w.writeStructBegin(QStringLiteral("AccountLimits")); + writer.writeStructBegin(QStringLiteral("AccountLimits")); if (s.userMailLimitDaily.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userMailLimitDaily"), ThriftFieldType::T_I32, 1); - w.writeI32(s.userMailLimitDaily.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userMailLimitDaily.ref()); + writer.writeFieldEnd(); } + if (s.noteSizeMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 2); - w.writeI64(s.noteSizeMax.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.noteSizeMax.ref()); + writer.writeFieldEnd(); } + if (s.resourceSizeMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); - w.writeI64(s.resourceSizeMax.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.resourceSizeMax.ref()); + writer.writeFieldEnd(); } + if (s.userLinkedNotebookMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userLinkedNotebookMax"), ThriftFieldType::T_I32, 4); - w.writeI32(s.userLinkedNotebookMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userLinkedNotebookMax.ref()); + writer.writeFieldEnd(); } + if (s.uploadLimit.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 5); - w.writeI64(s.uploadLimit.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploadLimit.ref()); + writer.writeFieldEnd(); } + if (s.userNoteCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userNoteCountMax"), ThriftFieldType::T_I32, 6); - w.writeI32(s.userNoteCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userNoteCountMax.ref()); + writer.writeFieldEnd(); } + if (s.userNotebookCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userNotebookCountMax"), ThriftFieldType::T_I32, 7); - w.writeI32(s.userNotebookCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userNotebookCountMax.ref()); + writer.writeFieldEnd(); } + if (s.userTagCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userTagCountMax"), ThriftFieldType::T_I32, 8); - w.writeI32(s.userTagCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userTagCountMax.ref()); + writer.writeFieldEnd(); } + if (s.noteTagCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteTagCountMax"), ThriftFieldType::T_I32, 9); - w.writeI32(s.noteTagCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.noteTagCountMax.ref()); + writer.writeFieldEnd(); } + if (s.userSavedSearchesMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userSavedSearchesMax"), ThriftFieldType::T_I32, 10); - w.writeI32(s.userSavedSearchesMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userSavedSearchesMax.ref()); + writer.writeFieldEnd(); } + if (s.noteResourceCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 11); - w.writeI32(s.noteResourceCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.noteResourceCountMax.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readAccountLimits( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, AccountLimits & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userMailLimitDaily = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.noteSizeMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.resourceSizeMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userLinkedNotebookMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploadLimit = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userNoteCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userNotebookCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userTagCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.noteTagCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.userSavedSearchesMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.noteResourceCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void AccountLimits::print(QTextStream & strm) const @@ -9888,338 +10499,374 @@ void AccountLimits::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUser( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const User & s) { - w.writeStructBegin(QStringLiteral("User")); + writer.writeStructBegin(QStringLiteral("User")); if (s.id.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("id"), ThriftFieldType::T_I32, 1); - w.writeI32(s.id.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.id.ref()); + writer.writeFieldEnd(); } + if (s.username.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 2); - w.writeString(s.username.ref()); - w.writeFieldEnd(); + + writer.writeString(s.username.ref()); + writer.writeFieldEnd(); } + if (s.email.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("email"), ThriftFieldType::T_STRING, 3); - w.writeString(s.email.ref()); - w.writeFieldEnd(); + + writer.writeString(s.email.ref()); + writer.writeFieldEnd(); } + if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 4); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.timezone.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("timezone"), ThriftFieldType::T_STRING, 6); - w.writeString(s.timezone.ref()); - w.writeFieldEnd(); + + writer.writeString(s.timezone.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 7); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.serviceLevel.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 21); - w.writeI32(static_cast(s.serviceLevel.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.serviceLevel.ref())); + writer.writeFieldEnd(); } + if (s.created.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("created"), ThriftFieldType::T_I64, 9); - w.writeI64(s.created.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.created.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 10); - w.writeI64(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.updated.ref()); + writer.writeFieldEnd(); } + if (s.deleted.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("deleted"), ThriftFieldType::T_I64, 11); - w.writeI64(s.deleted.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.deleted.ref()); + writer.writeFieldEnd(); } + if (s.active.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("active"), ThriftFieldType::T_BOOL, 13); - w.writeBool(s.active.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.active.ref()); + writer.writeFieldEnd(); } + if (s.shardId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shardId"), ThriftFieldType::T_STRING, 14); - w.writeString(s.shardId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.shardId.ref()); + writer.writeFieldEnd(); } + if (s.attributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 15); - writeUserAttributes(w, s.attributes.ref()); - w.writeFieldEnd(); + + writeUserAttributes(writer, s.attributes.ref()); + writer.writeFieldEnd(); } + if (s.accounting.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("accounting"), ThriftFieldType::T_STRUCT, 16); - writeAccounting(w, s.accounting.ref()); - w.writeFieldEnd(); + + writeAccounting(writer, s.accounting.ref()); + writer.writeFieldEnd(); } + if (s.businessUserInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessUserInfo"), ThriftFieldType::T_STRUCT, 18); - writeBusinessUserInfo(w, s.businessUserInfo.ref()); - w.writeFieldEnd(); + + writeBusinessUserInfo(writer, s.businessUserInfo.ref()); + writer.writeFieldEnd(); } + if (s.photoUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 19); - w.writeString(s.photoUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.photoUrl.ref()); + writer.writeFieldEnd(); } + if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 20); - w.writeI64(s.photoLastUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.photoLastUpdated.ref()); + writer.writeFieldEnd(); } + if (s.accountLimits.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("accountLimits"), ThriftFieldType::T_STRUCT, 22); - writeAccountLimits(w, s.accountLimits.ref()); - w.writeFieldEnd(); + + writeAccountLimits(writer, s.accountLimits.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUser( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, User & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.id = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.username = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.email = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.timezone = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { PrivilegeLevel v; - readEnumPrivilegeLevel(r, v); + readEnumPrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_I32) { ServiceLevel v; - readEnumServiceLevel(r, v); + readEnumServiceLevel(reader, v); s.serviceLevel = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.created = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.deleted = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.active = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.shardId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { UserAttributes v; - readUserAttributes(r, v); + readUserAttributes(reader, v); s.attributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRUCT) { Accounting v; - readAccounting(r, v); + readAccounting(reader, v); s.accounting = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessUserInfo v; - readBusinessUserInfo(r, v); + readBusinessUserInfo(reader, v); s.businessUserInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.photoUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.photoLastUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_STRUCT) { AccountLimits v; - readAccountLimits(r, v); + readAccountLimits(reader, v); s.accountLimits = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void User::print(QTextStream & strm) const @@ -10376,151 +11023,165 @@ void User::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeContact( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Contact & s) { - w.writeStructBegin(QStringLiteral("Contact")); + writer.writeStructBegin(QStringLiteral("Contact")); if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 1); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.id.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("id"), ThriftFieldType::T_STRING, 2); - w.writeString(s.id.ref()); - w.writeFieldEnd(); + + writer.writeString(s.id.ref()); + writer.writeFieldEnd(); } + if (s.type.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("type"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.type.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.type.ref())); + writer.writeFieldEnd(); } + if (s.photoUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 4); - w.writeString(s.photoUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.photoUrl.ref()); + writer.writeFieldEnd(); } + if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 5); - w.writeI64(s.photoLastUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.photoLastUpdated.ref()); + writer.writeFieldEnd(); } + if (s.messagingPermit.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("messagingPermit"), ThriftFieldType::T_STRING, 6); - w.writeBinary(s.messagingPermit.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.messagingPermit.ref()); + writer.writeFieldEnd(); } + if (s.messagingPermitExpires.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("messagingPermitExpires"), ThriftFieldType::T_I64, 7); - w.writeI64(s.messagingPermitExpires.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.messagingPermitExpires.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readContact( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Contact & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.id = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ContactType v; - readEnumContactType(r, v); + readEnumContactType(reader, v); s.type = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.photoUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.photoLastUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.messagingPermit = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.messagingPermitExpires = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Contact::print(QTextStream & strm) const @@ -10589,168 +11250,184 @@ void Contact::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeIdentity( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Identity & s) { - w.writeStructBegin(QStringLiteral("Identity")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("Identity")); + writer.writeFieldBegin( QStringLiteral("id"), ThriftFieldType::T_I64, 1); - w.writeI64(s.id); - w.writeFieldEnd(); + + writer.writeI64(s.id); + writer.writeFieldEnd(); + if (s.contact.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 2); - writeContact(w, s.contact.ref()); - w.writeFieldEnd(); + + writeContact(writer, s.contact.ref()); + writer.writeFieldEnd(); } + if (s.userId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userId"), ThriftFieldType::T_I32, 3); - w.writeI32(s.userId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userId.ref()); + writer.writeFieldEnd(); } + if (s.deactivated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("deactivated"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.deactivated.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.deactivated.ref()); + writer.writeFieldEnd(); } + if (s.sameBusiness.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sameBusiness"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.sameBusiness.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.sameBusiness.ref()); + writer.writeFieldEnd(); } + if (s.blocked.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("blocked"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.blocked.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.blocked.ref()); + writer.writeFieldEnd(); } + if (s.userConnected.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userConnected"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.userConnected.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.userConnected.ref()); + writer.writeFieldEnd(); } + if (s.eventId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("eventId"), ThriftFieldType::T_I64, 8); - w.writeI64(s.eventId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.eventId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readIdentity( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Identity & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool id_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { id_isset = true; IdentityID v; - r.readI64(v); + reader.readI64(v); s.id = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Contact v; - readContact(r, v); + readContact(reader, v); s.contact = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.userId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.deactivated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.sameBusiness = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.blocked = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.userConnected = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { MessageEventID v; - r.readI64(v); + reader.readI64(v); s.eventId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!id_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Identity.id has no value")); } @@ -10822,100 +11499,108 @@ void Identity::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeTag( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Tag & s) { - w.writeStructBegin(QStringLiteral("Tag")); + writer.writeStructBegin(QStringLiteral("Tag")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 2); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.parentGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("parentGuid"), ThriftFieldType::T_STRING, 3); - w.writeString(s.parentGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.parentGuid.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 4); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readTag( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Tag & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.parentGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Tag::print(QTextStream & strm) const @@ -10960,57 +11645,63 @@ void Tag::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeLazyMap( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const LazyMap & s) { - w.writeStructBegin(QStringLiteral("LazyMap")); + writer.writeStructBegin(QStringLiteral("LazyMap")); if (s.keysOnly.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("keysOnly"), ThriftFieldType::T_SET, 1); - w.writeSetBegin(ThriftFieldType::T_STRING, s.keysOnly.ref().count()); + + writer.writeSetBegin(ThriftFieldType::T_STRING, s.keysOnly.ref().count()); for(const auto & value: qAsConst(s.keysOnly.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeSetEnd(); - w.writeFieldEnd(); + writer.writeSetEnd(); + + writer.writeFieldEnd(); } + if (s.fullMap.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("fullMap"), ThriftFieldType::T_MAP, 2); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.fullMap.ref().size()); + + writer.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.fullMap.ref().size()); for(const auto & it: toRange(s.fullMap.ref())) { - w.writeString(it.key()); - w.writeString(it.value()); + writer.writeString(it.key()); + writer.writeString(it.value()); } - w.writeMapEnd(); - w.writeFieldEnd(); + writer.writeMapEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readLazyMap( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LazyMap & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_SET) { QSet v; qint32 size; ThriftFieldType elemType; - r.readSetBegin(elemType, size); + reader.readSetBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -11019,13 +11710,13 @@ void readLazyMap( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.insert(elem); } - r.readSetEnd(); + reader.readSetEnd(); s.keysOnly = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { @@ -11034,28 +11725,28 @@ void readLazyMap( qint32 size; ThriftFieldType keyType; ThriftFieldType elemType; - r.readMapBegin(keyType, elemType, size); + reader.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (LazyMap.fullMap)")); if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (LazyMap.fullMap)")); for(qint32 i = 0; i < size; i++) { QString key; - r.readString(key); + reader.readString(key); QString value; - r.readString(value); + reader.readString(value); v[key] = value; } - r.readMapEnd(); + reader.readMapEnd(); s.fullMap = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void LazyMap::print(QTextStream & strm) const @@ -11092,236 +11783,260 @@ void LazyMap::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeResourceAttributes( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const ResourceAttributes & s) { - w.writeStructBegin(QStringLiteral("ResourceAttributes")); + writer.writeStructBegin(QStringLiteral("ResourceAttributes")); if (s.sourceURL.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 1); - w.writeString(s.sourceURL.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceURL.ref()); + writer.writeFieldEnd(); } + if (s.timestamp.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("timestamp"), ThriftFieldType::T_I64, 2); - w.writeI64(s.timestamp.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.timestamp.ref()); + writer.writeFieldEnd(); } + if (s.latitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 3); - w.writeDouble(s.latitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.latitude.ref()); + writer.writeFieldEnd(); } + if (s.longitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 4); - w.writeDouble(s.longitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.longitude.ref()); + writer.writeFieldEnd(); } + if (s.altitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 5); - w.writeDouble(s.altitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.altitude.ref()); + writer.writeFieldEnd(); } + if (s.cameraMake.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("cameraMake"), ThriftFieldType::T_STRING, 6); - w.writeString(s.cameraMake.ref()); - w.writeFieldEnd(); + + writer.writeString(s.cameraMake.ref()); + writer.writeFieldEnd(); } + if (s.cameraModel.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("cameraModel"), ThriftFieldType::T_STRING, 7); - w.writeString(s.cameraModel.ref()); - w.writeFieldEnd(); + + writer.writeString(s.cameraModel.ref()); + writer.writeFieldEnd(); } + if (s.clientWillIndex.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("clientWillIndex"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.clientWillIndex.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.clientWillIndex.ref()); + writer.writeFieldEnd(); } + if (s.recoType.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recoType"), ThriftFieldType::T_STRING, 9); - w.writeString(s.recoType.ref()); - w.writeFieldEnd(); + + writer.writeString(s.recoType.ref()); + writer.writeFieldEnd(); } + if (s.fileName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("fileName"), ThriftFieldType::T_STRING, 10); - w.writeString(s.fileName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.fileName.ref()); + writer.writeFieldEnd(); } + if (s.attachment.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attachment"), ThriftFieldType::T_BOOL, 11); - w.writeBool(s.attachment.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.attachment.ref()); + writer.writeFieldEnd(); } + if (s.applicationData.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 12); - writeLazyMap(w, s.applicationData.ref()); - w.writeFieldEnd(); + + writeLazyMap(writer, s.applicationData.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readResourceAttributes( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, ResourceAttributes & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceURL = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.timestamp = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.latitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.longitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.altitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.cameraMake = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.cameraModel = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.clientWillIndex = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.recoType = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.fileName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.attachment = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRUCT) { LazyMap v; - readLazyMap(r, v); + readLazyMap(reader, v); s.applicationData = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void ResourceAttributes::print(QTextStream & strm) const @@ -11430,236 +12145,260 @@ void ResourceAttributes::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeResource( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Resource & s) { - w.writeStructBegin(QStringLiteral("Resource")); + writer.writeStructBegin(QStringLiteral("Resource")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.noteGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteGuid"), ThriftFieldType::T_STRING, 2); - w.writeString(s.noteGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteGuid.ref()); + writer.writeFieldEnd(); } + if (s.data.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("data"), ThriftFieldType::T_STRUCT, 3); - writeData(w, s.data.ref()); - w.writeFieldEnd(); + + writeData(writer, s.data.ref()); + writer.writeFieldEnd(); } + if (s.mime.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("mime"), ThriftFieldType::T_STRING, 4); - w.writeString(s.mime.ref()); - w.writeFieldEnd(); + + writer.writeString(s.mime.ref()); + writer.writeFieldEnd(); } + if (s.width.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("width"), ThriftFieldType::T_I16, 5); - w.writeI16(s.width.ref()); - w.writeFieldEnd(); + + writer.writeI16(s.width.ref()); + writer.writeFieldEnd(); } + if (s.height.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("height"), ThriftFieldType::T_I16, 6); - w.writeI16(s.height.ref()); - w.writeFieldEnd(); + + writer.writeI16(s.height.ref()); + writer.writeFieldEnd(); } + if (s.duration.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("duration"), ThriftFieldType::T_I16, 7); - w.writeI16(s.duration.ref()); - w.writeFieldEnd(); + + writer.writeI16(s.duration.ref()); + writer.writeFieldEnd(); } + if (s.active.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("active"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.active.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.active.ref()); + writer.writeFieldEnd(); } + if (s.recognition.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recognition"), ThriftFieldType::T_STRUCT, 9); - writeData(w, s.recognition.ref()); - w.writeFieldEnd(); + + writeData(writer, s.recognition.ref()); + writer.writeFieldEnd(); } + if (s.attributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 11); - writeResourceAttributes(w, s.attributes.ref()); - w.writeFieldEnd(); + + writeResourceAttributes(writer, s.attributes.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 12); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.alternateData.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("alternateData"), ThriftFieldType::T_STRUCT, 13); - writeData(w, s.alternateData.ref()); - w.writeFieldEnd(); + + writeData(writer, s.alternateData.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readResource( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Resource & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.noteGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; - readData(r, v); + readData(reader, v); s.data = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.mime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; - r.readI16(v); + reader.readI16(v); s.width = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; - r.readI16(v); + reader.readI16(v); s.height = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; - r.readI16(v); + reader.readI16(v); s.duration = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.active = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; - readData(r, v); + readData(reader, v); s.recognition = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRUCT) { ResourceAttributes v; - readResourceAttributes(r, v); + readResourceAttributes(reader, v); s.attributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; - readData(r, v); + readData(reader, v); s.alternateData = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Resource::print(QTextStream & strm) const @@ -11768,349 +12507,394 @@ void Resource::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteAttributes( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteAttributes & s) { - w.writeStructBegin(QStringLiteral("NoteAttributes")); + writer.writeStructBegin(QStringLiteral("NoteAttributes")); if (s.subjectDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("subjectDate"), ThriftFieldType::T_I64, 1); - w.writeI64(s.subjectDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.subjectDate.ref()); + writer.writeFieldEnd(); } + if (s.latitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("latitude"), ThriftFieldType::T_DOUBLE, 10); - w.writeDouble(s.latitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.latitude.ref()); + writer.writeFieldEnd(); } + if (s.longitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("longitude"), ThriftFieldType::T_DOUBLE, 11); - w.writeDouble(s.longitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.longitude.ref()); + writer.writeFieldEnd(); } + if (s.altitude.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("altitude"), ThriftFieldType::T_DOUBLE, 12); - w.writeDouble(s.altitude.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.altitude.ref()); + writer.writeFieldEnd(); } + if (s.author.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("author"), ThriftFieldType::T_STRING, 13); - w.writeString(s.author.ref()); - w.writeFieldEnd(); + + writer.writeString(s.author.ref()); + writer.writeFieldEnd(); } + if (s.source.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("source"), ThriftFieldType::T_STRING, 14); - w.writeString(s.source.ref()); - w.writeFieldEnd(); + + writer.writeString(s.source.ref()); + writer.writeFieldEnd(); } + if (s.sourceURL.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceURL"), ThriftFieldType::T_STRING, 15); - w.writeString(s.sourceURL.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceURL.ref()); + writer.writeFieldEnd(); } + if (s.sourceApplication.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceApplication"), ThriftFieldType::T_STRING, 16); - w.writeString(s.sourceApplication.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceApplication.ref()); + writer.writeFieldEnd(); } + if (s.shareDate.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shareDate"), ThriftFieldType::T_I64, 17); - w.writeI64(s.shareDate.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.shareDate.ref()); + writer.writeFieldEnd(); } + if (s.reminderOrder.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderOrder"), ThriftFieldType::T_I64, 18); - w.writeI64(s.reminderOrder.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.reminderOrder.ref()); + writer.writeFieldEnd(); } + if (s.reminderDoneTime.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderDoneTime"), ThriftFieldType::T_I64, 19); - w.writeI64(s.reminderDoneTime.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.reminderDoneTime.ref()); + writer.writeFieldEnd(); } + if (s.reminderTime.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderTime"), ThriftFieldType::T_I64, 20); - w.writeI64(s.reminderTime.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.reminderTime.ref()); + writer.writeFieldEnd(); } + if (s.placeName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("placeName"), ThriftFieldType::T_STRING, 21); - w.writeString(s.placeName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.placeName.ref()); + writer.writeFieldEnd(); } + if (s.contentClass.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentClass"), ThriftFieldType::T_STRING, 22); - w.writeString(s.contentClass.ref()); - w.writeFieldEnd(); + + writer.writeString(s.contentClass.ref()); + writer.writeFieldEnd(); } + if (s.applicationData.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("applicationData"), ThriftFieldType::T_STRUCT, 23); - writeLazyMap(w, s.applicationData.ref()); - w.writeFieldEnd(); + + writeLazyMap(writer, s.applicationData.ref()); + writer.writeFieldEnd(); } + if (s.lastEditedBy.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastEditedBy"), ThriftFieldType::T_STRING, 24); - w.writeString(s.lastEditedBy.ref()); - w.writeFieldEnd(); + + writer.writeString(s.lastEditedBy.ref()); + writer.writeFieldEnd(); } + if (s.classifications.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("classifications"), ThriftFieldType::T_MAP, 26); - w.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.classifications.ref().size()); + + writer.writeMapBegin(ThriftFieldType::T_STRING, ThriftFieldType::T_STRING, s.classifications.ref().size()); for(const auto & it: toRange(s.classifications.ref())) { - w.writeString(it.key()); - w.writeString(it.value()); + writer.writeString(it.key()); + writer.writeString(it.value()); } - w.writeMapEnd(); - w.writeFieldEnd(); + writer.writeMapEnd(); + + writer.writeFieldEnd(); } + if (s.creatorId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("creatorId"), ThriftFieldType::T_I32, 27); - w.writeI32(s.creatorId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.creatorId.ref()); + writer.writeFieldEnd(); } + if (s.lastEditorId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("lastEditorId"), ThriftFieldType::T_I32, 28); - w.writeI32(s.lastEditorId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.lastEditorId.ref()); + writer.writeFieldEnd(); } + if (s.sharedWithBusiness.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharedWithBusiness"), ThriftFieldType::T_BOOL, 29); - w.writeBool(s.sharedWithBusiness.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.sharedWithBusiness.ref()); + writer.writeFieldEnd(); } + if (s.conflictSourceNoteGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("conflictSourceNoteGuid"), ThriftFieldType::T_STRING, 30); - w.writeString(s.conflictSourceNoteGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.conflictSourceNoteGuid.ref()); + writer.writeFieldEnd(); } + if (s.noteTitleQuality.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteTitleQuality"), ThriftFieldType::T_I32, 31); - w.writeI32(s.noteTitleQuality.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.noteTitleQuality.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteAttributes( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteAttributes & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.subjectDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.latitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.longitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.altitude = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.author = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.source = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceURL = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceApplication = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.shareDate = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.reminderOrder = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.reminderDoneTime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.reminderTime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.placeName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.contentClass = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_STRUCT) { LazyMap v; - readLazyMap(r, v); + readLazyMap(reader, v); s.applicationData = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.lastEditedBy = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 26) { @@ -12119,73 +12903,73 @@ void readNoteAttributes( qint32 size; ThriftFieldType keyType; ThriftFieldType elemType; - r.readMapBegin(keyType, elemType, size); + reader.readMapBegin(keyType, elemType, size); if (keyType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map key type (NoteAttributes.classifications)")); if (elemType != ThriftFieldType::T_STRING) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("Incorrect map value type (NoteAttributes.classifications)")); for(qint32 i = 0; i < size; i++) { QString key; - r.readString(key); + reader.readString(key); QString value; - r.readString(value); + reader.readString(value); v[key] = value; } - r.readMapEnd(); + reader.readMapEnd(); s.classifications = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 27) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.creatorId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.lastEditorId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.sharedWithBusiness = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.conflictSourceNoteGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 31) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.noteTitleQuality = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteAttributes::print(QTextStream & strm) const @@ -12378,134 +13162,146 @@ void NoteAttributes::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSharedNote( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SharedNote & s) { - w.writeStructBegin(QStringLiteral("SharedNote")); + writer.writeStructBegin(QStringLiteral("SharedNote")); if (s.sharerUserID.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserID"), ThriftFieldType::T_I32, 1); - w.writeI32(s.sharerUserID.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserID.ref()); + writer.writeFieldEnd(); } + if (s.recipientIdentity.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientIdentity"), ThriftFieldType::T_STRUCT, 2); - writeIdentity(w, s.recipientIdentity.ref()); - w.writeFieldEnd(); + + writeIdentity(writer, s.recipientIdentity.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.serviceCreated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 4); - w.writeI64(s.serviceCreated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceCreated.ref()); + writer.writeFieldEnd(); } + if (s.serviceUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 5); - w.writeI64(s.serviceUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceUpdated.ref()); + writer.writeFieldEnd(); } + if (s.serviceAssigned.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 6); - w.writeI64(s.serviceAssigned.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceAssigned.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSharedNote( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNote & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserID = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Identity v; - readIdentity(r, v); + readIdentity(reader, v); s.recipientIdentity = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; - readEnumSharedNotePrivilegeLevel(r, v); + readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceCreated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceAssigned = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SharedNote::print(QTextStream & strm) const @@ -12566,117 +13362,127 @@ void SharedNote::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteRestrictions( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteRestrictions & s) { - w.writeStructBegin(QStringLiteral("NoteRestrictions")); + writer.writeStructBegin(QStringLiteral("NoteRestrictions")); if (s.noUpdateTitle.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noUpdateTitle"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.noUpdateTitle.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noUpdateTitle.ref()); + writer.writeFieldEnd(); } + if (s.noUpdateContent.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noUpdateContent"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.noUpdateContent.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noUpdateContent.ref()); + writer.writeFieldEnd(); } + if (s.noEmail.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noEmail"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.noEmail.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noEmail.ref()); + writer.writeFieldEnd(); } + if (s.noShare.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noShare"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.noShare.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noShare.ref()); + writer.writeFieldEnd(); } + if (s.noSharePublicly.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSharePublicly"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.noSharePublicly.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSharePublicly.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteRestrictions & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noUpdateTitle = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noUpdateContent = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noEmail = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noShare = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSharePublicly = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteRestrictions::print(QTextStream & strm) const @@ -12729,117 +13535,127 @@ void NoteRestrictions::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNoteLimits( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NoteLimits & s) { - w.writeStructBegin(QStringLiteral("NoteLimits")); + writer.writeStructBegin(QStringLiteral("NoteLimits")); if (s.noteResourceCountMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteResourceCountMax"), ThriftFieldType::T_I32, 1); - w.writeI32(s.noteResourceCountMax.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.noteResourceCountMax.ref()); + writer.writeFieldEnd(); } + if (s.uploadLimit.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploadLimit"), ThriftFieldType::T_I64, 2); - w.writeI64(s.uploadLimit.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploadLimit.ref()); + writer.writeFieldEnd(); } + if (s.resourceSizeMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("resourceSizeMax"), ThriftFieldType::T_I64, 3); - w.writeI64(s.resourceSizeMax.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.resourceSizeMax.ref()); + writer.writeFieldEnd(); } + if (s.noteSizeMax.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteSizeMax"), ThriftFieldType::T_I64, 4); - w.writeI64(s.noteSizeMax.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.noteSizeMax.ref()); + writer.writeFieldEnd(); } + if (s.uploaded.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uploaded"), ThriftFieldType::T_I64, 5); - w.writeI64(s.uploaded.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.uploaded.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNoteLimits( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NoteLimits & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.noteResourceCountMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploadLimit = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.resourceSizeMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.noteSizeMax = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.uploaded = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NoteLimits::print(QTextStream & strm) const @@ -12892,283 +13708,323 @@ void NoteLimits::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNote( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Note & s) { - w.writeStructBegin(QStringLiteral("Note")); + writer.writeStructBegin(QStringLiteral("Note")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.title.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("title"), ThriftFieldType::T_STRING, 2); - w.writeString(s.title.ref()); - w.writeFieldEnd(); + + writer.writeString(s.title.ref()); + writer.writeFieldEnd(); } + if (s.content.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("content"), ThriftFieldType::T_STRING, 3); - w.writeString(s.content.ref()); - w.writeFieldEnd(); + + writer.writeString(s.content.ref()); + writer.writeFieldEnd(); } + if (s.contentHash.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentHash"), ThriftFieldType::T_STRING, 4); - w.writeBinary(s.contentHash.ref()); - w.writeFieldEnd(); + + writer.writeBinary(s.contentHash.ref()); + writer.writeFieldEnd(); } + if (s.contentLength.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentLength"), ThriftFieldType::T_I32, 5); - w.writeI32(s.contentLength.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.contentLength.ref()); + writer.writeFieldEnd(); } + if (s.created.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("created"), ThriftFieldType::T_I64, 6); - w.writeI64(s.created.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.created.ref()); + writer.writeFieldEnd(); } + if (s.updated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updated"), ThriftFieldType::T_I64, 7); - w.writeI64(s.updated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.updated.ref()); + writer.writeFieldEnd(); } + if (s.deleted.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("deleted"), ThriftFieldType::T_I64, 8); - w.writeI64(s.deleted.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.deleted.ref()); + writer.writeFieldEnd(); } + if (s.active.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("active"), ThriftFieldType::T_BOOL, 9); - w.writeBool(s.active.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.active.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 10); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 11); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.tagGuids.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tagGuids"), ThriftFieldType::T_LIST, 12); - w.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.tagGuids.ref().length()); for(const auto & value: qAsConst(s.tagGuids.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.resources.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("resources"), ThriftFieldType::T_LIST, 13); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.resources.ref().length()); for(const auto & value: qAsConst(s.resources.ref())) { - writeResource(w, value); + writeResource(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.attributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 14); - writeNoteAttributes(w, s.attributes.ref()); - w.writeFieldEnd(); + + writeNoteAttributes(writer, s.attributes.ref()); + writer.writeFieldEnd(); } + if (s.tagNames.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("tagNames"), ThriftFieldType::T_LIST, 15); - w.writeListBegin(ThriftFieldType::T_STRING, s.tagNames.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.tagNames.ref().length()); for(const auto & value: qAsConst(s.tagNames.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.sharedNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharedNotes"), ThriftFieldType::T_LIST, 16); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotes.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotes.ref().length()); for(const auto & value: qAsConst(s.sharedNotes.ref())) { - writeSharedNote(w, value); + writeSharedNote(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.restrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); - writeNoteRestrictions(w, s.restrictions.ref()); - w.writeFieldEnd(); + + writeNoteRestrictions(writer, s.restrictions.ref()); + writer.writeFieldEnd(); } + if (s.limits.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("limits"), ThriftFieldType::T_STRUCT, 18); - writeNoteLimits(w, s.limits.ref()); - w.writeFieldEnd(); + + writeNoteLimits(writer, s.limits.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNote( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Note & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.title = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.content = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; - r.readBinary(v); + reader.readBinary(v); s.contentHash = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.contentLength = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.created = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.updated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.deleted = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.active = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { @@ -13176,7 +14032,7 @@ void readNote( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -13185,13 +14041,13 @@ void readNote( } for(qint32 i = 0; i < size; i++) { Guid elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tagGuids = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { @@ -13199,7 +14055,7 @@ void readNote( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -13208,22 +14064,22 @@ void readNote( } for(qint32 i = 0; i < size; i++) { Resource elem; - readResource(r, elem); + readResource(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.resources = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteAttributes v; - readNoteAttributes(r, v); + readNoteAttributes(reader, v); s.attributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { @@ -13231,7 +14087,7 @@ void readNote( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -13240,13 +14096,13 @@ void readNote( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.tagNames = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { @@ -13254,7 +14110,7 @@ void readNote( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -13263,39 +14119,39 @@ void readNote( } for(qint32 i = 0; i < size; i++) { SharedNote elem; - readSharedNote(r, elem); + readSharedNote(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.sharedNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteRestrictions v; - readNoteRestrictions(r, v); + readNoteRestrictions(reader, v); s.restrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteLimits v; - readNoteLimits(r, v); + readNoteLimits(reader, v); s.limits = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Note::print(QTextStream & strm) const @@ -13468,100 +14324,108 @@ void Note::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writePublishing( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Publishing & s) { - w.writeStructBegin(QStringLiteral("Publishing")); + writer.writeStructBegin(QStringLiteral("Publishing")); if (s.uri.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uri"), ThriftFieldType::T_STRING, 1); - w.writeString(s.uri.ref()); - w.writeFieldEnd(); + + writer.writeString(s.uri.ref()); + writer.writeFieldEnd(); } + if (s.order.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("order"), ThriftFieldType::T_I32, 2); - w.writeI32(static_cast(s.order.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.order.ref())); + writer.writeFieldEnd(); } + if (s.ascending.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("ascending"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.ascending.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.ascending.ref()); + writer.writeFieldEnd(); } + if (s.publicDescription.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("publicDescription"), ThriftFieldType::T_STRING, 4); - w.writeString(s.publicDescription.ref()); - w.writeFieldEnd(); + + writer.writeString(s.publicDescription.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readPublishing( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Publishing & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.uri = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { NoteSortOrder v; - readEnumNoteSortOrder(r, v); + readEnumNoteSortOrder(reader, v); s.order = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.ascending = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.publicDescription = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Publishing::print(QTextStream & strm) const @@ -13606,83 +14470,89 @@ void Publishing::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBusinessNotebook( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BusinessNotebook & s) { - w.writeStructBegin(QStringLiteral("BusinessNotebook")); + writer.writeStructBegin(QStringLiteral("BusinessNotebook")); if (s.notebookDescription.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookDescription"), ThriftFieldType::T_STRING, 1); - w.writeString(s.notebookDescription.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookDescription.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 2); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.recommended.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recommended"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.recommended.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.recommended.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBusinessNotebook( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessNotebook & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.notebookDescription = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; - readEnumSharedNotebookPrivilegeLevel(r, v); + readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.recommended = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void BusinessNotebook::print(QTextStream & strm) const @@ -13719,83 +14589,89 @@ void BusinessNotebook::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSavedSearchScope( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SavedSearchScope & s) { - w.writeStructBegin(QStringLiteral("SavedSearchScope")); + writer.writeStructBegin(QStringLiteral("SavedSearchScope")); if (s.includeAccount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeAccount"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.includeAccount.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeAccount.ref()); + writer.writeFieldEnd(); } + if (s.includePersonalLinkedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includePersonalLinkedNotebooks"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.includePersonalLinkedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includePersonalLinkedNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.includeBusinessLinkedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("includeBusinessLinkedNotebooks"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.includeBusinessLinkedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.includeBusinessLinkedNotebooks.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSavedSearchScope( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SavedSearchScope & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeAccount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includePersonalLinkedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.includeBusinessLinkedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SavedSearchScope::print(QTextStream & strm) const @@ -13832,134 +14708,146 @@ void SavedSearchScope::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSavedSearch( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SavedSearch & s) { - w.writeStructBegin(QStringLiteral("SavedSearch")); + writer.writeStructBegin(QStringLiteral("SavedSearch")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 2); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.query.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("query"), ThriftFieldType::T_STRING, 3); - w.writeString(s.query.ref()); - w.writeFieldEnd(); + + writer.writeString(s.query.ref()); + writer.writeFieldEnd(); } + if (s.format.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("format"), ThriftFieldType::T_I32, 4); - w.writeI32(static_cast(s.format.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.format.ref())); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.scope.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("scope"), ThriftFieldType::T_STRUCT, 6); - writeSavedSearchScope(w, s.scope.ref()); - w.writeFieldEnd(); + + writeSavedSearchScope(writer, s.scope.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSavedSearch( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SavedSearch & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.query = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { QueryFormat v; - readEnumQueryFormat(r, v); + readEnumQueryFormat(reader, v); s.format = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRUCT) { SavedSearchScope v; - readSavedSearchScope(r, v); + readSavedSearchScope(reader, v); s.scope = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SavedSearch::print(QTextStream & strm) const @@ -14020,66 +14908,70 @@ void SavedSearch::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSharedNotebookRecipientSettings( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SharedNotebookRecipientSettings & s) { - w.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); + writer.writeStructBegin(QStringLiteral("SharedNotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.reminderNotifyEmail.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.reminderNotifyEmail.ref()); + writer.writeFieldEnd(); } + if (s.reminderNotifyInApp.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.reminderNotifyInApp.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.reminderNotifyInApp.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSharedNotebookRecipientSettings( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebookRecipientSettings & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.reminderNotifyEmail = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.reminderNotifyInApp = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SharedNotebookRecipientSettings::print(QTextStream & strm) const @@ -14108,117 +15000,127 @@ void SharedNotebookRecipientSettings::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotebookRecipientSettings( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotebookRecipientSettings & s) { - w.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); + writer.writeStructBegin(QStringLiteral("NotebookRecipientSettings")); if (s.reminderNotifyEmail.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderNotifyEmail"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.reminderNotifyEmail.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.reminderNotifyEmail.ref()); + writer.writeFieldEnd(); } + if (s.reminderNotifyInApp.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reminderNotifyInApp"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.reminderNotifyInApp.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.reminderNotifyInApp.ref()); + writer.writeFieldEnd(); } + if (s.inMyList.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("inMyList"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.inMyList.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.inMyList.ref()); + writer.writeFieldEnd(); } + if (s.stack.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stack"), ThriftFieldType::T_STRING, 4); - w.writeString(s.stack.ref()); - w.writeFieldEnd(); + + writer.writeString(s.stack.ref()); + writer.writeFieldEnd(); } + if (s.recipientStatus.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientStatus"), ThriftFieldType::T_I32, 5); - w.writeI32(static_cast(s.recipientStatus.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.recipientStatus.ref())); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotebookRecipientSettings( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotebookRecipientSettings & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.reminderNotifyEmail = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.reminderNotifyInApp = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.inMyList = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.stack = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { RecipientStatus v; - readEnumRecipientStatus(r, v); + readEnumRecipientStatus(reader, v); s.recipientStatus = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NotebookRecipientSettings::print(QTextStream & strm) const @@ -14271,304 +15173,336 @@ void NotebookRecipientSettings::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeSharedNotebook( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const SharedNotebook & s) { - w.writeStructBegin(QStringLiteral("SharedNotebook")); + writer.writeStructBegin(QStringLiteral("SharedNotebook")); if (s.id.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("id"), ThriftFieldType::T_I64, 1); - w.writeI64(s.id.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.id.ref()); + writer.writeFieldEnd(); } + if (s.userId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userId"), ThriftFieldType::T_I32, 2); - w.writeI32(s.userId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.userId.ref()); + writer.writeFieldEnd(); } + if (s.notebookGuid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookGuid"), ThriftFieldType::T_STRING, 3); - w.writeString(s.notebookGuid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookGuid.ref()); + writer.writeFieldEnd(); } + if (s.email.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("email"), ThriftFieldType::T_STRING, 4); - w.writeString(s.email.ref()); - w.writeFieldEnd(); + + writer.writeString(s.email.ref()); + writer.writeFieldEnd(); } + if (s.recipientIdentityId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientIdentityId"), ThriftFieldType::T_I64, 18); - w.writeI64(s.recipientIdentityId.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.recipientIdentityId.ref()); + writer.writeFieldEnd(); } + if (s.notebookModifiable.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookModifiable"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.notebookModifiable.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.notebookModifiable.ref()); + writer.writeFieldEnd(); } + if (s.serviceCreated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); - w.writeI64(s.serviceCreated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceCreated.ref()); + writer.writeFieldEnd(); } + if (s.serviceUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 10); - w.writeI64(s.serviceUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceUpdated.ref()); + writer.writeFieldEnd(); } + if (s.globalId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("globalId"), ThriftFieldType::T_STRING, 8); - w.writeString(s.globalId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.globalId.ref()); + writer.writeFieldEnd(); } + if (s.username.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 9); - w.writeString(s.username.ref()); - w.writeFieldEnd(); + + writer.writeString(s.username.ref()); + writer.writeFieldEnd(); } + if (s.privilege.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("privilege"), ThriftFieldType::T_I32, 11); - w.writeI32(static_cast(s.privilege.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.privilege.ref())); + writer.writeFieldEnd(); } + if (s.recipientSettings.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 13); - writeSharedNotebookRecipientSettings(w, s.recipientSettings.ref()); - w.writeFieldEnd(); + + writeSharedNotebookRecipientSettings(writer, s.recipientSettings.ref()); + writer.writeFieldEnd(); } + if (s.sharerUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharerUserId"), ThriftFieldType::T_I32, 14); - w.writeI32(s.sharerUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.sharerUserId.ref()); + writer.writeFieldEnd(); } + if (s.recipientUsername.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientUsername"), ThriftFieldType::T_STRING, 15); - w.writeString(s.recipientUsername.ref()); - w.writeFieldEnd(); + + writer.writeString(s.recipientUsername.ref()); + writer.writeFieldEnd(); } + if (s.recipientUserId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientUserId"), ThriftFieldType::T_I32, 17); - w.writeI32(s.recipientUserId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.recipientUserId.ref()); + writer.writeFieldEnd(); } + if (s.serviceAssigned.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceAssigned"), ThriftFieldType::T_I64, 16); - w.writeI64(s.serviceAssigned.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceAssigned.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readSharedNotebook( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, SharedNotebook & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.id = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.userId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.notebookGuid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.email = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { IdentityID v; - r.readI64(v); + reader.readI64(v); s.recipientIdentityId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.notebookModifiable = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceCreated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.globalId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.username = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; - readEnumSharedNotebookPrivilegeLevel(r, v); + readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRUCT) { SharedNotebookRecipientSettings v; - readSharedNotebookRecipientSettings(r, v); + readSharedNotebookRecipientSettings(reader, v); s.recipientSettings = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.sharerUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.recipientUsername = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.recipientUserId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceAssigned = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void SharedNotebook::print(QTextStream & strm) const @@ -14709,49 +15643,51 @@ void SharedNotebook::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeCanMoveToContainerRestrictions( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const CanMoveToContainerRestrictions & s) { - w.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); + writer.writeStructBegin(QStringLiteral("CanMoveToContainerRestrictions")); if (s.canMoveToContainer.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("canMoveToContainer"), ThriftFieldType::T_I32, 1); - w.writeI32(static_cast(s.canMoveToContainer.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.canMoveToContainer.ref())); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readCanMoveToContainerRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, CanMoveToContainerRestrictions & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { CanMoveToContainerStatus v; - readEnumCanMoveToContainerStatus(r, v); + readEnumCanMoveToContainerStatus(reader, v); s.canMoveToContainer = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void CanMoveToContainerRestrictions::print(QTextStream & strm) const @@ -14772,525 +15708,583 @@ void CanMoveToContainerRestrictions::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotebookRestrictions( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotebookRestrictions & s) { - w.writeStructBegin(QStringLiteral("NotebookRestrictions")); + writer.writeStructBegin(QStringLiteral("NotebookRestrictions")); if (s.noReadNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noReadNotes"), ThriftFieldType::T_BOOL, 1); - w.writeBool(s.noReadNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noReadNotes.ref()); + writer.writeFieldEnd(); } + if (s.noCreateNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noCreateNotes"), ThriftFieldType::T_BOOL, 2); - w.writeBool(s.noCreateNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noCreateNotes.ref()); + writer.writeFieldEnd(); } + if (s.noUpdateNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noUpdateNotes"), ThriftFieldType::T_BOOL, 3); - w.writeBool(s.noUpdateNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noUpdateNotes.ref()); + writer.writeFieldEnd(); } + if (s.noExpungeNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noExpungeNotes"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.noExpungeNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noExpungeNotes.ref()); + writer.writeFieldEnd(); } + if (s.noShareNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noShareNotes"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.noShareNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noShareNotes.ref()); + writer.writeFieldEnd(); } + if (s.noEmailNotes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noEmailNotes"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.noEmailNotes.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noEmailNotes.ref()); + writer.writeFieldEnd(); } + if (s.noSendMessageToRecipients.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSendMessageToRecipients"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.noSendMessageToRecipients.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSendMessageToRecipients.ref()); + writer.writeFieldEnd(); } + if (s.noUpdateNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noUpdateNotebook"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.noUpdateNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noUpdateNotebook.ref()); + writer.writeFieldEnd(); } + if (s.noExpungeNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noExpungeNotebook"), ThriftFieldType::T_BOOL, 9); - w.writeBool(s.noExpungeNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noExpungeNotebook.ref()); + writer.writeFieldEnd(); } + if (s.noSetDefaultNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetDefaultNotebook"), ThriftFieldType::T_BOOL, 10); - w.writeBool(s.noSetDefaultNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetDefaultNotebook.ref()); + writer.writeFieldEnd(); } + if (s.noSetNotebookStack.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetNotebookStack"), ThriftFieldType::T_BOOL, 11); - w.writeBool(s.noSetNotebookStack.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetNotebookStack.ref()); + writer.writeFieldEnd(); } + if (s.noPublishToPublic.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noPublishToPublic"), ThriftFieldType::T_BOOL, 12); - w.writeBool(s.noPublishToPublic.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noPublishToPublic.ref()); + writer.writeFieldEnd(); } + if (s.noPublishToBusinessLibrary.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noPublishToBusinessLibrary"), ThriftFieldType::T_BOOL, 13); - w.writeBool(s.noPublishToBusinessLibrary.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noPublishToBusinessLibrary.ref()); + writer.writeFieldEnd(); } + if (s.noCreateTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noCreateTags"), ThriftFieldType::T_BOOL, 14); - w.writeBool(s.noCreateTags.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noCreateTags.ref()); + writer.writeFieldEnd(); } + if (s.noUpdateTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noUpdateTags"), ThriftFieldType::T_BOOL, 15); - w.writeBool(s.noUpdateTags.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noUpdateTags.ref()); + writer.writeFieldEnd(); } + if (s.noExpungeTags.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noExpungeTags"), ThriftFieldType::T_BOOL, 16); - w.writeBool(s.noExpungeTags.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noExpungeTags.ref()); + writer.writeFieldEnd(); } + if (s.noSetParentTag.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetParentTag"), ThriftFieldType::T_BOOL, 17); - w.writeBool(s.noSetParentTag.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetParentTag.ref()); + writer.writeFieldEnd(); } + if (s.noCreateSharedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noCreateSharedNotebooks"), ThriftFieldType::T_BOOL, 18); - w.writeBool(s.noCreateSharedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noCreateSharedNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.updateWhichSharedNotebookRestrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 19); - w.writeI32(static_cast(s.updateWhichSharedNotebookRestrictions.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.updateWhichSharedNotebookRestrictions.ref())); + writer.writeFieldEnd(); } + if (s.expungeWhichSharedNotebookRestrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("expungeWhichSharedNotebookRestrictions"), ThriftFieldType::T_I32, 20); - w.writeI32(static_cast(s.expungeWhichSharedNotebookRestrictions.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.expungeWhichSharedNotebookRestrictions.ref())); + writer.writeFieldEnd(); } + if (s.noShareNotesWithBusiness.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noShareNotesWithBusiness"), ThriftFieldType::T_BOOL, 21); - w.writeBool(s.noShareNotesWithBusiness.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noShareNotesWithBusiness.ref()); + writer.writeFieldEnd(); } + if (s.noRenameNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noRenameNotebook"), ThriftFieldType::T_BOOL, 22); - w.writeBool(s.noRenameNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noRenameNotebook.ref()); + writer.writeFieldEnd(); } + if (s.noSetInMyList.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetInMyList"), ThriftFieldType::T_BOOL, 23); - w.writeBool(s.noSetInMyList.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetInMyList.ref()); + writer.writeFieldEnd(); } + if (s.noChangeContact.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noChangeContact"), ThriftFieldType::T_BOOL, 24); - w.writeBool(s.noChangeContact.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noChangeContact.ref()); + writer.writeFieldEnd(); } + if (s.canMoveToContainerRestrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("canMoveToContainerRestrictions"), ThriftFieldType::T_STRUCT, 26); - writeCanMoveToContainerRestrictions(w, s.canMoveToContainerRestrictions.ref()); - w.writeFieldEnd(); + + writeCanMoveToContainerRestrictions(writer, s.canMoveToContainerRestrictions.ref()); + writer.writeFieldEnd(); } + if (s.noSetReminderNotifyEmail.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetReminderNotifyEmail"), ThriftFieldType::T_BOOL, 27); - w.writeBool(s.noSetReminderNotifyEmail.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetReminderNotifyEmail.ref()); + writer.writeFieldEnd(); } + if (s.noSetReminderNotifyInApp.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetReminderNotifyInApp"), ThriftFieldType::T_BOOL, 28); - w.writeBool(s.noSetReminderNotifyInApp.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetReminderNotifyInApp.ref()); + writer.writeFieldEnd(); } + if (s.noSetRecipientSettingsStack.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noSetRecipientSettingsStack"), ThriftFieldType::T_BOOL, 29); - w.writeBool(s.noSetRecipientSettingsStack.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noSetRecipientSettingsStack.ref()); + writer.writeFieldEnd(); } + if (s.noCanMoveNote.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noCanMoveNote"), ThriftFieldType::T_BOOL, 30); - w.writeBool(s.noCanMoveNote.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.noCanMoveNote.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotebookRestrictions( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotebookRestrictions & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noReadNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noCreateNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noUpdateNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noExpungeNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noShareNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noEmailNotes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSendMessageToRecipients = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noUpdateNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noExpungeNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetDefaultNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetNotebookStack = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noPublishToPublic = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noPublishToBusinessLibrary = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noCreateTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noUpdateTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noExpungeTags = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetParentTag = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noCreateSharedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookInstanceRestrictions v; - readEnumSharedNotebookInstanceRestrictions(r, v); + readEnumSharedNotebookInstanceRestrictions(reader, v); s.updateWhichSharedNotebookRestrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookInstanceRestrictions v; - readEnumSharedNotebookInstanceRestrictions(r, v); + readEnumSharedNotebookInstanceRestrictions(reader, v); s.expungeWhichSharedNotebookRestrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noShareNotesWithBusiness = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noRenameNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetInMyList = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noChangeContact = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_STRUCT) { CanMoveToContainerRestrictions v; - readCanMoveToContainerRestrictions(r, v); + readCanMoveToContainerRestrictions(reader, v); s.canMoveToContainerRestrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 27) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetReminderNotifyEmail = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetReminderNotifyInApp = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noSetRecipientSettingsStack = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.noCanMoveNote = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NotebookRestrictions::print(QTextStream & strm) const @@ -15535,233 +16529,265 @@ void NotebookRestrictions::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotebook( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const Notebook & s) { - w.writeStructBegin(QStringLiteral("Notebook")); + writer.writeStructBegin(QStringLiteral("Notebook")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 2); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 5); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.defaultNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("defaultNotebook"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.defaultNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.defaultNotebook.ref()); + writer.writeFieldEnd(); } + if (s.serviceCreated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceCreated"), ThriftFieldType::T_I64, 7); - w.writeI64(s.serviceCreated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceCreated.ref()); + writer.writeFieldEnd(); } + if (s.serviceUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceUpdated"), ThriftFieldType::T_I64, 8); - w.writeI64(s.serviceUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.serviceUpdated.ref()); + writer.writeFieldEnd(); } + if (s.publishing.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("publishing"), ThriftFieldType::T_STRUCT, 10); - writePublishing(w, s.publishing.ref()); - w.writeFieldEnd(); + + writePublishing(writer, s.publishing.ref()); + writer.writeFieldEnd(); } + if (s.published.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("published"), ThriftFieldType::T_BOOL, 11); - w.writeBool(s.published.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.published.ref()); + writer.writeFieldEnd(); } + if (s.stack.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stack"), ThriftFieldType::T_STRING, 12); - w.writeString(s.stack.ref()); - w.writeFieldEnd(); + + writer.writeString(s.stack.ref()); + writer.writeFieldEnd(); } + if (s.sharedNotebookIds.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharedNotebookIds"), ThriftFieldType::T_LIST, 13); - w.writeListBegin(ThriftFieldType::T_I64, s.sharedNotebookIds.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_I64, s.sharedNotebookIds.ref().length()); for(const auto & value: qAsConst(s.sharedNotebookIds.ref())) { - w.writeI64(value); + writer.writeI64(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.sharedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharedNotebooks"), ThriftFieldType::T_LIST, 14); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotebooks.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.sharedNotebooks.ref().length()); for(const auto & value: qAsConst(s.sharedNotebooks.ref())) { - writeSharedNotebook(w, value); + writeSharedNotebook(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.businessNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessNotebook"), ThriftFieldType::T_STRUCT, 15); - writeBusinessNotebook(w, s.businessNotebook.ref()); - w.writeFieldEnd(); + + writeBusinessNotebook(writer, s.businessNotebook.ref()); + writer.writeFieldEnd(); } + if (s.contact.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 16); - writeUser(w, s.contact.ref()); - w.writeFieldEnd(); + + writeUser(writer, s.contact.ref()); + writer.writeFieldEnd(); } + if (s.restrictions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("restrictions"), ThriftFieldType::T_STRUCT, 17); - writeNotebookRestrictions(w, s.restrictions.ref()); - w.writeFieldEnd(); + + writeNotebookRestrictions(writer, s.restrictions.ref()); + writer.writeFieldEnd(); } + if (s.recipientSettings.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("recipientSettings"), ThriftFieldType::T_STRUCT, 18); - writeNotebookRecipientSettings(w, s.recipientSettings.ref()); - w.writeFieldEnd(); + + writeNotebookRecipientSettings(writer, s.recipientSettings.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotebook( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, Notebook & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.defaultNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceCreated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.serviceUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRUCT) { Publishing v; - readPublishing(r, v); + readPublishing(reader, v); s.publishing = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.published = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.stack = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { @@ -15769,7 +16795,7 @@ void readNotebook( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I64) { throw ThriftException( @@ -15778,13 +16804,13 @@ void readNotebook( } for(qint32 i = 0; i < size; i++) { qint64 elem; - r.readI64(elem); + reader.readI64(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.sharedNotebookIds = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { @@ -15792,7 +16818,7 @@ void readNotebook( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -15801,57 +16827,57 @@ void readNotebook( } for(qint32 i = 0; i < size; i++) { SharedNotebook elem; - readSharedNotebook(r, elem); + readSharedNotebook(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.sharedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessNotebook v; - readBusinessNotebook(r, v); + readBusinessNotebook(reader, v); s.businessNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRUCT) { User v; - readUser(r, v); + readUser(reader, v); s.contact = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_STRUCT) { NotebookRestrictions v; - readNotebookRestrictions(r, v); + readNotebookRestrictions(reader, v); s.restrictions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { NotebookRecipientSettings v; - readNotebookRecipientSettings(r, v); + readNotebookRecipientSettings(reader, v); s.recipientSettings = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void Notebook::print(QTextStream & strm) const @@ -15992,219 +17018,241 @@ void Notebook::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeLinkedNotebook( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const LinkedNotebook & s) { - w.writeStructBegin(QStringLiteral("LinkedNotebook")); + writer.writeStructBegin(QStringLiteral("LinkedNotebook")); if (s.shareName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shareName"), ThriftFieldType::T_STRING, 2); - w.writeString(s.shareName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.shareName.ref()); + writer.writeFieldEnd(); } + if (s.username.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 3); - w.writeString(s.username.ref()); - w.writeFieldEnd(); + + writer.writeString(s.username.ref()); + writer.writeFieldEnd(); } + if (s.shardId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("shardId"), ThriftFieldType::T_STRING, 4); - w.writeString(s.shardId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.shardId.ref()); + writer.writeFieldEnd(); } + if (s.sharedNotebookGlobalId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sharedNotebookGlobalId"), ThriftFieldType::T_STRING, 5); - w.writeString(s.sharedNotebookGlobalId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sharedNotebookGlobalId.ref()); + writer.writeFieldEnd(); } + if (s.uri.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("uri"), ThriftFieldType::T_STRING, 6); - w.writeString(s.uri.ref()); - w.writeFieldEnd(); + + writer.writeString(s.uri.ref()); + writer.writeFieldEnd(); } + if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 7); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.updateSequenceNum.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("updateSequenceNum"), ThriftFieldType::T_I32, 8); - w.writeI32(s.updateSequenceNum.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.updateSequenceNum.ref()); + writer.writeFieldEnd(); } + if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 9); - w.writeString(s.noteStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 10); - w.writeString(s.webApiUrlPrefix.ref()); - w.writeFieldEnd(); + + writer.writeString(s.webApiUrlPrefix.ref()); + writer.writeFieldEnd(); } + if (s.stack.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stack"), ThriftFieldType::T_STRING, 11); - w.writeString(s.stack.ref()); - w.writeFieldEnd(); + + writer.writeString(s.stack.ref()); + writer.writeFieldEnd(); } + if (s.businessId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessId"), ThriftFieldType::T_I32, 12); - w.writeI32(s.businessId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.businessId.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readLinkedNotebook( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, LinkedNotebook & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.shareName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.username = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.shardId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sharedNotebookGlobalId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.uri = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.updateSequenceNum = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.webApiUrlPrefix = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.stack = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.businessId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void LinkedNotebook::print(QTextStream & strm) const @@ -16305,117 +17353,127 @@ void LinkedNotebook::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeNotebookDescriptor( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const NotebookDescriptor & s) { - w.writeStructBegin(QStringLiteral("NotebookDescriptor")); + writer.writeStructBegin(QStringLiteral("NotebookDescriptor")); if (s.guid.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("guid"), ThriftFieldType::T_STRING, 1); - w.writeString(s.guid.ref()); - w.writeFieldEnd(); + + writer.writeString(s.guid.ref()); + writer.writeFieldEnd(); } + if (s.notebookDisplayName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("notebookDisplayName"), ThriftFieldType::T_STRING, 2); - w.writeString(s.notebookDisplayName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.notebookDisplayName.ref()); + writer.writeFieldEnd(); } + if (s.contactName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contactName"), ThriftFieldType::T_STRING, 3); - w.writeString(s.contactName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.contactName.ref()); + writer.writeFieldEnd(); } + if (s.hasSharedNotebook.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("hasSharedNotebook"), ThriftFieldType::T_BOOL, 4); - w.writeBool(s.hasSharedNotebook.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.hasSharedNotebook.ref()); + writer.writeFieldEnd(); } + if (s.joinedUserCount.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("joinedUserCount"), ThriftFieldType::T_I32, 5); - w.writeI32(s.joinedUserCount.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.joinedUserCount.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readNotebookDescriptor( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, NotebookDescriptor & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; - r.readString(v); + reader.readString(v); s.guid = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.notebookDisplayName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.contactName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.hasSharedNotebook = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.joinedUserCount = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void NotebookDescriptor::print(QTextStream & strm) const @@ -16468,202 +17526,222 @@ void NotebookDescriptor::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUserProfile( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const UserProfile & s) { - w.writeStructBegin(QStringLiteral("UserProfile")); + writer.writeStructBegin(QStringLiteral("UserProfile")); if (s.id.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("id"), ThriftFieldType::T_I32, 1); - w.writeI32(s.id.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.id.ref()); + writer.writeFieldEnd(); } + if (s.name.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 2); - w.writeString(s.name.ref()); - w.writeFieldEnd(); + + writer.writeString(s.name.ref()); + writer.writeFieldEnd(); } + if (s.email.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("email"), ThriftFieldType::T_STRING, 3); - w.writeString(s.email.ref()); - w.writeFieldEnd(); + + writer.writeString(s.email.ref()); + writer.writeFieldEnd(); } + if (s.username.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 4); - w.writeString(s.username.ref()); - w.writeFieldEnd(); + + writer.writeString(s.username.ref()); + writer.writeFieldEnd(); } + if (s.attributes.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("attributes"), ThriftFieldType::T_STRUCT, 5); - writeBusinessUserAttributes(w, s.attributes.ref()); - w.writeFieldEnd(); + + writeBusinessUserAttributes(writer, s.attributes.ref()); + writer.writeFieldEnd(); } + if (s.joined.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("joined"), ThriftFieldType::T_I64, 6); - w.writeI64(s.joined.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.joined.ref()); + writer.writeFieldEnd(); } + if (s.photoLastUpdated.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoLastUpdated"), ThriftFieldType::T_I64, 7); - w.writeI64(s.photoLastUpdated.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.photoLastUpdated.ref()); + writer.writeFieldEnd(); } + if (s.photoUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("photoUrl"), ThriftFieldType::T_STRING, 8); - w.writeString(s.photoUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.photoUrl.ref()); + writer.writeFieldEnd(); } + if (s.role.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("role"), ThriftFieldType::T_I32, 9); - w.writeI32(static_cast(s.role.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.role.ref())); + writer.writeFieldEnd(); } + if (s.status.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("status"), ThriftFieldType::T_I32, 10); - w.writeI32(static_cast(s.status.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.status.ref())); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUserProfile( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserProfile & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.id = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.email = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.username = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessUserAttributes v; - readBusinessUserAttributes(r, v); + readBusinessUserAttributes(reader, v); s.attributes = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.joined = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.photoLastUpdated = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.photoUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; - readEnumBusinessUserRole(r, v); + readEnumBusinessUserRole(reader, v); s.role = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserStatus v; - readEnumBusinessUserStatus(r, v); + readEnumBusinessUserStatus(reader, v); s.status = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void UserProfile::print(QTextStream & strm) const @@ -16756,117 +17834,127 @@ void UserProfile::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeRelatedContentImage( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const RelatedContentImage & s) { - w.writeStructBegin(QStringLiteral("RelatedContentImage")); + writer.writeStructBegin(QStringLiteral("RelatedContentImage")); if (s.url.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("url"), ThriftFieldType::T_STRING, 1); - w.writeString(s.url.ref()); - w.writeFieldEnd(); + + writer.writeString(s.url.ref()); + writer.writeFieldEnd(); } + if (s.width.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("width"), ThriftFieldType::T_I32, 2); - w.writeI32(s.width.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.width.ref()); + writer.writeFieldEnd(); } + if (s.height.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("height"), ThriftFieldType::T_I32, 3); - w.writeI32(s.height.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.height.ref()); + writer.writeFieldEnd(); } + if (s.pixelRatio.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("pixelRatio"), ThriftFieldType::T_DOUBLE, 4); - w.writeDouble(s.pixelRatio.ref()); - w.writeFieldEnd(); + + writer.writeDouble(s.pixelRatio.ref()); + writer.writeFieldEnd(); } + if (s.fileSize.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("fileSize"), ThriftFieldType::T_I32, 5); - w.writeI32(s.fileSize.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.fileSize.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readRelatedContentImage( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedContentImage & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.url = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.width = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.height = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; - r.readDouble(v); + reader.readDouble(v); s.pixelRatio = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.fileSize = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void RelatedContentImage::print(QTextStream & strm) const @@ -16919,241 +18007,275 @@ void RelatedContentImage::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeRelatedContent( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const RelatedContent & s) { - w.writeStructBegin(QStringLiteral("RelatedContent")); + writer.writeStructBegin(QStringLiteral("RelatedContent")); if (s.contentId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentId"), ThriftFieldType::T_STRING, 1); - w.writeString(s.contentId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.contentId.ref()); + writer.writeFieldEnd(); } + if (s.title.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("title"), ThriftFieldType::T_STRING, 2); - w.writeString(s.title.ref()); - w.writeFieldEnd(); + + writer.writeString(s.title.ref()); + writer.writeFieldEnd(); } + if (s.url.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("url"), ThriftFieldType::T_STRING, 3); - w.writeString(s.url.ref()); - w.writeFieldEnd(); + + writer.writeString(s.url.ref()); + writer.writeFieldEnd(); } + if (s.sourceId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceId"), ThriftFieldType::T_STRING, 4); - w.writeString(s.sourceId.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceId.ref()); + writer.writeFieldEnd(); } + if (s.sourceUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceUrl"), ThriftFieldType::T_STRING, 5); - w.writeString(s.sourceUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceUrl.ref()); + writer.writeFieldEnd(); } + if (s.sourceFaviconUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceFaviconUrl"), ThriftFieldType::T_STRING, 6); - w.writeString(s.sourceFaviconUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceFaviconUrl.ref()); + writer.writeFieldEnd(); } + if (s.sourceName.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("sourceName"), ThriftFieldType::T_STRING, 7); - w.writeString(s.sourceName.ref()); - w.writeFieldEnd(); + + writer.writeString(s.sourceName.ref()); + writer.writeFieldEnd(); } + if (s.date.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("date"), ThriftFieldType::T_I64, 8); - w.writeI64(s.date.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.date.ref()); + writer.writeFieldEnd(); } + if (s.teaser.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("teaser"), ThriftFieldType::T_STRING, 9); - w.writeString(s.teaser.ref()); - w.writeFieldEnd(); + + writer.writeString(s.teaser.ref()); + writer.writeFieldEnd(); } + if (s.thumbnails.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("thumbnails"), ThriftFieldType::T_LIST, 10); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.thumbnails.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.thumbnails.ref().length()); for(const auto & value: qAsConst(s.thumbnails.ref())) { - writeRelatedContentImage(w, value); + writeRelatedContentImage(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } + if (s.contentType.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contentType"), ThriftFieldType::T_I32, 11); - w.writeI32(static_cast(s.contentType.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.contentType.ref())); + writer.writeFieldEnd(); } + if (s.accessType.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("accessType"), ThriftFieldType::T_I32, 12); - w.writeI32(static_cast(s.accessType.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.accessType.ref())); + writer.writeFieldEnd(); } + if (s.visibleUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("visibleUrl"), ThriftFieldType::T_STRING, 13); - w.writeString(s.visibleUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.visibleUrl.ref()); + writer.writeFieldEnd(); } + if (s.clipUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("clipUrl"), ThriftFieldType::T_STRING, 14); - w.writeString(s.clipUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.clipUrl.ref()); + writer.writeFieldEnd(); } + if (s.contact.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("contact"), ThriftFieldType::T_STRUCT, 15); - writeContact(w, s.contact.ref()); - w.writeFieldEnd(); + + writeContact(writer, s.contact.ref()); + writer.writeFieldEnd(); } + if (s.authors.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("authors"), ThriftFieldType::T_LIST, 16); - w.writeListBegin(ThriftFieldType::T_STRING, s.authors.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_STRING, s.authors.ref().length()); for(const auto & value: qAsConst(s.authors.ref())) { - w.writeString(value); + writer.writeString(value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readRelatedContent( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, RelatedContent & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.contentId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.title = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.url = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceFaviconUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.sourceName = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.date = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.teaser = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { @@ -17161,7 +18283,7 @@ void readRelatedContent( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -17170,58 +18292,58 @@ void readRelatedContent( } for(qint32 i = 0; i < size; i++) { RelatedContentImage elem; - readRelatedContentImage(r, elem); + readRelatedContentImage(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.thumbnails = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { RelatedContentType v; - readEnumRelatedContentType(r, v); + readEnumRelatedContentType(reader, v); s.contentType = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { RelatedContentAccess v; - readEnumRelatedContentAccess(r, v); + readEnumRelatedContentAccess(reader, v); s.accessType = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.visibleUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.clipUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { Contact v; - readContact(r, v); + readContact(reader, v); s.contact = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { @@ -17229,7 +18351,7 @@ void readRelatedContent( QStringList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRING) { throw ThriftException( @@ -17238,21 +18360,21 @@ void readRelatedContent( } for(qint32 i = 0; i < size; i++) { QString elem; - r.readString(elem); + reader.readString(elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.authors = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void RelatedContent::print(QTextStream & strm) const @@ -17401,168 +18523,184 @@ void RelatedContent::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBusinessInvitation( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BusinessInvitation & s) { - w.writeStructBegin(QStringLiteral("BusinessInvitation")); + writer.writeStructBegin(QStringLiteral("BusinessInvitation")); if (s.businessId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("businessId"), ThriftFieldType::T_I32, 1); - w.writeI32(s.businessId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.businessId.ref()); + writer.writeFieldEnd(); } + if (s.email.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("email"), ThriftFieldType::T_STRING, 2); - w.writeString(s.email.ref()); - w.writeFieldEnd(); + + writer.writeString(s.email.ref()); + writer.writeFieldEnd(); } + if (s.role.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("role"), ThriftFieldType::T_I32, 3); - w.writeI32(static_cast(s.role.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.role.ref())); + writer.writeFieldEnd(); } + if (s.status.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("status"), ThriftFieldType::T_I32, 4); - w.writeI32(static_cast(s.status.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.status.ref())); + writer.writeFieldEnd(); } + if (s.requesterId.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("requesterId"), ThriftFieldType::T_I32, 5); - w.writeI32(s.requesterId.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.requesterId.ref()); + writer.writeFieldEnd(); } + if (s.fromWorkChat.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("fromWorkChat"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.fromWorkChat.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.fromWorkChat.ref()); + writer.writeFieldEnd(); } + if (s.created.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("created"), ThriftFieldType::T_I64, 7); - w.writeI64(s.created.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.created.ref()); + writer.writeFieldEnd(); } + if (s.mostRecentReminder.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("mostRecentReminder"), ThriftFieldType::T_I64, 8); - w.writeI64(s.mostRecentReminder.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.mostRecentReminder.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBusinessInvitation( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BusinessInvitation & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.businessId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.email = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; - readEnumBusinessUserRole(r, v); + readEnumBusinessUserRole(reader, v); s.role = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { BusinessInvitationStatus v; - readEnumBusinessInvitationStatus(r, v); + readEnumBusinessInvitationStatus(reader, v); s.status = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; - r.readI32(v); + reader.readI32(v); s.requesterId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.fromWorkChat = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.created = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.mostRecentReminder = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void BusinessInvitation::print(QTextStream & strm) const @@ -17639,83 +18777,89 @@ void BusinessInvitation::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUserIdentity( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const UserIdentity & s) { - w.writeStructBegin(QStringLiteral("UserIdentity")); + writer.writeStructBegin(QStringLiteral("UserIdentity")); if (s.type.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("type"), ThriftFieldType::T_I32, 1); - w.writeI32(static_cast(s.type.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.type.ref())); + writer.writeFieldEnd(); } + if (s.stringIdentifier.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("stringIdentifier"), ThriftFieldType::T_STRING, 2); - w.writeString(s.stringIdentifier.ref()); - w.writeFieldEnd(); + + writer.writeString(s.stringIdentifier.ref()); + writer.writeFieldEnd(); } + if (s.longIdentifier.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("longIdentifier"), ThriftFieldType::T_I64, 3); - w.writeI64(s.longIdentifier.ref()); - w.writeFieldEnd(); + + writer.writeI64(s.longIdentifier.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUserIdentity( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserIdentity & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { UserIdentityType v; - readEnumUserIdentityType(r, v); + readEnumUserIdentityType(reader, v); s.type = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.stringIdentifier = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; - r.readI64(v); + reader.readI64(v); s.longIdentifier = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void UserIdentity::print(QTextStream & strm) const @@ -17752,117 +18896,127 @@ void UserIdentity::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writePublicUserInfo( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const PublicUserInfo & s) { - w.writeStructBegin(QStringLiteral("PublicUserInfo")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("PublicUserInfo")); + writer.writeFieldBegin( QStringLiteral("userId"), ThriftFieldType::T_I32, 1); - w.writeI32(s.userId); - w.writeFieldEnd(); + + writer.writeI32(s.userId); + writer.writeFieldEnd(); + if (s.serviceLevel.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("serviceLevel"), ThriftFieldType::T_I32, 7); - w.writeI32(static_cast(s.serviceLevel.ref())); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.serviceLevel.ref())); + writer.writeFieldEnd(); } + if (s.username.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("username"), ThriftFieldType::T_STRING, 4); - w.writeString(s.username.ref()); - w.writeFieldEnd(); + + writer.writeString(s.username.ref()); + writer.writeFieldEnd(); } + if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 5); - w.writeString(s.noteStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 6); - w.writeString(s.webApiUrlPrefix.ref()); - w.writeFieldEnd(); + + writer.writeString(s.webApiUrlPrefix.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readPublicUserInfo( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, PublicUserInfo & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool userId_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { userId_isset = true; UserID v; - r.readI32(v); + reader.readI32(v); s.userId = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { ServiceLevel v; - readEnumServiceLevel(r, v); + readEnumServiceLevel(reader, v); s.serviceLevel = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.username = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.webApiUrlPrefix = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!userId_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("PublicUserInfo.userId has no value")); } @@ -17910,134 +19064,146 @@ void PublicUserInfo::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeUserUrls( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const UserUrls & s) { - w.writeStructBegin(QStringLiteral("UserUrls")); + writer.writeStructBegin(QStringLiteral("UserUrls")); if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 1); - w.writeString(s.noteStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 2); - w.writeString(s.webApiUrlPrefix.ref()); - w.writeFieldEnd(); + + writer.writeString(s.webApiUrlPrefix.ref()); + writer.writeFieldEnd(); } + if (s.userStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userStoreUrl"), ThriftFieldType::T_STRING, 3); - w.writeString(s.userStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.userStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.utilityUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("utilityUrl"), ThriftFieldType::T_STRING, 4); - w.writeString(s.utilityUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.utilityUrl.ref()); + writer.writeFieldEnd(); } + if (s.messageStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("messageStoreUrl"), ThriftFieldType::T_STRING, 5); - w.writeString(s.messageStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.messageStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.userWebSocketUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("userWebSocketUrl"), ThriftFieldType::T_STRING, 6); - w.writeString(s.userWebSocketUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.userWebSocketUrl.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readUserUrls( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, UserUrls & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.webApiUrlPrefix = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.userStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.utilityUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.messageStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.userWebSocketUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void UserUrls::print(QTextStream & strm) const @@ -18098,90 +19264,110 @@ void UserUrls::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeAuthenticationResult( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const AuthenticationResult & s) { - w.writeStructBegin(QStringLiteral("AuthenticationResult")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("AuthenticationResult")); + writer.writeFieldBegin( QStringLiteral("currentTime"), ThriftFieldType::T_I64, 1); - w.writeI64(s.currentTime); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeI64(s.currentTime); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 2); - w.writeString(s.authenticationToken); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(s.authenticationToken); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("expiration"), ThriftFieldType::T_I64, 3); - w.writeI64(s.expiration); - w.writeFieldEnd(); + + writer.writeI64(s.expiration); + writer.writeFieldEnd(); + if (s.user.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("user"), ThriftFieldType::T_STRUCT, 4); - writeUser(w, s.user.ref()); - w.writeFieldEnd(); + + writeUser(writer, s.user.ref()); + writer.writeFieldEnd(); } + if (s.publicUserInfo.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("publicUserInfo"), ThriftFieldType::T_STRUCT, 5); - writePublicUserInfo(w, s.publicUserInfo.ref()); - w.writeFieldEnd(); + + writePublicUserInfo(writer, s.publicUserInfo.ref()); + writer.writeFieldEnd(); } + if (s.noteStoreUrl.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("noteStoreUrl"), ThriftFieldType::T_STRING, 6); - w.writeString(s.noteStoreUrl.ref()); - w.writeFieldEnd(); + + writer.writeString(s.noteStoreUrl.ref()); + writer.writeFieldEnd(); } + if (s.webApiUrlPrefix.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("webApiUrlPrefix"), ThriftFieldType::T_STRING, 7); - w.writeString(s.webApiUrlPrefix.ref()); - w.writeFieldEnd(); + + writer.writeString(s.webApiUrlPrefix.ref()); + writer.writeFieldEnd(); } + if (s.secondFactorRequired.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("secondFactorRequired"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.secondFactorRequired.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.secondFactorRequired.ref()); + writer.writeFieldEnd(); } + if (s.secondFactorDeliveryHint.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("secondFactorDeliveryHint"), ThriftFieldType::T_STRING, 9); - w.writeString(s.secondFactorDeliveryHint.ref()); - w.writeFieldEnd(); + + writer.writeString(s.secondFactorDeliveryHint.ref()); + writer.writeFieldEnd(); } + if (s.urls.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("urls"), ThriftFieldType::T_STRUCT, 10); - writeUserUrls(w, s.urls.ref()); - w.writeFieldEnd(); + + writeUserUrls(writer, s.urls.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readAuthenticationResult( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, AuthenticationResult & s) { QString fname; @@ -18190,110 +19376,110 @@ void readAuthenticationResult( bool currentTime_isset = false; bool authenticationToken_isset = false; bool expiration_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I64) { currentTime_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.currentTime = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { authenticationToken_isset = true; QString v; - r.readString(v); + reader.readString(v); s.authenticationToken = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { expiration_isset = true; qint64 v; - r.readI64(v); + reader.readI64(v); s.expiration = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { User v; - readUser(r, v); + readUser(reader, v); s.user = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { PublicUserInfo v; - readPublicUserInfo(r, v); + readPublicUserInfo(reader, v); s.publicUserInfo = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.noteStoreUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.webApiUrlPrefix = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.secondFactorRequired = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.secondFactorDeliveryHint = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRUCT) { UserUrls v; - readUserUrls(r, v); + readUserUrls(reader, v); s.urls = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!currentTime_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.currentTime has no value")); if (!authenticationToken_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.authenticationToken has no value")); if (!expiration_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("AuthenticationResult.expiration has no value")); @@ -18371,120 +19557,148 @@ void AuthenticationResult::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBootstrapSettings( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BootstrapSettings & s) { - w.writeStructBegin(QStringLiteral("BootstrapSettings")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("BootstrapSettings")); + writer.writeFieldBegin( QStringLiteral("serviceHost"), ThriftFieldType::T_STRING, 1); - w.writeString(s.serviceHost); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(s.serviceHost); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("marketingUrl"), ThriftFieldType::T_STRING, 2); - w.writeString(s.marketingUrl); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(s.marketingUrl); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("supportUrl"), ThriftFieldType::T_STRING, 3); - w.writeString(s.supportUrl); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(s.supportUrl); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("accountEmailDomain"), ThriftFieldType::T_STRING, 4); - w.writeString(s.accountEmailDomain); - w.writeFieldEnd(); + + writer.writeString(s.accountEmailDomain); + writer.writeFieldEnd(); + if (s.enableFacebookSharing.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableFacebookSharing"), ThriftFieldType::T_BOOL, 5); - w.writeBool(s.enableFacebookSharing.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableFacebookSharing.ref()); + writer.writeFieldEnd(); } + if (s.enableGiftSubscriptions.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableGiftSubscriptions"), ThriftFieldType::T_BOOL, 6); - w.writeBool(s.enableGiftSubscriptions.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableGiftSubscriptions.ref()); + writer.writeFieldEnd(); } + if (s.enableSupportTickets.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableSupportTickets"), ThriftFieldType::T_BOOL, 7); - w.writeBool(s.enableSupportTickets.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableSupportTickets.ref()); + writer.writeFieldEnd(); } + if (s.enableSharedNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableSharedNotebooks"), ThriftFieldType::T_BOOL, 8); - w.writeBool(s.enableSharedNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableSharedNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.enableSingleNoteSharing.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableSingleNoteSharing"), ThriftFieldType::T_BOOL, 9); - w.writeBool(s.enableSingleNoteSharing.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableSingleNoteSharing.ref()); + writer.writeFieldEnd(); } + if (s.enableSponsoredAccounts.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableSponsoredAccounts"), ThriftFieldType::T_BOOL, 10); - w.writeBool(s.enableSponsoredAccounts.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableSponsoredAccounts.ref()); + writer.writeFieldEnd(); } + if (s.enableTwitterSharing.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableTwitterSharing"), ThriftFieldType::T_BOOL, 11); - w.writeBool(s.enableTwitterSharing.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableTwitterSharing.ref()); + writer.writeFieldEnd(); } + if (s.enableLinkedInSharing.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableLinkedInSharing"), ThriftFieldType::T_BOOL, 12); - w.writeBool(s.enableLinkedInSharing.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableLinkedInSharing.ref()); + writer.writeFieldEnd(); } + if (s.enablePublicNotebooks.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enablePublicNotebooks"), ThriftFieldType::T_BOOL, 13); - w.writeBool(s.enablePublicNotebooks.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enablePublicNotebooks.ref()); + writer.writeFieldEnd(); } + if (s.enableGoogle.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("enableGoogle"), ThriftFieldType::T_BOOL, 16); - w.writeBool(s.enableGoogle.ref()); - w.writeFieldEnd(); + + writer.writeBool(s.enableGoogle.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBootstrapSettings( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BootstrapSettings & s) { QString fname; @@ -18494,147 +19708,147 @@ void readBootstrapSettings( bool marketingUrl_isset = false; bool supportUrl_isset = false; bool accountEmailDomain_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { serviceHost_isset = true; QString v; - r.readString(v); + reader.readString(v); s.serviceHost = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { marketingUrl_isset = true; QString v; - r.readString(v); + reader.readString(v); s.marketingUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { supportUrl_isset = true; QString v; - r.readString(v); + reader.readString(v); s.supportUrl = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { accountEmailDomain_isset = true; QString v; - r.readString(v); + reader.readString(v); s.accountEmailDomain = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableFacebookSharing = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableGiftSubscriptions = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableSupportTickets = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableSharedNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableSingleNoteSharing = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableSponsoredAccounts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableTwitterSharing = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableLinkedInSharing = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enablePublicNotebooks = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; - r.readBool(v); + reader.readBool(v); s.enableGoogle = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!serviceHost_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.serviceHost has no value")); if (!marketingUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.marketingUrl has no value")); if (!supportUrl_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapSettings.supportUrl has no value")); @@ -18739,28 +19953,32 @@ void BootstrapSettings::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBootstrapProfile( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BootstrapProfile & s) { - w.writeStructBegin(QStringLiteral("BootstrapProfile")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("BootstrapProfile")); + writer.writeFieldBegin( QStringLiteral("name"), ThriftFieldType::T_STRING, 1); - w.writeString(s.name); - w.writeFieldEnd(); - w.writeFieldBegin( + + writer.writeString(s.name); + writer.writeFieldEnd(); + + writer.writeFieldBegin( QStringLiteral("settings"), ThriftFieldType::T_STRUCT, 2); - writeBootstrapSettings(w, s.settings); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); + + writeBootstrapSettings(writer, s.settings); + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBootstrapProfile( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BootstrapProfile & s) { QString fname; @@ -18768,37 +19986,37 @@ void readBootstrapProfile( qint16 fieldId; bool name_isset = false; bool settings_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { name_isset = true; QString v; - r.readString(v); + reader.readString(v); s.name = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { settings_isset = true; BootstrapSettings v; - readBootstrapSettings(r, v); + readBootstrapSettings(reader, v); s.settings = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!name_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.name has no value")); if (!settings_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapProfile.settings has no value")); } @@ -18816,36 +20034,39 @@ void BootstrapProfile::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// void writeBootstrapInfo( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const BootstrapInfo & s) { - w.writeStructBegin(QStringLiteral("BootstrapInfo")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("BootstrapInfo")); + writer.writeFieldBegin( QStringLiteral("profiles"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.profiles.length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.profiles.length()); for(const auto & value: qAsConst(s.profiles)) { - writeBootstrapProfile(w, value); + writeBootstrapProfile(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); - w.writeFieldStop(); - w.writeStructEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readBootstrapInfo( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, BootstrapInfo & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool profiles_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { @@ -18853,7 +20074,7 @@ void readBootstrapInfo( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -18862,21 +20083,21 @@ void readBootstrapInfo( } for(qint32 i = 0; i < size; i++) { BootstrapProfile elem; - readBootstrapProfile(r, elem); + readBootstrapProfile(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.profiles = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!profiles_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("BootstrapInfo.profiles has no value")); } @@ -18902,66 +20123,70 @@ EDAMUserException::EDAMUserException(const EDAMUserException& other) : EvernoteE parameter = other.parameter; } void writeEDAMUserException( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const EDAMUserException & s) { - w.writeStructBegin(QStringLiteral("EDAMUserException")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("EDAMUserException")); + writer.writeFieldBegin( QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); - w.writeI32(static_cast(s.errorCode)); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.errorCode)); + writer.writeFieldEnd(); + if (s.parameter.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); - w.writeString(s.parameter.ref()); - w.writeFieldEnd(); + + writer.writeString(s.parameter.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readEDAMUserException( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMUserException & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool errorCode_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { errorCode_isset = true; EDAMErrorCode v; - readEnumEDAMErrorCode(r, v); + readEnumEDAMErrorCode(reader, v); s.errorCode = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.parameter = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMUserException.errorCode has no value")); } @@ -18993,83 +20218,89 @@ EDAMSystemException::EDAMSystemException(const EDAMSystemException& other) : Eve rateLimitDuration = other.rateLimitDuration; } void writeEDAMSystemException( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const EDAMSystemException & s) { - w.writeStructBegin(QStringLiteral("EDAMSystemException")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("EDAMSystemException")); + writer.writeFieldBegin( QStringLiteral("errorCode"), ThriftFieldType::T_I32, 1); - w.writeI32(static_cast(s.errorCode)); - w.writeFieldEnd(); + + writer.writeI32(static_cast(s.errorCode)); + writer.writeFieldEnd(); + if (s.message.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("message"), ThriftFieldType::T_STRING, 2); - w.writeString(s.message.ref()); - w.writeFieldEnd(); + + writer.writeString(s.message.ref()); + writer.writeFieldEnd(); } + if (s.rateLimitDuration.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("rateLimitDuration"), ThriftFieldType::T_I32, 3); - w.writeI32(s.rateLimitDuration.ref()); - w.writeFieldEnd(); + + writer.writeI32(s.rateLimitDuration.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readEDAMSystemException( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMSystemException & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool errorCode_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_I32) { errorCode_isset = true; EDAMErrorCode v; - readEnumEDAMErrorCode(r, v); + readEnumEDAMErrorCode(reader, v); s.errorCode = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.message = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; - r.readI32(v); + reader.readI32(v); s.rateLimitDuration = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!errorCode_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMSystemException.errorCode has no value")); } @@ -19108,66 +20339,70 @@ EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) key = other.key; } void writeEDAMNotFoundException( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const EDAMNotFoundException & s) { - w.writeStructBegin(QStringLiteral("EDAMNotFoundException")); + writer.writeStructBegin(QStringLiteral("EDAMNotFoundException")); if (s.identifier.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("identifier"), ThriftFieldType::T_STRING, 1); - w.writeString(s.identifier.ref()); - w.writeFieldEnd(); + + writer.writeString(s.identifier.ref()); + writer.writeFieldEnd(); } + if (s.key.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("key"), ThriftFieldType::T_STRING, 2); - w.writeString(s.key.ref()); - w.writeFieldEnd(); + + writer.writeString(s.key.ref()); + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readEDAMNotFoundException( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMNotFoundException & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.identifier = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.key = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); } void EDAMNotFoundException::print(QTextStream & strm) const @@ -19204,56 +20439,64 @@ EDAMInvalidContactsException::EDAMInvalidContactsException(const EDAMInvalidCont reasons = other.reasons; } void writeEDAMInvalidContactsException( - ThriftBinaryBufferWriter & w, + ThriftBinaryBufferWriter & writer, const EDAMInvalidContactsException & s) { - w.writeStructBegin(QStringLiteral("EDAMInvalidContactsException")); - w.writeFieldBegin( + writer.writeStructBegin(QStringLiteral("EDAMInvalidContactsException")); + writer.writeFieldBegin( QStringLiteral("contacts"), ThriftFieldType::T_LIST, 1); - w.writeListBegin(ThriftFieldType::T_STRUCT, s.contacts.length()); + + writer.writeListBegin(ThriftFieldType::T_STRUCT, s.contacts.length()); for(const auto & value: qAsConst(s.contacts)) { - writeContact(w, value); + writeContact(writer, value); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); + if (s.parameter.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("parameter"), ThriftFieldType::T_STRING, 2); - w.writeString(s.parameter.ref()); - w.writeFieldEnd(); + + writer.writeString(s.parameter.ref()); + writer.writeFieldEnd(); } + if (s.reasons.isSet()) { - w.writeFieldBegin( + writer.writeFieldBegin( QStringLiteral("reasons"), ThriftFieldType::T_LIST, 3); - w.writeListBegin(ThriftFieldType::T_I32, s.reasons.ref().length()); + + writer.writeListBegin(ThriftFieldType::T_I32, s.reasons.ref().length()); for(const auto & value: qAsConst(s.reasons.ref())) { - w.writeI32(static_cast(value)); + writer.writeI32(static_cast(value)); } - w.writeListEnd(); - w.writeFieldEnd(); + writer.writeListEnd(); + + writer.writeFieldEnd(); } - w.writeFieldStop(); - w.writeStructEnd(); + + writer.writeFieldStop(); + writer.writeStructEnd(); } void readEDAMInvalidContactsException( - ThriftBinaryBufferReader & r, + ThriftBinaryBufferReader & reader, EDAMInvalidContactsException & s) { QString fname; ThriftFieldType fieldType; qint16 fieldId; bool contacts_isset = false; - r.readStructBegin(fname); + reader.readStructBegin(fname); while(true) { - r.readFieldBegin(fname, fieldType, fieldId); + reader.readFieldBegin(fname, fieldType, fieldId); if (fieldType == ThriftFieldType::T_STOP) break; if (fieldId == 1) { if (fieldType == ThriftFieldType::T_LIST) { @@ -19261,7 +20504,7 @@ void readEDAMInvalidContactsException( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_STRUCT) { throw ThriftException( @@ -19270,22 +20513,22 @@ void readEDAMInvalidContactsException( } for(qint32 i = 0; i < size; i++) { Contact elem; - readContact(r, elem); + readContact(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.contacts = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; - r.readString(v); + reader.readString(v); s.parameter = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else if (fieldId == 3) { @@ -19293,7 +20536,7 @@ void readEDAMInvalidContactsException( QList v; qint32 size; ThriftFieldType elemType; - r.readListBegin(elemType, size); + reader.readListBegin(elemType, size); v.reserve(size); if (elemType != ThriftFieldType::T_I32) { throw ThriftException( @@ -19302,21 +20545,21 @@ void readEDAMInvalidContactsException( } for(qint32 i = 0; i < size; i++) { EDAMInvalidContactReason elem; - readEnumEDAMInvalidContactReason(r, elem); + readEnumEDAMInvalidContactReason(reader, elem); v.append(elem); } - r.readListEnd(); + reader.readListEnd(); s.reasons = v; } else { - r.skip(fieldType); + reader.skip(fieldType); } } else { - r.skip(fieldType); + reader.skip(fieldType); } - r.readFieldEnd(); + reader.readFieldEnd(); } - r.readStructEnd(); + reader.readStructEnd(); if (!contacts_isset) throw ThriftException(ThriftException::Type::INVALID_DATA, QStringLiteral("EDAMInvalidContactsException.contacts has no value")); } diff --git a/QEverCloud/src/generated/Types_io.h b/QEverCloud/src/generated/Types_io.h index 7e5187e8..66e37d2c 100644 --- a/QEverCloud/src/generated/Types_io.h +++ b/QEverCloud/src/generated/Types_io.h @@ -20,186 +20,186 @@ namespace qevercloud { /** @cond HIDDEN_SYMBOLS */ -void writeSyncState(ThriftBinaryBufferWriter & w, const SyncState & s); -void readSyncState(ThriftBinaryBufferReader & r, SyncState & s); -void writeSyncChunk(ThriftBinaryBufferWriter & w, const SyncChunk & s); -void readSyncChunk(ThriftBinaryBufferReader & r, SyncChunk & s); -void writeSyncChunkFilter(ThriftBinaryBufferWriter & w, const SyncChunkFilter & s); -void readSyncChunkFilter(ThriftBinaryBufferReader & r, SyncChunkFilter & s); -void writeNoteFilter(ThriftBinaryBufferWriter & w, const NoteFilter & s); -void readNoteFilter(ThriftBinaryBufferReader & r, NoteFilter & s); -void writeNoteList(ThriftBinaryBufferWriter & w, const NoteList & s); -void readNoteList(ThriftBinaryBufferReader & r, NoteList & s); -void writeNoteMetadata(ThriftBinaryBufferWriter & w, const NoteMetadata & s); -void readNoteMetadata(ThriftBinaryBufferReader & r, NoteMetadata & s); -void writeNotesMetadataList(ThriftBinaryBufferWriter & w, const NotesMetadataList & s); -void readNotesMetadataList(ThriftBinaryBufferReader & r, NotesMetadataList & s); -void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & w, const NotesMetadataResultSpec & s); -void readNotesMetadataResultSpec(ThriftBinaryBufferReader & r, NotesMetadataResultSpec & s); -void writeNoteCollectionCounts(ThriftBinaryBufferWriter & w, const NoteCollectionCounts & s); -void readNoteCollectionCounts(ThriftBinaryBufferReader & r, NoteCollectionCounts & s); -void writeNoteResultSpec(ThriftBinaryBufferWriter & w, const NoteResultSpec & s); -void readNoteResultSpec(ThriftBinaryBufferReader & r, NoteResultSpec & s); -void writeNoteEmailParameters(ThriftBinaryBufferWriter & w, const NoteEmailParameters & s); -void readNoteEmailParameters(ThriftBinaryBufferReader & r, NoteEmailParameters & s); -void writeNoteVersionId(ThriftBinaryBufferWriter & w, const NoteVersionId & s); -void readNoteVersionId(ThriftBinaryBufferReader & r, NoteVersionId & s); -void writeRelatedQuery(ThriftBinaryBufferWriter & w, const RelatedQuery & s); -void readRelatedQuery(ThriftBinaryBufferReader & r, RelatedQuery & s); -void writeRelatedResult(ThriftBinaryBufferWriter & w, const RelatedResult & s); -void readRelatedResult(ThriftBinaryBufferReader & r, RelatedResult & s); -void writeRelatedResultSpec(ThriftBinaryBufferWriter & w, const RelatedResultSpec & s); -void readRelatedResultSpec(ThriftBinaryBufferReader & r, RelatedResultSpec & s); -void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & w, const UpdateNoteIfUsnMatchesResult & s); -void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & r, UpdateNoteIfUsnMatchesResult & s); -void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const ShareRelationshipRestrictions & s); -void readShareRelationshipRestrictions(ThriftBinaryBufferReader & r, ShareRelationshipRestrictions & s); -void writeInvitationShareRelationship(ThriftBinaryBufferWriter & w, const InvitationShareRelationship & s); -void readInvitationShareRelationship(ThriftBinaryBufferReader & r, InvitationShareRelationship & s); -void writeMemberShareRelationship(ThriftBinaryBufferWriter & w, const MemberShareRelationship & s); -void readMemberShareRelationship(ThriftBinaryBufferReader & r, MemberShareRelationship & s); -void writeShareRelationships(ThriftBinaryBufferWriter & w, const ShareRelationships & s); -void readShareRelationships(ThriftBinaryBufferReader & r, ShareRelationships & s); -void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & w, const ManageNotebookSharesParameters & s); -void readManageNotebookSharesParameters(ThriftBinaryBufferReader & r, ManageNotebookSharesParameters & s); -void writeManageNotebookSharesError(ThriftBinaryBufferWriter & w, const ManageNotebookSharesError & s); -void readManageNotebookSharesError(ThriftBinaryBufferReader & r, ManageNotebookSharesError & s); -void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & w, const ManageNotebookSharesResult & s); -void readManageNotebookSharesResult(ThriftBinaryBufferReader & r, ManageNotebookSharesResult & s); -void writeSharedNoteTemplate(ThriftBinaryBufferWriter & w, const SharedNoteTemplate & s); -void readSharedNoteTemplate(ThriftBinaryBufferReader & r, SharedNoteTemplate & s); -void writeNotebookShareTemplate(ThriftBinaryBufferWriter & w, const NotebookShareTemplate & s); -void readNotebookShareTemplate(ThriftBinaryBufferReader & r, NotebookShareTemplate & s); -void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & w, const CreateOrUpdateNotebookSharesResult & s); -void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & r, CreateOrUpdateNotebookSharesResult & s); -void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & w, const NoteShareRelationshipRestrictions & s); -void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & r, NoteShareRelationshipRestrictions & s); -void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & w, const NoteMemberShareRelationship & s); -void readNoteMemberShareRelationship(ThriftBinaryBufferReader & r, NoteMemberShareRelationship & s); -void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & w, const NoteInvitationShareRelationship & s); -void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & r, NoteInvitationShareRelationship & s); -void writeNoteShareRelationships(ThriftBinaryBufferWriter & w, const NoteShareRelationships & s); -void readNoteShareRelationships(ThriftBinaryBufferReader & r, NoteShareRelationships & s); -void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & w, const ManageNoteSharesParameters & s); -void readManageNoteSharesParameters(ThriftBinaryBufferReader & r, ManageNoteSharesParameters & s); -void writeManageNoteSharesError(ThriftBinaryBufferWriter & w, const ManageNoteSharesError & s); -void readManageNoteSharesError(ThriftBinaryBufferReader & r, ManageNoteSharesError & s); -void writeManageNoteSharesResult(ThriftBinaryBufferWriter & w, const ManageNoteSharesResult & s); -void readManageNoteSharesResult(ThriftBinaryBufferReader & r, ManageNoteSharesResult & s); -void writeData(ThriftBinaryBufferWriter & w, const Data & s); -void readData(ThriftBinaryBufferReader & r, Data & s); -void writeUserAttributes(ThriftBinaryBufferWriter & w, const UserAttributes & s); -void readUserAttributes(ThriftBinaryBufferReader & r, UserAttributes & s); -void writeBusinessUserAttributes(ThriftBinaryBufferWriter & w, const BusinessUserAttributes & s); -void readBusinessUserAttributes(ThriftBinaryBufferReader & r, BusinessUserAttributes & s); -void writeAccounting(ThriftBinaryBufferWriter & w, const Accounting & s); -void readAccounting(ThriftBinaryBufferReader & r, Accounting & s); -void writeBusinessUserInfo(ThriftBinaryBufferWriter & w, const BusinessUserInfo & s); -void readBusinessUserInfo(ThriftBinaryBufferReader & r, BusinessUserInfo & s); -void writeAccountLimits(ThriftBinaryBufferWriter & w, const AccountLimits & s); -void readAccountLimits(ThriftBinaryBufferReader & r, AccountLimits & s); -void writeUser(ThriftBinaryBufferWriter & w, const User & s); -void readUser(ThriftBinaryBufferReader & r, User & s); -void writeContact(ThriftBinaryBufferWriter & w, const Contact & s); -void readContact(ThriftBinaryBufferReader & r, Contact & s); -void writeIdentity(ThriftBinaryBufferWriter & w, const Identity & s); -void readIdentity(ThriftBinaryBufferReader & r, Identity & s); -void writeTag(ThriftBinaryBufferWriter & w, const Tag & s); -void readTag(ThriftBinaryBufferReader & r, Tag & s); -void writeLazyMap(ThriftBinaryBufferWriter & w, const LazyMap & s); -void readLazyMap(ThriftBinaryBufferReader & r, LazyMap & s); -void writeResourceAttributes(ThriftBinaryBufferWriter & w, const ResourceAttributes & s); -void readResourceAttributes(ThriftBinaryBufferReader & r, ResourceAttributes & s); -void writeResource(ThriftBinaryBufferWriter & w, const Resource & s); -void readResource(ThriftBinaryBufferReader & r, Resource & s); -void writeNoteAttributes(ThriftBinaryBufferWriter & w, const NoteAttributes & s); -void readNoteAttributes(ThriftBinaryBufferReader & r, NoteAttributes & s); -void writeSharedNote(ThriftBinaryBufferWriter & w, const SharedNote & s); -void readSharedNote(ThriftBinaryBufferReader & r, SharedNote & s); -void writeNoteRestrictions(ThriftBinaryBufferWriter & w, const NoteRestrictions & s); -void readNoteRestrictions(ThriftBinaryBufferReader & r, NoteRestrictions & s); -void writeNoteLimits(ThriftBinaryBufferWriter & w, const NoteLimits & s); -void readNoteLimits(ThriftBinaryBufferReader & r, NoteLimits & s); -void writeNote(ThriftBinaryBufferWriter & w, const Note & s); -void readNote(ThriftBinaryBufferReader & r, Note & s); -void writePublishing(ThriftBinaryBufferWriter & w, const Publishing & s); -void readPublishing(ThriftBinaryBufferReader & r, Publishing & s); -void writeBusinessNotebook(ThriftBinaryBufferWriter & w, const BusinessNotebook & s); -void readBusinessNotebook(ThriftBinaryBufferReader & r, BusinessNotebook & s); -void writeSavedSearchScope(ThriftBinaryBufferWriter & w, const SavedSearchScope & s); -void readSavedSearchScope(ThriftBinaryBufferReader & r, SavedSearchScope & s); -void writeSavedSearch(ThriftBinaryBufferWriter & w, const SavedSearch & s); -void readSavedSearch(ThriftBinaryBufferReader & r, SavedSearch & s); -void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const SharedNotebookRecipientSettings & s); -void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & r, SharedNotebookRecipientSettings & s); -void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & w, const NotebookRecipientSettings & s); -void readNotebookRecipientSettings(ThriftBinaryBufferReader & r, NotebookRecipientSettings & s); -void writeSharedNotebook(ThriftBinaryBufferWriter & w, const SharedNotebook & s); -void readSharedNotebook(ThriftBinaryBufferReader & r, SharedNotebook & s); -void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & w, const CanMoveToContainerRestrictions & s); -void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & r, CanMoveToContainerRestrictions & s); -void writeNotebookRestrictions(ThriftBinaryBufferWriter & w, const NotebookRestrictions & s); -void readNotebookRestrictions(ThriftBinaryBufferReader & r, NotebookRestrictions & s); -void writeNotebook(ThriftBinaryBufferWriter & w, const Notebook & s); -void readNotebook(ThriftBinaryBufferReader & r, Notebook & s); -void writeLinkedNotebook(ThriftBinaryBufferWriter & w, const LinkedNotebook & s); -void readLinkedNotebook(ThriftBinaryBufferReader & r, LinkedNotebook & s); -void writeNotebookDescriptor(ThriftBinaryBufferWriter & w, const NotebookDescriptor & s); -void readNotebookDescriptor(ThriftBinaryBufferReader & r, NotebookDescriptor & s); -void writeUserProfile(ThriftBinaryBufferWriter & w, const UserProfile & s); -void readUserProfile(ThriftBinaryBufferReader & r, UserProfile & s); -void writeRelatedContentImage(ThriftBinaryBufferWriter & w, const RelatedContentImage & s); -void readRelatedContentImage(ThriftBinaryBufferReader & r, RelatedContentImage & s); -void writeRelatedContent(ThriftBinaryBufferWriter & w, const RelatedContent & s); -void readRelatedContent(ThriftBinaryBufferReader & r, RelatedContent & s); -void writeBusinessInvitation(ThriftBinaryBufferWriter & w, const BusinessInvitation & s); -void readBusinessInvitation(ThriftBinaryBufferReader & r, BusinessInvitation & s); -void writeUserIdentity(ThriftBinaryBufferWriter & w, const UserIdentity & s); -void readUserIdentity(ThriftBinaryBufferReader & r, UserIdentity & s); -void writePublicUserInfo(ThriftBinaryBufferWriter & w, const PublicUserInfo & s); -void readPublicUserInfo(ThriftBinaryBufferReader & r, PublicUserInfo & s); -void writeUserUrls(ThriftBinaryBufferWriter & w, const UserUrls & s); -void readUserUrls(ThriftBinaryBufferReader & r, UserUrls & s); -void writeAuthenticationResult(ThriftBinaryBufferWriter & w, const AuthenticationResult & s); -void readAuthenticationResult(ThriftBinaryBufferReader & r, AuthenticationResult & s); -void writeBootstrapSettings(ThriftBinaryBufferWriter & w, const BootstrapSettings & s); -void readBootstrapSettings(ThriftBinaryBufferReader & r, BootstrapSettings & s); -void writeBootstrapProfile(ThriftBinaryBufferWriter & w, const BootstrapProfile & s); -void readBootstrapProfile(ThriftBinaryBufferReader & r, BootstrapProfile & s); -void writeBootstrapInfo(ThriftBinaryBufferWriter & w, const BootstrapInfo & s); -void readBootstrapInfo(ThriftBinaryBufferReader & r, BootstrapInfo & s); -void writeEDAMUserException(ThriftBinaryBufferWriter & w, const EDAMUserException & s); -void readEDAMUserException(ThriftBinaryBufferReader & r, EDAMUserException & s); -void writeEDAMSystemException(ThriftBinaryBufferWriter & w, const EDAMSystemException & s); -void readEDAMSystemException(ThriftBinaryBufferReader & r, EDAMSystemException & s); -void writeEDAMNotFoundException(ThriftBinaryBufferWriter & w, const EDAMNotFoundException & s); -void readEDAMNotFoundException(ThriftBinaryBufferReader & r, EDAMNotFoundException & s); -void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & w, const EDAMInvalidContactsException & s); -void readEDAMInvalidContactsException(ThriftBinaryBufferReader & r, EDAMInvalidContactsException & s); +void writeSyncState(ThriftBinaryBufferWriter & writer, const SyncState & s); +void readSyncState(ThriftBinaryBufferReader & reader, SyncState & s); +void writeSyncChunk(ThriftBinaryBufferWriter & writer, const SyncChunk & s); +void readSyncChunk(ThriftBinaryBufferReader & reader, SyncChunk & s); +void writeSyncChunkFilter(ThriftBinaryBufferWriter & writer, const SyncChunkFilter & s); +void readSyncChunkFilter(ThriftBinaryBufferReader & reader, SyncChunkFilter & s); +void writeNoteFilter(ThriftBinaryBufferWriter & writer, const NoteFilter & s); +void readNoteFilter(ThriftBinaryBufferReader & reader, NoteFilter & s); +void writeNoteList(ThriftBinaryBufferWriter & writer, const NoteList & s); +void readNoteList(ThriftBinaryBufferReader & reader, NoteList & s); +void writeNoteMetadata(ThriftBinaryBufferWriter & writer, const NoteMetadata & s); +void readNoteMetadata(ThriftBinaryBufferReader & reader, NoteMetadata & s); +void writeNotesMetadataList(ThriftBinaryBufferWriter & writer, const NotesMetadataList & s); +void readNotesMetadataList(ThriftBinaryBufferReader & reader, NotesMetadataList & s); +void writeNotesMetadataResultSpec(ThriftBinaryBufferWriter & writer, const NotesMetadataResultSpec & s); +void readNotesMetadataResultSpec(ThriftBinaryBufferReader & reader, NotesMetadataResultSpec & s); +void writeNoteCollectionCounts(ThriftBinaryBufferWriter & writer, const NoteCollectionCounts & s); +void readNoteCollectionCounts(ThriftBinaryBufferReader & reader, NoteCollectionCounts & s); +void writeNoteResultSpec(ThriftBinaryBufferWriter & writer, const NoteResultSpec & s); +void readNoteResultSpec(ThriftBinaryBufferReader & reader, NoteResultSpec & s); +void writeNoteEmailParameters(ThriftBinaryBufferWriter & writer, const NoteEmailParameters & s); +void readNoteEmailParameters(ThriftBinaryBufferReader & reader, NoteEmailParameters & s); +void writeNoteVersionId(ThriftBinaryBufferWriter & writer, const NoteVersionId & s); +void readNoteVersionId(ThriftBinaryBufferReader & reader, NoteVersionId & s); +void writeRelatedQuery(ThriftBinaryBufferWriter & writer, const RelatedQuery & s); +void readRelatedQuery(ThriftBinaryBufferReader & reader, RelatedQuery & s); +void writeRelatedResult(ThriftBinaryBufferWriter & writer, const RelatedResult & s); +void readRelatedResult(ThriftBinaryBufferReader & reader, RelatedResult & s); +void writeRelatedResultSpec(ThriftBinaryBufferWriter & writer, const RelatedResultSpec & s); +void readRelatedResultSpec(ThriftBinaryBufferReader & reader, RelatedResultSpec & s); +void writeUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferWriter & writer, const UpdateNoteIfUsnMatchesResult & s); +void readUpdateNoteIfUsnMatchesResult(ThriftBinaryBufferReader & reader, UpdateNoteIfUsnMatchesResult & s); +void writeShareRelationshipRestrictions(ThriftBinaryBufferWriter & writer, const ShareRelationshipRestrictions & s); +void readShareRelationshipRestrictions(ThriftBinaryBufferReader & reader, ShareRelationshipRestrictions & s); +void writeInvitationShareRelationship(ThriftBinaryBufferWriter & writer, const InvitationShareRelationship & s); +void readInvitationShareRelationship(ThriftBinaryBufferReader & reader, InvitationShareRelationship & s); +void writeMemberShareRelationship(ThriftBinaryBufferWriter & writer, const MemberShareRelationship & s); +void readMemberShareRelationship(ThriftBinaryBufferReader & reader, MemberShareRelationship & s); +void writeShareRelationships(ThriftBinaryBufferWriter & writer, const ShareRelationships & s); +void readShareRelationships(ThriftBinaryBufferReader & reader, ShareRelationships & s); +void writeManageNotebookSharesParameters(ThriftBinaryBufferWriter & writer, const ManageNotebookSharesParameters & s); +void readManageNotebookSharesParameters(ThriftBinaryBufferReader & reader, ManageNotebookSharesParameters & s); +void writeManageNotebookSharesError(ThriftBinaryBufferWriter & writer, const ManageNotebookSharesError & s); +void readManageNotebookSharesError(ThriftBinaryBufferReader & reader, ManageNotebookSharesError & s); +void writeManageNotebookSharesResult(ThriftBinaryBufferWriter & writer, const ManageNotebookSharesResult & s); +void readManageNotebookSharesResult(ThriftBinaryBufferReader & reader, ManageNotebookSharesResult & s); +void writeSharedNoteTemplate(ThriftBinaryBufferWriter & writer, const SharedNoteTemplate & s); +void readSharedNoteTemplate(ThriftBinaryBufferReader & reader, SharedNoteTemplate & s); +void writeNotebookShareTemplate(ThriftBinaryBufferWriter & writer, const NotebookShareTemplate & s); +void readNotebookShareTemplate(ThriftBinaryBufferReader & reader, NotebookShareTemplate & s); +void writeCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferWriter & writer, const CreateOrUpdateNotebookSharesResult & s); +void readCreateOrUpdateNotebookSharesResult(ThriftBinaryBufferReader & reader, CreateOrUpdateNotebookSharesResult & s); +void writeNoteShareRelationshipRestrictions(ThriftBinaryBufferWriter & writer, const NoteShareRelationshipRestrictions & s); +void readNoteShareRelationshipRestrictions(ThriftBinaryBufferReader & reader, NoteShareRelationshipRestrictions & s); +void writeNoteMemberShareRelationship(ThriftBinaryBufferWriter & writer, const NoteMemberShareRelationship & s); +void readNoteMemberShareRelationship(ThriftBinaryBufferReader & reader, NoteMemberShareRelationship & s); +void writeNoteInvitationShareRelationship(ThriftBinaryBufferWriter & writer, const NoteInvitationShareRelationship & s); +void readNoteInvitationShareRelationship(ThriftBinaryBufferReader & reader, NoteInvitationShareRelationship & s); +void writeNoteShareRelationships(ThriftBinaryBufferWriter & writer, const NoteShareRelationships & s); +void readNoteShareRelationships(ThriftBinaryBufferReader & reader, NoteShareRelationships & s); +void writeManageNoteSharesParameters(ThriftBinaryBufferWriter & writer, const ManageNoteSharesParameters & s); +void readManageNoteSharesParameters(ThriftBinaryBufferReader & reader, ManageNoteSharesParameters & s); +void writeManageNoteSharesError(ThriftBinaryBufferWriter & writer, const ManageNoteSharesError & s); +void readManageNoteSharesError(ThriftBinaryBufferReader & reader, ManageNoteSharesError & s); +void writeManageNoteSharesResult(ThriftBinaryBufferWriter & writer, const ManageNoteSharesResult & s); +void readManageNoteSharesResult(ThriftBinaryBufferReader & reader, ManageNoteSharesResult & s); +void writeData(ThriftBinaryBufferWriter & writer, const Data & s); +void readData(ThriftBinaryBufferReader & reader, Data & s); +void writeUserAttributes(ThriftBinaryBufferWriter & writer, const UserAttributes & s); +void readUserAttributes(ThriftBinaryBufferReader & reader, UserAttributes & s); +void writeBusinessUserAttributes(ThriftBinaryBufferWriter & writer, const BusinessUserAttributes & s); +void readBusinessUserAttributes(ThriftBinaryBufferReader & reader, BusinessUserAttributes & s); +void writeAccounting(ThriftBinaryBufferWriter & writer, const Accounting & s); +void readAccounting(ThriftBinaryBufferReader & reader, Accounting & s); +void writeBusinessUserInfo(ThriftBinaryBufferWriter & writer, const BusinessUserInfo & s); +void readBusinessUserInfo(ThriftBinaryBufferReader & reader, BusinessUserInfo & s); +void writeAccountLimits(ThriftBinaryBufferWriter & writer, const AccountLimits & s); +void readAccountLimits(ThriftBinaryBufferReader & reader, AccountLimits & s); +void writeUser(ThriftBinaryBufferWriter & writer, const User & s); +void readUser(ThriftBinaryBufferReader & reader, User & s); +void writeContact(ThriftBinaryBufferWriter & writer, const Contact & s); +void readContact(ThriftBinaryBufferReader & reader, Contact & s); +void writeIdentity(ThriftBinaryBufferWriter & writer, const Identity & s); +void readIdentity(ThriftBinaryBufferReader & reader, Identity & s); +void writeTag(ThriftBinaryBufferWriter & writer, const Tag & s); +void readTag(ThriftBinaryBufferReader & reader, Tag & s); +void writeLazyMap(ThriftBinaryBufferWriter & writer, const LazyMap & s); +void readLazyMap(ThriftBinaryBufferReader & reader, LazyMap & s); +void writeResourceAttributes(ThriftBinaryBufferWriter & writer, const ResourceAttributes & s); +void readResourceAttributes(ThriftBinaryBufferReader & reader, ResourceAttributes & s); +void writeResource(ThriftBinaryBufferWriter & writer, const Resource & s); +void readResource(ThriftBinaryBufferReader & reader, Resource & s); +void writeNoteAttributes(ThriftBinaryBufferWriter & writer, const NoteAttributes & s); +void readNoteAttributes(ThriftBinaryBufferReader & reader, NoteAttributes & s); +void writeSharedNote(ThriftBinaryBufferWriter & writer, const SharedNote & s); +void readSharedNote(ThriftBinaryBufferReader & reader, SharedNote & s); +void writeNoteRestrictions(ThriftBinaryBufferWriter & writer, const NoteRestrictions & s); +void readNoteRestrictions(ThriftBinaryBufferReader & reader, NoteRestrictions & s); +void writeNoteLimits(ThriftBinaryBufferWriter & writer, const NoteLimits & s); +void readNoteLimits(ThriftBinaryBufferReader & reader, NoteLimits & s); +void writeNote(ThriftBinaryBufferWriter & writer, const Note & s); +void readNote(ThriftBinaryBufferReader & reader, Note & s); +void writePublishing(ThriftBinaryBufferWriter & writer, const Publishing & s); +void readPublishing(ThriftBinaryBufferReader & reader, Publishing & s); +void writeBusinessNotebook(ThriftBinaryBufferWriter & writer, const BusinessNotebook & s); +void readBusinessNotebook(ThriftBinaryBufferReader & reader, BusinessNotebook & s); +void writeSavedSearchScope(ThriftBinaryBufferWriter & writer, const SavedSearchScope & s); +void readSavedSearchScope(ThriftBinaryBufferReader & reader, SavedSearchScope & s); +void writeSavedSearch(ThriftBinaryBufferWriter & writer, const SavedSearch & s); +void readSavedSearch(ThriftBinaryBufferReader & reader, SavedSearch & s); +void writeSharedNotebookRecipientSettings(ThriftBinaryBufferWriter & writer, const SharedNotebookRecipientSettings & s); +void readSharedNotebookRecipientSettings(ThriftBinaryBufferReader & reader, SharedNotebookRecipientSettings & s); +void writeNotebookRecipientSettings(ThriftBinaryBufferWriter & writer, const NotebookRecipientSettings & s); +void readNotebookRecipientSettings(ThriftBinaryBufferReader & reader, NotebookRecipientSettings & s); +void writeSharedNotebook(ThriftBinaryBufferWriter & writer, const SharedNotebook & s); +void readSharedNotebook(ThriftBinaryBufferReader & reader, SharedNotebook & s); +void writeCanMoveToContainerRestrictions(ThriftBinaryBufferWriter & writer, const CanMoveToContainerRestrictions & s); +void readCanMoveToContainerRestrictions(ThriftBinaryBufferReader & reader, CanMoveToContainerRestrictions & s); +void writeNotebookRestrictions(ThriftBinaryBufferWriter & writer, const NotebookRestrictions & s); +void readNotebookRestrictions(ThriftBinaryBufferReader & reader, NotebookRestrictions & s); +void writeNotebook(ThriftBinaryBufferWriter & writer, const Notebook & s); +void readNotebook(ThriftBinaryBufferReader & reader, Notebook & s); +void writeLinkedNotebook(ThriftBinaryBufferWriter & writer, const LinkedNotebook & s); +void readLinkedNotebook(ThriftBinaryBufferReader & reader, LinkedNotebook & s); +void writeNotebookDescriptor(ThriftBinaryBufferWriter & writer, const NotebookDescriptor & s); +void readNotebookDescriptor(ThriftBinaryBufferReader & reader, NotebookDescriptor & s); +void writeUserProfile(ThriftBinaryBufferWriter & writer, const UserProfile & s); +void readUserProfile(ThriftBinaryBufferReader & reader, UserProfile & s); +void writeRelatedContentImage(ThriftBinaryBufferWriter & writer, const RelatedContentImage & s); +void readRelatedContentImage(ThriftBinaryBufferReader & reader, RelatedContentImage & s); +void writeRelatedContent(ThriftBinaryBufferWriter & writer, const RelatedContent & s); +void readRelatedContent(ThriftBinaryBufferReader & reader, RelatedContent & s); +void writeBusinessInvitation(ThriftBinaryBufferWriter & writer, const BusinessInvitation & s); +void readBusinessInvitation(ThriftBinaryBufferReader & reader, BusinessInvitation & s); +void writeUserIdentity(ThriftBinaryBufferWriter & writer, const UserIdentity & s); +void readUserIdentity(ThriftBinaryBufferReader & reader, UserIdentity & s); +void writePublicUserInfo(ThriftBinaryBufferWriter & writer, const PublicUserInfo & s); +void readPublicUserInfo(ThriftBinaryBufferReader & reader, PublicUserInfo & s); +void writeUserUrls(ThriftBinaryBufferWriter & writer, const UserUrls & s); +void readUserUrls(ThriftBinaryBufferReader & reader, UserUrls & s); +void writeAuthenticationResult(ThriftBinaryBufferWriter & writer, const AuthenticationResult & s); +void readAuthenticationResult(ThriftBinaryBufferReader & reader, AuthenticationResult & s); +void writeBootstrapSettings(ThriftBinaryBufferWriter & writer, const BootstrapSettings & s); +void readBootstrapSettings(ThriftBinaryBufferReader & reader, BootstrapSettings & s); +void writeBootstrapProfile(ThriftBinaryBufferWriter & writer, const BootstrapProfile & s); +void readBootstrapProfile(ThriftBinaryBufferReader & reader, BootstrapProfile & s); +void writeBootstrapInfo(ThriftBinaryBufferWriter & writer, const BootstrapInfo & s); +void readBootstrapInfo(ThriftBinaryBufferReader & reader, BootstrapInfo & s); +void writeEDAMUserException(ThriftBinaryBufferWriter & writer, const EDAMUserException & s); +void readEDAMUserException(ThriftBinaryBufferReader & reader, EDAMUserException & s); +void writeEDAMSystemException(ThriftBinaryBufferWriter & writer, const EDAMSystemException & s); +void readEDAMSystemException(ThriftBinaryBufferReader & reader, EDAMSystemException & s); +void writeEDAMNotFoundException(ThriftBinaryBufferWriter & writer, const EDAMNotFoundException & s); +void readEDAMNotFoundException(ThriftBinaryBufferReader & reader, EDAMNotFoundException & s); +void writeEDAMInvalidContactsException(ThriftBinaryBufferWriter & writer, const EDAMInvalidContactsException & s); +void readEDAMInvalidContactsException(ThriftBinaryBufferReader & reader, EDAMInvalidContactsException & s); -void readEnumEDAMErrorCode(ThriftBinaryBufferReader & r, EDAMErrorCode & e); -void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & r, EDAMInvalidContactReason & e); -void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & r, ShareRelationshipPrivilegeLevel & e); -void readEnumPrivilegeLevel(ThriftBinaryBufferReader & r, PrivilegeLevel & e); -void readEnumServiceLevel(ThriftBinaryBufferReader & r, ServiceLevel & e); -void readEnumQueryFormat(ThriftBinaryBufferReader & r, QueryFormat & e); -void readEnumNoteSortOrder(ThriftBinaryBufferReader & r, NoteSortOrder & e); -void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & r, PremiumOrderStatus & e); -void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotebookPrivilegeLevel & e); -void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & r, SharedNotePrivilegeLevel & e); -void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & r, SponsoredGroupRole & e); -void readEnumBusinessUserRole(ThriftBinaryBufferReader & r, BusinessUserRole & e); -void readEnumBusinessUserStatus(ThriftBinaryBufferReader & r, BusinessUserStatus & e); -void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & r, SharedNotebookInstanceRestrictions & e); -void readEnumReminderEmailConfig(ThriftBinaryBufferReader & r, ReminderEmailConfig & e); -void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & r, BusinessInvitationStatus & e); -void readEnumContactType(ThriftBinaryBufferReader & r, ContactType & e); -void readEnumEntityType(ThriftBinaryBufferReader & r, EntityType & e); -void readEnumRecipientStatus(ThriftBinaryBufferReader & r, RecipientStatus & e); -void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & r, CanMoveToContainerStatus & e); -void readEnumRelatedContentType(ThriftBinaryBufferReader & r, RelatedContentType & e); -void readEnumRelatedContentAccess(ThriftBinaryBufferReader & r, RelatedContentAccess & e); -void readEnumUserIdentityType(ThriftBinaryBufferReader & r, UserIdentityType & e); +void readEnumEDAMErrorCode(ThriftBinaryBufferReader & reader, EDAMErrorCode & e); +void readEnumEDAMInvalidContactReason(ThriftBinaryBufferReader & reader, EDAMInvalidContactReason & e); +void readEnumShareRelationshipPrivilegeLevel(ThriftBinaryBufferReader & reader, ShareRelationshipPrivilegeLevel & e); +void readEnumPrivilegeLevel(ThriftBinaryBufferReader & reader, PrivilegeLevel & e); +void readEnumServiceLevel(ThriftBinaryBufferReader & reader, ServiceLevel & e); +void readEnumQueryFormat(ThriftBinaryBufferReader & reader, QueryFormat & e); +void readEnumNoteSortOrder(ThriftBinaryBufferReader & reader, NoteSortOrder & e); +void readEnumPremiumOrderStatus(ThriftBinaryBufferReader & reader, PremiumOrderStatus & e); +void readEnumSharedNotebookPrivilegeLevel(ThriftBinaryBufferReader & reader, SharedNotebookPrivilegeLevel & e); +void readEnumSharedNotePrivilegeLevel(ThriftBinaryBufferReader & reader, SharedNotePrivilegeLevel & e); +void readEnumSponsoredGroupRole(ThriftBinaryBufferReader & reader, SponsoredGroupRole & e); +void readEnumBusinessUserRole(ThriftBinaryBufferReader & reader, BusinessUserRole & e); +void readEnumBusinessUserStatus(ThriftBinaryBufferReader & reader, BusinessUserStatus & e); +void readEnumSharedNotebookInstanceRestrictions(ThriftBinaryBufferReader & reader, SharedNotebookInstanceRestrictions & e); +void readEnumReminderEmailConfig(ThriftBinaryBufferReader & reader, ReminderEmailConfig & e); +void readEnumBusinessInvitationStatus(ThriftBinaryBufferReader & reader, BusinessInvitationStatus & e); +void readEnumContactType(ThriftBinaryBufferReader & reader, ContactType & e); +void readEnumEntityType(ThriftBinaryBufferReader & reader, EntityType & e); +void readEnumRecipientStatus(ThriftBinaryBufferReader & reader, RecipientStatus & e); +void readEnumCanMoveToContainerStatus(ThriftBinaryBufferReader & reader, CanMoveToContainerStatus & e); +void readEnumRelatedContentType(ThriftBinaryBufferReader & reader, RelatedContentType & e); +void readEnumRelatedContentAccess(ThriftBinaryBufferReader & reader, RelatedContentAccess & e); +void readEnumUserIdentityType(ThriftBinaryBufferReader & reader, UserIdentityType & e); /** @endcond */ } // namespace qevercloud From e0ade03f161c40c6ff2cacbd00145b7d6f688186 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 7 Nov 2019 07:37:51 +0300 Subject: [PATCH 062/188] Add function to write ThriftException to thrift binary buffer --- QEverCloud/src/Exceptions.cpp | 16 ++++++++++++++++ QEverCloud/src/Impl.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index b5e6afa8..62773e90 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -320,6 +320,22 @@ ThriftException readThriftException(ThriftBinaryBufferReader & reader) return ThriftException(type, error); } +void writeThriftException( + ThriftBinaryBufferWriter & writer, const ThriftException & exception) +{ + writer.writeStructBegin(QStringLiteral("ThriftException")); + + writer.writeFieldBegin(QStringLiteral("error"), ThriftFieldType::T_STRING, 1); + writer.writeString(QString::fromUtf8(exception.what())); + writer.writeFieldEnd(); + + writer.writeFieldBegin(QStringLiteral("type"), ThriftFieldType::T_I32, 2); + writer.writeI32(static_cast(exception.type())); + writer.writeFieldEnd(); + + writer.writeStructEnd(); +} + QSharedPointer EDAMInvalidContactsException::exceptionData() const { return QSharedPointer::create( diff --git a/QEverCloud/src/Impl.h b/QEverCloud/src/Impl.h index 3a5552b9..356ec014 100644 --- a/QEverCloud/src/Impl.h +++ b/QEverCloud/src/Impl.h @@ -39,6 +39,9 @@ namespace qevercloud { ThriftException readThriftException(ThriftBinaryBufferReader & reader); +void writeThriftException( + ThriftBinaryBufferWriter & writer, const ThriftException & exception); + void throwEDAMSystemException(const EDAMSystemException & baseException); /** @endcond */ From a13ad32ea07ea32d73eb3f6d6a09f541292eae16 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 7 Nov 2019 07:38:03 +0300 Subject: [PATCH 063/188] Update generated code --- QEverCloud/headers/generated/Servers.h | 440 ++- QEverCloud/src/generated/Servers.cpp | 4209 ++++++++++++++++++++++-- 2 files changed, 4205 insertions(+), 444 deletions(-) diff --git a/QEverCloud/headers/generated/Servers.h b/QEverCloud/headers/generated/Servers.h index a44a19be..d55baa16 100644 --- a/QEverCloud/headers/generated/Servers.h +++ b/QEverCloud/headers/generated/Servers.h @@ -373,80 +373,300 @@ public Q_SLOTS: // Slot used to deliver requests to the server void onRequest(QByteArray data); - void onGetSyncStateRequestReady(SyncState value); - void onGetFilteredSyncChunkRequestReady(SyncChunk value); - void onGetLinkedNotebookSyncStateRequestReady(SyncState value); - void onGetLinkedNotebookSyncChunkRequestReady(SyncChunk value); - void onListNotebooksRequestReady(QList value); - void onListAccessibleBusinessNotebooksRequestReady(QList value); - void onGetNotebookRequestReady(Notebook value); - void onGetDefaultNotebookRequestReady(Notebook value); - void onCreateNotebookRequestReady(Notebook value); - void onUpdateNotebookRequestReady(qint32 value); - void onExpungeNotebookRequestReady(qint32 value); - void onListTagsRequestReady(QList value); - void onListTagsByNotebookRequestReady(QList value); - void onGetTagRequestReady(Tag value); - void onCreateTagRequestReady(Tag value); - void onUpdateTagRequestReady(qint32 value); - void onUntagAllRequestReady(); - void onExpungeTagRequestReady(qint32 value); - void onListSearchesRequestReady(QList value); - void onGetSearchRequestReady(SavedSearch value); - void onCreateSearchRequestReady(SavedSearch value); - void onUpdateSearchRequestReady(qint32 value); - void onExpungeSearchRequestReady(qint32 value); - void onFindNoteOffsetRequestReady(qint32 value); - void onFindNotesMetadataRequestReady(NotesMetadataList value); - void onFindNoteCountsRequestReady(NoteCollectionCounts value); - void onGetNoteWithResultSpecRequestReady(Note value); - void onGetNoteRequestReady(Note value); - void onGetNoteApplicationDataRequestReady(LazyMap value); - void onGetNoteApplicationDataEntryRequestReady(QString value); - void onSetNoteApplicationDataEntryRequestReady(qint32 value); - void onUnsetNoteApplicationDataEntryRequestReady(qint32 value); - void onGetNoteContentRequestReady(QString value); - void onGetNoteSearchTextRequestReady(QString value); - void onGetResourceSearchTextRequestReady(QString value); - void onGetNoteTagNamesRequestReady(QStringList value); - void onCreateNoteRequestReady(Note value); - void onUpdateNoteRequestReady(Note value); - void onDeleteNoteRequestReady(qint32 value); - void onExpungeNoteRequestReady(qint32 value); - void onCopyNoteRequestReady(Note value); - void onListNoteVersionsRequestReady(QList value); - void onGetNoteVersionRequestReady(Note value); - void onGetResourceRequestReady(Resource value); - void onGetResourceApplicationDataRequestReady(LazyMap value); - void onGetResourceApplicationDataEntryRequestReady(QString value); - void onSetResourceApplicationDataEntryRequestReady(qint32 value); - void onUnsetResourceApplicationDataEntryRequestReady(qint32 value); - void onUpdateResourceRequestReady(qint32 value); - void onGetResourceDataRequestReady(QByteArray value); - void onGetResourceByHashRequestReady(Resource value); - void onGetResourceRecognitionRequestReady(QByteArray value); - void onGetResourceAlternateDataRequestReady(QByteArray value); - void onGetResourceAttributesRequestReady(ResourceAttributes value); - void onGetPublicNotebookRequestReady(Notebook value); - void onShareNotebookRequestReady(SharedNotebook value); - void onCreateOrUpdateNotebookSharesRequestReady(CreateOrUpdateNotebookSharesResult value); - void onUpdateSharedNotebookRequestReady(qint32 value); - void onSetNotebookRecipientSettingsRequestReady(Notebook value); - void onListSharedNotebooksRequestReady(QList value); - void onCreateLinkedNotebookRequestReady(LinkedNotebook value); - void onUpdateLinkedNotebookRequestReady(qint32 value); - void onListLinkedNotebooksRequestReady(QList value); - void onExpungeLinkedNotebookRequestReady(qint32 value); - void onAuthenticateToSharedNotebookRequestReady(AuthenticationResult value); - void onGetSharedNotebookByAuthRequestReady(SharedNotebook value); - void onEmailNoteRequestReady(); - void onShareNoteRequestReady(QString value); - void onStopSharingNoteRequestReady(); - void onAuthenticateToSharedNoteRequestReady(AuthenticationResult value); - void onFindRelatedRequestReady(RelatedResult value); - void onUpdateNoteIfUsnMatchesRequestReady(UpdateNoteIfUsnMatchesResult value); - void onManageNotebookSharesRequestReady(ManageNotebookSharesResult value); - void onGetNotebookSharesRequestReady(ShareRelationships value); + // Slots for replies to requests + void onGetSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData); + + void onGetFilteredSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData); + + void onGetLinkedNotebookSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData); + + void onGetLinkedNotebookSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData); + + void onListNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + + void onListAccessibleBusinessNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + + void onGetNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + + void onGetDefaultNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + + void onCreateNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + + void onUpdateNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onExpungeNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onListTagsRequestReady( + QList value, + QSharedPointer exceptionData); + + void onListTagsByNotebookRequestReady( + QList value, + QSharedPointer exceptionData); + + void onGetTagRequestReady( + Tag value, + QSharedPointer exceptionData); + + void onCreateTagRequestReady( + Tag value, + QSharedPointer exceptionData); + + void onUpdateTagRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onUntagAllRequestReady( + QSharedPointer exceptionData); + + void onExpungeTagRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onListSearchesRequestReady( + QList value, + QSharedPointer exceptionData); + + void onGetSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData); + + void onCreateSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData); + + void onUpdateSearchRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onExpungeSearchRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onFindNoteOffsetRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onFindNotesMetadataRequestReady( + NotesMetadataList value, + QSharedPointer exceptionData); + + void onFindNoteCountsRequestReady( + NoteCollectionCounts value, + QSharedPointer exceptionData); + + void onGetNoteWithResultSpecRequestReady( + Note value, + QSharedPointer exceptionData); + + void onGetNoteRequestReady( + Note value, + QSharedPointer exceptionData); + + void onGetNoteApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData); + + void onGetNoteApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData); + + void onSetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onUnsetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onGetNoteContentRequestReady( + QString value, + QSharedPointer exceptionData); + + void onGetNoteSearchTextRequestReady( + QString value, + QSharedPointer exceptionData); + + void onGetResourceSearchTextRequestReady( + QString value, + QSharedPointer exceptionData); + + void onGetNoteTagNamesRequestReady( + QStringList value, + QSharedPointer exceptionData); + + void onCreateNoteRequestReady( + Note value, + QSharedPointer exceptionData); + + void onUpdateNoteRequestReady( + Note value, + QSharedPointer exceptionData); + + void onDeleteNoteRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onExpungeNoteRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onCopyNoteRequestReady( + Note value, + QSharedPointer exceptionData); + + void onListNoteVersionsRequestReady( + QList value, + QSharedPointer exceptionData); + + void onGetNoteVersionRequestReady( + Note value, + QSharedPointer exceptionData); + + void onGetResourceRequestReady( + Resource value, + QSharedPointer exceptionData); + + void onGetResourceApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData); + + void onGetResourceApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData); + + void onSetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onUnsetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onUpdateResourceRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onGetResourceDataRequestReady( + QByteArray value, + QSharedPointer exceptionData); + + void onGetResourceByHashRequestReady( + Resource value, + QSharedPointer exceptionData); + + void onGetResourceRecognitionRequestReady( + QByteArray value, + QSharedPointer exceptionData); + + void onGetResourceAlternateDataRequestReady( + QByteArray value, + QSharedPointer exceptionData); + + void onGetResourceAttributesRequestReady( + ResourceAttributes value, + QSharedPointer exceptionData); + + void onGetPublicNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + + void onShareNotebookRequestReady( + SharedNotebook value, + QSharedPointer exceptionData); + + void onCreateOrUpdateNotebookSharesRequestReady( + CreateOrUpdateNotebookSharesResult value, + QSharedPointer exceptionData); + + void onUpdateSharedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onSetNotebookRecipientSettingsRequestReady( + Notebook value, + QSharedPointer exceptionData); + + void onListSharedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + + void onCreateLinkedNotebookRequestReady( + LinkedNotebook value, + QSharedPointer exceptionData); + + void onUpdateLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onListLinkedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + + void onExpungeLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + + void onAuthenticateToSharedNotebookRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + + void onGetSharedNotebookByAuthRequestReady( + SharedNotebook value, + QSharedPointer exceptionData); + + void onEmailNoteRequestReady( + QSharedPointer exceptionData); + + void onShareNoteRequestReady( + QString value, + QSharedPointer exceptionData); + + void onStopSharingNoteRequestReady( + QSharedPointer exceptionData); + + void onAuthenticateToSharedNoteRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + + void onFindRelatedRequestReady( + RelatedResult value, + QSharedPointer exceptionData); + + void onUpdateNoteIfUsnMatchesRequestReady( + UpdateNoteIfUsnMatchesResult value, + QSharedPointer exceptionData); + + void onManageNotebookSharesRequestReady( + ManageNotebookSharesResult value, + QSharedPointer exceptionData); + + void onGetNotebookSharesRequestReady( + ShareRelationships value, + QSharedPointer exceptionData); + }; //////////////////////////////////////////////////////////////////////////////// @@ -535,21 +755,63 @@ public Q_SLOTS: // Slot used to deliver requests to the server void onRequest(QByteArray data); - void onCheckVersionRequestReady(bool value); - void onGetBootstrapInfoRequestReady(BootstrapInfo value); - void onAuthenticateLongSessionRequestReady(AuthenticationResult value); - void onCompleteTwoFactorAuthenticationRequestReady(AuthenticationResult value); - void onRevokeLongSessionRequestReady(); - void onAuthenticateToBusinessRequestReady(AuthenticationResult value); - void onGetUserRequestReady(User value); - void onGetPublicUserInfoRequestReady(PublicUserInfo value); - void onGetUserUrlsRequestReady(UserUrls value); - void onInviteToBusinessRequestReady(); - void onRemoveFromBusinessRequestReady(); - void onUpdateBusinessUserIdentifierRequestReady(); - void onListBusinessUsersRequestReady(QList value); - void onListBusinessInvitationsRequestReady(QList value); - void onGetAccountLimitsRequestReady(AccountLimits value); + // Slots for replies to requests + void onCheckVersionRequestReady( + bool value, + QSharedPointer exceptionData); + + void onGetBootstrapInfoRequestReady( + BootstrapInfo value, + QSharedPointer exceptionData); + + void onAuthenticateLongSessionRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + + void onCompleteTwoFactorAuthenticationRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + + void onRevokeLongSessionRequestReady( + QSharedPointer exceptionData); + + void onAuthenticateToBusinessRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + + void onGetUserRequestReady( + User value, + QSharedPointer exceptionData); + + void onGetPublicUserInfoRequestReady( + PublicUserInfo value, + QSharedPointer exceptionData); + + void onGetUserUrlsRequestReady( + UserUrls value, + QSharedPointer exceptionData); + + void onInviteToBusinessRequestReady( + QSharedPointer exceptionData); + + void onRemoveFromBusinessRequestReady( + QSharedPointer exceptionData); + + void onUpdateBusinessUserIdentifierRequestReady( + QSharedPointer exceptionData); + + void onListBusinessUsersRequestReady( + QList value, + QSharedPointer exceptionData); + + void onListBusinessInvitationsRequestReady( + QList value, + QSharedPointer exceptionData); + + void onGetAccountLimitsRequestReady( + AccountLimits value, + QSharedPointer exceptionData); + }; } // namespace qevercloud diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index b1220a67..e918f6bf 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -6750,444 +6750,3342 @@ void NoteStoreServer::onRequest(QByteArray data) } } -void NoteStoreServer::onGetSyncStateRequestReady(SyncState value) +void NoteStoreServer::onGetSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onGetFilteredSyncChunkRequestReady(SyncChunk value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getSyncState"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady(SyncState value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("getSyncState"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady(SyncChunk value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getSyncState")); -void NoteStoreServer::onListNotebooksRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onGetNotebookRequestReady(Notebook value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onGetDefaultNotebookRequestReady(Notebook value) +void NoteStoreServer::onGetFilteredSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onCreateNotebookRequestReady(Notebook value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getFilteredSyncChunk"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onUpdateNotebookRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("getFilteredSyncChunk"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onExpungeNotebookRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getFilteredSyncChunk")); -void NoteStoreServer::onListTagsRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onListTagsByNotebookRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onGetTagRequestReady(Tag value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onCreateTagRequestReady(Tag value) +void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onUpdateTagRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncState"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onUntagAllRequestReady() -{ - // TODO: implement -} + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncState"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onExpungeTagRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getLinkedNotebookSyncState")); -void NoteStoreServer::onListSearchesRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onGetSearchRequestReady(SavedSearch value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onCreateSearchRequestReady(SavedSearch value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onUpdateSearchRequestReady(qint32 value) +void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onExpungeSearchRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncChunk"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onFindNoteOffsetRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("getLinkedNotebookSyncChunk"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onFindNotesMetadataRequestReady(NotesMetadataList value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getLinkedNotebookSyncChunk")); -void NoteStoreServer::onFindNoteCountsRequestReady(NoteCollectionCounts value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onGetNoteWithResultSpecRequestReady(Note value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onGetNoteRequestReady(Note value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onGetNoteApplicationDataRequestReady(LazyMap value) +void NoteStoreServer::onListNotebooksRequestReady( + QList value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady(QString value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listNotebooks"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("listNotebooks"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("listNotebooks")); -void NoteStoreServer::onGetNoteContentRequestReady(QString value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onGetNoteSearchTextRequestReady(QString value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onGetResourceSearchTextRequestReady(QString value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onGetNoteTagNamesRequestReady(QStringList value) +void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( + QList value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onCreateNoteRequestReady(Note value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listAccessibleBusinessNotebooks"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onUpdateNoteRequestReady(Note value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("listAccessibleBusinessNotebooks"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onDeleteNoteRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("listAccessibleBusinessNotebooks")); -void NoteStoreServer::onExpungeNoteRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onCopyNoteRequestReady(Note value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onListNoteVersionsRequestReady(QList value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onGetNoteVersionRequestReady(Note value) +void NoteStoreServer::onGetNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onGetResourceRequestReady(Resource value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onGetResourceApplicationDataRequestReady(LazyMap value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("getNotebook"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady(QString value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getNotebook")); -void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onUpdateResourceRequestReady(qint32 value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onGetResourceDataRequestReady(QByteArray value) +void NoteStoreServer::onGetDefaultNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onGetResourceByHashRequestReady(Resource value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getDefaultNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onGetResourceRecognitionRequestReady(QByteArray value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeMessageBegin( + QStringLiteral("getDefaultNotebook"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onGetResourceAlternateDataRequestReady(QByteArray value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("getDefaultNotebook")); -void NoteStoreServer::onGetResourceAttributesRequestReady(ResourceAttributes value) -{ - // TODO: implement - Q_UNUSED(value) -} + // TODO: implement further -void NoteStoreServer::onGetPublicNotebookRequestReady(Notebook value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onShareNotebookRequestReady(SharedNotebook value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady(CreateOrUpdateNotebookSharesResult value) +void NoteStoreServer::onCreateNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onUpdateSharedNotebookRequestReady(qint32 value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady(Notebook value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onListSharedNotebooksRequestReady(QList value) +void NoteStoreServer::onUpdateNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void NoteStoreServer::onCreateLinkedNotebookRequestReady(LinkedNotebook value) +void NoteStoreServer::onExpungeNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("expungeNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("expungeNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("expungeNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void NoteStoreServer::onUpdateLinkedNotebookRequestReady(qint32 value) +void NoteStoreServer::onListTagsRequestReady( + QList value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listTags"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listTags"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listTags")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onListTagsByNotebookRequestReady( + QList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listTagsByNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listTagsByNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listTagsByNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetTagRequestReady( + Tag value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getTag"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getTag"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getTag")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateTagRequestReady( + Tag value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createTag"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createTag"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createTag")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateTagRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateTag"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateTag"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateTag")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUntagAllRequestReady( + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("untagAll"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("untagAll"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("untagAll")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + +} + +void NoteStoreServer::onExpungeTagRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("expungeTag"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("expungeTag"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("expungeTag")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onListSearchesRequestReady( + QList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listSearches"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listSearches"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listSearches")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getSearch"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getSearch"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getSearch")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createSearch"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createSearch"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createSearch")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateSearchRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateSearch"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateSearch"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateSearch")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeSearchRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("expungeSearch"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("expungeSearch"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("expungeSearch")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNoteOffsetRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("findNoteOffset"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("findNoteOffset"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("findNoteOffset")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNotesMetadataRequestReady( + NotesMetadataList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("findNotesMetadata"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("findNotesMetadata"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("findNotesMetadata")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onFindNoteCountsRequestReady( + NoteCollectionCounts value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("findNoteCounts"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("findNoteCounts"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("findNoteCounts")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteWithResultSpecRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteWithResultSpec"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteWithResultSpec"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteWithResultSpec")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationData"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationData"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteApplicationData")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("setNoteApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("setNoteApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("setNoteApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("unsetNoteApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("unsetNoteApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("unsetNoteApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteContentRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteContent"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteContent"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteContent")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteSearchTextRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteSearchText"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteSearchText"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteSearchText")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceSearchTextRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceSearchText"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceSearchText"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceSearchText")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteTagNamesRequestReady( + QStringList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteTagNames"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteTagNames"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteTagNames")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateNoteRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateNoteRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onDeleteNoteRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("deleteNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("deleteNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("deleteNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeNoteRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("expungeNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("expungeNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("expungeNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCopyNoteRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("copyNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("copyNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("copyNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onListNoteVersionsRequestReady( + QList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listNoteVersions"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listNoteVersions"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listNoteVersions")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetNoteVersionRequestReady( + Note value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNoteVersion"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNoteVersion"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNoteVersion")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceRequestReady( + Resource value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResource"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResource"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResource")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationData"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationData"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceApplicationData")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("setResourceApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("setResourceApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("setResourceApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("unsetResourceApplicationDataEntry"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("unsetResourceApplicationDataEntry"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("unsetResourceApplicationDataEntry")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateResourceRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateResource"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateResource"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateResource")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceDataRequestReady( + QByteArray value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceData"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceData"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceData")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceByHashRequestReady( + Resource value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceByHash"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceByHash"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceByHash")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceRecognitionRequestReady( + QByteArray value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceRecognition"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceRecognition"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceRecognition")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceAlternateDataRequestReady( + QByteArray value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceAlternateData"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceAlternateData"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceAlternateData")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetResourceAttributesRequestReady( + ResourceAttributes value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getResourceAttributes"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getResourceAttributes"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getResourceAttributes")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetPublicNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getPublicNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getPublicNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getPublicNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onShareNotebookRequestReady( + SharedNotebook value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("shareNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("shareNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("shareNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( + CreateOrUpdateNotebookSharesResult value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createOrUpdateNotebookShares"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createOrUpdateNotebookShares"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createOrUpdateNotebookShares")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateSharedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateSharedNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateSharedNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateSharedNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( + Notebook value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("setNotebookRecipientSettings"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("setNotebookRecipientSettings"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("setNotebookRecipientSettings")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onListSharedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listSharedNotebooks"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listSharedNotebooks"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listSharedNotebooks")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onCreateLinkedNotebookRequestReady( + LinkedNotebook value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("createLinkedNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("createLinkedNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("createLinkedNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateLinkedNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateLinkedNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateLinkedNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onListLinkedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listLinkedNotebooks"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listLinkedNotebooks"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listLinkedNotebooks")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onExpungeLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("expungeLinkedNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("expungeLinkedNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("expungeLinkedNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNotebook"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNotebook"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateToSharedNotebook")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( + SharedNotebook value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getSharedNotebookByAuth"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getSharedNotebookByAuth"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getSharedNotebookByAuth")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onEmailNoteRequestReady( + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("emailNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("emailNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("emailNote")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + +} + +void NoteStoreServer::onShareNoteRequestReady( + QString value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("shareNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("shareNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("shareNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onStopSharingNoteRequestReady( + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("stopSharingNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("stopSharingNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("stopSharingNote")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + +} + +void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateToSharedNote")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onFindRelatedRequestReady( + RelatedResult value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("findRelated"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("findRelated"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("findRelated")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} + +void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( + UpdateNoteIfUsnMatchesResult value, + QSharedPointer exceptionData) +{ + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateNoteIfUsnMatches"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateNoteIfUsnMatches"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateNoteIfUsnMatches")); + + // TODO: implement further -void NoteStoreServer::onListLinkedNotebooksRequestReady(QList value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onExpungeLinkedNotebookRequestReady(qint32 value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady(AuthenticationResult value) +void NoteStoreServer::onManageNotebookSharesRequestReady( + ManageNotebookSharesResult value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onGetSharedNotebookByAuthRequestReady(SharedNotebook value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("manageNotebookShares"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } -void NoteStoreServer::onEmailNoteRequestReady() -{ - // TODO: implement -} + writer.writeMessageBegin( + QStringLiteral("manageNotebookShares"), + ThriftMessageType::T_REPLY, + cseqid); -void NoteStoreServer::onShareNoteRequestReady(QString value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructBegin( + QStringLiteral("manageNotebookShares")); -void NoteStoreServer::onStopSharingNoteRequestReady() -{ - // TODO: implement -} + // TODO: implement further -void NoteStoreServer::onAuthenticateToSharedNoteRequestReady(AuthenticationResult value) -{ - // TODO: implement - Q_UNUSED(value) -} + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onFindRelatedRequestReady(RelatedResult value) -{ - // TODO: implement Q_UNUSED(value) } -void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady(UpdateNoteIfUsnMatchesResult value) +void NoteStoreServer::onGetNotebookSharesRequestReady( + ShareRelationships value, + QSharedPointer exceptionData) { - // TODO: implement - Q_UNUSED(value) -} + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; -void NoteStoreServer::onManageNotebookSharesRequestReady(ManageNotebookSharesResult value) -{ - // TODO: implement - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getNotebookShares"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getNotebookShares"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getNotebookShares")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); -void NoteStoreServer::onGetNotebookSharesRequestReady(ShareRelationships value) -{ - // TODO: implement Q_UNUSED(value) } @@ -7441,89 +10339,690 @@ void UserStoreServer::onRequest(QByteArray data) } } -void UserStoreServer::onCheckVersionRequestReady(bool value) +void UserStoreServer::onCheckVersionRequestReady( + bool value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("checkVersion"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("checkVersion"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("checkVersion")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onGetBootstrapInfoRequestReady(BootstrapInfo value) +void UserStoreServer::onGetBootstrapInfoRequestReady( + BootstrapInfo value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getBootstrapInfo"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getBootstrapInfo"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getBootstrapInfo")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onAuthenticateLongSessionRequestReady(AuthenticationResult value) +void UserStoreServer::onAuthenticateLongSessionRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateLongSession"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateLongSession"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateLongSession")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady(AuthenticationResult value) +void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("completeTwoFactorAuthentication"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("completeTwoFactorAuthentication"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("completeTwoFactorAuthentication")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onRevokeLongSessionRequestReady() +void UserStoreServer::onRevokeLongSessionRequestReady( + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("revokeLongSession"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("revokeLongSession"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("revokeLongSession")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + } -void UserStoreServer::onAuthenticateToBusinessRequestReady(AuthenticationResult value) +void UserStoreServer::onAuthenticateToBusinessRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateToBusiness")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onGetUserRequestReady(User value) +void UserStoreServer::onGetUserRequestReady( + User value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getUser"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getUser"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getUser")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onGetPublicUserInfoRequestReady(PublicUserInfo value) +void UserStoreServer::onGetPublicUserInfoRequestReady( + PublicUserInfo value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getPublicUserInfo"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getPublicUserInfo"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getPublicUserInfo")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onGetUserUrlsRequestReady(UserUrls value) +void UserStoreServer::onGetUserUrlsRequestReady( + UserUrls value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getUserUrls"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getUserUrls"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getUserUrls")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onInviteToBusinessRequestReady() +void UserStoreServer::onInviteToBusinessRequestReady( + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("inviteToBusiness"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("inviteToBusiness"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("inviteToBusiness")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + } -void UserStoreServer::onRemoveFromBusinessRequestReady() +void UserStoreServer::onRemoveFromBusinessRequestReady( + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("removeFromBusiness"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("removeFromBusiness"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("removeFromBusiness")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + } -void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady() +void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("updateBusinessUserIdentifier"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("updateBusinessUserIdentifier"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("updateBusinessUserIdentifier")); + + // TODO: implement further + + writer.writeFieldBegin( + QLatin1String(), + ThriftFieldType::T_VOID, + 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); + writer.writeMessageEnd(); + } -void UserStoreServer::onListBusinessUsersRequestReady(QList value) +void UserStoreServer::onListBusinessUsersRequestReady( + QList value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listBusinessUsers"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listBusinessUsers"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listBusinessUsers")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onListBusinessInvitationsRequestReady(QList value) +void UserStoreServer::onListBusinessInvitationsRequestReady( + QList value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("listBusinessInvitations"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("listBusinessInvitations"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("listBusinessInvitations")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } -void UserStoreServer::onGetAccountLimitsRequestReady(AccountLimits value) +void UserStoreServer::onGetAccountLimitsRequestReady( + AccountLimits value, + QSharedPointer exceptionData) { - // TODO: implement + ThriftBinaryBufferWriter writer; + qint32 cseqid = 0; + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("getAccountLimits"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("getAccountLimits"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("getAccountLimits")); + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + Q_UNUSED(value) } From fe3b6cf80167d74f71f6f0870fe06f639df59227 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 8 Nov 2019 07:57:54 +0300 Subject: [PATCH 064/188] Update generated code --- QEverCloud/src/generated/Servers.cpp | 5329 +++++++++++++++++++++++++- 1 file changed, 5263 insertions(+), 66 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index e918f6bf..28b3441f 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -13,6 +13,7 @@ #include "../Impl.h" #include "../Thrift.h" #include "Types_io.h" +#include namespace qevercloud { @@ -6787,6 +6788,54 @@ void NoteStoreServer::onGetSyncStateRequestReady( writer.writeStructBegin( QStringLiteral("getSyncState")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -6832,6 +6881,54 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( writer.writeStructBegin( QStringLiteral("getFilteredSyncChunk")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -6877,6 +6974,69 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( writer.writeStructBegin( QStringLiteral("getLinkedNotebookSyncState")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -6922,6 +7082,69 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( writer.writeStructBegin( QStringLiteral("getLinkedNotebookSyncChunk")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -6967,6 +7190,54 @@ void NoteStoreServer::onListNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listNotebooks")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7012,6 +7283,54 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listAccessibleBusinessNotebooks")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7057,6 +7376,69 @@ void NoteStoreServer::onGetNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7102,6 +7484,54 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getDefaultNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7147,6 +7577,69 @@ void NoteStoreServer::onCreateNotebookRequestReady( writer.writeStructBegin( QStringLiteral("createNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7192,13 +7685,76 @@ void NoteStoreServer::onUpdateNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateNotebook")); - // TODO: implement further - - writer.writeStructEnd(); - writer.writeMessageEnd(); - - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} void NoteStoreServer::onExpungeNotebookRequestReady( qint32 value, @@ -7237,6 +7793,69 @@ void NoteStoreServer::onExpungeNotebookRequestReady( writer.writeStructBegin( QStringLiteral("expungeNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7282,6 +7901,54 @@ void NoteStoreServer::onListTagsRequestReady( writer.writeStructBegin( QStringLiteral("listTags")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7327,6 +7994,69 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( writer.writeStructBegin( QStringLiteral("listTagsByNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7372,6 +8102,69 @@ void NoteStoreServer::onGetTagRequestReady( writer.writeStructBegin( QStringLiteral("getTag")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7417,6 +8210,69 @@ void NoteStoreServer::onCreateTagRequestReady( writer.writeStructBegin( QStringLiteral("createTag")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7462,6 +8318,69 @@ void NoteStoreServer::onUpdateTagRequestReady( writer.writeStructBegin( QStringLiteral("updateTag")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7506,6 +8425,69 @@ void NoteStoreServer::onUntagAllRequestReady( writer.writeStructBegin( QStringLiteral("untagAll")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -7555,13 +8537,76 @@ void NoteStoreServer::onExpungeTagRequestReady( writer.writeStructBegin( QStringLiteral("expungeTag")); - // TODO: implement further - - writer.writeStructEnd(); - writer.writeMessageEnd(); - - Q_UNUSED(value) -} + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} void NoteStoreServer::onListSearchesRequestReady( QList value, @@ -7600,6 +8645,54 @@ void NoteStoreServer::onListSearchesRequestReady( writer.writeStructBegin( QStringLiteral("listSearches")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7645,6 +8738,69 @@ void NoteStoreServer::onGetSearchRequestReady( writer.writeStructBegin( QStringLiteral("getSearch")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7690,6 +8846,54 @@ void NoteStoreServer::onCreateSearchRequestReady( writer.writeStructBegin( QStringLiteral("createSearch")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7735,6 +8939,69 @@ void NoteStoreServer::onUpdateSearchRequestReady( writer.writeStructBegin( QStringLiteral("updateSearch")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7780,6 +9047,69 @@ void NoteStoreServer::onExpungeSearchRequestReady( writer.writeStructBegin( QStringLiteral("expungeSearch")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7825,6 +9155,69 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( writer.writeStructBegin( QStringLiteral("findNoteOffset")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7870,6 +9263,69 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( writer.writeStructBegin( QStringLiteral("findNotesMetadata")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -7915,13 +9371,76 @@ void NoteStoreServer::onFindNoteCountsRequestReady( writer.writeStructBegin( QStringLiteral("findNoteCounts")); - // TODO: implement further - - writer.writeStructEnd(); - writer.writeMessageEnd(); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); - Q_UNUSED(value) -} + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} void NoteStoreServer::onGetNoteWithResultSpecRequestReady( Note value, @@ -7960,6 +9479,69 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( writer.writeStructBegin( QStringLiteral("getNoteWithResultSpec")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8005,6 +9587,69 @@ void NoteStoreServer::onGetNoteRequestReady( writer.writeStructBegin( QStringLiteral("getNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8050,6 +9695,69 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( writer.writeStructBegin( QStringLiteral("getNoteApplicationData")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8095,6 +9803,69 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("getNoteApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8140,6 +9911,69 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("setNoteApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8185,6 +10019,69 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("unsetNoteApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8230,6 +10127,69 @@ void NoteStoreServer::onGetNoteContentRequestReady( writer.writeStructBegin( QStringLiteral("getNoteContent")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8275,9 +10235,72 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( writer.writeStructBegin( QStringLiteral("getNoteSearchText")); - // TODO: implement further + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); - writer.writeStructEnd(); + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); writer.writeMessageEnd(); Q_UNUSED(value) @@ -8320,6 +10343,69 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( writer.writeStructBegin( QStringLiteral("getResourceSearchText")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8365,6 +10451,69 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( writer.writeStructBegin( QStringLiteral("getNoteTagNames")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8410,6 +10559,69 @@ void NoteStoreServer::onCreateNoteRequestReady( writer.writeStructBegin( QStringLiteral("createNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8455,6 +10667,69 @@ void NoteStoreServer::onUpdateNoteRequestReady( writer.writeStructBegin( QStringLiteral("updateNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8500,6 +10775,69 @@ void NoteStoreServer::onDeleteNoteRequestReady( writer.writeStructBegin( QStringLiteral("deleteNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8545,6 +10883,69 @@ void NoteStoreServer::onExpungeNoteRequestReady( writer.writeStructBegin( QStringLiteral("expungeNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8590,6 +10991,69 @@ void NoteStoreServer::onCopyNoteRequestReady( writer.writeStructBegin( QStringLiteral("copyNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8635,13 +11099,76 @@ void NoteStoreServer::onListNoteVersionsRequestReady( writer.writeStructBegin( QStringLiteral("listNoteVersions")); - // TODO: implement further - - writer.writeStructEnd(); - writer.writeMessageEnd(); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); - Q_UNUSED(value) -} + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} void NoteStoreServer::onGetNoteVersionRequestReady( Note value, @@ -8680,6 +11207,69 @@ void NoteStoreServer::onGetNoteVersionRequestReady( writer.writeStructBegin( QStringLiteral("getNoteVersion")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8725,6 +11315,69 @@ void NoteStoreServer::onGetResourceRequestReady( writer.writeStructBegin( QStringLiteral("getResource")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8770,6 +11423,69 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceApplicationData")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8815,6 +11531,69 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("getResourceApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8860,6 +11639,69 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("setResourceApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8905,6 +11747,69 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("unsetResourceApplicationDataEntry")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8950,6 +11855,69 @@ void NoteStoreServer::onUpdateResourceRequestReady( writer.writeStructBegin( QStringLiteral("updateResource")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -8995,9 +11963,72 @@ void NoteStoreServer::onGetResourceDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceData")); - // TODO: implement further + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); - writer.writeStructEnd(); + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); writer.writeMessageEnd(); Q_UNUSED(value) @@ -9040,6 +12071,69 @@ void NoteStoreServer::onGetResourceByHashRequestReady( writer.writeStructBegin( QStringLiteral("getResourceByHash")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9085,6 +12179,69 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( writer.writeStructBegin( QStringLiteral("getResourceRecognition")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9130,6 +12287,69 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceAlternateData")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9175,6 +12395,69 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( writer.writeStructBegin( QStringLiteral("getResourceAttributes")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9220,6 +12503,54 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getPublicNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9265,6 +12596,69 @@ void NoteStoreServer::onShareNotebookRequestReady( writer.writeStructBegin( QStringLiteral("shareNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9310,6 +12704,84 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("createOrUpdateNotebookShares")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMInvalidContactsException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMInvalidContactsException"), + ThriftFieldType::T_STRUCT, + 4); + + writeEDAMInvalidContactsException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9355,13 +12827,76 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateSharedNotebook")); - // TODO: implement further - - writer.writeStructEnd(); - writer.writeMessageEnd(); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); - Q_UNUSED(value) -} + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + + // TODO: implement further + + writer.writeStructEnd(); + writer.writeMessageEnd(); + + Q_UNUSED(value) +} void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( Notebook value, @@ -9400,6 +12935,69 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( writer.writeStructBegin( QStringLiteral("setNotebookRecipientSettings")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9445,6 +13043,69 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listSharedNotebooks")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9490,6 +13151,69 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("createLinkedNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9535,6 +13259,69 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateLinkedNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9580,6 +13367,69 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listLinkedNotebooks")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9625,6 +13475,69 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("expungeLinkedNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9670,6 +13583,69 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("authenticateToSharedNotebook")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9715,6 +13691,69 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( writer.writeStructBegin( QStringLiteral("getSharedNotebookByAuth")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9759,6 +13798,69 @@ void NoteStoreServer::onEmailNoteRequestReady( writer.writeStructBegin( QStringLiteral("emailNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -9808,6 +13910,69 @@ void NoteStoreServer::onShareNoteRequestReady( writer.writeStructBegin( QStringLiteral("shareNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9852,6 +14017,69 @@ void NoteStoreServer::onStopSharingNoteRequestReady( writer.writeStructBegin( QStringLiteral("stopSharingNote")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -9877,30 +14105,93 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( { exceptionData->throwException(); } - catch(const ThriftException & exception) + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateToSharedNote")); + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) { - writer.writeMessageBegin( - QStringLiteral("authenticateToSharedNote"), - ThriftMessageType::T_EXCEPTION, - cseqid); - writeThriftException(writer, exception); + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); writer.writeMessageEnd(); return; } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } catch(...) { - // Will be handled below + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); } } - writer.writeMessageBegin( - QStringLiteral("authenticateToSharedNote"), - ThriftMessageType::T_REPLY, - cseqid); - - writer.writeStructBegin( - QStringLiteral("authenticateToSharedNote")); - // TODO: implement further writer.writeStructEnd(); @@ -9946,6 +14237,69 @@ void NoteStoreServer::onFindRelatedRequestReady( writer.writeStructBegin( QStringLiteral("findRelated")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -9991,6 +14345,69 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( writer.writeStructBegin( QStringLiteral("updateNoteIfUsnMatches")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10036,6 +14453,69 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("manageNotebookShares")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10081,6 +14561,69 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("getNotebookShares")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10466,6 +15009,54 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( writer.writeStructBegin( QStringLiteral("authenticateLongSession")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10511,6 +15102,54 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( writer.writeStructBegin( QStringLiteral("completeTwoFactorAuthentication")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10555,6 +15194,54 @@ void UserStoreServer::onRevokeLongSessionRequestReady( writer.writeStructBegin( QStringLiteral("revokeLongSession")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -10580,30 +15267,78 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( { exceptionData->throwException(); } - catch(const ThriftException & exception) + catch(const ThriftException & exception) + { + writer.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), + ThriftMessageType::T_EXCEPTION, + cseqid); + writeThriftException(writer, exception); + writer.writeMessageEnd(); + return; + } + catch(...) + { + // Will be handled below + } + } + + writer.writeMessageBegin( + QStringLiteral("authenticateToBusiness"), + ThriftMessageType::T_REPLY, + cseqid); + + writer.writeStructBegin( + QStringLiteral("authenticateToBusiness")); + + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) { - writer.writeMessageBegin( - QStringLiteral("authenticateToBusiness"), - ThriftMessageType::T_EXCEPTION, - cseqid); - writeThriftException(writer, exception); + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); writer.writeMessageEnd(); return; } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } catch(...) { - // Will be handled below + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); } } - writer.writeMessageBegin( - QStringLiteral("authenticateToBusiness"), - ThriftMessageType::T_REPLY, - cseqid); - - writer.writeStructBegin( - QStringLiteral("authenticateToBusiness")); - // TODO: implement further writer.writeStructEnd(); @@ -10649,6 +15384,54 @@ void UserStoreServer::onGetUserRequestReady( writer.writeStructBegin( QStringLiteral("getUser")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10694,6 +15477,69 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( writer.writeStructBegin( QStringLiteral("getPublicUserInfo")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10739,6 +15585,54 @@ void UserStoreServer::onGetUserUrlsRequestReady( writer.writeStructBegin( QStringLiteral("getUserUrls")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10783,6 +15677,54 @@ void UserStoreServer::onInviteToBusinessRequestReady( writer.writeStructBegin( QStringLiteral("inviteToBusiness")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -10831,6 +15773,69 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( writer.writeStructBegin( QStringLiteral("removeFromBusiness")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -10879,6 +15884,69 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( writer.writeStructBegin( QStringLiteral("updateBusinessUserIdentifier")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMNotFoundException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMNotFoundException"), + ThriftFieldType::T_STRUCT, + 3); + + writeEDAMNotFoundException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeFieldBegin( @@ -10928,6 +15996,54 @@ void UserStoreServer::onListBusinessUsersRequestReady( writer.writeStructBegin( QStringLiteral("listBusinessUsers")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -10973,6 +16089,54 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( writer.writeStructBegin( QStringLiteral("listBusinessInvitations")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const EDAMSystemException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMSystemException"), + ThriftFieldType::T_STRUCT, + 2); + + writeEDAMSystemException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); @@ -11018,6 +16182,39 @@ void UserStoreServer::onGetAccountLimitsRequestReady( writer.writeStructBegin( QStringLiteral("getAccountLimits")); + if (!exceptionData.isNull()) + { + try + { + exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + writer.writeFieldBegin( + QStringLiteral("EDAMUserException"), + ThriftFieldType::T_STRUCT, + 1); + + writeEDAMUserException(writer, e); + writer.writeFieldEnd(); + + // Finalize message and return immediately + writer.writeStructEnd(); + writer.writeMessageEnd(); + return; + } + catch(const std::exception & e) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception: " << e.what()); + } + catch(...) + { + // TODO: more proper error handling + QEC_ERROR("server", "Unknown exception"); + } + } + // TODO: implement further writer.writeStructEnd(); From 323f4bad57288976fc869d4eaedc902f480ebcec Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 9 Nov 2019 16:42:44 +0300 Subject: [PATCH 065/188] Update generated code --- QEverCloud/src/generated/Services.cpp | 300 +++++++++++++------------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 8a7ab72b..2c30a990 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -19576,7 +19576,7 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "afterUSN = " << afterUSN << "\n"; strm << "maxEntries = " << maxEntries << "\n"; strm << "filter = " << filter << "\n"; @@ -19615,7 +19615,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "afterUSN = " << afterUSN << "\n"; strm << "maxEntries = " << maxEntries << "\n"; strm << "filter = " << filter << "\n"; @@ -19650,7 +19650,7 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -19683,7 +19683,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -19722,7 +19722,7 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; strm << "afterUSN = " << afterUSN << "\n"; strm << "maxEntries = " << maxEntries << "\n"; @@ -19764,7 +19764,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; strm << "afterUSN = " << afterUSN << "\n"; strm << "maxEntries = " << maxEntries << "\n"; @@ -19900,7 +19900,7 @@ Notebook DurableNoteStore::getNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -19933,7 +19933,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20016,7 +20016,7 @@ Notebook DurableNoteStore::createNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebook = " << notebook << "\n"; } @@ -20049,7 +20049,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebook = " << notebook << "\n"; } @@ -20082,7 +20082,7 @@ qint32 DurableNoteStore::updateNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebook = " << notebook << "\n"; } @@ -20115,7 +20115,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebook = " << notebook << "\n"; } @@ -20148,7 +20148,7 @@ qint32 DurableNoteStore::expungeNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20181,7 +20181,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20264,7 +20264,7 @@ QList DurableNoteStore::listTagsByNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; } @@ -20297,7 +20297,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; } @@ -20330,7 +20330,7 @@ Tag DurableNoteStore::getTag( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20363,7 +20363,7 @@ AsyncResult * DurableNoteStore::getTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20396,7 +20396,7 @@ Tag DurableNoteStore::createTag( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "tag = " << tag << "\n"; } @@ -20429,7 +20429,7 @@ AsyncResult * DurableNoteStore::createTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "tag = " << tag << "\n"; } @@ -20462,7 +20462,7 @@ qint32 DurableNoteStore::updateTag( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "tag = " << tag << "\n"; } @@ -20495,7 +20495,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "tag = " << tag << "\n"; } @@ -20528,7 +20528,7 @@ void DurableNoteStore::untagAll( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20561,7 +20561,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20594,7 +20594,7 @@ qint32 DurableNoteStore::expungeTag( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20627,7 +20627,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20710,7 +20710,7 @@ SavedSearch DurableNoteStore::getSearch( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20743,7 +20743,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20776,7 +20776,7 @@ SavedSearch DurableNoteStore::createSearch( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "search = " << search << "\n"; } @@ -20809,7 +20809,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "search = " << search << "\n"; } @@ -20842,7 +20842,7 @@ qint32 DurableNoteStore::updateSearch( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "search = " << search << "\n"; } @@ -20875,7 +20875,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "search = " << search << "\n"; } @@ -20908,7 +20908,7 @@ qint32 DurableNoteStore::expungeSearch( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20941,7 +20941,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -20976,7 +20976,7 @@ qint32 DurableNoteStore::findNoteOffset( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "guid = " << guid << "\n"; } @@ -21012,7 +21012,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "guid = " << guid << "\n"; } @@ -21052,7 +21052,7 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "offset = " << offset << "\n"; strm << "maxNotes = " << maxNotes << "\n"; @@ -21094,7 +21094,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "offset = " << offset << "\n"; strm << "maxNotes = " << maxNotes << "\n"; @@ -21132,7 +21132,7 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "withTrash = " << withTrash << "\n"; } @@ -21168,7 +21168,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "filter = " << filter << "\n"; strm << "withTrash = " << withTrash << "\n"; } @@ -21204,7 +21204,7 @@ Note DurableNoteStore::getNoteWithResultSpec( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "resultSpec = " << resultSpec << "\n"; } @@ -21240,7 +21240,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "resultSpec = " << resultSpec << "\n"; } @@ -21282,7 +21282,7 @@ Note DurableNoteStore::getNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "withContent = " << withContent << "\n"; strm << "withResourcesData = " << withResourcesData << "\n"; @@ -21327,7 +21327,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "withContent = " << withContent << "\n"; strm << "withResourcesData = " << withResourcesData << "\n"; @@ -21364,7 +21364,7 @@ LazyMap DurableNoteStore::getNoteApplicationData( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21397,7 +21397,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21432,7 +21432,7 @@ QString DurableNoteStore::getNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -21468,7 +21468,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -21506,7 +21506,7 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; strm << "value = " << value << "\n"; @@ -21545,7 +21545,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; strm << "value = " << value << "\n"; @@ -21582,7 +21582,7 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -21618,7 +21618,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -21652,7 +21652,7 @@ QString DurableNoteStore::getNoteContent( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21685,7 +21685,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21722,7 +21722,7 @@ QString DurableNoteStore::getNoteSearchText( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "noteOnly = " << noteOnly << "\n"; strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; @@ -21761,7 +21761,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "noteOnly = " << noteOnly << "\n"; strm << "tokenizeForIndexing = " << tokenizeForIndexing << "\n"; @@ -21796,7 +21796,7 @@ QString DurableNoteStore::getResourceSearchText( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21829,7 +21829,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21862,7 +21862,7 @@ QStringList DurableNoteStore::getNoteTagNames( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21895,7 +21895,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -21928,7 +21928,7 @@ Note DurableNoteStore::createNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -21961,7 +21961,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -21994,7 +21994,7 @@ Note DurableNoteStore::updateNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -22027,7 +22027,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -22060,7 +22060,7 @@ qint32 DurableNoteStore::deleteNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22093,7 +22093,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22126,7 +22126,7 @@ qint32 DurableNoteStore::expungeNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22159,7 +22159,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22194,7 +22194,7 @@ Note DurableNoteStore::copyNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "toNotebookGuid = " << toNotebookGuid << "\n"; } @@ -22230,7 +22230,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "toNotebookGuid = " << toNotebookGuid << "\n"; } @@ -22264,7 +22264,7 @@ QList DurableNoteStore::listNoteVersions( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; } @@ -22297,7 +22297,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; } @@ -22338,7 +22338,7 @@ Note DurableNoteStore::getNoteVersion( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "updateSequenceNum = " << updateSequenceNum << "\n"; strm << "withResourcesData = " << withResourcesData << "\n"; @@ -22383,7 +22383,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "updateSequenceNum = " << updateSequenceNum << "\n"; strm << "withResourcesData = " << withResourcesData << "\n"; @@ -22428,7 +22428,7 @@ Resource DurableNoteStore::getResource( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "withData = " << withData << "\n"; strm << "withRecognition = " << withRecognition << "\n"; @@ -22473,7 +22473,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "withData = " << withData << "\n"; strm << "withRecognition = " << withRecognition << "\n"; @@ -22510,7 +22510,7 @@ LazyMap DurableNoteStore::getResourceApplicationData( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22543,7 +22543,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22578,7 +22578,7 @@ QString DurableNoteStore::getResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -22614,7 +22614,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -22652,7 +22652,7 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; strm << "value = " << value << "\n"; @@ -22691,7 +22691,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; strm << "value = " << value << "\n"; @@ -22728,7 +22728,7 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -22764,7 +22764,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "key = " << key << "\n"; } @@ -22798,7 +22798,7 @@ qint32 DurableNoteStore::updateResource( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "resource = " << resource << "\n"; } @@ -22831,7 +22831,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "resource = " << resource << "\n"; } @@ -22864,7 +22864,7 @@ QByteArray DurableNoteStore::getResourceData( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22897,7 +22897,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -22938,7 +22938,7 @@ Resource DurableNoteStore::getResourceByHash( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "contentHash = " << contentHash << "\n"; strm << "withData = " << withData << "\n"; @@ -22983,7 +22983,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "noteGuid = " << noteGuid << "\n"; strm << "contentHash = " << contentHash << "\n"; strm << "withData = " << withData << "\n"; @@ -23020,7 +23020,7 @@ QByteArray DurableNoteStore::getResourceRecognition( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23053,7 +23053,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23086,7 +23086,7 @@ QByteArray DurableNoteStore::getResourceAlternateData( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23119,7 +23119,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23152,7 +23152,7 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23185,7 +23185,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23220,7 +23220,7 @@ Notebook DurableNoteStore::getPublicNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "userId = " << userId << "\n"; strm << "publicUri = " << publicUri << "\n"; } @@ -23256,7 +23256,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "userId = " << userId << "\n"; strm << "publicUri = " << publicUri << "\n"; } @@ -23292,7 +23292,7 @@ SharedNotebook DurableNoteStore::shareNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "sharedNotebook = " << sharedNotebook << "\n"; strm << "message = " << message << "\n"; } @@ -23328,7 +23328,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "sharedNotebook = " << sharedNotebook << "\n"; strm << "message = " << message << "\n"; } @@ -23362,7 +23362,7 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "shareTemplate = " << shareTemplate << "\n"; } @@ -23395,7 +23395,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "shareTemplate = " << shareTemplate << "\n"; } @@ -23428,7 +23428,7 @@ qint32 DurableNoteStore::updateSharedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "sharedNotebook = " << sharedNotebook << "\n"; } @@ -23461,7 +23461,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "sharedNotebook = " << sharedNotebook << "\n"; } @@ -23496,7 +23496,7 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; strm << "recipientSettings = " << recipientSettings << "\n"; } @@ -23532,7 +23532,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; strm << "recipientSettings = " << recipientSettings << "\n"; } @@ -23616,7 +23616,7 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -23649,7 +23649,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -23682,7 +23682,7 @@ qint32 DurableNoteStore::updateLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -23715,7 +23715,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "linkedNotebook = " << linkedNotebook << "\n"; } @@ -23798,7 +23798,7 @@ qint32 DurableNoteStore::expungeLinkedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23831,7 +23831,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -23864,7 +23864,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; } @@ -23897,7 +23897,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "shareKeyOrGlobalId = " << shareKeyOrGlobalId << "\n"; } @@ -23980,7 +23980,7 @@ void DurableNoteStore::emailNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "parameters = " << parameters << "\n"; } @@ -24013,7 +24013,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "parameters = " << parameters << "\n"; } @@ -24046,7 +24046,7 @@ QString DurableNoteStore::shareNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -24079,7 +24079,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -24112,7 +24112,7 @@ void DurableNoteStore::stopSharingNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -24145,7 +24145,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; } @@ -24180,7 +24180,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "noteKey = " << noteKey << "\n"; } @@ -24216,7 +24216,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "guid = " << guid << "\n"; strm << "noteKey = " << noteKey << "\n"; } @@ -24252,7 +24252,7 @@ RelatedResult DurableNoteStore::findRelated( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "query = " << query << "\n"; strm << "resultSpec = " << resultSpec << "\n"; } @@ -24288,7 +24288,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "query = " << query << "\n"; strm << "resultSpec = " << resultSpec << "\n"; } @@ -24322,7 +24322,7 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -24355,7 +24355,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "note = " << note << "\n"; } @@ -24388,7 +24388,7 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "parameters = " << parameters << "\n"; } @@ -24421,7 +24421,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "parameters = " << parameters << "\n"; } @@ -24454,7 +24454,7 @@ ShareRelationships DurableNoteStore::getNotebookShares( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; } @@ -24487,7 +24487,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "notebookGuid = " << notebookGuid << "\n"; } @@ -24526,7 +24526,7 @@ bool DurableUserStore::checkVersion( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "clientName = " << clientName << "\n"; strm << "edamVersionMajor = " << edamVersionMajor << "\n"; strm << "edamVersionMinor = " << edamVersionMinor << "\n"; @@ -24565,7 +24565,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "clientName = " << clientName << "\n"; strm << "edamVersionMajor = " << edamVersionMajor << "\n"; strm << "edamVersionMinor = " << edamVersionMinor << "\n"; @@ -24600,7 +24600,7 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "locale = " << locale << "\n"; } @@ -24633,7 +24633,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "locale = " << locale << "\n"; } @@ -24678,7 +24678,7 @@ AuthenticationResult DurableUserStore::authenticateLongSession( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "username = " << username << "\n"; strm << "deviceIdentifier = " << deviceIdentifier << "\n"; strm << "deviceDescription = " << deviceDescription << "\n"; @@ -24726,7 +24726,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "username = " << username << "\n"; strm << "deviceIdentifier = " << deviceIdentifier << "\n"; strm << "deviceDescription = " << deviceDescription << "\n"; @@ -24766,7 +24766,7 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "deviceIdentifier = " << deviceIdentifier << "\n"; strm << "deviceDescription = " << deviceDescription << "\n"; } @@ -24804,7 +24804,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "deviceIdentifier = " << deviceIdentifier << "\n"; strm << "deviceDescription = " << deviceDescription << "\n"; } @@ -24988,7 +24988,7 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "username = " << username << "\n"; } @@ -25021,7 +25021,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "username = " << username << "\n"; } @@ -25104,7 +25104,7 @@ void DurableUserStore::inviteToBusiness( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "emailAddress = " << emailAddress << "\n"; } @@ -25137,7 +25137,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "emailAddress = " << emailAddress << "\n"; } @@ -25170,7 +25170,7 @@ void DurableUserStore::removeFromBusiness( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "emailAddress = " << emailAddress << "\n"; } @@ -25203,7 +25203,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "emailAddress = " << emailAddress << "\n"; } @@ -25238,7 +25238,7 @@ void DurableUserStore::updateBusinessUserIdentifier( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "oldEmailAddress = " << oldEmailAddress << "\n"; strm << "newEmailAddress = " << newEmailAddress << "\n"; } @@ -25274,7 +25274,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "oldEmailAddress = " << oldEmailAddress << "\n"; strm << "newEmailAddress = " << newEmailAddress << "\n"; } @@ -25358,7 +25358,7 @@ QList DurableUserStore::listBusinessInvitations( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; } @@ -25391,7 +25391,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "includeRequestedInvitations = " << includeRequestedInvitations << "\n"; } @@ -25424,7 +25424,7 @@ AccountLimits DurableUserStore::getAccountLimits( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "serviceLevel = " << serviceLevel << "\n"; } @@ -25457,7 +25457,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( QString requestDescription; QTextStream strm(&requestDescription); - if (auto log = logger(); log->shouldLog(LogLevel::Trace, "durable_service")) { + if (logger()->shouldLog(LogLevel::Trace, "durable_service")) { strm << "serviceLevel = " << serviceLevel << "\n"; } From 0d15625700300b8327f98f29091e647f3da81a5c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 10 Nov 2019 19:13:39 +0300 Subject: [PATCH 066/188] Update generated code --- QEverCloud/src/generated/Servers.cpp | 824 ++++++++++++++++++--------- 1 file changed, 550 insertions(+), 274 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index 28b3441f..a71696ed 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -6836,12 +6836,15 @@ void NoteStoreServer::onGetSyncStateRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getSyncState"), + ThriftFieldType::T_STRUCT, + 0); + writeSyncState(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetFilteredSyncChunkRequestReady( @@ -6929,12 +6932,15 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getFilteredSyncChunk"), + ThriftFieldType::T_STRUCT, + 0); + writeSyncChunk(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( @@ -7037,12 +7043,15 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getLinkedNotebookSyncState"), + ThriftFieldType::T_STRUCT, + 0); + writeSyncState(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( @@ -7145,12 +7154,15 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getLinkedNotebookSyncChunk"), + ThriftFieldType::T_STRUCT, + 0); + writeSyncChunk(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListNotebooksRequestReady( @@ -7238,12 +7250,19 @@ void NoteStoreServer::onListNotebooksRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listNotebooks"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeNotebook(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( @@ -7331,12 +7350,19 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listAccessibleBusinessNotebooks"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeNotebook(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNotebookRequestReady( @@ -7439,12 +7465,15 @@ void NoteStoreServer::onGetNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetDefaultNotebookRequestReady( @@ -7532,12 +7561,15 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getDefaultNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateNotebookRequestReady( @@ -7640,12 +7672,15 @@ void NoteStoreServer::onCreateNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateNotebookRequestReady( @@ -7748,12 +7783,15 @@ void NoteStoreServer::onUpdateNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateNotebook"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onExpungeNotebookRequestReady( @@ -7856,12 +7894,15 @@ void NoteStoreServer::onExpungeNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("expungeNotebook"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListTagsRequestReady( @@ -7949,12 +7990,19 @@ void NoteStoreServer::onListTagsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listTags"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeTag(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListTagsByNotebookRequestReady( @@ -8057,12 +8105,19 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listTagsByNotebook"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeTag(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetTagRequestReady( @@ -8165,12 +8220,15 @@ void NoteStoreServer::onGetTagRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getTag"), + ThriftFieldType::T_STRUCT, + 0); + writeTag(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateTagRequestReady( @@ -8273,12 +8331,15 @@ void NoteStoreServer::onCreateTagRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createTag"), + ThriftFieldType::T_STRUCT, + 0); + writeTag(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateTagRequestReady( @@ -8381,12 +8442,15 @@ void NoteStoreServer::onUpdateTagRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateTag"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUntagAllRequestReady( @@ -8488,16 +8552,14 @@ void NoteStoreServer::onUntagAllRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("untagAll"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void NoteStoreServer::onExpungeTagRequestReady( @@ -8600,12 +8662,15 @@ void NoteStoreServer::onExpungeTagRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("expungeTag"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListSearchesRequestReady( @@ -8693,12 +8758,19 @@ void NoteStoreServer::onListSearchesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listSearches"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeSavedSearch(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetSearchRequestReady( @@ -8801,12 +8873,15 @@ void NoteStoreServer::onGetSearchRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getSearch"), + ThriftFieldType::T_STRUCT, + 0); + writeSavedSearch(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateSearchRequestReady( @@ -8894,12 +8969,15 @@ void NoteStoreServer::onCreateSearchRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createSearch"), + ThriftFieldType::T_STRUCT, + 0); + writeSavedSearch(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateSearchRequestReady( @@ -9002,12 +9080,15 @@ void NoteStoreServer::onUpdateSearchRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateSearch"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onExpungeSearchRequestReady( @@ -9110,12 +9191,15 @@ void NoteStoreServer::onExpungeSearchRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("expungeSearch"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onFindNoteOffsetRequestReady( @@ -9218,12 +9302,15 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("findNoteOffset"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onFindNotesMetadataRequestReady( @@ -9326,12 +9413,15 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("findNotesMetadata"), + ThriftFieldType::T_STRUCT, + 0); + writeNotesMetadataList(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onFindNoteCountsRequestReady( @@ -9434,12 +9524,15 @@ void NoteStoreServer::onFindNoteCountsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("findNoteCounts"), + ThriftFieldType::T_STRUCT, + 0); + writeNoteCollectionCounts(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteWithResultSpecRequestReady( @@ -9542,12 +9635,15 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteWithResultSpec"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteRequestReady( @@ -9650,12 +9746,15 @@ void NoteStoreServer::onGetNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNote"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteApplicationDataRequestReady( @@ -9758,12 +9857,15 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteApplicationData"), + ThriftFieldType::T_STRUCT, + 0); + writeLazyMap(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( @@ -9866,12 +9968,15 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteApplicationDataEntry"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( @@ -9974,12 +10079,15 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("setNoteApplicationDataEntry"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( @@ -10082,12 +10190,15 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("unsetNoteApplicationDataEntry"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteContentRequestReady( @@ -10190,12 +10301,15 @@ void NoteStoreServer::onGetNoteContentRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteContent"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteSearchTextRequestReady( @@ -10298,12 +10412,15 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteSearchText"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceSearchTextRequestReady( @@ -10406,12 +10523,15 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceSearchText"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteTagNamesRequestReady( @@ -10514,12 +10634,19 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteTagNames"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRING, value.size()); + for(const auto & v: qAsConst(value)) { + writer.writeString(v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateNoteRequestReady( @@ -10622,12 +10749,15 @@ void NoteStoreServer::onCreateNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createNote"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateNoteRequestReady( @@ -10730,12 +10860,15 @@ void NoteStoreServer::onUpdateNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateNote"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onDeleteNoteRequestReady( @@ -10838,12 +10971,15 @@ void NoteStoreServer::onDeleteNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("deleteNote"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onExpungeNoteRequestReady( @@ -10946,12 +11082,15 @@ void NoteStoreServer::onExpungeNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("expungeNote"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCopyNoteRequestReady( @@ -11054,12 +11193,15 @@ void NoteStoreServer::onCopyNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("copyNote"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListNoteVersionsRequestReady( @@ -11162,12 +11304,19 @@ void NoteStoreServer::onListNoteVersionsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listNoteVersions"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeNoteVersionId(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNoteVersionRequestReady( @@ -11270,12 +11419,15 @@ void NoteStoreServer::onGetNoteVersionRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNoteVersion"), + ThriftFieldType::T_STRUCT, + 0); + writeNote(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceRequestReady( @@ -11378,12 +11530,15 @@ void NoteStoreServer::onGetResourceRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResource"), + ThriftFieldType::T_STRUCT, + 0); + writeResource(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceApplicationDataRequestReady( @@ -11486,12 +11641,15 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceApplicationData"), + ThriftFieldType::T_STRUCT, + 0); + writeLazyMap(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( @@ -11594,12 +11752,15 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceApplicationDataEntry"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( @@ -11702,12 +11863,15 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("setResourceApplicationDataEntry"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( @@ -11810,12 +11974,15 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("unsetResourceApplicationDataEntry"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateResourceRequestReady( @@ -11918,12 +12085,15 @@ void NoteStoreServer::onUpdateResourceRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateResource"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceDataRequestReady( @@ -12026,12 +12196,15 @@ void NoteStoreServer::onGetResourceDataRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceData"), + ThriftFieldType::T_STRING, + 0); + writer.writeBinary(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceByHashRequestReady( @@ -12134,12 +12307,15 @@ void NoteStoreServer::onGetResourceByHashRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceByHash"), + ThriftFieldType::T_STRUCT, + 0); + writeResource(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceRecognitionRequestReady( @@ -12242,12 +12418,15 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceRecognition"), + ThriftFieldType::T_STRING, + 0); + writer.writeBinary(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceAlternateDataRequestReady( @@ -12350,12 +12529,15 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceAlternateData"), + ThriftFieldType::T_STRING, + 0); + writer.writeBinary(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetResourceAttributesRequestReady( @@ -12458,12 +12640,15 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getResourceAttributes"), + ThriftFieldType::T_STRUCT, + 0); + writeResourceAttributes(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetPublicNotebookRequestReady( @@ -12551,12 +12736,15 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getPublicNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onShareNotebookRequestReady( @@ -12659,12 +12847,15 @@ void NoteStoreServer::onShareNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("shareNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeSharedNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( @@ -12782,12 +12973,15 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createOrUpdateNotebookShares"), + ThriftFieldType::T_STRUCT, + 0); + writeCreateOrUpdateNotebookSharesResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateSharedNotebookRequestReady( @@ -12890,12 +13084,15 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateSharedNotebook"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( @@ -12998,12 +13195,15 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("setNotebookRecipientSettings"), + ThriftFieldType::T_STRUCT, + 0); + writeNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListSharedNotebooksRequestReady( @@ -13106,12 +13306,19 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listSharedNotebooks"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeSharedNotebook(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onCreateLinkedNotebookRequestReady( @@ -13214,12 +13421,15 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("createLinkedNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeLinkedNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateLinkedNotebookRequestReady( @@ -13322,12 +13532,15 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateLinkedNotebook"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onListLinkedNotebooksRequestReady( @@ -13430,12 +13643,19 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listLinkedNotebooks"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeLinkedNotebook(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onExpungeLinkedNotebookRequestReady( @@ -13538,12 +13758,15 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("expungeLinkedNotebook"), + ThriftFieldType::T_I32, + 0); + writer.writeI32(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( @@ -13646,12 +13869,15 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("authenticateToSharedNotebook"), + ThriftFieldType::T_STRUCT, + 0); + writeAuthenticationResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( @@ -13754,12 +13980,15 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getSharedNotebookByAuth"), + ThriftFieldType::T_STRUCT, + 0); + writeSharedNotebook(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onEmailNoteRequestReady( @@ -13861,16 +14090,14 @@ void NoteStoreServer::onEmailNoteRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("emailNote"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void NoteStoreServer::onShareNoteRequestReady( @@ -13973,12 +14200,15 @@ void NoteStoreServer::onShareNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("shareNote"), + ThriftFieldType::T_STRING, + 0); + writer.writeString(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onStopSharingNoteRequestReady( @@ -14080,16 +14310,14 @@ void NoteStoreServer::onStopSharingNoteRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("stopSharingNote"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( @@ -14192,12 +14420,15 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("authenticateToSharedNote"), + ThriftFieldType::T_STRUCT, + 0); + writeAuthenticationResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onFindRelatedRequestReady( @@ -14300,12 +14531,15 @@ void NoteStoreServer::onFindRelatedRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("findRelated"), + ThriftFieldType::T_STRUCT, + 0); + writeRelatedResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( @@ -14408,12 +14642,15 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("updateNoteIfUsnMatches"), + ThriftFieldType::T_STRUCT, + 0); + writeUpdateNoteIfUsnMatchesResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onManageNotebookSharesRequestReady( @@ -14516,12 +14753,15 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("manageNotebookShares"), + ThriftFieldType::T_STRUCT, + 0); + writeManageNotebookSharesResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void NoteStoreServer::onGetNotebookSharesRequestReady( @@ -14624,12 +14864,15 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getNotebookShares"), + ThriftFieldType::T_STRUCT, + 0); + writeShareRelationships(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } //////////////////////////////////////////////////////////////////////////////// @@ -14919,12 +15162,15 @@ void UserStoreServer::onCheckVersionRequestReady( writer.writeStructBegin( QStringLiteral("checkVersion")); - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("checkVersion"), + ThriftFieldType::T_BOOL, + 0); + writer.writeBool(value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onGetBootstrapInfoRequestReady( @@ -14964,12 +15210,15 @@ void UserStoreServer::onGetBootstrapInfoRequestReady( writer.writeStructBegin( QStringLiteral("getBootstrapInfo")); - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getBootstrapInfo"), + ThriftFieldType::T_STRUCT, + 0); + writeBootstrapInfo(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onAuthenticateLongSessionRequestReady( @@ -15057,12 +15306,15 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("authenticateLongSession"), + ThriftFieldType::T_STRUCT, + 0); + writeAuthenticationResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( @@ -15150,12 +15402,15 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("completeTwoFactorAuthentication"), + ThriftFieldType::T_STRUCT, + 0); + writeAuthenticationResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onRevokeLongSessionRequestReady( @@ -15242,16 +15497,14 @@ void UserStoreServer::onRevokeLongSessionRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("revokeLongSession"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void UserStoreServer::onAuthenticateToBusinessRequestReady( @@ -15339,12 +15592,15 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("authenticateToBusiness"), + ThriftFieldType::T_STRUCT, + 0); + writeAuthenticationResult(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onGetUserRequestReady( @@ -15432,12 +15688,15 @@ void UserStoreServer::onGetUserRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getUser"), + ThriftFieldType::T_STRUCT, + 0); + writeUser(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onGetPublicUserInfoRequestReady( @@ -15540,12 +15799,15 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getPublicUserInfo"), + ThriftFieldType::T_STRUCT, + 0); + writePublicUserInfo(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onGetUserUrlsRequestReady( @@ -15633,12 +15895,15 @@ void UserStoreServer::onGetUserUrlsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getUserUrls"), + ThriftFieldType::T_STRUCT, + 0); + writeUserUrls(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onInviteToBusinessRequestReady( @@ -15725,16 +15990,14 @@ void UserStoreServer::onInviteToBusinessRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("inviteToBusiness"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void UserStoreServer::onRemoveFromBusinessRequestReady( @@ -15836,16 +16099,14 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("removeFromBusiness"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( @@ -15947,16 +16208,14 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( } } - // TODO: implement further - writer.writeFieldBegin( - QLatin1String(), + QStringLiteral("updateBusinessUserIdentifier"), ThriftFieldType::T_VOID, 0); writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); - } void UserStoreServer::onListBusinessUsersRequestReady( @@ -16044,12 +16303,19 @@ void UserStoreServer::onListBusinessUsersRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listBusinessUsers"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeUserProfile(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onListBusinessInvitationsRequestReady( @@ -16137,12 +16403,19 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("listBusinessInvitations"), + ThriftFieldType::T_LIST, + 0); + writer.writeListBegin(ThriftFieldType::T_STRUCT, value.size()); + for(const auto & v: qAsConst(value)) { + writeBusinessInvitation(writer, v); + } + writer.writeListEnd(); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } void UserStoreServer::onGetAccountLimitsRequestReady( @@ -16215,12 +16488,15 @@ void UserStoreServer::onGetAccountLimitsRequestReady( } } - // TODO: implement further + writer.writeFieldBegin( + QStringLiteral("getAccountLimits"), + ThriftFieldType::T_STRUCT, + 0); + writeAccountLimits(writer, value); + writer.writeFieldEnd(); writer.writeStructEnd(); writer.writeMessageEnd(); - - Q_UNUSED(value) } } // namespace qevercloud From d302f45b2751ba191990fd369d83272917687761 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 11 Nov 2019 07:55:20 +0300 Subject: [PATCH 067/188] Start implementing functions generating random values for each of the affected types to use in tests --- QEverCloud/CMakeLists.txt | 1 + QEverCloud/src/tests/Common.cpp | 543 ++++++++++++++++++++++++++++++++ QEverCloud/src/tests/Common.h | 156 +++++++++ 3 files changed, 700 insertions(+) create mode 100644 QEverCloud/src/tests/Common.cpp diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 3b68ff62..855f4909 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -147,6 +147,7 @@ if(Qt5Test_FOUND) src/tests/TestDurableService.h src/tests/TestOptional.h) set(TEST_SOURCES + src/tests/Common.cpp src/tests/TestDurableService.cpp src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp new file mode 100644 index 00000000..5ac252f3 --- /dev/null +++ b/QEverCloud/src/tests/Common.cpp @@ -0,0 +1,543 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#include "Common.h" + +#include + +namespace qevercloud { +namespace tests { + +SyncState generateSyncState() +{ + SyncState state; + state.currentTime = QDateTime::currentMSecsSinceEpoch(); + state.fullSyncBefore = state.currentTime + 100000; + state.updateCount = 10; + state.uploaded = 20000; + state.userLastUpdated = state.currentTime - 20; + state.userMaxMessageEventId = 50000; + + return state; +} + +SyncChunkFilter generateSyncChunkFilter() +{ + SyncChunkFilter filter; + filter.includeNotes = true; + filter.includeNoteResources = false; + filter.includeNoteAttributes = true; + filter.includeNotebooks = false; + filter.includeTags = true; + filter.includeSearches = false; + filter.includeResources = true; + filter.includeLinkedNotebooks = false; + filter.includeExpunged = true; + filter.includeNoteApplicationDataFullMap = false; + filter.includeResourceApplicationDataFullMap = true; + filter.includeNoteResourceApplicationDataFullMap = false; + filter.includeSharedNotes = true; + filter.omitSharedNotebooks = false; + filter.requireNoteContentClass = true; + filter.notebookGuids = QSet() << QStringLiteral("guid1") + << QStringLiteral("guid2") << QStringLiteral("guid3"); + + return filter; +} + +NoteFilter generateNoteFilter() +{ + NoteFilter filter; + filter.order = 5; + filter.ascending = false; + filter.words = QStringLiteral("words"); + filter.notebookGuid = QStringLiteral("notebookGuid"); + filter.tagGuids = QList() << QStringLiteral("tagGuid1") + << QStringLiteral("tagGuid2") << QStringLiteral("tagGuid3"); + filter.timeZone = QStringLiteral("America/Los_Angeles"); + filter.inactive = false; + filter.emphasized = QStringLiteral("emphasized"); + filter.includeAllReadableNotebooks = true; + filter.includeAllReadableWorkspaces = false; + filter.context = QStringLiteral("context"); + filter.rawWords = QStringLiteral("rawWords"); + filter.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); + + return filter; +} + +NotesMetadataResultSpec generateNotesMetadataResultSpec() +{ + NotesMetadataResultSpec spec; + spec.includeTitle = true; + spec.includeContentLength = false; + spec.includeCreated = true; + spec.includeUpdated = false; + spec.includeDeleted = true; + spec.includeUpdateSequenceNum = false; + spec.includeNotebookGuid = true; + spec.includeTagGuids = false; + spec.includeAttributes = true; + spec.includeLargestResourceMime = false; + spec.includeLargestResourceSize = true; + + return spec; +} + +NoteCollectionCounts generateNoteCollectionCounts() +{ + NoteCollectionCounts counts; + + QMap notebookCounts; + notebookCounts[QStringLiteral("notebookGuid1")] = 2; + notebookCounts[QStringLiteral("notebookGuid2")] = 3; + notebookCounts[QStringLiteral("notebookGuid3")] = 4; + counts.notebookCounts = notebookCounts; + + QMap tagCounts; + tagCounts[QStringLiteral("tagGuid1")] = 2; + tagCounts[QStringLiteral("tagGuid2")] = 3; + tagCounts[QStringLiteral("tagGuid3")] = 4; + counts.tagCounts = tagCounts; + + counts.trashCount = 15; + + return counts; +} + +NoteResultSpec generateNoteResultSpec() +{ + NoteResultSpec spec; + spec.includeContent = true; + spec.includeResourcesData = false; + spec.includeResourcesRecognition = true; + spec.includeResourcesAlternateData = false; + spec.includeSharedNotes = true; + spec.includeNoteAppDataValues = false; + spec.includeResourceAppDataValues = true; + spec.includeAccountLimits = false; + + return spec; +} + +NoteVersionId generateNoteVersionId() +{ + NoteVersionId id; + id.updateSequenceNum = 95; + id.updated = QDateTime::currentMSecsSinceEpoch(); + id.saved = id.updated - 100; + id.title = QStringLiteral("title"); + id.lastEditorId = 72; + + return id; +} + +RelatedQuery generateRelatedQuery() +{ + // TODO: implement + return {}; +} + +RelatedResultSpec generateRelatedResultSpec() +{ + // TODO: implement + return {}; +} + +ShareRelationshipRestrictions generateShareRelationshipRestrictions() +{ + // TODO: implement + return {}; +} + +MemberShareRelationship generateMemberShareRelationship() +{ + // TODO: implement + return {}; +} + +NoteShareRelationshipRestrictions generateNoteShareRelationshipRestrictions() +{ + // TODO: implement + return {}; +} + +NoteMemberShareRelationship generateNoteMemberShareRelationship() +{ + // TODO: implement + return {}; +} + +NoteInvitationShareRelationship generateNoteInvitationShareRelationship() +{ + // TODO: implement + return {}; +} + +NoteShareRelationships generateNoteShareRelationships() +{ + // TODO: implement + return {}; +} + +ManageNoteSharesParameters generateManageNoteSharesParameters() +{ + // TODO: implement + return {}; +} + +Data generateData() +{ + // TODO: implement + return {}; +} + +UserAttributes generateUserAttributes() +{ + // TODO: implement + return {}; +} + +BusinessUserAttributes generateBusinessUserAttributes() +{ + // TODO: implement + return {}; +} + +Accounting generateAccounting() +{ + // TODO: implement + return {}; +} + +BusinessUserInfo generateBusinessUserInfo() +{ + // TODO: implement + return {}; +} + +AccountLimits generateAccountLimits() +{ + // TODO: implement + return {}; +} + +User generateUser() +{ + // TODO: implement + return {}; +} + +Contact generateContact() +{ + // TODO: implement + return {}; +} + +Identity generateIdentity() +{ + // TODO: implement + return {}; +} + +Tag generateTag() +{ + // TODO: implement + return {}; +} + +LazyMap generateLazyMap() +{ + // TODO: implement + return {}; +} + +ResourceAttributes generateResourceAttributes() +{ + // TODO: implement + return {}; +} + +Resource generateResource() +{ + // TODO: implement + return {}; +} + +NoteAttributes generateNoteAttributes() +{ + // TODO: implement + return {}; +} + +SharedNote generateSharedNote() +{ + // TODO: implement + return {}; +} + +NoteRestrictions generateNoteRestrictions() +{ + // TODO: implement + return {}; +} + +NoteLimits generateNoteLimits() +{ + // TODO: implement + return {}; +} + +Note generateNote() +{ + // TODO: implement + return {}; +} + +Publishing generatePublishing() +{ + // TODO: implement + return {}; +} + +BusinessNotebook generateBusinessNotebook() +{ + // TODO: implement + return {}; +} + +SavedSearchScope generateSavedSearchScope() +{ + // TODO: implement + return {}; +} + +SavedSearch generateSavedSearch() +{ + // TODO: implement + return {}; +} + +SharedNotebookRecipientSettings generateSharedNotebookRecipientSettings() +{ + // TODO: implement + return {}; +} + +NotebookRecipientSettings generateNotebookRecipientSettings() +{ + // TODO: implement + return {}; +} + +SharedNotebook generateSharedNotebook() +{ + // TODO: implement + return {}; +} + +CanMoveToContainerRestrictions generateCanMoveToContainerRestrictions() +{ + // TODO: implement + return {}; +} + +NotebookRestrictions generateNotebookRestrictions() +{ + // TODO: implement + return {}; +} + +Notebook generateNotebook() +{ + // TODO: implement + return {}; +} + +LinkedNotebook generateLinkedNotebook() +{ + // TODO: implement + return {}; +} + +NotebookDescriptor generateNotebookDescriptor() +{ + // TODO: implement + return {}; +} + +UserProfile generateUserProfile() +{ + // TODO: implement + return {}; +} + +RelatedContentImage generateRelatedContentImage() +{ + // TODO: implement + return {}; +} + +RelatedContent generateRelatedContent() +{ + // TODO: implement + return {}; +} + +BusinessInvitation generateBusinessInvitation() +{ + // TODO: implement + return {}; +} + +UserIdentity generateUserIdentity() +{ + // TODO: implement + return {}; +} + +PublicUserInfo generatePublicUserInfo() +{ + // TODO: implement + return {}; +} + +UserUrls generateUserUrls() +{ + // TODO: implement + return {}; +} + +AuthenticationResult generateAuthenticationResult() +{ + // TODO: implement + return {}; +} + +BootstrapSettings generateBootstrapSettings() +{ + // TODO: implement + return {}; +} + +BootstrapProfile generateBootstrapProfile() +{ + // TODO: implement + return {}; +} + +BootstrapInfo generateBootstrapInfo() +{ + // TODO: implement + return {}; +} + +SyncChunk generateSyncChunk() +{ + // TODO: implement + return {}; +} + +NoteList generateNoteList() +{ + // TODO: implement + return {}; +} + +NoteMetadata generateNoteMetadata() +{ + // TODO: implement + return {}; +} + +NotesMetadataList generateNotesMetadataList() +{ + // TODO: implement + return {}; +} + +NoteEmailParameters generateNoteEmailParameters() +{ + // TODO: implement + return {}; +} + +RelatedResult generateRelatedResult() +{ + // TODO: implement + return {}; +} + +UpdateNoteIfUsnMatchesResult generateUpdateNoteIfUsnMatchesResult() +{ + // TODO: implement + return {}; +} + +InvitationShareRelationship generateInvitationShareRelationship() +{ + // TODO: implement + return {}; +} + +ShareRelationships generateShareRelationships() +{ + // TODO: implement + return {}; +} + +ManageNotebookSharesParameters generateManageNotebookSharesParameters() +{ + // TODO: implement + return {}; +} + +ManageNotebookSharesError generateManageNotebookSharesError() +{ + // TODO: implement + return {}; +} + +ManageNotebookSharesResult generateManageNotebookSharesResult() +{ + // TODO: implement + return {}; +} + +SharedNoteTemplate generateSharedNoteTemplate() +{ + // TODO: implement + return {}; +} + +NotebookShareTemplate generateNotebookShareTemplate() +{ + // TODO: implement + return {}; +} + +CreateOrUpdateNotebookSharesResult generateCreateOrUpdateNotebookSharesResult() +{ + // TODO: implement + return {}; +} + +ManageNoteSharesError generateManageNoteSharesError() +{ + // TODO: implement + return {}; +} + +ManageNoteSharesResult generateManageNoteSharesResult() +{ + // TODO: implement + return {}; +} + +} // namespace tests +} // namespace qevercloud diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index ea5117ae..d453bd33 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -9,6 +9,8 @@ #ifndef QEVERCLOUD_TEST_COMMON_H #define QEVERCLOUD_TEST_COMMON_H +#include + #ifdef QEVERCLOUD_SHARED_LIBRARY #undef QEVERCLOUD_SHARED_LIBRARY #endif @@ -17,4 +19,158 @@ #undef QEVERCLOUD_STATIC_LIBRARY #endif +namespace qevercloud { +namespace tests { + +SyncState generateSyncState(); + +SyncChunkFilter generateSyncChunkFilter(); + +NoteFilter generateNoteFilter(); + +NotesMetadataResultSpec generateNotesMetadataResultSpec(); + +NoteCollectionCounts generateNoteCollectionCounts(); + +NoteResultSpec generateNoteResultSpec(); + +NoteVersionId generateNoteVersionId(); + +RelatedQuery generateRelatedQuery(); + +RelatedResultSpec generateRelatedResultSpec(); + +ShareRelationshipRestrictions generateShareRelationshipRestrictions(); + +MemberShareRelationship generateMemberShareRelationship(); + +NoteShareRelationshipRestrictions generateNoteShareRelationshipRestrictions(); + +NoteMemberShareRelationship generateNoteMemberShareRelationship(); + +NoteInvitationShareRelationship generateNoteInvitationShareRelationship(); + +NoteShareRelationships generateNoteShareRelationships(); + +ManageNoteSharesParameters generateManageNoteSharesParameters(); + +Data generateData(); + +UserAttributes generateUserAttributes(); + +BusinessUserAttributes generateBusinessUserAttributes(); + +Accounting generateAccounting(); + +BusinessUserInfo generateBusinessUserInfo(); + +AccountLimits generateAccountLimits(); + +User generateUser(); + +Contact generateContact(); + +Identity generateIdentity(); + +Tag generateTag(); + +LazyMap generateLazyMap(); + +ResourceAttributes generateResourceAttributes(); + +Resource generateResource(); + +NoteAttributes generateNoteAttributes(); + +SharedNote generateSharedNote(); + +NoteRestrictions generateNoteRestrictions(); + +NoteLimits generateNoteLimits(); + +Note generateNote(); + +Publishing generatePublishing(); + +BusinessNotebook generateBusinessNotebook(); + +SavedSearchScope generateSavedSearchScope(); + +SavedSearch generateSavedSearch(); + +SharedNotebookRecipientSettings generateSharedNotebookRecipientSettings(); + +NotebookRecipientSettings generateNotebookRecipientSettings(); + +SharedNotebook generateSharedNotebook(); + +CanMoveToContainerRestrictions generateCanMoveToContainerRestrictions(); + +NotebookRestrictions generateNotebookRestrictions(); + +Notebook generateNotebook(); + +LinkedNotebook generateLinkedNotebook(); + +NotebookDescriptor generateNotebookDescriptor(); + +UserProfile generateUserProfile(); + +RelatedContentImage generateRelatedContentImage(); + +RelatedContent generateRelatedContent(); + +BusinessInvitation generateBusinessInvitation(); + +UserIdentity generateUserIdentity(); + +PublicUserInfo generatePublicUserInfo(); + +UserUrls generateUserUrls(); + +AuthenticationResult generateAuthenticationResult(); + +BootstrapSettings generateBootstrapSettings(); + +BootstrapProfile generateBootstrapProfile(); + +BootstrapInfo generateBootstrapInfo(); + +SyncChunk generateSyncChunk(); + +NoteList generateNoteList(); + +NoteMetadata generateNoteMetadata(); + +NotesMetadataList generateNotesMetadataList(); + +NoteEmailParameters generateNoteEmailParameters(); + +RelatedResult generateRelatedResult(); + +UpdateNoteIfUsnMatchesResult generateUpdateNoteIfUsnMatchesResult(); + +InvitationShareRelationship generateInvitationShareRelationship(); + +ShareRelationships generateShareRelationships(); + +ManageNotebookSharesParameters generateManageNotebookSharesParameters(); + +ManageNotebookSharesError generateManageNotebookSharesError(); + +ManageNotebookSharesResult generateManageNotebookSharesResult(); + +SharedNoteTemplate generateSharedNoteTemplate(); + +NotebookShareTemplate generateNotebookShareTemplate(); + +CreateOrUpdateNotebookSharesResult generateCreateOrUpdateNotebookSharesResult(); + +ManageNoteSharesError generateManageNoteSharesError(); + +ManageNoteSharesResult generateManageNoteSharesResult(); + +} // namespace tests +} // namespace qevercloud + #endif // QEVERCLOUD_TEST_COMMON_H From d387922cfe13bfe3bd42734fd3b184b7014efa6e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 12 Nov 2019 07:06:55 +0300 Subject: [PATCH 068/188] Update generated code --- QEverCloud/headers/generated/Types.h | 78 ---------------------------- 1 file changed, 78 deletions(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 27589949..10ccb937 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -171,7 +171,6 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable { return !(*this == other); } - }; /** @@ -310,7 +309,6 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { return !(*this == other); } - }; /** @@ -424,7 +422,6 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { return !(*this == other); } - }; /** @@ -487,7 +484,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { return !(*this == other); } - }; /** @@ -529,7 +525,6 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { return !(*this == other); } - }; /** @@ -599,7 +594,6 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { return !(*this == other); } - }; /** @@ -656,7 +650,6 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { return !(*this == other); } - }; /** @@ -728,7 +721,6 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { return !(*this == other); } - }; /** @@ -818,7 +810,6 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { return !(*this == other); } - }; /** NO DOC COMMENT ID FOUND */ @@ -848,7 +839,6 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { return !(*this == other); } - }; /** @@ -917,7 +907,6 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { return !(*this == other); } - }; /** @@ -958,7 +947,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { return !(*this == other); } - }; /** @@ -1015,7 +1003,6 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { return !(*this == other); } - }; /** @@ -1066,7 +1053,6 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { return !(*this == other); } - }; /** @@ -1106,7 +1092,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { return !(*this == other); } - }; /** @@ -1166,7 +1151,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { return !(*this == other); } - }; /** @@ -1213,7 +1197,6 @@ struct QEVERCLOUD_EXPORT Data: public Printable { return !(*this == other); } - }; /** @@ -1467,7 +1450,6 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { return !(*this == other); } - }; /** @@ -1525,7 +1507,6 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { return !(*this == other); } - }; /** @@ -1677,7 +1658,6 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable { return !(*this == other); } - }; /** @@ -1730,7 +1710,6 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { return !(*this == other); } - }; /** @@ -1815,7 +1794,6 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { return !(*this == other); } - }; /** @@ -1967,7 +1945,6 @@ struct QEVERCLOUD_EXPORT User: public Printable { return !(*this == other); } - }; /** @@ -2035,7 +2012,6 @@ struct QEVERCLOUD_EXPORT Contact: public Printable { return !(*this == other); } - }; /** @@ -2116,7 +2092,6 @@ struct QEVERCLOUD_EXPORT Identity: public Printable { return !(*this == other); } - }; /** @@ -2182,7 +2157,6 @@ struct QEVERCLOUD_EXPORT Tag: public Printable { return !(*this == other); } - }; /** @@ -2229,7 +2203,6 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable { return !(*this == other); } - }; /** @@ -2337,7 +2310,6 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { return !(*this == other); } - }; /** @@ -2446,7 +2418,6 @@ struct QEVERCLOUD_EXPORT Resource: public Printable { return !(*this == other); } - }; /** @@ -2694,7 +2665,6 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { return !(*this == other); } - }; /** @@ -2750,7 +2720,6 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable { return !(*this == other); } - }; /** @@ -2828,7 +2797,6 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { return !(*this == other); } - }; /** @@ -2868,7 +2836,6 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { return !(*this == other); } - }; /** @@ -3049,7 +3016,6 @@ struct QEVERCLOUD_EXPORT Note: public Printable { return !(*this == other); } - }; /** @@ -3109,7 +3075,6 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable { return !(*this == other); } - }; /** @@ -3157,7 +3122,6 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { return !(*this == other); } - }; /** @@ -3196,7 +3160,6 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { return !(*this == other); } - }; /** @@ -3273,7 +3236,6 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { return !(*this == other); } - }; /** @@ -3320,7 +3282,6 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { return !(*this == other); } - }; /** @@ -3385,7 +3346,6 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { return !(*this == other); } - }; /** @@ -3522,7 +3482,6 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { return !(*this == other); } - }; /** @@ -3545,7 +3504,6 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { return !(*this == other); } - }; /** @@ -3746,7 +3704,6 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { return !(*this == other); } - }; /** @@ -3900,7 +3857,6 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable { return !(*this == other); } - }; /** @@ -4006,7 +3962,6 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { return !(*this == other); } - }; /** @@ -4055,7 +4010,6 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { return !(*this == other); } - }; /** @@ -4127,7 +4081,6 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable { return !(*this == other); } - }; /** @@ -4175,7 +4128,6 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { return !(*this == other); } - }; /** @@ -4284,7 +4236,6 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { return !(*this == other); } - }; /** @@ -4348,7 +4299,6 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { return !(*this == other); } - }; /** @@ -4403,7 +4353,6 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { return !(*this == other); } - }; /** @@ -4456,7 +4405,6 @@ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { return !(*this == other); } - }; /** @@ -4524,7 +4472,6 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable { return !(*this == other); } - }; /** @@ -4613,7 +4560,6 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { return !(*this == other); } - }; /** @@ -4710,7 +4656,6 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { return !(*this == other); } - }; /** @@ -4741,7 +4686,6 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { return !(*this == other); } - }; /** @@ -4767,7 +4711,6 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { return !(*this == other); } - }; /** @@ -4814,7 +4757,6 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin { return !(*this == other); } - }; /** @@ -4859,7 +4801,6 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr { return !(*this == other); } - }; /** @@ -4901,7 +4842,6 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public { return !(*this == other); } - }; /** @@ -4954,7 +4894,6 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, { return !(*this == other); } - }; /** @@ -5076,7 +5015,6 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { return !(*this == other); } - }; /** @@ -5153,7 +5091,6 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable { return !(*this == other); } - }; /** @@ -5224,7 +5161,6 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { return !(*this == other); } - }; /** @@ -5305,7 +5241,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { return !(*this == other); } - }; /** @@ -5369,7 +5304,6 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { return !(*this == other); } - }; /** @@ -5481,7 +5415,6 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { return !(*this == other); } - }; /** @@ -5518,7 +5451,6 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { return !(*this == other); } - }; /** @@ -5572,7 +5504,6 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { return !(*this == other); } - }; /** @@ -5619,7 +5550,6 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { return !(*this == other); } - }; /** @@ -5691,7 +5621,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { return !(*this == other); } - }; /** @@ -5739,7 +5668,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { return !(*this == other); } - }; /** @@ -5767,7 +5695,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { return !(*this == other); } - }; /** @@ -5815,7 +5742,6 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { return !(*this == other); } - }; /** @@ -5863,7 +5789,6 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { return !(*this == other); } - }; /** @@ -5897,7 +5822,6 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { return !(*this == other); } - }; /** @@ -5952,7 +5876,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { return !(*this == other); } - }; /** @@ -5980,7 +5903,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { return !(*this == other); } - }; } // namespace qevercloud From f4ffdd31f771ac8d84cfa1e9f8ca71568159950e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 12 Nov 2019 07:51:46 +0300 Subject: [PATCH 069/188] Implement some of test data generators --- QEverCloud/src/tests/Common.cpp | 423 ++++++++++++++++++++++++++++---- 1 file changed, 369 insertions(+), 54 deletions(-) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 5ac252f3..748c5073 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -8,8 +8,11 @@ #include "Common.h" +#include #include +#include + namespace qevercloud { namespace tests { @@ -139,164 +142,476 @@ NoteVersionId generateNoteVersionId() RelatedQuery generateRelatedQuery() { - // TODO: implement - return {}; + RelatedQuery query; + query.noteGuid = QStringLiteral("noteGuid"); + query.plainText = QStringLiteral("plainText"); + query.filter = generateNoteFilter(); + query.referenceUri = QStringLiteral("referenceUri"); + query.context = QStringLiteral("context"); + query.cacheKey = QStringLiteral("cacheKey"); + + return query; } RelatedResultSpec generateRelatedResultSpec() { - // TODO: implement - return {}; + RelatedResultSpec spec; + spec.maxNotes = 30; + spec.maxNotebooks = 10; + spec.maxTags = 20; + spec.writableNotebooksOnly = false; + spec.includeContainingNotebooks = true; + spec.includeDebugInfo = false; + spec.maxExperts = 5; + spec.maxRelatedContent = 3; + spec.relatedContentTypes = QSet() + << RelatedContentType::NEWS_ARTICLE + << RelatedContentType::PROFILE_ORGANIZATION + << RelatedContentType::PROFILE_PERSON; + + return spec; } ShareRelationshipRestrictions generateShareRelationshipRestrictions() { - // TODO: implement - return {}; + ShareRelationshipRestrictions r; + r.noSetReadOnly = false; + r.noSetReadPlusActivity = true; + r.noSetModify = false; + r.noSetFullAccess = true; + + return r; } MemberShareRelationship generateMemberShareRelationship() { - // TODO: implement - return {}; + MemberShareRelationship r; + r.displayName = QStringLiteral("displayName"); + r.recipientUserId = 5; + r.bestPrivilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; + r.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; + r.restrictions = generateShareRelationshipRestrictions(); + r.sharerUserId = 10; + + return r; } NoteShareRelationshipRestrictions generateNoteShareRelationshipRestrictions() { - // TODO: implement - return {}; + NoteShareRelationshipRestrictions r; + r.noSetReadNote = false; + r.noSetModifyNote = true; + r.noSetFullAccess = false; + + return r; } NoteMemberShareRelationship generateNoteMemberShareRelationship() { - // TODO: implement - return {}; + NoteMemberShareRelationship r; + r.displayName = QStringLiteral("displayName"); + r.recipientUserId = 7; + r.privilege = SharedNotePrivilegeLevel::READ_NOTE; + r.restrictions = generateNoteShareRelationshipRestrictions(); + r.sharerUserId = 19; + + return r; } NoteInvitationShareRelationship generateNoteInvitationShareRelationship() { - // TODO: implement - return {}; + NoteInvitationShareRelationship r; + r.displayName = QStringLiteral("displayName"); + r.recipientIdentityId = 124; + r.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + r.sharerUserId = 231; + + return r; } NoteShareRelationships generateNoteShareRelationships() { - // TODO: implement - return {}; + NoteShareRelationships r; + r.invitations = QList() + << generateNoteInvitationShareRelationship(); + r.memberships = QList() + << generateNoteMemberShareRelationship(); + r.invitationRestrictions = generateNoteShareRelationshipRestrictions(); + + return r; } ManageNoteSharesParameters generateManageNoteSharesParameters() { - // TODO: implement - return {}; + ManageNoteSharesParameters p; + p.noteGuid = QStringLiteral("noteGuid"); + p.membershipsToUpdate = QList() + << generateNoteMemberShareRelationship(); + p.invitationsToUpdate = QList() + << generateNoteInvitationShareRelationship(); + p.membershipsToUnshare = QList() << 27 << 81 << 32; + p.invitationsToUnshare = QList() << 22 << 46 << 73; + + return p; } Data generateData() { - // TODO: implement - return {}; + Data data; + data.body = QString(QStringLiteral("data body ") + QString::number(rand() % 101)).toUtf8(); + data.size = data.body->size(); + data.bodyHash = QCryptographicHash::hash(data.body.ref(), QCryptographicHash::Md5); + + return data; } UserAttributes generateUserAttributes() { - // TODO: implement - return {}; + UserAttributes a; + a.defaultLocationName = QStringLiteral("defaultLocationName"); + a.defaultLatitude = 0.1; + a.defaultLongitude = 0.2; + a.preactivation = false; + a.viewedPromotions = QStringList() + << QStringLiteral("viewedPromotion1") + << QStringLiteral("viewedPromotion2") + << QStringLiteral("viewedPromotion3"); + a.incomingEmailAddress = QStringLiteral("incomingEmailAddress"); + a.recentMailedAddresses = QStringList() + << QStringLiteral("recentMailedAddress1") + << QStringLiteral("recentMailedAddress2") + << QStringLiteral("recentMailedAddress3"); + a.comments = QStringLiteral("comments"); + a.dateAgreedToTermsOfService = QDateTime::currentMSecsSinceEpoch(); + a.maxReferrals = 11; + a.referralCount = 9; + a.refererCode = QStringLiteral("refererCode"); + a.sentEmailDate = QDateTime::currentMSecsSinceEpoch(); + a.sentEmailCount = 8; + a.dailyEmailLimit = 22; + a.emailOptOutDate = QDateTime::currentMSecsSinceEpoch(); + a.partnerEmailOptInDate = QDateTime::currentMSecsSinceEpoch(); + a.preferredLanguage = QStringLiteral("en"); + a.preferredCountry = QStringLiteral("US"); + a.clipFullPage = false; + a.twitterUserName = QStringLiteral("twitterUserName"); + a.twitterId = QStringLiteral("twitterId"); + a.groupName = QStringLiteral("groupName"); + a.recognitionLanguage = QStringLiteral("ru"); + a.referralProof = QStringLiteral("referralProof"); + a.educationalDiscount = false; + a.businessAddress = QStringLiteral("businessAddress"); + a.hideSponsorBilling = true; + a.useEmailAutoFiling = false; + a.reminderEmailConfig = ReminderEmailConfig::DO_NOT_SEND; + a.passwordUpdated = QDateTime::currentMSecsSinceEpoch(); + a.salesforcePushEnabled = false; + a.shouldLogClientEvent = true; + a.optOutMachineLearning = false; + + return a; } BusinessUserAttributes generateBusinessUserAttributes() { - // TODO: implement - return {}; + BusinessUserAttributes a; + a.title = QStringLiteral("title"); + a.location = QStringLiteral("location"); + a.department = QStringLiteral("department"); + a.mobilePhone = QStringLiteral("mobilePhone"); + a.linkedInProfileUrl = QStringLiteral("linkedInProfileUrl"); + a.workPhone = QStringLiteral("workPhone"); + a.companyStartDate = QDateTime::currentMSecsSinceEpoch(); + + return a; } Accounting generateAccounting() { - // TODO: implement - return {}; + Accounting a; + a.uploadLimitEnd = QDateTime::currentMSecsSinceEpoch() + 10000; + a.uploadLimitNextMonth = 700; + a.premiumServiceStatus = PremiumOrderStatus::PENDING; + a.premiumOrderNumber = QStringLiteral("premiumOrderNumber"); + a.premiumCommerceService = QStringLiteral("premiumCommerceService"); + a.premiumServiceStart = QDateTime::currentMSecsSinceEpoch(); + a.premiumServiceSKU = QStringLiteral("premiumServiceSKU"); + a.lastSuccessfulCharge = QDateTime::currentMSecsSinceEpoch(); + a.lastFailedCharge = QDateTime::currentMSecsSinceEpoch(); + a.lastFailedChargeReason = QStringLiteral("lastFailedChargeReason"); + a.nextPaymentDue = QDateTime::currentMSecsSinceEpoch() + 200; + a.premiumLockUntil = QDateTime::currentMSecsSinceEpoch() + 100; + a.updated = QDateTime::currentMSecsSinceEpoch() + 50; + a.premiumSubscriptionNumber = QStringLiteral("premiumSubscriptionNumber"); + a.lastRequestedCharge = QDateTime::currentMSecsSinceEpoch() - 50; + a.currency = QStringLiteral("currency"); + a.unitPrice = 19; + a.businessId = 21; + a.businessName = QStringLiteral("businessName"); + a.businessRole = BusinessUserRole::NORMAL; + a.unitDiscount = 14; + a.nextChargeDate = QDateTime::currentMSecsSinceEpoch() + 400; + a.availablePoints = 11; + + return a; } BusinessUserInfo generateBusinessUserInfo() { - // TODO: implement - return {}; + BusinessUserInfo info; + info.businessId = 13; + info.businessName = QStringLiteral("businessName"); + info.role = BusinessUserRole::NORMAL; + info.email = QStringLiteral("email"); + info.updated = QDateTime::currentMSecsSinceEpoch(); + + return info; } AccountLimits generateAccountLimits() { - // TODO: implement - return {}; + AccountLimits limits; + limits.userMailLimitDaily = 9; + limits.noteSizeMax = 300; + limits.resourceSizeMax = 200; + limits.userLinkedNotebookMax = 30; + limits.uploadLimit = 500; + limits.userNoteCountMax = 40; + limits.userNotebookCountMax = 35; + limits.userTagCountMax = 45; + limits.noteTagCountMax = 20; + limits.userSavedSearchesMax = 50; + limits.noteResourceCountMax = 60; + + return limits; } User generateUser() { - // TODO: implement - return {}; + User user; + user.id = 19; + user.username = QStringLiteral("username"); + user.email = QStringLiteral("email"); + user.name = QStringLiteral("name"); + user.timezone = QStringLiteral("America/Los_Angeles"); + user.privilege = PrivilegeLevel::MANAGER; + user.serviceLevel = ServiceLevel::BASIC; + user.created = QDateTime::currentMSecsSinceEpoch(); + user.updated = QDateTime::currentMSecsSinceEpoch(); + user.deleted = QDateTime::currentMSecsSinceEpoch(); + user.active = true; + user.shardId = QStringLiteral("shardId"); + user.attributes = generateUserAttributes(); + user.accounting = generateAccounting(); + user.businessUserInfo = generateBusinessUserInfo(); + user.photoUrl = QStringLiteral("photoUrl"); + user.photoLastUpdated = QDateTime::currentMSecsSinceEpoch(); + user.accountLimits = generateAccountLimits(); + + return user; } Contact generateContact() { - // TODO: implement - return {}; + Contact contact; + contact.name = QStringLiteral("name"); + contact.id = QStringLiteral("id"); + contact.type = ContactType::EVERNOTE; + contact.photoUrl = QStringLiteral("photoUrl"); + contact.photoLastUpdated = QDateTime::currentMSecsSinceEpoch() - 20; + contact.messagingPermit = QStringLiteral("messagingPermit").toUtf8(); + contact.messagingPermitExpires = QDateTime::currentMSecsSinceEpoch(); + + return contact; } Identity generateIdentity() { - // TODO: implement - return {}; + Identity identity; + identity.id = 200; + identity.contact = generateContact(); + identity.userId = 30; + identity.deactivated = false; + identity.sameBusiness = true; + identity.blocked = false; + identity.userConnected = true; + identity.eventId = 341; + + return identity; } Tag generateTag() { - // TODO: implement - return {}; + Tag tag; + tag.guid = QStringLiteral("guid"); + tag.name = QStringLiteral("name"); + tag.parentGuid = QStringLiteral("parentGuid"); + tag.updateSequenceNum = 30; + + return tag; } LazyMap generateLazyMap() { - // TODO: implement - return {}; + LazyMap lazyMap; + + QSet keysOnly; + keysOnly << QStringLiteral("key1"); + keysOnly << QStringLiteral("key2"); + keysOnly << QStringLiteral("key3"); + lazyMap.keysOnly = keysOnly; + + QMap fullMap; + fullMap[QStringLiteral("key1")] = QStringLiteral("value1"); + fullMap[QStringLiteral("key2")] = QStringLiteral("value2"); + fullMap[QStringLiteral("key3")] = QStringLiteral("value3"); + lazyMap.fullMap = fullMap; + + return lazyMap; } ResourceAttributes generateResourceAttributes() { - // TODO: implement - return {}; + ResourceAttributes a; + a.sourceURL = QStringLiteral("sourceURL"); + a.timestamp = QDateTime::currentMSecsSinceEpoch(); + a.latitude = 0.1; + a.longitude = 0.2; + a.altitude = 0.3; + a.cameraMake = QStringLiteral("cameraMake"); + a.clientWillIndex = false; + a.recoType = QStringLiteral("recoType"); + a.fileName = QStringLiteral("fileName"); + a.attachment = false; + a.applicationData = generateLazyMap(); + + return a; } Resource generateResource() { - // TODO: implement - return {}; + Resource r; + r.guid = QStringLiteral("guid"); + r.noteGuid = QStringLiteral("noteGuid"); + r.data = generateData(); + r.mime = QStringLiteral("mime"); + r.width = 23; + r.height = 19; + r.duration = 13; + r.active = true; + r.recognition = generateData(); + r.attributes = generateResourceAttributes(); + r.updateSequenceNum = 31; + r.alternateData = generateData(); + + return r; } NoteAttributes generateNoteAttributes() { - // TODO: implement - return {}; + NoteAttributes a; + a.subjectDate = QDateTime::currentMSecsSinceEpoch(); + a.latitude = 0.1; + a.longitude = 0.2; + a.altitude = 0.3; + a.author = QStringLiteral("author"); + a.source = QStringLiteral("source"); + a.sourceURL = QStringLiteral("sourceURL"); + a.sourceApplication = QStringLiteral("sourceApplication"); + a.shareDate = QDateTime::currentMSecsSinceEpoch() - 20; + a.reminderOrder = 20; + a.reminderDoneTime = QDateTime::currentMSecsSinceEpoch() - 300; + a.reminderTime = QDateTime::currentMSecsSinceEpoch() - 100; + a.placeName = QStringLiteral("placeName"); + a.contentClass = QStringLiteral("contentClass"); + a.applicationData = generateLazyMap(); + a.lastEditedBy = QStringLiteral("lastEditedBy"); + + QMap classifications; + classifications[QStringLiteral("key1")] = QStringLiteral("value1"); + classifications[QStringLiteral("key2")] = QStringLiteral("value2"); + classifications[QStringLiteral("key3")] = QStringLiteral("value3"); + a.classifications = classifications; + + a.creatorId = 18; + a.lastEditorId = 16; + a.sharedWithBusiness = false; + a.conflictSourceNoteGuid = QStringLiteral("conflictSourceNoteGuid"); + a.noteTitleQuality = 2; + + return a; } SharedNote generateSharedNote() { - // TODO: implement - return {}; + SharedNote n; + n.sharerUserID = 19; + n.recipientIdentity = generateIdentity(); + n.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + n.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 20; + n.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 10; + n.serviceAssigned = QDateTime::currentMSecsSinceEpoch(); + + return n; } NoteRestrictions generateNoteRestrictions() { - // TODO: implement - return {}; + NoteRestrictions r; + r.noUpdateTitle = true; + r.noUpdateContent = false; + r.noEmail = true; + r.noShare = false; + r.noSharePublicly = true; + + return r; } NoteLimits generateNoteLimits() { - // TODO: implement - return {}; + NoteLimits limits; + limits.noteResourceCountMax = 10; + limits.uploadLimit = 100; + limits.resourceSizeMax = 20; + limits.noteSizeMax = 40; + limits.uploaded = 50; + + return limits; } Note generateNote() { - // TODO: implement - return {}; + Note note; + note.guid = QStringLiteral("guid"); + note.title = QStringLiteral("title"); + note.content = QStringLiteral("content"); + note.contentHash = QCryptographicHash::hash( + note.content.ref().toUtf8(), + QCryptographicHash::Md5); + note.contentLength = note.content->size(); + note.created = QDateTime::currentMSecsSinceEpoch() - 20; + note.updated = QDateTime::currentMSecsSinceEpoch() - 10; + note.deleted = QDateTime::currentMSecsSinceEpoch(); + note.active = true; + note.updateSequenceNum = 20; + note.notebookGuid = QStringLiteral("notebookGuid"); + note.tagGuids = QList() + << QStringLiteral("tagGuid1") + << QStringLiteral("tagGuid2") + << QStringLiteral("tagGuid3"); + note.resources = QList() + << generateResource(); + note.attributes = generateNoteAttributes(); + note.tagNames = QStringList() + << QStringLiteral("tagName1") + << QStringLiteral("tagName2") + << QStringLiteral("tagName3"); + note.sharedNotes = QList() + << generateSharedNote(); + note.restrictions = generateNoteRestrictions(); + note.limits = generateNoteLimits(); + + return note; } Publishing generatePublishing() From 0d127450bd8f90eb52b2cb3fb9ee58195b04651c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 13 Nov 2019 07:55:32 +0300 Subject: [PATCH 070/188] Implement the rest of test data generators --- QEverCloud/src/tests/Common.cpp | 519 +++++++++++++++++++++++++++----- 1 file changed, 439 insertions(+), 80 deletions(-) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 748c5073..6f528636 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -616,242 +616,601 @@ Note generateNote() Publishing generatePublishing() { - // TODO: implement - return {}; + Publishing p; + p.uri = QStringLiteral("uri"); + p.order = NoteSortOrder::UPDATED; + p.ascending = true; + p.publicDescription = QStringLiteral("publicDescription"); + + return p; } BusinessNotebook generateBusinessNotebook() { - // TODO: implement - return {}; + BusinessNotebook notebook; + notebook.notebookDescription = QStringLiteral("notebookDescription"); + notebook.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK; + notebook.recommended = true; + + return notebook; } SavedSearchScope generateSavedSearchScope() { - // TODO: implement - return {}; + SavedSearchScope scope; + scope.includeAccount = true; + scope.includePersonalLinkedNotebooks = true; + scope.includeBusinessLinkedNotebooks = false; + + return scope; } SavedSearch generateSavedSearch() { - // TODO: implement - return {}; + SavedSearch search; + search.guid = QStringLiteral("guid"); + search.name = QStringLiteral("name"); + search.query = QStringLiteral("query"); + search.format = QueryFormat::USER; + search.updateSequenceNum = 13; + search.scope = generateSavedSearchScope(); + + return search; } SharedNotebookRecipientSettings generateSharedNotebookRecipientSettings() { - // TODO: implement - return {}; + SharedNotebookRecipientSettings s; + s.reminderNotifyEmail = true; + s.reminderNotifyInApp = false; + + return s; } NotebookRecipientSettings generateNotebookRecipientSettings() { - // TODO: implement - return {}; + NotebookRecipientSettings s; + s.reminderNotifyEmail = true; + s.reminderNotifyInApp = false; + s.inMyList = true; + s.stack = QStringLiteral("stack"); + s.recipientStatus = RecipientStatus::IN_MY_LIST; + + return s; } SharedNotebook generateSharedNotebook() { - // TODO: implement - return {}; + SharedNotebook notebook; + notebook.id = 201; + notebook.userId = 102; + notebook.notebookGuid = QStringLiteral("notebookGuid"); + notebook.email = QStringLiteral("email"); + notebook.recipientIdentityId = 172; + notebook.notebookModifiable = true; + notebook.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 200; + notebook.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 100; + notebook.globalId = QStringLiteral("globalId"); + notebook.username = QStringLiteral("username"); + notebook.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; + notebook.recipientSettings = generateSharedNotebookRecipientSettings(); + notebook.sharerUserId = 314; + notebook.recipientUsername = QStringLiteral("recipientUsername"); + notebook.recipientUserId = 635; + notebook.serviceAssigned = QDateTime::currentMSecsSinceEpoch() - 50; + + return notebook; } CanMoveToContainerRestrictions generateCanMoveToContainerRestrictions() { - // TODO: implement - return {}; + CanMoveToContainerRestrictions r; + r.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; + + return r; } NotebookRestrictions generateNotebookRestrictions() { - // TODO: implement - return {}; + NotebookRestrictions r; + r.noReadNotes = true; + r.noCreateNotes = false; + r.noUpdateNotes = false; + r.noExpungeNotes = true; + r.noShareNotes = false; + r.noEmailNotes = true; + r.noSendMessageToRecipients = false; + r.noUpdateNotebook = true; + r.noExpungeNotebook = false; + r.noSetDefaultNotebook = true; + r.noSetNotebookStack = false; + r.noPublishToPublic = true; + r.noPublishToBusinessLibrary = false; + r.noCreateTags = true; + r.noUpdateTags = false; + r.noExpungeTags = true; + r.noSetParentTag = true; + r.noCreateSharedNotebooks = false; + r.updateWhichSharedNotebookRestrictions = + SharedNotebookInstanceRestrictions::ASSIGNED; + r.expungeWhichSharedNotebookRestrictions = + SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; + r.noShareNotesWithBusiness = false; + r.noRenameNotebook = true; + r.noSetInMyList = false; + r.noChangeContact = true; + r.canMoveToContainerRestrictions = generateCanMoveToContainerRestrictions(); + r.noSetReminderNotifyEmail = true; + r.noSetReminderNotifyInApp = false; + r.noSetRecipientSettingsStack = true; + r.noCanMoveNote = false; + + return r; } Notebook generateNotebook() { - // TODO: implement - return {}; + Notebook notebook; + notebook.guid = QStringLiteral("guid"); + notebook.name = QStringLiteral("name"); + notebook.updateSequenceNum = 31; + notebook.defaultNotebook = false; + notebook.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 200; + notebook.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 100; + notebook.publishing = generatePublishing(); + notebook.published = true; + notebook.stack = QStringLiteral("stack"); + notebook.sharedNotebookIds = QList() << 45; + notebook.sharedNotebooks = QList() + << generateSharedNotebook(); + notebook.businessNotebook = generateBusinessNotebook(); + notebook.contact = generateUser(); + notebook.restrictions = generateNotebookRestrictions(); + notebook.recipientSettings = generateNotebookRecipientSettings(); + + return notebook; } LinkedNotebook generateLinkedNotebook() { - // TODO: implement - return {}; + LinkedNotebook notebook; + notebook.shareName = QStringLiteral("shareName"); + notebook.username = QStringLiteral("username"); + notebook.shardId = QStringLiteral("shardId"); + notebook.sharedNotebookGlobalId = QStringLiteral("sharedNotebookGlobalId"); + notebook.uri = QStringLiteral("uri"); + notebook.guid = QStringLiteral("guid"); + notebook.updateSequenceNum = 823; + notebook.noteStoreUrl = QStringLiteral("noteStoreUrl"); + notebook.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); + notebook.stack = QStringLiteral("stack"); + notebook.businessId = 71; + + return notebook; } NotebookDescriptor generateNotebookDescriptor() { - // TODO: implement - return {}; + NotebookDescriptor d; + d.guid = QStringLiteral("guid"); + d.notebookDisplayName = QStringLiteral("notebookDisplayName"); + d.contactName = QStringLiteral("contactName"); + d.hasSharedNotebook = false; + d.joinedUserCount = 23; + + return d; } UserProfile generateUserProfile() { - // TODO: implement - return {}; + UserProfile p; + p.id = 23; + p.name = QStringLiteral("name"); + p.email = QStringLiteral("email"); + p.username = QStringLiteral("username"); + p.attributes = generateBusinessUserAttributes(); + p.joined = QDateTime::currentMSecsSinceEpoch(); + p.photoLastUpdated = QDateTime::currentMSecsSinceEpoch() - 100; + p.photoUrl = QStringLiteral("photoUrl"); + p.role = BusinessUserRole::NORMAL; + p.status = BusinessUserStatus::ACTIVE; + + return p; } RelatedContentImage generateRelatedContentImage() { - // TODO: implement - return {}; + RelatedContentImage i; + i.url = QStringLiteral("url"); + i.width = 20; + i.height = 30; + i.pixelRatio = 0.2; + i.fileSize = 315; + + return i; } RelatedContent generateRelatedContent() { - // TODO: implement - return {}; + RelatedContent c; + c.contentId = QStringLiteral("contentId"); + c.title = QStringLiteral("title"); + c.url = QStringLiteral("url"); + c.sourceId = QStringLiteral("sourceId"); + c.sourceUrl = QStringLiteral("sourceUrl"); + c.sourceFaviconUrl = QStringLiteral("sourceFaviconUrl"); + c.sourceName = QStringLiteral("sourceName"); + c.date = QDateTime::currentMSecsSinceEpoch(); + c.teaser = QStringLiteral("teaser"); + c.thumbnails = QList() << generateRelatedContentImage(); + c.contentType = RelatedContentType::NEWS_ARTICLE; + c.accessType = RelatedContentAccess::DIRECT_LINK_ACCESS_OK; + c.visibleUrl = QStringLiteral("visibleUrl"); + c.clipUrl = QStringLiteral("clipUrl"); + c.contact = generateContact(); + c.authors = QStringList() + << QStringLiteral("author1") + << QStringLiteral("author2") + << QStringLiteral("author3"); + + return c; } BusinessInvitation generateBusinessInvitation() { - // TODO: implement - return {}; + BusinessInvitation i; + i.businessId = 22; + i.email = QStringLiteral("email"); + i.role = BusinessUserRole::NORMAL; + i.status = BusinessInvitationStatus::APPROVED; + i.requesterId = 13; + i.fromWorkChat = false; + i.created = QDateTime::currentMSecsSinceEpoch(); + i.mostRecentReminder = QDateTime::currentMSecsSinceEpoch(); + + return i; } UserIdentity generateUserIdentity() { - // TODO: implement - return {}; + UserIdentity i; + i.type = UserIdentityType::EMAIL; + i.stringIdentifier = QStringLiteral("stringIdentifier"); + i.longIdentifier = 346; + + return i; } PublicUserInfo generatePublicUserInfo() { - // TODO: implement - return {}; + PublicUserInfo i; + i.userId = 34; + i.serviceLevel = ServiceLevel::BASIC; + i.username = QStringLiteral("username"); + i.noteStoreUrl = QStringLiteral("noteStoreUrl"); + i.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); + + return i; } UserUrls generateUserUrls() { - // TODO: implement - return {}; + UserUrls u; + u.noteStoreUrl = QStringLiteral("noteStoreUrl"); + u.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); + u.userStoreUrl = QStringLiteral("userStoreUrl"); + u.utilityUrl = QStringLiteral("utilityUrl"); + u.messageStoreUrl = QStringLiteral("messageStoreUrl"); + u.userWebSocketUrl = QStringLiteral("userWebSocketUrl"); + + return u; } AuthenticationResult generateAuthenticationResult() { - // TODO: implement - return {}; + AuthenticationResult r; + r.currentTime = QDateTime::currentMSecsSinceEpoch(); + r.authenticationToken = QStringLiteral("authenticationToken"); + r.expiration = QDateTime::currentMSecsSinceEpoch(); + r.user = generateUser(); + r.publicUserInfo = generatePublicUserInfo(); + r.noteStoreUrl = QStringLiteral("noteStoreUrl"); + r.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); + r.secondFactorRequired = false; + r.secondFactorDeliveryHint = QStringLiteral("secondFactorDeliveryHint"); + r.urls = generateUserUrls(); + + return r; } BootstrapSettings generateBootstrapSettings() { - // TODO: implement - return {}; + BootstrapSettings s; + s.serviceHost = QStringLiteral("serviceHost"); + s.marketingUrl = QStringLiteral("marketingUrl"); + s.supportUrl = QStringLiteral("supportUrl"); + s.accountEmailDomain = QStringLiteral("accountEmailDomain"); + s.enableFacebookSharing = false; + s.enableGiftSubscriptions = true; + s.enableSupportTickets = false; + s.enableSharedNotebooks = true; + s.enableSingleNoteSharing = false; + s.enableSponsoredAccounts = true; + s.enableTwitterSharing = false; + s.enableLinkedInSharing = true; + s.enablePublicNotebooks = false; + s.enableGoogle = true; + + return s; } BootstrapProfile generateBootstrapProfile() { - // TODO: implement - return {}; + BootstrapProfile p; + p.name = QStringLiteral("name"); + p.settings = generateBootstrapSettings(); + + return p; } BootstrapInfo generateBootstrapInfo() { - // TODO: implement - return {}; + BootstrapInfo i; + i.profiles = QList() << generateBootstrapProfile(); + + return i; } SyncChunk generateSyncChunk() { - // TODO: implement - return {}; + SyncChunk c; + c.currentTime = QDateTime::currentMSecsSinceEpoch(); + c.chunkHighUSN = 32; + c.updateCount = 17; + c.notes = QList() << generateNote(); + c.notebooks = QList() << generateNotebook(); + c.tags = QList() << generateTag(); + c.searches = QList() << generateSavedSearch(); + c.resources = QList() << generateResource(); + c.expungedNotes = QList() << QStringLiteral("expungedNoteGuid"); + c.expungedNotebooks = QList() << QStringLiteral("expungedNotebookGuid"); + c.expungedTags = QList() << QStringLiteral("expungedTagGuid"); + c.expungedSearches = QList() << QStringLiteral("expungedSearcheGuid"); + c.linkedNotebooks = QList() << generateLinkedNotebook(); + c.expungedLinkedNotebooks = QList() + << QStringLiteral("expungedLinkedNotebookGuid"); + + return c; } NoteList generateNoteList() { - // TODO: implement - return {}; + NoteList l; + l.startIndex = 2; + l.totalNotes = 1; + l.notes = QList() << generateNote(); + l.stoppedWords = QStringList() + << QStringLiteral("stoppedWord1") + << QStringLiteral("stoppedWord2") + << QStringLiteral("stoppedWord3"); + l.searchedWords = QStringList() + << QStringLiteral("seachedWord1") + << QStringLiteral("seachedWord2") + << QStringLiteral("seachedWord3"); + l.updateCount = 34; + l.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); + l.debugInfo = QStringLiteral("debugInfo"); + + return l; } NoteMetadata generateNoteMetadata() { - // TODO: implement - return {}; + NoteMetadata m; + m.guid = QStringLiteral("guid"); + m.title = QStringLiteral("title"); + m.contentLength = 23; + m.created = QDateTime::currentMSecsSinceEpoch() - 200; + m.updated = QDateTime::currentMSecsSinceEpoch() - 100; + m.deleted = QDateTime::currentMSecsSinceEpoch() - 50; + m.updateSequenceNum = 345; + m.notebookGuid = QStringLiteral("notebookGuid"); + m.tagGuids = QList() + << QStringLiteral("tagGuid1") + << QStringLiteral("tagGuid2") + << QStringLiteral("tagGuid3"); + m.attributes = generateNoteAttributes(); + m.largestResourceMime = QStringLiteral("largestResourceMime"); + m.largestResourceSize = 378; + + return m; } NotesMetadataList generateNotesMetadataList() { - // TODO: implement - return {}; + NotesMetadataList l; + l.startIndex = 2; + l.totalNotes = 1; + l.notes = QList() << generateNoteMetadata(); + l.stoppedWords = QStringList() + << QStringLiteral("stoppedWord1") + << QStringLiteral("stoppedWord2") + << QStringLiteral("stoppedWord3"); + l.searchedWords = QStringList() + << QStringLiteral("seachedWord1") + << QStringLiteral("seachedWord2") + << QStringLiteral("seachedWord3"); + l.updateCount = 34; + l.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); + l.debugInfo = QStringLiteral("debugInfo"); + + return l; } NoteEmailParameters generateNoteEmailParameters() { - // TODO: implement - return {}; + NoteEmailParameters p; + p.guid = QStringLiteral("guid"); + p.note = generateNote(); + p.toAddresses = QStringList() + << QStringLiteral("address1") + << QStringLiteral("address2") + << QStringLiteral("address3"); + p.ccAddresses = QStringList() + << QStringLiteral("ccAddress1") + << QStringLiteral("ccAddress2") + << QStringLiteral("ccAddress3"); + p.subject = QStringLiteral("subject"); + p.message = QStringLiteral("message"); + + return p; } RelatedResult generateRelatedResult() { - // TODO: implement - return {}; + RelatedResult r; + r.notes = QList() << generateNote(); + r.notebooks = QList() << generateNotebook(); + r.tags = QList() << generateTag(); + r.containingNotebooks = QList() + << generateNotebookDescriptor(); + r.debugInfo = QStringLiteral("debugInfo"); + r.experts = QList() << generateUserProfile(); + r.relatedContent = QList() << generateRelatedContent(); + r.cacheKey = QStringLiteral("cacheKey"); + r.cacheExpires = 320; + + return r; } UpdateNoteIfUsnMatchesResult generateUpdateNoteIfUsnMatchesResult() { - // TODO: implement - return {}; + UpdateNoteIfUsnMatchesResult r; + r.note = generateNote(); + r.updated = true; + + return r; } InvitationShareRelationship generateInvitationShareRelationship() { - // TODO: implement - return {}; + InvitationShareRelationship r; + r.displayName = QStringLiteral("displayName"); + r.recipientUserIdentity = generateUserIdentity(); + r.privilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; + r.sharerUserId = 341; + + return r; } ShareRelationships generateShareRelationships() { - // TODO: implement - return {}; + ShareRelationships r; + r.invitations = QList() + << generateInvitationShareRelationship(); + r.memberships = QList() + << generateMemberShareRelationship(); + r.invitationRestrictions = generateShareRelationshipRestrictions(); + + return r; } ManageNotebookSharesParameters generateManageNotebookSharesParameters() { - // TODO: implement - return {}; + ManageNotebookSharesParameters p; + p.notebookGuid = QStringLiteral("notebookGuid"); + p.inviteMessage = QStringLiteral("inviteMessage"); + p.membershipsToUpdate = QList() + << generateMemberShareRelationship(); + p.invitationsToCreateOrUpdate = QList() + << generateInvitationShareRelationship(); + p.unshares = QList() << generateUserIdentity(); + + return p; } ManageNotebookSharesError generateManageNotebookSharesError() { - // TODO: implement - return {}; + ManageNotebookSharesError e; + e.userIdentity = generateUserIdentity(); + + e.userException = EDAMUserException(); + e.userException->errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + e.userException->parameter = QStringLiteral("userException"); + + e.notFoundException = EDAMNotFoundException(); + e.notFoundException->identifier = QStringLiteral("identfier"); + e.notFoundException->key = QStringLiteral("key"); + + return e; } ManageNotebookSharesResult generateManageNotebookSharesResult() { - // TODO: implement - return {}; + ManageNotebookSharesResult r; + r.errors = QList() + << generateManageNotebookSharesError(); + + return r; } SharedNoteTemplate generateSharedNoteTemplate() { - // TODO: implement - return {}; + SharedNoteTemplate t; + t.noteGuid = QStringLiteral("noteGuid"); + t.recipientThreadId = 23; + t.recipientContacts = QList() + << generateContact(); + t.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + + return t; } NotebookShareTemplate generateNotebookShareTemplate() { - // TODO: implement - return {}; + NotebookShareTemplate t; + t.notebookGuid = QStringLiteral("notebookGuid"); + t.recipientThreadId = 23; + t.recipientContacts = QList() + << generateContact(); + t.privilege = SharedNotebookPrivilegeLevel::GROUP; + + return t; } CreateOrUpdateNotebookSharesResult generateCreateOrUpdateNotebookSharesResult() { - // TODO: implement - return {}; + CreateOrUpdateNotebookSharesResult r; + r.updateSequenceNum = 34; + r.matchingShares = QList() << generateSharedNotebook(); + + return r; } ManageNoteSharesError generateManageNoteSharesError() { - // TODO: implement - return {}; + ManageNoteSharesError e; + e.identityID = 54; + e.userID = 34; + + e.userException = EDAMUserException(); + e.userException->errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + e.userException->parameter = QStringLiteral("userException"); + + e.notFoundException = EDAMNotFoundException(); + e.notFoundException->identifier = QStringLiteral("identfier"); + e.notFoundException->key = QStringLiteral("key"); + + return e; } ManageNoteSharesResult generateManageNoteSharesResult() { - // TODO: implement - return {}; + ManageNoteSharesResult r; + r.errors = QList() + << generateManageNoteSharesError(); + + return r; } } // namespace tests From 5420893913ea38487e8e0f14602ea70fadb6d1a7 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 16 Nov 2019 12:18:14 +0300 Subject: [PATCH 071/188] Add generated tests code (placeholders for now) --- QEverCloud/CMakeLists.txt | 8 +- QEverCloud/src/tests/TestQEverCloud.cpp | 4 + .../src/tests/generated/TestNoteStore.cpp | 4192 +++++++++++++++++ .../src/tests/generated/TestNoteStore.h | 107 + .../src/tests/generated/TestUserStore.cpp | 861 ++++ .../src/tests/generated/TestUserStore.h | 48 + 6 files changed, 5218 insertions(+), 2 deletions(-) create mode 100644 QEverCloud/src/tests/generated/TestNoteStore.cpp create mode 100644 QEverCloud/src/tests/generated/TestNoteStore.h create mode 100644 QEverCloud/src/tests/generated/TestUserStore.cpp create mode 100644 QEverCloud/src/tests/generated/TestUserStore.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 855f4909..0f0386cc 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -145,12 +145,16 @@ if(Qt5Test_FOUND) set(TEST_HEADERS src/tests/Common.h src/tests/TestDurableService.h - src/tests/TestOptional.h) + src/tests/TestOptional.h + src/tests/generated/TestNoteStore.h + src/tests/generated/TestUserStore.h) set(TEST_SOURCES src/tests/Common.cpp src/tests/TestDurableService.cpp src/tests/TestOptional.cpp - src/tests/TestQEverCloud.cpp) + src/tests/TestQEverCloud.cpp + src/tests/generated/TestNoteStore.cpp + src/tests/generated/TestUserStore.cpp) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 052d2767..287df084 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -8,6 +8,8 @@ #include "TestDurableService.h" #include "TestOptional.h" +#include "generated/TestNoteStore.h" +#include "generated/TestUserStore.h" #include #include @@ -29,6 +31,8 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) + RUN_TESTS(NoteStoreTester) + RUN_TESTS(UserStoreTester) return 0; } diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp new file mode 100644 index 00000000..251a2491 --- /dev/null +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -0,0 +1,4192 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#include "TestNoteStore.h" +#include "../../Impl.h" +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +NoteStoreTester::NoteStoreTester(QObject * parent) : + QObject(parent) +{} + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetSyncStateTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SyncState( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetSyncStateTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetSyncStateRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetFilteredSyncChunkTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SyncChunk( + qint32, + qint32, + const SyncChunkFilter &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetFilteredSyncChunkTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetFilteredSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetFilteredSyncChunkRequestReceived( + qint32 afterUSN, + qint32 maxEntries, + SyncChunkFilter filter, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + afterUSN, + maxEntries, + filter, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetLinkedNotebookSyncStateTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SyncState( + const LinkedNotebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetLinkedNotebookSyncStateTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetLinkedNotebookSyncStateRequestReady( + SyncState value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetLinkedNotebookSyncStateRequestReceived( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + linkedNotebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetLinkedNotebookSyncChunkTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SyncChunk( + const LinkedNotebook &, + qint32, + qint32, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetLinkedNotebookSyncChunkTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetLinkedNotebookSyncChunkRequestReady( + SyncChunk value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetLinkedNotebookSyncChunkRequestReceived( + LinkedNotebook linkedNotebook, + qint32 afterUSN, + qint32 maxEntries, + bool fullSyncOnly, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListNotebooksTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListNotebooksTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListNotebooksRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListAccessibleBusinessNotebooksTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListAccessibleBusinessNotebooksTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListAccessibleBusinessNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListAccessibleBusinessNotebooksRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Notebook( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNotebookRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetDefaultNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Notebook( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetDefaultNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetDefaultNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetDefaultNotebookRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Notebook( + const Notebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateNotebookRequestReceived( + Notebook notebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + notebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const Notebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateNotebookRequestReceived( + Notebook notebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + notebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreExpungeNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ExpungeNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onExpungeNotebookRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListTagsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListTagsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListTagsRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListTagsRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListTagsByNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListTagsByNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListTagsByNotebookRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListTagsByNotebookRequestReceived( + Guid notebookGuid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + notebookGuid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetTagTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Tag( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetTagTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetTagRequestReady( + Tag value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetTagRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateTagTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Tag( + const Tag &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateTagTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateTagRequestReady( + Tag value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateTagRequestReceived( + Tag tag, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + tag, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateTagTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const Tag &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateTagTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateTagRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateTagRequestReceived( + Tag tag, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + tag, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUntagAllTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUntagAllTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UntagAllRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUntagAllRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + m_executor( + guid, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeTagTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreExpungeTagTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ExpungeTagRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onExpungeTagRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListSearchesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListSearchesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListSearchesRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListSearchesRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetSearchTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SavedSearch( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetSearchTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetSearchRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateSearchTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SavedSearch( + const SavedSearch &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateSearchTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateSearchRequestReady( + SavedSearch value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateSearchRequestReceived( + SavedSearch search, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + search, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateSearchTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const SavedSearch &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateSearchTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateSearchRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateSearchRequestReceived( + SavedSearch search, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + search, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeSearchTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreExpungeSearchTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ExpungeSearchRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onExpungeSearchRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNoteOffsetTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const NoteFilter &, + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreFindNoteOffsetTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void FindNoteOffsetRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onFindNoteOffsetRequestReceived( + NoteFilter filter, + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + filter, + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNotesMetadataTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + NotesMetadataList( + const NoteFilter &, + qint32, + qint32, + const NotesMetadataResultSpec &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreFindNotesMetadataTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void FindNotesMetadataRequestReady( + NotesMetadataList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onFindNotesMetadataRequestReceived( + NoteFilter filter, + qint32 offset, + qint32 maxNotes, + NotesMetadataResultSpec resultSpec, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + filter, + offset, + maxNotes, + resultSpec, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNoteCountsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + NoteCollectionCounts( + const NoteFilter &, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreFindNoteCountsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void FindNoteCountsRequestReady( + NoteCollectionCounts value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onFindNoteCountsRequestReceived( + NoteFilter filter, + bool withTrash, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + filter, + withTrash, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteWithResultSpecTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + Guid, + const NoteResultSpec &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteWithResultSpecTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteWithResultSpecRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteWithResultSpecRequestReceived( + Guid guid, + NoteResultSpec resultSpec, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + resultSpec, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + Guid, + bool, + bool, + bool, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteRequestReceived( + Guid guid, + bool withContent, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteApplicationDataTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + LazyMap( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteApplicationDataTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteApplicationDataRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteApplicationDataEntryRequestReceived( + Guid guid, + QString key, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetNoteApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + QString, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreSetNoteApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void SetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onSetNoteApplicationDataEntryRequestReceived( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + value, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUnsetNoteApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUnsetNoteApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UnsetNoteApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUnsetNoteApplicationDataEntryRequestReceived( + Guid guid, + QString key, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteContentTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteContentTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteContentRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteContentRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteSearchTextTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + bool, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteSearchTextTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteSearchTextRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteSearchTextRequestReceived( + Guid guid, + bool noteOnly, + bool tokenizeForIndexing, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceSearchTextTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceSearchTextTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceSearchTextRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceSearchTextRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteTagNamesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QStringList( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteTagNamesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteTagNamesRequestReady( + QStringList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteTagNamesRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + const Note &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateNoteRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateNoteRequestReceived( + Note note, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + note, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + const Note &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateNoteRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateNoteRequestReceived( + Note note, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + note, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreDeleteNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreDeleteNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void DeleteNoteRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onDeleteNoteRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreExpungeNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ExpungeNoteRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onExpungeNoteRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCopyNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + Guid, + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCopyNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CopyNoteRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCopyNoteRequestReceived( + Guid noteGuid, + Guid toNotebookGuid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + noteGuid, + toNotebookGuid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListNoteVersionsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListNoteVersionsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListNoteVersionsRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListNoteVersionsRequestReceived( + Guid noteGuid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + noteGuid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteVersionTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Note( + Guid, + qint32, + bool, + bool, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNoteVersionTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNoteVersionRequestReady( + Note value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNoteVersionRequestReceived( + Guid noteGuid, + qint32 updateSequenceNum, + bool withResourcesData, + bool withResourcesRecognition, + bool withResourcesAlternateData, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Resource( + Guid, + bool, + bool, + bool, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceRequestReady( + Resource value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceRequestReceived( + Guid guid, + bool withData, + bool withRecognition, + bool withAttributes, + bool withAlternateData, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceApplicationDataTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + LazyMap( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceApplicationDataTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceApplicationDataRequestReady( + LazyMap value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceApplicationDataRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceApplicationDataEntryRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceApplicationDataEntryRequestReceived( + Guid guid, + QString key, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetResourceApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + QString, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreSetResourceApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void SetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onSetResourceApplicationDataEntryRequestReceived( + Guid guid, + QString key, + QString value, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + value, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUnsetResourceApplicationDataEntryTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUnsetResourceApplicationDataEntryTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UnsetResourceApplicationDataEntryRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUnsetResourceApplicationDataEntryRequestReceived( + Guid guid, + QString key, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + key, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateResourceTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const Resource &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateResourceTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateResourceRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateResourceRequestReceived( + Resource resource, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + resource, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceDataTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QByteArray( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceDataTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceDataRequestReady( + QByteArray value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceDataRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceByHashTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Resource( + Guid, + QByteArray, + bool, + bool, + bool, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceByHashTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceByHashRequestReady( + Resource value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceByHashRequestReceived( + Guid noteGuid, + QByteArray contentHash, + bool withData, + bool withRecognition, + bool withAlternateData, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceRecognitionTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QByteArray( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceRecognitionTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceRecognitionRequestReady( + QByteArray value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceRecognitionRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceAlternateDataTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QByteArray( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceAlternateDataTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceAlternateDataRequestReady( + QByteArray value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceAlternateDataRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceAttributesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + ResourceAttributes( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetResourceAttributesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetResourceAttributesRequestReady( + ResourceAttributes value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetResourceAttributesRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetPublicNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Notebook( + UserID, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetPublicNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetPublicNotebookRequestReady( + Notebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetPublicNotebookRequestReceived( + UserID userId, + QString publicUri, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + userId, + publicUri, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreShareNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SharedNotebook( + const SharedNotebook &, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreShareNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ShareNotebookRequestReady( + SharedNotebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onShareNotebookRequestReceived( + SharedNotebook sharedNotebook, + QString message, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + sharedNotebook, + message, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateOrUpdateNotebookSharesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + CreateOrUpdateNotebookSharesResult( + const NotebookShareTemplate &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateOrUpdateNotebookSharesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateOrUpdateNotebookSharesRequestReady( + CreateOrUpdateNotebookSharesResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateOrUpdateNotebookSharesRequestReceived( + NotebookShareTemplate shareTemplate, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + shareTemplate, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateSharedNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const SharedNotebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateSharedNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateSharedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateSharedNotebookRequestReceived( + SharedNotebook sharedNotebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + sharedNotebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetNotebookRecipientSettingsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + Notebook( + QString, + const NotebookRecipientSettings &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreSetNotebookRecipientSettingsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void SetNotebookRecipientSettingsRequestReady( + Notebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onSetNotebookRecipientSettingsRequestReceived( + QString notebookGuid, + NotebookRecipientSettings recipientSettings, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + notebookGuid, + recipientSettings, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListSharedNotebooksTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListSharedNotebooksTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListSharedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListSharedNotebooksRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateLinkedNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + LinkedNotebook( + const LinkedNotebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreCreateLinkedNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CreateLinkedNotebookRequestReady( + LinkedNotebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCreateLinkedNotebookRequestReceived( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + linkedNotebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateLinkedNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + const LinkedNotebook &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateLinkedNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateLinkedNotebookRequestReceived( + LinkedNotebook linkedNotebook, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + linkedNotebook, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListLinkedNotebooksTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreListLinkedNotebooksTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListLinkedNotebooksRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListLinkedNotebooksRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeLinkedNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + qint32( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreExpungeLinkedNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ExpungeLinkedNotebookRequestReady( + qint32 value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onExpungeLinkedNotebookRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreAuthenticateToSharedNotebookTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AuthenticationResult( + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreAuthenticateToSharedNotebookTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void AuthenticateToSharedNotebookRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onAuthenticateToSharedNotebookRequestReceived( + QString shareKeyOrGlobalId, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + shareKeyOrGlobalId, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetSharedNotebookByAuthTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + SharedNotebook( + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetSharedNotebookByAuthTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetSharedNotebookByAuthRequestReady( + SharedNotebook value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetSharedNotebookByAuthRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreEmailNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + const NoteEmailParameters &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreEmailNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void EmailNoteRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onEmailNoteRequestReceived( + NoteEmailParameters parameters, + IRequestContextPtr ctx) + { + try + { + m_executor( + parameters, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreShareNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QString( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreShareNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ShareNoteRequestReady( + QString value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onShareNoteRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreStopSharingNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + Guid, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreStopSharingNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void StopSharingNoteRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onStopSharingNoteRequestReceived( + Guid guid, + IRequestContextPtr ctx) + { + try + { + m_executor( + guid, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreAuthenticateToSharedNoteTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AuthenticationResult( + QString, + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreAuthenticateToSharedNoteTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void AuthenticateToSharedNoteRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onAuthenticateToSharedNoteRequestReceived( + QString guid, + QString noteKey, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + guid, + noteKey, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindRelatedTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + RelatedResult( + const RelatedQuery &, + const RelatedResultSpec &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreFindRelatedTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void FindRelatedRequestReady( + RelatedResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onFindRelatedRequestReceived( + RelatedQuery query, + RelatedResultSpec resultSpec, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + query, + resultSpec, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNoteIfUsnMatchesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + UpdateNoteIfUsnMatchesResult( + const Note &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreUpdateNoteIfUsnMatchesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateNoteIfUsnMatchesRequestReady( + UpdateNoteIfUsnMatchesResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateNoteIfUsnMatchesRequestReceived( + Note note, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + note, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreManageNotebookSharesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + ManageNotebookSharesResult( + const ManageNotebookSharesParameters &, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreManageNotebookSharesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ManageNotebookSharesRequestReady( + ManageNotebookSharesResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onManageNotebookSharesRequestReceived( + ManageNotebookSharesParameters parameters, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + parameters, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNotebookSharesTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + ShareRelationships( + QString, + IRequestContextPtr ctx)>; + +public: + explicit NoteStoreGetNotebookSharesTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetNotebookSharesRequestReady( + ShareRelationships value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetNotebookSharesRequestReceived( + QString notebookGuid, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + notebookGuid, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetSyncState() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNotebooks() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetDefaultNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTags() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTagsByNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetTag() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateTag() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateTag() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUntagAll() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeTag() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListSearches() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetSearch() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateSearch() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateSearch() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeSearch() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteOffset() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNotesMetadata() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteCounts() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationData() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteContent() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteSearchText() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceSearchText() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteTagNames() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteDeleteNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCopyNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNoteVersions() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteVersion() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResource() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceApplicationData() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateResource() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceData() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceByHash() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceRecognition() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceAlternateData() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceAttributes() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetPublicNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteShareNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateSharedNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListSharedNotebooks() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateLinkedNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListLinkedNotebooks() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteEmailNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteShareNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteStopSharingNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindRelated() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteManageNotebookShares() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNotebookShares() +{ + // TODO: implement +} + +} // namespace qevercloud + +#include diff --git a/QEverCloud/src/tests/generated/TestNoteStore.h b/QEverCloud/src/tests/generated/TestNoteStore.h new file mode 100644 index 00000000..ba460458 --- /dev/null +++ b/QEverCloud/src/tests/generated/TestNoteStore.h @@ -0,0 +1,107 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#ifndef QEVERCLOUD_GENERATED_TESTNOTESTORE_H +#define QEVERCLOUD_GENERATED_TESTNOTESTORE_H + +#include "../Common.h" +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreTester: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreTester(QObject * parent = nullptr); + +private Q_SLOTS: + void shouldExecuteGetSyncState(); + void shouldExecuteGetFilteredSyncChunk(); + void shouldExecuteGetLinkedNotebookSyncState(); + void shouldExecuteGetLinkedNotebookSyncChunk(); + void shouldExecuteListNotebooks(); + void shouldExecuteListAccessibleBusinessNotebooks(); + void shouldExecuteGetNotebook(); + void shouldExecuteGetDefaultNotebook(); + void shouldExecuteCreateNotebook(); + void shouldExecuteUpdateNotebook(); + void shouldExecuteExpungeNotebook(); + void shouldExecuteListTags(); + void shouldExecuteListTagsByNotebook(); + void shouldExecuteGetTag(); + void shouldExecuteCreateTag(); + void shouldExecuteUpdateTag(); + void shouldExecuteUntagAll(); + void shouldExecuteExpungeTag(); + void shouldExecuteListSearches(); + void shouldExecuteGetSearch(); + void shouldExecuteCreateSearch(); + void shouldExecuteUpdateSearch(); + void shouldExecuteExpungeSearch(); + void shouldExecuteFindNoteOffset(); + void shouldExecuteFindNotesMetadata(); + void shouldExecuteFindNoteCounts(); + void shouldExecuteGetNoteWithResultSpec(); + void shouldExecuteGetNote(); + void shouldExecuteGetNoteApplicationData(); + void shouldExecuteGetNoteApplicationDataEntry(); + void shouldExecuteSetNoteApplicationDataEntry(); + void shouldExecuteUnsetNoteApplicationDataEntry(); + void shouldExecuteGetNoteContent(); + void shouldExecuteGetNoteSearchText(); + void shouldExecuteGetResourceSearchText(); + void shouldExecuteGetNoteTagNames(); + void shouldExecuteCreateNote(); + void shouldExecuteUpdateNote(); + void shouldExecuteDeleteNote(); + void shouldExecuteExpungeNote(); + void shouldExecuteCopyNote(); + void shouldExecuteListNoteVersions(); + void shouldExecuteGetNoteVersion(); + void shouldExecuteGetResource(); + void shouldExecuteGetResourceApplicationData(); + void shouldExecuteGetResourceApplicationDataEntry(); + void shouldExecuteSetResourceApplicationDataEntry(); + void shouldExecuteUnsetResourceApplicationDataEntry(); + void shouldExecuteUpdateResource(); + void shouldExecuteGetResourceData(); + void shouldExecuteGetResourceByHash(); + void shouldExecuteGetResourceRecognition(); + void shouldExecuteGetResourceAlternateData(); + void shouldExecuteGetResourceAttributes(); + void shouldExecuteGetPublicNotebook(); + void shouldExecuteShareNotebook(); + void shouldExecuteCreateOrUpdateNotebookShares(); + void shouldExecuteUpdateSharedNotebook(); + void shouldExecuteSetNotebookRecipientSettings(); + void shouldExecuteListSharedNotebooks(); + void shouldExecuteCreateLinkedNotebook(); + void shouldExecuteUpdateLinkedNotebook(); + void shouldExecuteListLinkedNotebooks(); + void shouldExecuteExpungeLinkedNotebook(); + void shouldExecuteAuthenticateToSharedNotebook(); + void shouldExecuteGetSharedNotebookByAuth(); + void shouldExecuteEmailNote(); + void shouldExecuteShareNote(); + void shouldExecuteStopSharingNote(); + void shouldExecuteAuthenticateToSharedNote(); + void shouldExecuteFindRelated(); + void shouldExecuteUpdateNoteIfUsnMatches(); + void shouldExecuteManageNotebookShares(); + void shouldExecuteGetNotebookShares(); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_GENERATED_TESTNOTESTORE_H diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp new file mode 100644 index 00000000..4834cfcd --- /dev/null +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -0,0 +1,861 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#include "TestUserStore.h" +#include "../../Impl.h" +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +UserStoreTester::UserStoreTester(QObject * parent) : + QObject(parent) +{} + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreCheckVersionTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + bool( + QString, + qint16, + qint16, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreCheckVersionTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CheckVersionRequestReady( + bool value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCheckVersionRequestReceived( + QString clientName, + qint16 edamVersionMajor, + qint16 edamVersionMinor, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetBootstrapInfoTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + BootstrapInfo( + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreGetBootstrapInfoTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetBootstrapInfoRequestReady( + BootstrapInfo value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetBootstrapInfoRequestReceived( + QString locale, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + locale, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreAuthenticateLongSessionTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AuthenticationResult( + QString, + QString, + QString, + QString, + QString, + QString, + bool, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreAuthenticateLongSessionTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void AuthenticateLongSessionRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onAuthenticateLongSessionRequestReceived( + QString username, + QString password, + QString consumerKey, + QString consumerSecret, + QString deviceIdentifier, + QString deviceDescription, + bool supportsTwoFactor, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreCompleteTwoFactorAuthenticationTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AuthenticationResult( + QString, + QString, + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreCompleteTwoFactorAuthenticationTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void CompleteTwoFactorAuthenticationRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onCompleteTwoFactorAuthenticationRequestReceived( + QString oneTimeCode, + QString deviceIdentifier, + QString deviceDescription, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreRevokeLongSessionTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + IRequestContextPtr ctx)>; + +public: + explicit UserStoreRevokeLongSessionTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void RevokeLongSessionRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onRevokeLongSessionRequestReceived( + IRequestContextPtr ctx) + { + try + { + m_executor( + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreAuthenticateToBusinessTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AuthenticationResult( + IRequestContextPtr ctx)>; + +public: + explicit UserStoreAuthenticateToBusinessTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void AuthenticateToBusinessRequestReady( + AuthenticationResult value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onAuthenticateToBusinessRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetUserTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + User( + IRequestContextPtr ctx)>; + +public: + explicit UserStoreGetUserTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetUserRequestReady( + User value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetUserRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetPublicUserInfoTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + PublicUserInfo( + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreGetPublicUserInfoTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetPublicUserInfoRequestReady( + PublicUserInfo value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetPublicUserInfoRequestReceived( + QString username, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + username, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetUserUrlsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + UserUrls( + IRequestContextPtr ctx)>; + +public: + explicit UserStoreGetUserUrlsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetUserUrlsRequestReady( + UserUrls value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetUserUrlsRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreInviteToBusinessTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreInviteToBusinessTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void InviteToBusinessRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onInviteToBusinessRequestReceived( + QString emailAddress, + IRequestContextPtr ctx) + { + try + { + m_executor( + emailAddress, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreRemoveFromBusinessTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreRemoveFromBusinessTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void RemoveFromBusinessRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onRemoveFromBusinessRequestReceived( + QString emailAddress, + IRequestContextPtr ctx) + { + try + { + m_executor( + emailAddress, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreUpdateBusinessUserIdentifierTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + void( + QString, + QString, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreUpdateBusinessUserIdentifierTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void UpdateBusinessUserIdentifierRequestReady( + QSharedPointer exceptionData); + +public Q_SLOTS: + void onUpdateBusinessUserIdentifierRequestReceived( + QString oldEmailAddress, + QString newEmailAddress, + IRequestContextPtr ctx) + { + try + { + m_executor( + oldEmailAddress, + newEmailAddress, + ctx); + // TODO: emit finished + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreListBusinessUsersTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + IRequestContextPtr ctx)>; + +public: + explicit UserStoreListBusinessUsersTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListBusinessUsersRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListBusinessUsersRequestReceived( + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreListBusinessInvitationsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + QList( + bool, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreListBusinessInvitationsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void ListBusinessInvitationsRequestReady( + QList value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onListBusinessInvitationsRequestReceived( + bool includeRequestedInvitations, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + includeRequestedInvitations, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetAccountLimitsTesterHelper: public QObject +{ + Q_OBJECT +public: + using Executor = std::function< + AccountLimits( + ServiceLevel, + IRequestContextPtr ctx)>; + +public: + explicit UserStoreGetAccountLimitsTesterHelper( + Executor executor, + QObject * parent = nullptr) : + QObject(parent), + m_executor(std::move(executor)) + {} + +Q_SIGNALS: + void GetAccountLimitsRequestReady( + AccountLimits value, + QSharedPointer exceptionData); + +public Q_SLOTS: + void onGetAccountLimitsRequestReceived( + ServiceLevel serviceLevel, + IRequestContextPtr ctx) + { + try + { + auto v = m_executor( + serviceLevel, + ctx); + // TODO: emit finished + Q_UNUSED(v) + } + catch(const EverCloudException & e) + { + // TODO: emit error + Q_UNUSED(e) + } + } + +private: + Executor m_executor; +}; + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteCheckVersion() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetBootstrapInfo() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteAuthenticateLongSession() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteRevokeLongSession() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteAuthenticateToBusiness() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUser() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetPublicUserInfo() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUserUrls() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteInviteToBusiness() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteRemoveFromBusiness() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteListBusinessUsers() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteListBusinessInvitations() +{ + // TODO: implement +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetAccountLimits() +{ + // TODO: implement +} + +} // namespace qevercloud + +#include diff --git a/QEverCloud/src/tests/generated/TestUserStore.h b/QEverCloud/src/tests/generated/TestUserStore.h new file mode 100644 index 00000000..d1cde949 --- /dev/null +++ b/QEverCloud/src/tests/generated/TestUserStore.h @@ -0,0 +1,48 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#ifndef QEVERCLOUD_GENERATED_TESTUSERSTORE_H +#define QEVERCLOUD_GENERATED_TESTUSERSTORE_H + +#include "../Common.h" +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreTester: public QObject +{ + Q_OBJECT +public: + explicit UserStoreTester(QObject * parent = nullptr); + +private Q_SLOTS: + void shouldExecuteCheckVersion(); + void shouldExecuteGetBootstrapInfo(); + void shouldExecuteAuthenticateLongSession(); + void shouldExecuteCompleteTwoFactorAuthentication(); + void shouldExecuteRevokeLongSession(); + void shouldExecuteAuthenticateToBusiness(); + void shouldExecuteGetUser(); + void shouldExecuteGetPublicUserInfo(); + void shouldExecuteGetUserUrls(); + void shouldExecuteInviteToBusiness(); + void shouldExecuteRemoveFromBusiness(); + void shouldExecuteUpdateBusinessUserIdentifier(); + void shouldExecuteListBusinessUsers(); + void shouldExecuteListBusinessInvitations(); + void shouldExecuteGetAccountLimits(); +}; + +} // namespace qevercloud + +#endif // QEVERCLOUD_GENERATED_TESTUSERSTORE_H From cd224fb17da6dd16bf49eff6b94a9faaa84dd117 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 16 Nov 2019 13:31:24 +0300 Subject: [PATCH 072/188] Update generated code --- .../src/tests/generated/TestNoteStore.cpp | 953 +++++++++++------- .../src/tests/generated/TestUserStore.cpp | 183 ++-- 2 files changed, 698 insertions(+), 438 deletions(-) diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 251a2491..d35b9089 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -40,7 +40,7 @@ class NoteStoreGetSyncStateTesterHelper: public QObject {} Q_SIGNALS: - void GetSyncStateRequestReady( + void getSyncStateRequestReady( SyncState value, QSharedPointer exceptionData); @@ -52,13 +52,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getSyncStateRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getSyncStateRequestReady( + {}, + e.exceptionData()); } } @@ -88,7 +91,7 @@ class NoteStoreGetFilteredSyncChunkTesterHelper: public QObject {} Q_SIGNALS: - void GetFilteredSyncChunkRequestReady( + void getFilteredSyncChunkRequestReady( SyncChunk value, QSharedPointer exceptionData); @@ -106,13 +109,16 @@ public Q_SLOTS: maxEntries, filter, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getFilteredSyncChunkRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getFilteredSyncChunkRequestReady( + {}, + e.exceptionData()); } } @@ -140,7 +146,7 @@ class NoteStoreGetLinkedNotebookSyncStateTesterHelper: public QObject {} Q_SIGNALS: - void GetLinkedNotebookSyncStateRequestReady( + void getLinkedNotebookSyncStateRequestReady( SyncState value, QSharedPointer exceptionData); @@ -154,13 +160,16 @@ public Q_SLOTS: auto v = m_executor( linkedNotebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getLinkedNotebookSyncStateRequestReady( + {}, + e.exceptionData()); } } @@ -191,7 +200,7 @@ class NoteStoreGetLinkedNotebookSyncChunkTesterHelper: public QObject {} Q_SIGNALS: - void GetLinkedNotebookSyncChunkRequestReady( + void getLinkedNotebookSyncChunkRequestReady( SyncChunk value, QSharedPointer exceptionData); @@ -211,13 +220,16 @@ public Q_SLOTS: maxEntries, fullSyncOnly, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + {}, + e.exceptionData()); } } @@ -244,7 +256,7 @@ class NoteStoreListNotebooksTesterHelper: public QObject {} Q_SIGNALS: - void ListNotebooksRequestReady( + void listNotebooksRequestReady( QList value, QSharedPointer exceptionData); @@ -256,13 +268,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listNotebooksRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listNotebooksRequestReady( + {}, + e.exceptionData()); } } @@ -289,7 +304,7 @@ class NoteStoreListAccessibleBusinessNotebooksTesterHelper: public QObject {} Q_SIGNALS: - void ListAccessibleBusinessNotebooksRequestReady( + void listAccessibleBusinessNotebooksRequestReady( QList value, QSharedPointer exceptionData); @@ -301,13 +316,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + {}, + e.exceptionData()); } } @@ -335,7 +353,7 @@ class NoteStoreGetNotebookTesterHelper: public QObject {} Q_SIGNALS: - void GetNotebookRequestReady( + void getNotebookRequestReady( Notebook value, QSharedPointer exceptionData); @@ -349,13 +367,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -382,7 +403,7 @@ class NoteStoreGetDefaultNotebookTesterHelper: public QObject {} Q_SIGNALS: - void GetDefaultNotebookRequestReady( + void getDefaultNotebookRequestReady( Notebook value, QSharedPointer exceptionData); @@ -394,13 +415,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getDefaultNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getDefaultNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -428,7 +452,7 @@ class NoteStoreCreateNotebookTesterHelper: public QObject {} Q_SIGNALS: - void CreateNotebookRequestReady( + void createNotebookRequestReady( Notebook value, QSharedPointer exceptionData); @@ -442,13 +466,16 @@ public Q_SLOTS: auto v = m_executor( notebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -476,7 +503,7 @@ class NoteStoreUpdateNotebookTesterHelper: public QObject {} Q_SIGNALS: - void UpdateNotebookRequestReady( + void updateNotebookRequestReady( qint32 value, QSharedPointer exceptionData); @@ -490,13 +517,16 @@ public Q_SLOTS: auto v = m_executor( notebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -524,7 +554,7 @@ class NoteStoreExpungeNotebookTesterHelper: public QObject {} Q_SIGNALS: - void ExpungeNotebookRequestReady( + void expungeNotebookRequestReady( qint32 value, QSharedPointer exceptionData); @@ -538,13 +568,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT expungeNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT expungeNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -571,7 +604,7 @@ class NoteStoreListTagsTesterHelper: public QObject {} Q_SIGNALS: - void ListTagsRequestReady( + void listTagsRequestReady( QList value, QSharedPointer exceptionData); @@ -583,13 +616,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listTagsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listTagsRequestReady( + {}, + e.exceptionData()); } } @@ -617,7 +653,7 @@ class NoteStoreListTagsByNotebookTesterHelper: public QObject {} Q_SIGNALS: - void ListTagsByNotebookRequestReady( + void listTagsByNotebookRequestReady( QList value, QSharedPointer exceptionData); @@ -631,13 +667,16 @@ public Q_SLOTS: auto v = m_executor( notebookGuid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listTagsByNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listTagsByNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -665,7 +704,7 @@ class NoteStoreGetTagTesterHelper: public QObject {} Q_SIGNALS: - void GetTagRequestReady( + void getTagRequestReady( Tag value, QSharedPointer exceptionData); @@ -679,13 +718,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getTagRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getTagRequestReady( + {}, + e.exceptionData()); } } @@ -713,7 +755,7 @@ class NoteStoreCreateTagTesterHelper: public QObject {} Q_SIGNALS: - void CreateTagRequestReady( + void createTagRequestReady( Tag value, QSharedPointer exceptionData); @@ -727,13 +769,16 @@ public Q_SLOTS: auto v = m_executor( tag, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createTagRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createTagRequestReady( + {}, + e.exceptionData()); } } @@ -761,7 +806,7 @@ class NoteStoreUpdateTagTesterHelper: public QObject {} Q_SIGNALS: - void UpdateTagRequestReady( + void updateTagRequestReady( qint32 value, QSharedPointer exceptionData); @@ -775,13 +820,16 @@ public Q_SLOTS: auto v = m_executor( tag, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateTagRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateTagRequestReady( + {}, + e.exceptionData()); } } @@ -809,7 +857,7 @@ class NoteStoreUntagAllTesterHelper: public QObject {} Q_SIGNALS: - void UntagAllRequestReady( + void untagAllRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -822,12 +870,14 @@ public Q_SLOTS: m_executor( guid, ctx); - // TODO: emit finished + + Q_EMIT untagAllRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT untagAllRequestReady( + e.exceptionData()); } } @@ -855,7 +905,7 @@ class NoteStoreExpungeTagTesterHelper: public QObject {} Q_SIGNALS: - void ExpungeTagRequestReady( + void expungeTagRequestReady( qint32 value, QSharedPointer exceptionData); @@ -869,13 +919,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT expungeTagRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT expungeTagRequestReady( + {}, + e.exceptionData()); } } @@ -902,7 +955,7 @@ class NoteStoreListSearchesTesterHelper: public QObject {} Q_SIGNALS: - void ListSearchesRequestReady( + void listSearchesRequestReady( QList value, QSharedPointer exceptionData); @@ -914,13 +967,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listSearchesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listSearchesRequestReady( + {}, + e.exceptionData()); } } @@ -948,7 +1004,7 @@ class NoteStoreGetSearchTesterHelper: public QObject {} Q_SIGNALS: - void GetSearchRequestReady( + void getSearchRequestReady( SavedSearch value, QSharedPointer exceptionData); @@ -962,13 +1018,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getSearchRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getSearchRequestReady( + {}, + e.exceptionData()); } } @@ -996,7 +1055,7 @@ class NoteStoreCreateSearchTesterHelper: public QObject {} Q_SIGNALS: - void CreateSearchRequestReady( + void createSearchRequestReady( SavedSearch value, QSharedPointer exceptionData); @@ -1010,13 +1069,16 @@ public Q_SLOTS: auto v = m_executor( search, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createSearchRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createSearchRequestReady( + {}, + e.exceptionData()); } } @@ -1044,7 +1106,7 @@ class NoteStoreUpdateSearchTesterHelper: public QObject {} Q_SIGNALS: - void UpdateSearchRequestReady( + void updateSearchRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1058,13 +1120,16 @@ public Q_SLOTS: auto v = m_executor( search, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateSearchRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateSearchRequestReady( + {}, + e.exceptionData()); } } @@ -1092,7 +1157,7 @@ class NoteStoreExpungeSearchTesterHelper: public QObject {} Q_SIGNALS: - void ExpungeSearchRequestReady( + void expungeSearchRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1106,13 +1171,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT expungeSearchRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT expungeSearchRequestReady( + {}, + e.exceptionData()); } } @@ -1141,7 +1209,7 @@ class NoteStoreFindNoteOffsetTesterHelper: public QObject {} Q_SIGNALS: - void FindNoteOffsetRequestReady( + void findNoteOffsetRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1157,13 +1225,16 @@ public Q_SLOTS: filter, guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT findNoteOffsetRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT findNoteOffsetRequestReady( + {}, + e.exceptionData()); } } @@ -1194,7 +1265,7 @@ class NoteStoreFindNotesMetadataTesterHelper: public QObject {} Q_SIGNALS: - void FindNotesMetadataRequestReady( + void findNotesMetadataRequestReady( NotesMetadataList value, QSharedPointer exceptionData); @@ -1214,13 +1285,16 @@ public Q_SLOTS: maxNotes, resultSpec, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT findNotesMetadataRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT findNotesMetadataRequestReady( + {}, + e.exceptionData()); } } @@ -1249,7 +1323,7 @@ class NoteStoreFindNoteCountsTesterHelper: public QObject {} Q_SIGNALS: - void FindNoteCountsRequestReady( + void findNoteCountsRequestReady( NoteCollectionCounts value, QSharedPointer exceptionData); @@ -1265,13 +1339,16 @@ public Q_SLOTS: filter, withTrash, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT findNoteCountsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT findNoteCountsRequestReady( + {}, + e.exceptionData()); } } @@ -1300,7 +1377,7 @@ class NoteStoreGetNoteWithResultSpecTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteWithResultSpecRequestReady( + void getNoteWithResultSpecRequestReady( Note value, QSharedPointer exceptionData); @@ -1316,13 +1393,16 @@ public Q_SLOTS: guid, resultSpec, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteWithResultSpecRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteWithResultSpecRequestReady( + {}, + e.exceptionData()); } } @@ -1354,7 +1434,7 @@ class NoteStoreGetNoteTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteRequestReady( + void getNoteRequestReady( Note value, QSharedPointer exceptionData); @@ -1376,13 +1456,16 @@ public Q_SLOTS: withResourcesRecognition, withResourcesAlternateData, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteRequestReady( + {}, + e.exceptionData()); } } @@ -1410,7 +1493,7 @@ class NoteStoreGetNoteApplicationDataTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteApplicationDataRequestReady( + void getNoteApplicationDataRequestReady( LazyMap value, QSharedPointer exceptionData); @@ -1424,13 +1507,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteApplicationDataRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteApplicationDataRequestReady( + {}, + e.exceptionData()); } } @@ -1459,7 +1545,7 @@ class NoteStoreGetNoteApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteApplicationDataEntryRequestReady( + void getNoteApplicationDataEntryRequestReady( QString value, QSharedPointer exceptionData); @@ -1475,13 +1561,16 @@ public Q_SLOTS: guid, key, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -1511,7 +1600,7 @@ class NoteStoreSetNoteApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void SetNoteApplicationDataEntryRequestReady( + void setNoteApplicationDataEntryRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1529,13 +1618,16 @@ public Q_SLOTS: key, value, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT setNoteApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT setNoteApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -1564,7 +1656,7 @@ class NoteStoreUnsetNoteApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void UnsetNoteApplicationDataEntryRequestReady( + void unsetNoteApplicationDataEntryRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1580,13 +1672,16 @@ public Q_SLOTS: guid, key, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -1614,7 +1709,7 @@ class NoteStoreGetNoteContentTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteContentRequestReady( + void getNoteContentRequestReady( QString value, QSharedPointer exceptionData); @@ -1628,13 +1723,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteContentRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteContentRequestReady( + {}, + e.exceptionData()); } } @@ -1664,7 +1762,7 @@ class NoteStoreGetNoteSearchTextTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteSearchTextRequestReady( + void getNoteSearchTextRequestReady( QString value, QSharedPointer exceptionData); @@ -1682,13 +1780,16 @@ public Q_SLOTS: noteOnly, tokenizeForIndexing, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteSearchTextRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteSearchTextRequestReady( + {}, + e.exceptionData()); } } @@ -1716,7 +1817,7 @@ class NoteStoreGetResourceSearchTextTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceSearchTextRequestReady( + void getResourceSearchTextRequestReady( QString value, QSharedPointer exceptionData); @@ -1730,13 +1831,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceSearchTextRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceSearchTextRequestReady( + {}, + e.exceptionData()); } } @@ -1764,7 +1868,7 @@ class NoteStoreGetNoteTagNamesTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteTagNamesRequestReady( + void getNoteTagNamesRequestReady( QStringList value, QSharedPointer exceptionData); @@ -1778,13 +1882,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteTagNamesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteTagNamesRequestReady( + {}, + e.exceptionData()); } } @@ -1812,7 +1919,7 @@ class NoteStoreCreateNoteTesterHelper: public QObject {} Q_SIGNALS: - void CreateNoteRequestReady( + void createNoteRequestReady( Note value, QSharedPointer exceptionData); @@ -1826,13 +1933,16 @@ public Q_SLOTS: auto v = m_executor( note, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createNoteRequestReady( + {}, + e.exceptionData()); } } @@ -1860,7 +1970,7 @@ class NoteStoreUpdateNoteTesterHelper: public QObject {} Q_SIGNALS: - void UpdateNoteRequestReady( + void updateNoteRequestReady( Note value, QSharedPointer exceptionData); @@ -1874,13 +1984,16 @@ public Q_SLOTS: auto v = m_executor( note, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateNoteRequestReady( + {}, + e.exceptionData()); } } @@ -1908,7 +2021,7 @@ class NoteStoreDeleteNoteTesterHelper: public QObject {} Q_SIGNALS: - void DeleteNoteRequestReady( + void deleteNoteRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1922,13 +2035,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT deleteNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT deleteNoteRequestReady( + {}, + e.exceptionData()); } } @@ -1956,7 +2072,7 @@ class NoteStoreExpungeNoteTesterHelper: public QObject {} Q_SIGNALS: - void ExpungeNoteRequestReady( + void expungeNoteRequestReady( qint32 value, QSharedPointer exceptionData); @@ -1970,13 +2086,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT expungeNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT expungeNoteRequestReady( + {}, + e.exceptionData()); } } @@ -2005,7 +2124,7 @@ class NoteStoreCopyNoteTesterHelper: public QObject {} Q_SIGNALS: - void CopyNoteRequestReady( + void copyNoteRequestReady( Note value, QSharedPointer exceptionData); @@ -2021,13 +2140,16 @@ public Q_SLOTS: noteGuid, toNotebookGuid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT copyNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT copyNoteRequestReady( + {}, + e.exceptionData()); } } @@ -2055,7 +2177,7 @@ class NoteStoreListNoteVersionsTesterHelper: public QObject {} Q_SIGNALS: - void ListNoteVersionsRequestReady( + void listNoteVersionsRequestReady( QList value, QSharedPointer exceptionData); @@ -2069,13 +2191,16 @@ public Q_SLOTS: auto v = m_executor( noteGuid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listNoteVersionsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listNoteVersionsRequestReady( + {}, + e.exceptionData()); } } @@ -2107,7 +2232,7 @@ class NoteStoreGetNoteVersionTesterHelper: public QObject {} Q_SIGNALS: - void GetNoteVersionRequestReady( + void getNoteVersionRequestReady( Note value, QSharedPointer exceptionData); @@ -2129,13 +2254,16 @@ public Q_SLOTS: withResourcesRecognition, withResourcesAlternateData, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNoteVersionRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNoteVersionRequestReady( + {}, + e.exceptionData()); } } @@ -2167,7 +2295,7 @@ class NoteStoreGetResourceTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceRequestReady( + void getResourceRequestReady( Resource value, QSharedPointer exceptionData); @@ -2189,13 +2317,16 @@ public Q_SLOTS: withAttributes, withAlternateData, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceRequestReady( + {}, + e.exceptionData()); } } @@ -2223,7 +2354,7 @@ class NoteStoreGetResourceApplicationDataTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceApplicationDataRequestReady( + void getResourceApplicationDataRequestReady( LazyMap value, QSharedPointer exceptionData); @@ -2237,13 +2368,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceApplicationDataRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceApplicationDataRequestReady( + {}, + e.exceptionData()); } } @@ -2272,7 +2406,7 @@ class NoteStoreGetResourceApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceApplicationDataEntryRequestReady( + void getResourceApplicationDataEntryRequestReady( QString value, QSharedPointer exceptionData); @@ -2288,13 +2422,16 @@ public Q_SLOTS: guid, key, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -2324,7 +2461,7 @@ class NoteStoreSetResourceApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void SetResourceApplicationDataEntryRequestReady( + void setResourceApplicationDataEntryRequestReady( qint32 value, QSharedPointer exceptionData); @@ -2342,13 +2479,16 @@ public Q_SLOTS: key, value, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT setResourceApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT setResourceApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -2377,7 +2517,7 @@ class NoteStoreUnsetResourceApplicationDataEntryTesterHelper: public QObject {} Q_SIGNALS: - void UnsetResourceApplicationDataEntryRequestReady( + void unsetResourceApplicationDataEntryRequestReady( qint32 value, QSharedPointer exceptionData); @@ -2393,13 +2533,16 @@ public Q_SLOTS: guid, key, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + {}, + e.exceptionData()); } } @@ -2427,7 +2570,7 @@ class NoteStoreUpdateResourceTesterHelper: public QObject {} Q_SIGNALS: - void UpdateResourceRequestReady( + void updateResourceRequestReady( qint32 value, QSharedPointer exceptionData); @@ -2441,13 +2584,16 @@ public Q_SLOTS: auto v = m_executor( resource, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateResourceRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateResourceRequestReady( + {}, + e.exceptionData()); } } @@ -2475,7 +2621,7 @@ class NoteStoreGetResourceDataTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceDataRequestReady( + void getResourceDataRequestReady( QByteArray value, QSharedPointer exceptionData); @@ -2489,13 +2635,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceDataRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceDataRequestReady( + {}, + e.exceptionData()); } } @@ -2527,7 +2676,7 @@ class NoteStoreGetResourceByHashTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceByHashRequestReady( + void getResourceByHashRequestReady( Resource value, QSharedPointer exceptionData); @@ -2549,13 +2698,16 @@ public Q_SLOTS: withRecognition, withAlternateData, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceByHashRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceByHashRequestReady( + {}, + e.exceptionData()); } } @@ -2583,7 +2735,7 @@ class NoteStoreGetResourceRecognitionTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceRecognitionRequestReady( + void getResourceRecognitionRequestReady( QByteArray value, QSharedPointer exceptionData); @@ -2597,13 +2749,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceRecognitionRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceRecognitionRequestReady( + {}, + e.exceptionData()); } } @@ -2631,7 +2786,7 @@ class NoteStoreGetResourceAlternateDataTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceAlternateDataRequestReady( + void getResourceAlternateDataRequestReady( QByteArray value, QSharedPointer exceptionData); @@ -2645,13 +2800,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceAlternateDataRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceAlternateDataRequestReady( + {}, + e.exceptionData()); } } @@ -2679,7 +2837,7 @@ class NoteStoreGetResourceAttributesTesterHelper: public QObject {} Q_SIGNALS: - void GetResourceAttributesRequestReady( + void getResourceAttributesRequestReady( ResourceAttributes value, QSharedPointer exceptionData); @@ -2693,13 +2851,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getResourceAttributesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getResourceAttributesRequestReady( + {}, + e.exceptionData()); } } @@ -2728,7 +2889,7 @@ class NoteStoreGetPublicNotebookTesterHelper: public QObject {} Q_SIGNALS: - void GetPublicNotebookRequestReady( + void getPublicNotebookRequestReady( Notebook value, QSharedPointer exceptionData); @@ -2744,13 +2905,16 @@ public Q_SLOTS: userId, publicUri, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getPublicNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getPublicNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -2779,7 +2943,7 @@ class NoteStoreShareNotebookTesterHelper: public QObject {} Q_SIGNALS: - void ShareNotebookRequestReady( + void shareNotebookRequestReady( SharedNotebook value, QSharedPointer exceptionData); @@ -2795,13 +2959,16 @@ public Q_SLOTS: sharedNotebook, message, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT shareNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT shareNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -2829,7 +2996,7 @@ class NoteStoreCreateOrUpdateNotebookSharesTesterHelper: public QObject {} Q_SIGNALS: - void CreateOrUpdateNotebookSharesRequestReady( + void createOrUpdateNotebookSharesRequestReady( CreateOrUpdateNotebookSharesResult value, QSharedPointer exceptionData); @@ -2843,13 +3010,16 @@ public Q_SLOTS: auto v = m_executor( shareTemplate, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createOrUpdateNotebookSharesRequestReady( + {}, + e.exceptionData()); } } @@ -2877,7 +3047,7 @@ class NoteStoreUpdateSharedNotebookTesterHelper: public QObject {} Q_SIGNALS: - void UpdateSharedNotebookRequestReady( + void updateSharedNotebookRequestReady( qint32 value, QSharedPointer exceptionData); @@ -2891,13 +3061,16 @@ public Q_SLOTS: auto v = m_executor( sharedNotebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateSharedNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateSharedNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -2926,7 +3099,7 @@ class NoteStoreSetNotebookRecipientSettingsTesterHelper: public QObject {} Q_SIGNALS: - void SetNotebookRecipientSettingsRequestReady( + void setNotebookRecipientSettingsRequestReady( Notebook value, QSharedPointer exceptionData); @@ -2942,13 +3115,16 @@ public Q_SLOTS: notebookGuid, recipientSettings, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT setNotebookRecipientSettingsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT setNotebookRecipientSettingsRequestReady( + {}, + e.exceptionData()); } } @@ -2975,7 +3151,7 @@ class NoteStoreListSharedNotebooksTesterHelper: public QObject {} Q_SIGNALS: - void ListSharedNotebooksRequestReady( + void listSharedNotebooksRequestReady( QList value, QSharedPointer exceptionData); @@ -2987,13 +3163,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listSharedNotebooksRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listSharedNotebooksRequestReady( + {}, + e.exceptionData()); } } @@ -3021,7 +3200,7 @@ class NoteStoreCreateLinkedNotebookTesterHelper: public QObject {} Q_SIGNALS: - void CreateLinkedNotebookRequestReady( + void createLinkedNotebookRequestReady( LinkedNotebook value, QSharedPointer exceptionData); @@ -3035,13 +3214,16 @@ public Q_SLOTS: auto v = m_executor( linkedNotebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT createLinkedNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT createLinkedNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -3069,7 +3251,7 @@ class NoteStoreUpdateLinkedNotebookTesterHelper: public QObject {} Q_SIGNALS: - void UpdateLinkedNotebookRequestReady( + void updateLinkedNotebookRequestReady( qint32 value, QSharedPointer exceptionData); @@ -3083,13 +3265,16 @@ public Q_SLOTS: auto v = m_executor( linkedNotebook, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateLinkedNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateLinkedNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -3116,7 +3301,7 @@ class NoteStoreListLinkedNotebooksTesterHelper: public QObject {} Q_SIGNALS: - void ListLinkedNotebooksRequestReady( + void listLinkedNotebooksRequestReady( QList value, QSharedPointer exceptionData); @@ -3128,13 +3313,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listLinkedNotebooksRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listLinkedNotebooksRequestReady( + {}, + e.exceptionData()); } } @@ -3162,7 +3350,7 @@ class NoteStoreExpungeLinkedNotebookTesterHelper: public QObject {} Q_SIGNALS: - void ExpungeLinkedNotebookRequestReady( + void expungeLinkedNotebookRequestReady( qint32 value, QSharedPointer exceptionData); @@ -3176,13 +3364,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT expungeLinkedNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT expungeLinkedNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -3210,7 +3401,7 @@ class NoteStoreAuthenticateToSharedNotebookTesterHelper: public QObject {} Q_SIGNALS: - void AuthenticateToSharedNotebookRequestReady( + void authenticateToSharedNotebookRequestReady( AuthenticationResult value, QSharedPointer exceptionData); @@ -3224,13 +3415,16 @@ public Q_SLOTS: auto v = m_executor( shareKeyOrGlobalId, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT authenticateToSharedNotebookRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT authenticateToSharedNotebookRequestReady( + {}, + e.exceptionData()); } } @@ -3257,7 +3451,7 @@ class NoteStoreGetSharedNotebookByAuthTesterHelper: public QObject {} Q_SIGNALS: - void GetSharedNotebookByAuthRequestReady( + void getSharedNotebookByAuthRequestReady( SharedNotebook value, QSharedPointer exceptionData); @@ -3269,13 +3463,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getSharedNotebookByAuthRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getSharedNotebookByAuthRequestReady( + {}, + e.exceptionData()); } } @@ -3303,7 +3500,7 @@ class NoteStoreEmailNoteTesterHelper: public QObject {} Q_SIGNALS: - void EmailNoteRequestReady( + void emailNoteRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -3316,12 +3513,14 @@ public Q_SLOTS: m_executor( parameters, ctx); - // TODO: emit finished + + Q_EMIT emailNoteRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT emailNoteRequestReady( + e.exceptionData()); } } @@ -3349,7 +3548,7 @@ class NoteStoreShareNoteTesterHelper: public QObject {} Q_SIGNALS: - void ShareNoteRequestReady( + void shareNoteRequestReady( QString value, QSharedPointer exceptionData); @@ -3363,13 +3562,16 @@ public Q_SLOTS: auto v = m_executor( guid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT shareNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT shareNoteRequestReady( + {}, + e.exceptionData()); } } @@ -3397,7 +3599,7 @@ class NoteStoreStopSharingNoteTesterHelper: public QObject {} Q_SIGNALS: - void StopSharingNoteRequestReady( + void stopSharingNoteRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -3410,12 +3612,14 @@ public Q_SLOTS: m_executor( guid, ctx); - // TODO: emit finished + + Q_EMIT stopSharingNoteRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT stopSharingNoteRequestReady( + e.exceptionData()); } } @@ -3444,7 +3648,7 @@ class NoteStoreAuthenticateToSharedNoteTesterHelper: public QObject {} Q_SIGNALS: - void AuthenticateToSharedNoteRequestReady( + void authenticateToSharedNoteRequestReady( AuthenticationResult value, QSharedPointer exceptionData); @@ -3460,13 +3664,16 @@ public Q_SLOTS: guid, noteKey, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT authenticateToSharedNoteRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT authenticateToSharedNoteRequestReady( + {}, + e.exceptionData()); } } @@ -3495,7 +3702,7 @@ class NoteStoreFindRelatedTesterHelper: public QObject {} Q_SIGNALS: - void FindRelatedRequestReady( + void findRelatedRequestReady( RelatedResult value, QSharedPointer exceptionData); @@ -3511,13 +3718,16 @@ public Q_SLOTS: query, resultSpec, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT findRelatedRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT findRelatedRequestReady( + {}, + e.exceptionData()); } } @@ -3545,7 +3755,7 @@ class NoteStoreUpdateNoteIfUsnMatchesTesterHelper: public QObject {} Q_SIGNALS: - void UpdateNoteIfUsnMatchesRequestReady( + void updateNoteIfUsnMatchesRequestReady( UpdateNoteIfUsnMatchesResult value, QSharedPointer exceptionData); @@ -3559,13 +3769,16 @@ public Q_SLOTS: auto v = m_executor( note, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateNoteIfUsnMatchesRequestReady( + {}, + e.exceptionData()); } } @@ -3593,7 +3806,7 @@ class NoteStoreManageNotebookSharesTesterHelper: public QObject {} Q_SIGNALS: - void ManageNotebookSharesRequestReady( + void manageNotebookSharesRequestReady( ManageNotebookSharesResult value, QSharedPointer exceptionData); @@ -3607,13 +3820,16 @@ public Q_SLOTS: auto v = m_executor( parameters, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT manageNotebookSharesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT manageNotebookSharesRequestReady( + {}, + e.exceptionData()); } } @@ -3641,7 +3857,7 @@ class NoteStoreGetNotebookSharesTesterHelper: public QObject {} Q_SIGNALS: - void GetNotebookSharesRequestReady( + void getNotebookSharesRequestReady( ShareRelationships value, QSharedPointer exceptionData); @@ -3655,13 +3871,16 @@ public Q_SLOTS: auto v = m_executor( notebookGuid, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getNotebookSharesRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getNotebookSharesRequestReady( + {}, + e.exceptionData()); } } diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 4834cfcd..37c6eda4 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -43,7 +43,7 @@ class UserStoreCheckVersionTesterHelper: public QObject {} Q_SIGNALS: - void CheckVersionRequestReady( + void checkVersionRequestReady( bool value, QSharedPointer exceptionData); @@ -61,13 +61,16 @@ public Q_SLOTS: edamVersionMajor, edamVersionMinor, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT checkVersionRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT checkVersionRequestReady( + {}, + e.exceptionData()); } } @@ -95,7 +98,7 @@ class UserStoreGetBootstrapInfoTesterHelper: public QObject {} Q_SIGNALS: - void GetBootstrapInfoRequestReady( + void getBootstrapInfoRequestReady( BootstrapInfo value, QSharedPointer exceptionData); @@ -109,13 +112,16 @@ public Q_SLOTS: auto v = m_executor( locale, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getBootstrapInfoRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getBootstrapInfoRequestReady( + {}, + e.exceptionData()); } } @@ -149,7 +155,7 @@ class UserStoreAuthenticateLongSessionTesterHelper: public QObject {} Q_SIGNALS: - void AuthenticateLongSessionRequestReady( + void authenticateLongSessionRequestReady( AuthenticationResult value, QSharedPointer exceptionData); @@ -175,13 +181,16 @@ public Q_SLOTS: deviceDescription, supportsTwoFactor, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT authenticateLongSessionRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT authenticateLongSessionRequestReady( + {}, + e.exceptionData()); } } @@ -211,7 +220,7 @@ class UserStoreCompleteTwoFactorAuthenticationTesterHelper: public QObject {} Q_SIGNALS: - void CompleteTwoFactorAuthenticationRequestReady( + void completeTwoFactorAuthenticationRequestReady( AuthenticationResult value, QSharedPointer exceptionData); @@ -229,13 +238,16 @@ public Q_SLOTS: deviceIdentifier, deviceDescription, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT completeTwoFactorAuthenticationRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT completeTwoFactorAuthenticationRequestReady( + {}, + e.exceptionData()); } } @@ -262,7 +274,7 @@ class UserStoreRevokeLongSessionTesterHelper: public QObject {} Q_SIGNALS: - void RevokeLongSessionRequestReady( + void revokeLongSessionRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -273,12 +285,14 @@ public Q_SLOTS: { m_executor( ctx); - // TODO: emit finished + + Q_EMIT revokeLongSessionRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT revokeLongSessionRequestReady( + e.exceptionData()); } } @@ -305,7 +319,7 @@ class UserStoreAuthenticateToBusinessTesterHelper: public QObject {} Q_SIGNALS: - void AuthenticateToBusinessRequestReady( + void authenticateToBusinessRequestReady( AuthenticationResult value, QSharedPointer exceptionData); @@ -317,13 +331,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT authenticateToBusinessRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT authenticateToBusinessRequestReady( + {}, + e.exceptionData()); } } @@ -350,7 +367,7 @@ class UserStoreGetUserTesterHelper: public QObject {} Q_SIGNALS: - void GetUserRequestReady( + void getUserRequestReady( User value, QSharedPointer exceptionData); @@ -362,13 +379,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getUserRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getUserRequestReady( + {}, + e.exceptionData()); } } @@ -396,7 +416,7 @@ class UserStoreGetPublicUserInfoTesterHelper: public QObject {} Q_SIGNALS: - void GetPublicUserInfoRequestReady( + void getPublicUserInfoRequestReady( PublicUserInfo value, QSharedPointer exceptionData); @@ -410,13 +430,16 @@ public Q_SLOTS: auto v = m_executor( username, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getPublicUserInfoRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getPublicUserInfoRequestReady( + {}, + e.exceptionData()); } } @@ -443,7 +466,7 @@ class UserStoreGetUserUrlsTesterHelper: public QObject {} Q_SIGNALS: - void GetUserUrlsRequestReady( + void getUserUrlsRequestReady( UserUrls value, QSharedPointer exceptionData); @@ -455,13 +478,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getUserUrlsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getUserUrlsRequestReady( + {}, + e.exceptionData()); } } @@ -489,7 +515,7 @@ class UserStoreInviteToBusinessTesterHelper: public QObject {} Q_SIGNALS: - void InviteToBusinessRequestReady( + void inviteToBusinessRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -502,12 +528,14 @@ public Q_SLOTS: m_executor( emailAddress, ctx); - // TODO: emit finished + + Q_EMIT inviteToBusinessRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT inviteToBusinessRequestReady( + e.exceptionData()); } } @@ -535,7 +563,7 @@ class UserStoreRemoveFromBusinessTesterHelper: public QObject {} Q_SIGNALS: - void RemoveFromBusinessRequestReady( + void removeFromBusinessRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -548,12 +576,14 @@ public Q_SLOTS: m_executor( emailAddress, ctx); - // TODO: emit finished + + Q_EMIT removeFromBusinessRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT removeFromBusinessRequestReady( + e.exceptionData()); } } @@ -582,7 +612,7 @@ class UserStoreUpdateBusinessUserIdentifierTesterHelper: public QObject {} Q_SIGNALS: - void UpdateBusinessUserIdentifierRequestReady( + void updateBusinessUserIdentifierRequestReady( QSharedPointer exceptionData); public Q_SLOTS: @@ -597,12 +627,14 @@ public Q_SLOTS: oldEmailAddress, newEmailAddress, ctx); - // TODO: emit finished + + Q_EMIT updateBusinessUserIdentifierRequestReady( + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT updateBusinessUserIdentifierRequestReady( + e.exceptionData()); } } @@ -629,7 +661,7 @@ class UserStoreListBusinessUsersTesterHelper: public QObject {} Q_SIGNALS: - void ListBusinessUsersRequestReady( + void listBusinessUsersRequestReady( QList value, QSharedPointer exceptionData); @@ -641,13 +673,16 @@ public Q_SLOTS: { auto v = m_executor( ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listBusinessUsersRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listBusinessUsersRequestReady( + {}, + e.exceptionData()); } } @@ -675,7 +710,7 @@ class UserStoreListBusinessInvitationsTesterHelper: public QObject {} Q_SIGNALS: - void ListBusinessInvitationsRequestReady( + void listBusinessInvitationsRequestReady( QList value, QSharedPointer exceptionData); @@ -689,13 +724,16 @@ public Q_SLOTS: auto v = m_executor( includeRequestedInvitations, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT listBusinessInvitationsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT listBusinessInvitationsRequestReady( + {}, + e.exceptionData()); } } @@ -723,7 +761,7 @@ class UserStoreGetAccountLimitsTesterHelper: public QObject {} Q_SIGNALS: - void GetAccountLimitsRequestReady( + void getAccountLimitsRequestReady( AccountLimits value, QSharedPointer exceptionData); @@ -737,13 +775,16 @@ public Q_SLOTS: auto v = m_executor( serviceLevel, ctx); - // TODO: emit finished - Q_UNUSED(v) + + Q_EMIT getAccountLimitsRequestReady( + v, + QSharedPointer()); } catch(const EverCloudException & e) { - // TODO: emit error - Q_UNUSED(e) + Q_EMIT getAccountLimitsRequestReady( + {}, + e.exceptionData()); } } From e324f0c4f839f55e972d6d5023c52e313e15fd8b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 17 Nov 2019 19:38:59 +0300 Subject: [PATCH 073/188] Update generated code --- QEverCloud/headers/generated/Servers.h | 269 +++++++++++++++++++++++++ QEverCloud/src/generated/Servers.cpp | 267 ++++++++++++++++++++++++ 2 files changed, 536 insertions(+) diff --git a/QEverCloud/headers/generated/Servers.h b/QEverCloud/headers/generated/Servers.h index d55baa16..a76160aa 100644 --- a/QEverCloud/headers/generated/Servers.h +++ b/QEverCloud/headers/generated/Servers.h @@ -369,6 +369,229 @@ class QEVERCLOUD_EXPORT NoteStoreServer: public QObject QString notebookGuid, IRequestContextPtr ctx); + // Signals used to send encoded response data + void getSyncStateRequestReady( + QByteArray data); + + void getFilteredSyncChunkRequestReady( + QByteArray data); + + void getLinkedNotebookSyncStateRequestReady( + QByteArray data); + + void getLinkedNotebookSyncChunkRequestReady( + QByteArray data); + + void listNotebooksRequestReady( + QByteArray data); + + void listAccessibleBusinessNotebooksRequestReady( + QByteArray data); + + void getNotebookRequestReady( + QByteArray data); + + void getDefaultNotebookRequestReady( + QByteArray data); + + void createNotebookRequestReady( + QByteArray data); + + void updateNotebookRequestReady( + QByteArray data); + + void expungeNotebookRequestReady( + QByteArray data); + + void listTagsRequestReady( + QByteArray data); + + void listTagsByNotebookRequestReady( + QByteArray data); + + void getTagRequestReady( + QByteArray data); + + void createTagRequestReady( + QByteArray data); + + void updateTagRequestReady( + QByteArray data); + + void untagAllRequestReady( + QByteArray data); + + void expungeTagRequestReady( + QByteArray data); + + void listSearchesRequestReady( + QByteArray data); + + void getSearchRequestReady( + QByteArray data); + + void createSearchRequestReady( + QByteArray data); + + void updateSearchRequestReady( + QByteArray data); + + void expungeSearchRequestReady( + QByteArray data); + + void findNoteOffsetRequestReady( + QByteArray data); + + void findNotesMetadataRequestReady( + QByteArray data); + + void findNoteCountsRequestReady( + QByteArray data); + + void getNoteWithResultSpecRequestReady( + QByteArray data); + + void getNoteRequestReady( + QByteArray data); + + void getNoteApplicationDataRequestReady( + QByteArray data); + + void getNoteApplicationDataEntryRequestReady( + QByteArray data); + + void setNoteApplicationDataEntryRequestReady( + QByteArray data); + + void unsetNoteApplicationDataEntryRequestReady( + QByteArray data); + + void getNoteContentRequestReady( + QByteArray data); + + void getNoteSearchTextRequestReady( + QByteArray data); + + void getResourceSearchTextRequestReady( + QByteArray data); + + void getNoteTagNamesRequestReady( + QByteArray data); + + void createNoteRequestReady( + QByteArray data); + + void updateNoteRequestReady( + QByteArray data); + + void deleteNoteRequestReady( + QByteArray data); + + void expungeNoteRequestReady( + QByteArray data); + + void copyNoteRequestReady( + QByteArray data); + + void listNoteVersionsRequestReady( + QByteArray data); + + void getNoteVersionRequestReady( + QByteArray data); + + void getResourceRequestReady( + QByteArray data); + + void getResourceApplicationDataRequestReady( + QByteArray data); + + void getResourceApplicationDataEntryRequestReady( + QByteArray data); + + void setResourceApplicationDataEntryRequestReady( + QByteArray data); + + void unsetResourceApplicationDataEntryRequestReady( + QByteArray data); + + void updateResourceRequestReady( + QByteArray data); + + void getResourceDataRequestReady( + QByteArray data); + + void getResourceByHashRequestReady( + QByteArray data); + + void getResourceRecognitionRequestReady( + QByteArray data); + + void getResourceAlternateDataRequestReady( + QByteArray data); + + void getResourceAttributesRequestReady( + QByteArray data); + + void getPublicNotebookRequestReady( + QByteArray data); + + void shareNotebookRequestReady( + QByteArray data); + + void createOrUpdateNotebookSharesRequestReady( + QByteArray data); + + void updateSharedNotebookRequestReady( + QByteArray data); + + void setNotebookRecipientSettingsRequestReady( + QByteArray data); + + void listSharedNotebooksRequestReady( + QByteArray data); + + void createLinkedNotebookRequestReady( + QByteArray data); + + void updateLinkedNotebookRequestReady( + QByteArray data); + + void listLinkedNotebooksRequestReady( + QByteArray data); + + void expungeLinkedNotebookRequestReady( + QByteArray data); + + void authenticateToSharedNotebookRequestReady( + QByteArray data); + + void getSharedNotebookByAuthRequestReady( + QByteArray data); + + void emailNoteRequestReady( + QByteArray data); + + void shareNoteRequestReady( + QByteArray data); + + void stopSharingNoteRequestReady( + QByteArray data); + + void authenticateToSharedNoteRequestReady( + QByteArray data); + + void findRelatedRequestReady( + QByteArray data); + + void updateNoteIfUsnMatchesRequestReady( + QByteArray data); + + void manageNotebookSharesRequestReady( + QByteArray data); + + void getNotebookSharesRequestReady( + QByteArray data); + public Q_SLOTS: // Slot used to deliver requests to the server void onRequest(QByteArray data); @@ -751,6 +974,52 @@ class QEVERCLOUD_EXPORT UserStoreServer: public QObject ServiceLevel serviceLevel, IRequestContextPtr ctx); + // Signals used to send encoded response data + void checkVersionRequestReady( + QByteArray data); + + void getBootstrapInfoRequestReady( + QByteArray data); + + void authenticateLongSessionRequestReady( + QByteArray data); + + void completeTwoFactorAuthenticationRequestReady( + QByteArray data); + + void revokeLongSessionRequestReady( + QByteArray data); + + void authenticateToBusinessRequestReady( + QByteArray data); + + void getUserRequestReady( + QByteArray data); + + void getPublicUserInfoRequestReady( + QByteArray data); + + void getUserUrlsRequestReady( + QByteArray data); + + void inviteToBusinessRequestReady( + QByteArray data); + + void removeFromBusinessRequestReady( + QByteArray data); + + void updateBusinessUserIdentifierRequestReady( + QByteArray data); + + void listBusinessUsersRequestReady( + QByteArray data); + + void listBusinessInvitationsRequestReady( + QByteArray data); + + void getAccountLimitsRequestReady( + QByteArray data); + public Q_SLOTS: // Slot used to deliver requests to the server void onRequest(QByteArray data); diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index a71696ed..0adc518b 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -6845,6 +6845,9 @@ void NoteStoreServer::onGetSyncStateRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSyncStateRequestReady( + writer.buffer()); } void NoteStoreServer::onGetFilteredSyncChunkRequestReady( @@ -6941,6 +6944,9 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getFilteredSyncChunkRequestReady( + writer.buffer()); } void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( @@ -7052,6 +7058,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + writer.buffer()); } void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( @@ -7163,6 +7172,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + writer.buffer()); } void NoteStoreServer::onListNotebooksRequestReady( @@ -7263,6 +7275,9 @@ void NoteStoreServer::onListNotebooksRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNotebooksRequestReady( + writer.buffer()); } void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( @@ -7363,6 +7378,9 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNotebookRequestReady( @@ -7474,6 +7492,9 @@ void NoteStoreServer::onGetNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onGetDefaultNotebookRequestReady( @@ -7570,6 +7591,9 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getDefaultNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateNotebookRequestReady( @@ -7681,6 +7705,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateNotebookRequestReady( @@ -7792,6 +7819,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onExpungeNotebookRequestReady( @@ -7903,6 +7933,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onListTagsRequestReady( @@ -8003,6 +8036,9 @@ void NoteStoreServer::onListTagsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsRequestReady( + writer.buffer()); } void NoteStoreServer::onListTagsByNotebookRequestReady( @@ -8118,6 +8154,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsByNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onGetTagRequestReady( @@ -8229,6 +8268,9 @@ void NoteStoreServer::onGetTagRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getTagRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateTagRequestReady( @@ -8340,6 +8382,9 @@ void NoteStoreServer::onCreateTagRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createTagRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateTagRequestReady( @@ -8451,6 +8496,9 @@ void NoteStoreServer::onUpdateTagRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateTagRequestReady( + writer.buffer()); } void NoteStoreServer::onUntagAllRequestReady( @@ -8560,6 +8608,9 @@ void NoteStoreServer::onUntagAllRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT untagAllRequestReady( + writer.buffer()); } void NoteStoreServer::onExpungeTagRequestReady( @@ -8671,6 +8722,9 @@ void NoteStoreServer::onExpungeTagRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeTagRequestReady( + writer.buffer()); } void NoteStoreServer::onListSearchesRequestReady( @@ -8771,6 +8825,9 @@ void NoteStoreServer::onListSearchesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSearchesRequestReady( + writer.buffer()); } void NoteStoreServer::onGetSearchRequestReady( @@ -8882,6 +8939,9 @@ void NoteStoreServer::onGetSearchRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSearchRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateSearchRequestReady( @@ -8978,6 +9038,9 @@ void NoteStoreServer::onCreateSearchRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createSearchRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateSearchRequestReady( @@ -9089,6 +9152,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSearchRequestReady( + writer.buffer()); } void NoteStoreServer::onExpungeSearchRequestReady( @@ -9200,6 +9266,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeSearchRequestReady( + writer.buffer()); } void NoteStoreServer::onFindNoteOffsetRequestReady( @@ -9311,6 +9380,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteOffsetRequestReady( + writer.buffer()); } void NoteStoreServer::onFindNotesMetadataRequestReady( @@ -9422,6 +9494,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNotesMetadataRequestReady( + writer.buffer()); } void NoteStoreServer::onFindNoteCountsRequestReady( @@ -9533,6 +9608,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteCountsRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteWithResultSpecRequestReady( @@ -9644,6 +9722,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteWithResultSpecRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteRequestReady( @@ -9755,6 +9836,9 @@ void NoteStoreServer::onGetNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteApplicationDataRequestReady( @@ -9866,6 +9950,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( @@ -9977,6 +10064,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( @@ -10088,6 +10178,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNoteApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( @@ -10199,6 +10292,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteContentRequestReady( @@ -10310,6 +10406,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteContentRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteSearchTextRequestReady( @@ -10421,6 +10520,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteSearchTextRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceSearchTextRequestReady( @@ -10532,6 +10634,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceSearchTextRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteTagNamesRequestReady( @@ -10647,6 +10752,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteTagNamesRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateNoteRequestReady( @@ -10758,6 +10866,9 @@ void NoteStoreServer::onCreateNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateNoteRequestReady( @@ -10869,6 +10980,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onDeleteNoteRequestReady( @@ -10980,6 +11094,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT deleteNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onExpungeNoteRequestReady( @@ -11091,6 +11208,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onCopyNoteRequestReady( @@ -11202,6 +11322,9 @@ void NoteStoreServer::onCopyNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT copyNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onListNoteVersionsRequestReady( @@ -11317,6 +11440,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNoteVersionsRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNoteVersionRequestReady( @@ -11428,6 +11554,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteVersionRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceRequestReady( @@ -11539,6 +11668,9 @@ void NoteStoreServer::onGetResourceRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceApplicationDataRequestReady( @@ -11650,6 +11782,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( @@ -11761,6 +11896,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( @@ -11872,6 +12010,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setResourceApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( @@ -11983,6 +12124,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateResourceRequestReady( @@ -12094,6 +12238,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateResourceRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceDataRequestReady( @@ -12205,6 +12352,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceDataRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceByHashRequestReady( @@ -12316,6 +12466,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceByHashRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceRecognitionRequestReady( @@ -12427,6 +12580,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRecognitionRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceAlternateDataRequestReady( @@ -12538,6 +12694,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAlternateDataRequestReady( + writer.buffer()); } void NoteStoreServer::onGetResourceAttributesRequestReady( @@ -12649,6 +12808,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAttributesRequestReady( + writer.buffer()); } void NoteStoreServer::onGetPublicNotebookRequestReady( @@ -12745,6 +12907,9 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onShareNotebookRequestReady( @@ -12856,6 +13021,9 @@ void NoteStoreServer::onShareNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( @@ -12982,6 +13150,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateSharedNotebookRequestReady( @@ -13093,6 +13264,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSharedNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( @@ -13204,6 +13378,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNotebookRecipientSettingsRequestReady( + writer.buffer()); } void NoteStoreServer::onListSharedNotebooksRequestReady( @@ -13319,6 +13496,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSharedNotebooksRequestReady( + writer.buffer()); } void NoteStoreServer::onCreateLinkedNotebookRequestReady( @@ -13430,6 +13610,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createLinkedNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateLinkedNotebookRequestReady( @@ -13541,6 +13724,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateLinkedNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onListLinkedNotebooksRequestReady( @@ -13656,6 +13842,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listLinkedNotebooksRequestReady( + writer.buffer()); } void NoteStoreServer::onExpungeLinkedNotebookRequestReady( @@ -13767,6 +13956,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeLinkedNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( @@ -13878,6 +14070,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNotebookRequestReady( + writer.buffer()); } void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( @@ -13989,6 +14184,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSharedNotebookByAuthRequestReady( + writer.buffer()); } void NoteStoreServer::onEmailNoteRequestReady( @@ -14098,6 +14296,9 @@ void NoteStoreServer::onEmailNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT emailNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onShareNoteRequestReady( @@ -14209,6 +14410,9 @@ void NoteStoreServer::onShareNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onStopSharingNoteRequestReady( @@ -14318,6 +14522,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT stopSharingNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( @@ -14429,6 +14636,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNoteRequestReady( + writer.buffer()); } void NoteStoreServer::onFindRelatedRequestReady( @@ -14540,6 +14750,9 @@ void NoteStoreServer::onFindRelatedRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findRelatedRequestReady( + writer.buffer()); } void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( @@ -14651,6 +14864,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + writer.buffer()); } void NoteStoreServer::onManageNotebookSharesRequestReady( @@ -14762,6 +14978,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT manageNotebookSharesRequestReady( + writer.buffer()); } void NoteStoreServer::onGetNotebookSharesRequestReady( @@ -14873,6 +15092,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookSharesRequestReady( + writer.buffer()); } //////////////////////////////////////////////////////////////////////////////// @@ -15171,6 +15393,9 @@ void UserStoreServer::onCheckVersionRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT checkVersionRequestReady( + writer.buffer()); } void UserStoreServer::onGetBootstrapInfoRequestReady( @@ -15219,6 +15444,9 @@ void UserStoreServer::onGetBootstrapInfoRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getBootstrapInfoRequestReady( + writer.buffer()); } void UserStoreServer::onAuthenticateLongSessionRequestReady( @@ -15315,6 +15543,9 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateLongSessionRequestReady( + writer.buffer()); } void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( @@ -15411,6 +15642,9 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT completeTwoFactorAuthenticationRequestReady( + writer.buffer()); } void UserStoreServer::onRevokeLongSessionRequestReady( @@ -15505,6 +15739,9 @@ void UserStoreServer::onRevokeLongSessionRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT revokeLongSessionRequestReady( + writer.buffer()); } void UserStoreServer::onAuthenticateToBusinessRequestReady( @@ -15601,6 +15838,9 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToBusinessRequestReady( + writer.buffer()); } void UserStoreServer::onGetUserRequestReady( @@ -15697,6 +15937,9 @@ void UserStoreServer::onGetUserRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserRequestReady( + writer.buffer()); } void UserStoreServer::onGetPublicUserInfoRequestReady( @@ -15808,6 +16051,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicUserInfoRequestReady( + writer.buffer()); } void UserStoreServer::onGetUserUrlsRequestReady( @@ -15904,6 +16150,9 @@ void UserStoreServer::onGetUserUrlsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserUrlsRequestReady( + writer.buffer()); } void UserStoreServer::onInviteToBusinessRequestReady( @@ -15998,6 +16247,9 @@ void UserStoreServer::onInviteToBusinessRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT inviteToBusinessRequestReady( + writer.buffer()); } void UserStoreServer::onRemoveFromBusinessRequestReady( @@ -16107,6 +16359,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT removeFromBusinessRequestReady( + writer.buffer()); } void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( @@ -16216,6 +16471,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateBusinessUserIdentifierRequestReady( + writer.buffer()); } void UserStoreServer::onListBusinessUsersRequestReady( @@ -16316,6 +16574,9 @@ void UserStoreServer::onListBusinessUsersRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessUsersRequestReady( + writer.buffer()); } void UserStoreServer::onListBusinessInvitationsRequestReady( @@ -16416,6 +16677,9 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessInvitationsRequestReady( + writer.buffer()); } void UserStoreServer::onGetAccountLimitsRequestReady( @@ -16497,6 +16761,9 @@ void UserStoreServer::onGetAccountLimitsRequestReady( writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getAccountLimitsRequestReady( + writer.buffer()); } } // namespace qevercloud From 8a634510ff153557e1c4ae1f399f61e4d2ef8244 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 18 Nov 2019 07:14:50 +0300 Subject: [PATCH 074/188] Add request identifier to request context and log it --- QEverCloud/headers/AsyncResult.h | 10 +- QEverCloud/headers/RequestContext.h | 4 + QEverCloud/src/AsyncResult.cpp | 35 +- QEverCloud/src/AsyncResult_p.cpp | 16 +- QEverCloud/src/AsyncResult_p.h | 9 +- QEverCloud/src/DurableService.cpp | 10 +- QEverCloud/src/RequestContext.cpp | 19 +- QEverCloud/src/Thumbnail.cpp | 7 +- QEverCloud/src/generated/Services.cpp | 1279 +++++++++++-------- QEverCloud/src/tests/TestDurableService.cpp | 10 +- 10 files changed, 855 insertions(+), 544 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index af44353a..abf707a7 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -15,6 +15,7 @@ #include #include +#include namespace qevercloud { @@ -54,11 +55,13 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject typedef QVariant (*ReadFunctionType)(QByteArray replyData); - AsyncResult(QString url, QByteArray postData, qint64 timeoutMsec, + AsyncResult(QString url, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); - AsyncResult(QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + AsyncResult(QNetworkRequest request, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); @@ -67,7 +70,8 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * for use in tests */ AsyncResult(QVariant result, QSharedPointer error, - bool autoDelete = true, QObject * parent = nullptr); + QUuid requestId, bool autoDelete = true, + QObject * parent = nullptr); ~AsyncResult(); diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 8e6f79b1..b5d7c249 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace qevercloud { @@ -35,6 +36,9 @@ static constexpr quint32 DEFAULT_MAX_REQUEST_RETRY_COUNT = 10; class QEVERCLOUD_EXPORT IRequestContext { public: + /** Automatically generated unique identifier for each request */ + virtual QUuid requestId() const = 0; + /** Authentication token to use along with the request */ virtual QString authenticationToken() const = 0; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index 5c3f92f7..fdb849a3 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -26,12 +26,12 @@ QVariant AsyncResult::asIs(QByteArray replyData) } AsyncResult::AsyncResult( - QString url, QByteArray postData, qint64 timeoutMsec, + QString url, QByteArray postData, qint64 timeoutMsec, QUuid requestId, AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate( - url, postData, timeoutMsec, readFunction, autoDelete, this)) + url, postData, timeoutMsec, requestId, readFunction, autoDelete, this)) { if (!url.isEmpty()) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); @@ -40,19 +40,20 @@ AsyncResult::AsyncResult( AsyncResult::AsyncResult( QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, - qevercloud::AsyncResult::ReadFunctionType readFunction, bool autoDelete, - QObject * parent) : + QUuid requestId, qevercloud::AsyncResult::ReadFunctionType readFunction, + bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate( - request, postData, timeoutMsec, readFunction, autoDelete, this)) + request, postData, timeoutMsec, requestId, readFunction, autoDelete, this)) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } -AsyncResult::AsyncResult(QVariant result, QSharedPointer error, - bool autoDelete, QObject * parent) : +AsyncResult::AsyncResult( + QVariant result, QSharedPointer error, + QUuid requestId, bool autoDelete, QObject * parent) : QObject(parent), - d_ptr(new AsyncResultPrivate(result, error, autoDelete, this)) + d_ptr(new AsyncResultPrivate(result, error, requestId, autoDelete, this)) {} AsyncResult::~AsyncResult() @@ -63,14 +64,22 @@ AsyncResult::~AsyncResult() bool AsyncResult::waitForFinished(int timeout) { QEventLoop loop; - QObject::connect(this, - SIGNAL(finished(QVariant,QSharedPointer)), - &loop, SLOT(quit())); + QObject::connect( + this, + SIGNAL(finished(QVariant,QSharedPointer)), + &loop, + SLOT(quit())); - if(timeout >= 0) { + if (timeout >= 0) + { QTimer timer; EventLoopFinisher finisher(&loop, 1); - connect(&timer, SIGNAL(timeout()), &finisher, SLOT(stopEventLoop())); + QObject::connect( + &timer, + SIGNAL(timeout()), + &finisher, + SLOT(stopEventLoop())); + timer.setSingleShot(true); timer.setInterval(timeout); timer.start(); diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index f73d5eaa..cc4dff24 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -9,12 +9,16 @@ #include "AsyncResult_p.h" #include "Http.h" +#include + namespace qevercloud { AsyncResultPrivate::AsyncResultPrivate( - QString url, QByteArray postData, qint64 timeoutMsec, + QString url, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : + m_requestId(requestId), m_request(createEvernoteRequest(url)), m_postData(postData), m_timeoutMsec(timeoutMsec), @@ -24,9 +28,11 @@ AsyncResultPrivate::AsyncResultPrivate( {} AsyncResultPrivate::AsyncResultPrivate( - QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + QNetworkRequest request, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : + m_requestId(requestId), m_request(request), m_postData(postData), m_timeoutMsec(timeoutMsec), @@ -37,7 +43,8 @@ AsyncResultPrivate::AsyncResultPrivate( AsyncResultPrivate::AsyncResultPrivate( QVariant result, QSharedPointer error, - bool autoDelete, AsyncResult * q) : + QUuid requestId, bool autoDelete, AsyncResult * q) : + m_requestId(requestId), m_autoDelete(autoDelete), q_ptr(q) { @@ -65,6 +72,9 @@ void AsyncResultPrivate::start() void AsyncResultPrivate::onReplyFetched(QObject * rp) { + QEC_DEBUG("async_result", "received reply for request with id " + << m_requestId); + ReplyFetcher * reply = qobject_cast(rp); QSharedPointer error; QVariant result; diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 4649fe03..441fe721 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -18,18 +18,20 @@ class AsyncResultPrivate: public QObject Q_OBJECT public: explicit AsyncResultPrivate( - QString url, QByteArray postData, qint64 timeoutMsec, + QString url, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); explicit AsyncResultPrivate( - QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, + QNetworkRequest request, QByteArray postData, + qint64 timeoutMsec, QUuid requestId, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); explicit AsyncResultPrivate( QVariant result, QSharedPointer error, - bool autoDelete, AsyncResult * q); + QUuid requestId, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); @@ -44,6 +46,7 @@ public Q_SLOTS: void setValue(QVariant result, QSharedPointer error); public: + QUuid m_requestId; QNetworkRequest m_request; QByteArray m_postData; qint64 m_timeoutMsec = 0; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 46e469c8..0408f596 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -228,7 +228,7 @@ AsyncResult * DurableService::executeAsyncRequest( RetryState state; state.m_retryCount = ctx->maxRequestRetryCount(); - AsyncResult * result = new AsyncResult(QString(), QByteArray(), 0); + AsyncResult * result = new AsyncResult(QString(), QByteArray(), 0, ctx->requestId()); doExecuteAsyncRequest(std::move(asyncRequest), std::move(ctx), std::move(state), result); @@ -241,7 +241,7 @@ void DurableService::doExecuteAsyncRequest( { QEC_DEBUG("durable_service", "Executing async " << asyncRequest.m_name << " request: " << retryState.m_retryCount << " attempts left, timeout = " - << ctx->requestTimeout()); + << ctx->requestTimeout() << ", request id = " << ctx->requestId()); QEC_TRACE("durable_service", "Request details: " << asyncRequest.m_description); @@ -256,12 +256,14 @@ void DurableService::doExecuteAsyncRequest( { if (!exceptionData) { QEC_DEBUG("durable_service", "Successfully executed async " - << asyncRequest.m_name << " request"); + << asyncRequest.m_name << " request with id " + << ctx->requestId()); result->d_ptr->setValue(value, {}); return; } - QEC_WARNING("durable_service", "Sync request " << asyncRequest.m_name + QEC_WARNING("durable_service", "Sync request " + << asyncRequest.m_name << " with id " << ctx->requestId() << " failed: " << exceptionData->errorMessage << "; request details: " << asyncRequest.m_description); diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index e3d62181..7d752dbb 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -4,13 +4,14 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext +class Q_DECL_HIDDEN RequestContext final: public IRequestContext { public: RequestContext(QString authenticationToken, qint64 requestTimeout, bool increaseRequestTimeoutExponentially, qint64 maxRequestTimeout, quint32 maxRequestRetryCount) : + m_requestId(QUuid::createUuid()), m_authenticationToken(std::move(authenticationToken)), m_requestTimeout(requestTimeout), m_increaseRequestTimeoutExponentially(increaseRequestTimeoutExponentially), @@ -18,32 +19,38 @@ class Q_DECL_HIDDEN RequestContext Q_DECL_FINAL: public IRequestContext m_maxRequestRetryCount(maxRequestRetryCount) {} - virtual QString authenticationToken() const Q_DECL_OVERRIDE + virtual QUuid requestId() const override + { + return m_requestId; + } + + virtual QString authenticationToken() const override { return m_authenticationToken; } - virtual qint64 requestTimeout() const Q_DECL_OVERRIDE + virtual qint64 requestTimeout() const override { return m_requestTimeout; } - virtual bool increaseRequestTimeoutExponentially() const Q_DECL_OVERRIDE + virtual bool increaseRequestTimeoutExponentially() const override { return m_increaseRequestTimeoutExponentially; } - virtual qint64 maxRequestTimeout() const Q_DECL_OVERRIDE + virtual qint64 maxRequestTimeout() const override { return m_maxRequestTimeout; } - virtual quint32 maxRequestRetryCount() const Q_DECL_OVERRIDE + virtual quint32 maxRequestRetryCount() const override { return m_maxRequestRetryCount; } private: + QUuid m_requestId; QString m_authenticationToken; qint64 m_requestTimeout; bool m_increaseRequestTimeoutExponentially; diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 9afe2df2..6bfb3598 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -122,7 +122,12 @@ AsyncResult * Thumbnail::downloadAsync( << (isResourceGuid ? "resource guid" : "not a resource guid")); auto pair = createPostRequest(guid, isPublic, isResourceGuid); - auto res = new AsyncResult(pair.first, pair.second, timeoutMsec); + auto res = new AsyncResult( + pair.first, + pair.second, + timeoutMsec, + QUuid::createUuid()); + QObject::connect(res, &AsyncResult::finished, [=] (const QVariant & value, const QSharedPointer error) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 2c30a990..53f2b230 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -757,8 +757,6 @@ QByteArray NoteStoreGetSyncStatePrepareParams( SyncState NoteStoreGetSyncStateReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetSyncStateReadReply"); - bool resultIsSet = false; SyncState result = SyncState(); ThriftBinaryBufferReader reader(reply); @@ -856,11 +854,13 @@ QVariant NoteStoreGetSyncStateReadReplyAsync(QByteArray reply) SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getSyncState"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getSyncState: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreGetSyncStatePrepareParams( ctx->authenticationToken()); @@ -869,6 +869,8 @@ SyncState NoteStore::getSyncState( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetSyncStateReadReply(reply); } @@ -888,6 +890,7 @@ AsyncResult * NoteStore::getSyncStateAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetSyncStateReadReplyAsync); } @@ -953,8 +956,6 @@ QByteArray NoteStoreGetFilteredSyncChunkPrepareParams( SyncChunk NoteStoreGetFilteredSyncChunkReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetFilteredSyncChunkReadReply"); - bool resultIsSet = false; SyncChunk result = SyncChunk(); ThriftBinaryBufferReader reader(reply); @@ -1055,15 +1056,17 @@ SyncChunk NoteStore::getFilteredSyncChunk( const SyncChunkFilter & filter, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " afterUSN = " << afterUSN << "\n" << " maxEntries = " << maxEntries << "\n" << " filter = " << filter); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( ctx->authenticationToken(), afterUSN, @@ -1075,6 +1078,8 @@ SyncChunk NoteStore::getFilteredSyncChunk( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetFilteredSyncChunkReadReply(reply); } @@ -1104,6 +1109,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetFilteredSyncChunkReadReplyAsync); } @@ -1151,8 +1157,6 @@ QByteArray NoteStoreGetLinkedNotebookSyncStatePrepareParams( SyncState NoteStoreGetLinkedNotebookSyncStateReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncStateReadReply"); - bool resultIsSet = false; SyncState result = SyncState(); ThriftBinaryBufferReader reader(reply); @@ -1262,13 +1266,15 @@ SyncState NoteStore::getLinkedNotebookSyncState( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -1278,6 +1284,8 @@ SyncState NoteStore::getLinkedNotebookSyncState( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetLinkedNotebookSyncStateReadReply(reply); } @@ -1301,6 +1309,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetLinkedNotebookSyncStateReadReplyAsync); } @@ -1375,8 +1384,6 @@ QByteArray NoteStoreGetLinkedNotebookSyncChunkPrepareParams( SyncChunk NoteStoreGetLinkedNotebookSyncChunkReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetLinkedNotebookSyncChunkReadReply"); - bool resultIsSet = false; SyncChunk result = SyncChunk(); ThriftBinaryBufferReader reader(reply); @@ -1489,16 +1496,18 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( bool fullSyncOnly, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " linkedNotebook = " << linkedNotebook << "\n" << " afterUSN = " << afterUSN << "\n" << " maxEntries = " << maxEntries << "\n" << " fullSyncOnly = " << fullSyncOnly); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( ctx->authenticationToken(), linkedNotebook, @@ -1511,6 +1520,8 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetLinkedNotebookSyncChunkReadReply(reply); } @@ -1543,6 +1554,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetLinkedNotebookSyncChunkReadReplyAsync); } @@ -1581,8 +1593,6 @@ QByteArray NoteStoreListNotebooksPrepareParams( QList NoteStoreListNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListNotebooksReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -1694,11 +1704,13 @@ QVariant NoteStoreListNotebooksReadReplyAsync(QByteArray reply) QList NoteStore::listNotebooks( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listNotebooks"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listNotebooks: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListNotebooksPrepareParams( ctx->authenticationToken()); @@ -1707,6 +1719,8 @@ QList NoteStore::listNotebooks( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListNotebooksReadReply(reply); } @@ -1726,6 +1740,7 @@ AsyncResult * NoteStore::listNotebooksAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListNotebooksReadReplyAsync); } @@ -1764,8 +1779,6 @@ QByteArray NoteStoreListAccessibleBusinessNotebooksPrepareParams( QList NoteStoreListAccessibleBusinessNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListAccessibleBusinessNotebooksReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -1877,11 +1890,13 @@ QVariant NoteStoreListAccessibleBusinessNotebooksReadReplyAsync(QByteArray reply QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( ctx->authenticationToken()); @@ -1890,6 +1905,8 @@ QList NoteStore::listAccessibleBusinessNotebooks( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListAccessibleBusinessNotebooksReadReply(reply); } @@ -1909,6 +1926,7 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListAccessibleBusinessNotebooksReadReplyAsync); } @@ -1956,8 +1974,6 @@ QByteArray NoteStoreGetNotebookPrepareParams( Notebook NoteStoreGetNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNotebookReadReply"); - bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader reader(reply); @@ -2067,13 +2083,15 @@ Notebook NoteStore::getNotebook( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2083,6 +2101,8 @@ Notebook NoteStore::getNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNotebookReadReply(reply); } @@ -2106,6 +2126,7 @@ AsyncResult * NoteStore::getNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNotebookReadReplyAsync); } @@ -2144,8 +2165,6 @@ QByteArray NoteStoreGetDefaultNotebookPrepareParams( Notebook NoteStoreGetDefaultNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetDefaultNotebookReadReply"); - bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader reader(reply); @@ -2243,11 +2262,13 @@ QVariant NoteStoreGetDefaultNotebookReadReplyAsync(QByteArray reply) Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( ctx->authenticationToken()); @@ -2256,6 +2277,8 @@ Notebook NoteStore::getDefaultNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetDefaultNotebookReadReply(reply); } @@ -2275,6 +2298,7 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetDefaultNotebookReadReplyAsync); } @@ -2322,8 +2346,6 @@ QByteArray NoteStoreCreateNotebookPrepareParams( Notebook NoteStoreCreateNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateNotebookReadReply"); - bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader reader(reply); @@ -2433,13 +2455,15 @@ Notebook NoteStore::createNotebook( const Notebook & notebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebook = " << notebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + QByteArray params = NoteStoreCreateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2449,6 +2473,8 @@ Notebook NoteStore::createNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateNotebookReadReply(reply); } @@ -2472,6 +2498,7 @@ AsyncResult * NoteStore::createNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateNotebookReadReplyAsync); } @@ -2519,8 +2546,6 @@ QByteArray NoteStoreUpdateNotebookPrepareParams( qint32 NoteStoreUpdateNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateNotebookReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -2630,13 +2655,15 @@ qint32 NoteStore::updateNotebook( const Notebook & notebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebook = " << notebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " notebook = " << notebook); + QByteArray params = NoteStoreUpdateNotebookPrepareParams( ctx->authenticationToken(), notebook); @@ -2646,6 +2673,8 @@ qint32 NoteStore::updateNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateNotebookReadReply(reply); } @@ -2669,6 +2698,7 @@ AsyncResult * NoteStore::updateNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateNotebookReadReplyAsync); } @@ -2716,8 +2746,6 @@ QByteArray NoteStoreExpungeNotebookPrepareParams( qint32 NoteStoreExpungeNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreExpungeNotebookReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -2827,13 +2855,15 @@ qint32 NoteStore::expungeNotebook( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::expungeNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::expungeNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreExpungeNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -2843,6 +2873,8 @@ qint32 NoteStore::expungeNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreExpungeNotebookReadReply(reply); } @@ -2866,6 +2898,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreExpungeNotebookReadReplyAsync); } @@ -2904,8 +2937,6 @@ QByteArray NoteStoreListTagsPrepareParams( QList NoteStoreListTagsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListTagsReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -3017,11 +3048,13 @@ QVariant NoteStoreListTagsReadReplyAsync(QByteArray reply) QList NoteStore::listTags( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listTags"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listTags: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListTagsPrepareParams( ctx->authenticationToken()); @@ -3030,6 +3063,8 @@ QList NoteStore::listTags( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListTagsReadReply(reply); } @@ -3049,6 +3084,7 @@ AsyncResult * NoteStore::listTagsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListTagsReadReplyAsync); } @@ -3096,8 +3132,6 @@ QByteArray NoteStoreListTagsByNotebookPrepareParams( QList NoteStoreListTagsByNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListTagsByNotebookReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -3221,13 +3255,15 @@ QList NoteStore::listTagsByNotebook( Guid notebookGuid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebookGuid = " << notebookGuid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + QByteArray params = NoteStoreListTagsByNotebookPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -3237,6 +3273,8 @@ QList NoteStore::listTagsByNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListTagsByNotebookReadReply(reply); } @@ -3260,6 +3298,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListTagsByNotebookReadReplyAsync); } @@ -3307,8 +3346,6 @@ QByteArray NoteStoreGetTagPrepareParams( Tag NoteStoreGetTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetTagReadReply"); - bool resultIsSet = false; Tag result = Tag(); ThriftBinaryBufferReader reader(reply); @@ -3418,13 +3455,15 @@ Tag NoteStore::getTag( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getTag"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getTag: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetTagPrepareParams( ctx->authenticationToken(), guid); @@ -3434,6 +3473,8 @@ Tag NoteStore::getTag( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetTagReadReply(reply); } @@ -3457,6 +3498,7 @@ AsyncResult * NoteStore::getTagAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetTagReadReplyAsync); } @@ -3504,8 +3546,6 @@ QByteArray NoteStoreCreateTagPrepareParams( Tag NoteStoreCreateTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateTagReadReply"); - bool resultIsSet = false; Tag result = Tag(); ThriftBinaryBufferReader reader(reply); @@ -3615,13 +3655,15 @@ Tag NoteStore::createTag( const Tag & tag, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createTag"); - QEC_TRACE("note_store", "Parameters:\n" - << " tag = " << tag); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createTag: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + QByteArray params = NoteStoreCreateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3631,6 +3673,8 @@ Tag NoteStore::createTag( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateTagReadReply(reply); } @@ -3654,6 +3698,7 @@ AsyncResult * NoteStore::createTagAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateTagReadReplyAsync); } @@ -3701,8 +3746,6 @@ QByteArray NoteStoreUpdateTagPrepareParams( qint32 NoteStoreUpdateTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateTagReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -3812,13 +3855,15 @@ qint32 NoteStore::updateTag( const Tag & tag, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateTag"); - QEC_TRACE("note_store", "Parameters:\n" - << " tag = " << tag); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateTag: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " tag = " << tag); + QByteArray params = NoteStoreUpdateTagPrepareParams( ctx->authenticationToken(), tag); @@ -3828,6 +3873,8 @@ qint32 NoteStore::updateTag( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateTagReadReply(reply); } @@ -3851,6 +3898,7 @@ AsyncResult * NoteStore::updateTagAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateTagReadReplyAsync); } @@ -3898,8 +3946,6 @@ QByteArray NoteStoreUntagAllPrepareParams( void NoteStoreUntagAllReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUntagAllReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -3989,13 +4035,15 @@ void NoteStore::untagAll( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::untagAll"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::untagAll: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreUntagAllPrepareParams( ctx->authenticationToken(), guid); @@ -4005,6 +4053,8 @@ void NoteStore::untagAll( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); NoteStoreUntagAllReadReply(reply); } @@ -4028,6 +4078,7 @@ AsyncResult * NoteStore::untagAllAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUntagAllReadReplyAsync); } @@ -4075,8 +4126,6 @@ QByteArray NoteStoreExpungeTagPrepareParams( qint32 NoteStoreExpungeTagReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreExpungeTagReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -4186,13 +4235,15 @@ qint32 NoteStore::expungeTag( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::expungeTag"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::expungeTag: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreExpungeTagPrepareParams( ctx->authenticationToken(), guid); @@ -4202,6 +4253,8 @@ qint32 NoteStore::expungeTag( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreExpungeTagReadReply(reply); } @@ -4225,6 +4278,7 @@ AsyncResult * NoteStore::expungeTagAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreExpungeTagReadReplyAsync); } @@ -4263,8 +4317,6 @@ QByteArray NoteStoreListSearchesPrepareParams( QList NoteStoreListSearchesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListSearchesReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -4376,11 +4428,13 @@ QVariant NoteStoreListSearchesReadReplyAsync(QByteArray reply) QList NoteStore::listSearches( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listSearches"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listSearches: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListSearchesPrepareParams( ctx->authenticationToken()); @@ -4389,6 +4443,8 @@ QList NoteStore::listSearches( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListSearchesReadReply(reply); } @@ -4408,6 +4464,7 @@ AsyncResult * NoteStore::listSearchesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListSearchesReadReplyAsync); } @@ -4455,8 +4512,6 @@ QByteArray NoteStoreGetSearchPrepareParams( SavedSearch NoteStoreGetSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetSearchReadReply"); - bool resultIsSet = false; SavedSearch result = SavedSearch(); ThriftBinaryBufferReader reader(reply); @@ -4566,13 +4621,15 @@ SavedSearch NoteStore::getSearch( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getSearch"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getSearch: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetSearchPrepareParams( ctx->authenticationToken(), guid); @@ -4582,6 +4639,8 @@ SavedSearch NoteStore::getSearch( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetSearchReadReply(reply); } @@ -4605,6 +4664,7 @@ AsyncResult * NoteStore::getSearchAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetSearchReadReplyAsync); } @@ -4652,8 +4712,6 @@ QByteArray NoteStoreCreateSearchPrepareParams( SavedSearch NoteStoreCreateSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateSearchReadReply"); - bool resultIsSet = false; SavedSearch result = SavedSearch(); ThriftBinaryBufferReader reader(reply); @@ -4752,13 +4810,15 @@ SavedSearch NoteStore::createSearch( const SavedSearch & search, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createSearch"); - QEC_TRACE("note_store", "Parameters:\n" - << " search = " << search); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createSearch: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + QByteArray params = NoteStoreCreateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4768,6 +4828,8 @@ SavedSearch NoteStore::createSearch( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateSearchReadReply(reply); } @@ -4791,6 +4853,7 @@ AsyncResult * NoteStore::createSearchAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateSearchReadReplyAsync); } @@ -4838,8 +4901,6 @@ QByteArray NoteStoreUpdateSearchPrepareParams( qint32 NoteStoreUpdateSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateSearchReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -4949,13 +5010,15 @@ qint32 NoteStore::updateSearch( const SavedSearch & search, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateSearch"); - QEC_TRACE("note_store", "Parameters:\n" - << " search = " << search); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateSearch: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " search = " << search); + QByteArray params = NoteStoreUpdateSearchPrepareParams( ctx->authenticationToken(), search); @@ -4965,6 +5028,8 @@ qint32 NoteStore::updateSearch( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateSearchReadReply(reply); } @@ -4988,6 +5053,7 @@ AsyncResult * NoteStore::updateSearchAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateSearchReadReplyAsync); } @@ -5035,8 +5101,6 @@ QByteArray NoteStoreExpungeSearchPrepareParams( qint32 NoteStoreExpungeSearchReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreExpungeSearchReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -5146,13 +5210,15 @@ qint32 NoteStore::expungeSearch( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::expungeSearch"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::expungeSearch: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreExpungeSearchPrepareParams( ctx->authenticationToken(), guid); @@ -5162,6 +5228,8 @@ qint32 NoteStore::expungeSearch( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreExpungeSearchReadReply(reply); } @@ -5185,6 +5253,7 @@ AsyncResult * NoteStore::expungeSearchAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreExpungeSearchReadReplyAsync); } @@ -5241,8 +5310,6 @@ QByteArray NoteStoreFindNoteOffsetPrepareParams( qint32 NoteStoreFindNoteOffsetReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreFindNoteOffsetReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -5353,14 +5420,16 @@ qint32 NoteStore::findNoteOffset( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::findNoteOffset"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::findNoteOffset: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " filter = " << filter << "\n" << " guid = " << guid); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreFindNoteOffsetPrepareParams( ctx->authenticationToken(), filter, @@ -5371,6 +5440,8 @@ qint32 NoteStore::findNoteOffset( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreFindNoteOffsetReadReply(reply); } @@ -5397,6 +5468,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreFindNoteOffsetReadReplyAsync); } @@ -5471,8 +5543,6 @@ QByteArray NoteStoreFindNotesMetadataPrepareParams( NotesMetadataList NoteStoreFindNotesMetadataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreFindNotesMetadataReadReply"); - bool resultIsSet = false; NotesMetadataList result = NotesMetadataList(); ThriftBinaryBufferReader reader(reply); @@ -5585,16 +5655,18 @@ NotesMetadataList NoteStore::findNotesMetadata( const NotesMetadataResultSpec & resultSpec, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::findNotesMetadata"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::findNotesMetadata: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " filter = " << filter << "\n" << " offset = " << offset << "\n" << " maxNotes = " << maxNotes << "\n" << " resultSpec = " << resultSpec); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreFindNotesMetadataPrepareParams( ctx->authenticationToken(), filter, @@ -5607,6 +5679,8 @@ NotesMetadataList NoteStore::findNotesMetadata( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreFindNotesMetadataReadReply(reply); } @@ -5639,6 +5713,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreFindNotesMetadataReadReplyAsync); } @@ -5695,8 +5770,6 @@ QByteArray NoteStoreFindNoteCountsPrepareParams( NoteCollectionCounts NoteStoreFindNoteCountsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreFindNoteCountsReadReply"); - bool resultIsSet = false; NoteCollectionCounts result = NoteCollectionCounts(); ThriftBinaryBufferReader reader(reply); @@ -5807,14 +5880,16 @@ NoteCollectionCounts NoteStore::findNoteCounts( bool withTrash, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::findNoteCounts"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::findNoteCounts: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " filter = " << filter << "\n" << " withTrash = " << withTrash); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreFindNoteCountsPrepareParams( ctx->authenticationToken(), filter, @@ -5825,6 +5900,8 @@ NoteCollectionCounts NoteStore::findNoteCounts( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreFindNoteCountsReadReply(reply); } @@ -5851,6 +5928,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreFindNoteCountsReadReplyAsync); } @@ -5907,8 +5985,6 @@ QByteArray NoteStoreGetNoteWithResultSpecPrepareParams( Note NoteStoreGetNoteWithResultSpecReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteWithResultSpecReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -6019,14 +6095,16 @@ Note NoteStore::getNoteWithResultSpec( const NoteResultSpec & resultSpec, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " resultSpec = " << resultSpec); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( ctx->authenticationToken(), guid, @@ -6037,6 +6115,8 @@ Note NoteStore::getNoteWithResultSpec( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteWithResultSpecReadReply(reply); } @@ -6063,6 +6143,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteWithResultSpecReadReplyAsync); } @@ -6146,8 +6227,6 @@ QByteArray NoteStoreGetNotePrepareParams( Note NoteStoreGetNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -6261,7 +6340,12 @@ Note NoteStore::getNote( bool withResourcesAlternateData, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNote"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getNote: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " withContent = " << withContent << "\n" @@ -6269,9 +6353,6 @@ Note NoteStore::getNote( << " withResourcesRecognition = " << withResourcesRecognition << "\n" << " withResourcesAlternateData = " << withResourcesAlternateData); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetNotePrepareParams( ctx->authenticationToken(), guid, @@ -6285,6 +6366,8 @@ Note NoteStore::getNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteReadReply(reply); } @@ -6320,6 +6403,7 @@ AsyncResult * NoteStore::getNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteReadReplyAsync); } @@ -6367,8 +6451,6 @@ QByteArray NoteStoreGetNoteApplicationDataPrepareParams( LazyMap NoteStoreGetNoteApplicationDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataReadReply"); - bool resultIsSet = false; LazyMap result = LazyMap(); ThriftBinaryBufferReader reader(reply); @@ -6478,13 +6560,15 @@ LazyMap NoteStore::getNoteApplicationData( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -6494,6 +6578,8 @@ LazyMap NoteStore::getNoteApplicationData( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteApplicationDataReadReply(reply); } @@ -6517,6 +6603,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteApplicationDataReadReplyAsync); } @@ -6573,8 +6660,6 @@ QByteArray NoteStoreGetNoteApplicationDataEntryPrepareParams( QString NoteStoreGetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteApplicationDataEntryReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -6685,14 +6770,16 @@ QString NoteStore::getNoteApplicationDataEntry( QString key, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -6703,6 +6790,8 @@ QString NoteStore::getNoteApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteApplicationDataEntryReadReply(reply); } @@ -6729,6 +6818,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteApplicationDataEntryReadReplyAsync); } @@ -6794,8 +6884,6 @@ QByteArray NoteStoreSetNoteApplicationDataEntryPrepareParams( qint32 NoteStoreSetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreSetNoteApplicationDataEntryReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -6907,15 +6995,17 @@ qint32 NoteStore::setNoteApplicationDataEntry( QString value, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key << "\n" << " value = " << value); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -6927,6 +7017,8 @@ qint32 NoteStore::setNoteApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreSetNoteApplicationDataEntryReadReply(reply); } @@ -6956,6 +7048,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreSetNoteApplicationDataEntryReadReplyAsync); } @@ -7012,8 +7105,6 @@ QByteArray NoteStoreUnsetNoteApplicationDataEntryPrepareParams( qint32 NoteStoreUnsetNoteApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUnsetNoteApplicationDataEntryReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -7124,14 +7215,16 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( QString key, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -7142,6 +7235,8 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUnsetNoteApplicationDataEntryReadReply(reply); } @@ -7168,6 +7263,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUnsetNoteApplicationDataEntryReadReplyAsync); } @@ -7215,8 +7311,6 @@ QByteArray NoteStoreGetNoteContentPrepareParams( QString NoteStoreGetNoteContentReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteContentReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -7326,13 +7420,15 @@ QString NoteStore::getNoteContent( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteContent"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getNoteContent: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetNoteContentPrepareParams( ctx->authenticationToken(), guid); @@ -7342,6 +7438,8 @@ QString NoteStore::getNoteContent( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteContentReadReply(reply); } @@ -7365,6 +7463,7 @@ AsyncResult * NoteStore::getNoteContentAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteContentReadReplyAsync); } @@ -7430,8 +7529,6 @@ QByteArray NoteStoreGetNoteSearchTextPrepareParams( QString NoteStoreGetNoteSearchTextReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteSearchTextReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -7543,15 +7640,17 @@ QString NoteStore::getNoteSearchText( bool tokenizeForIndexing, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteSearchText"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getNoteSearchText: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " noteOnly = " << noteOnly << "\n" << " tokenizeForIndexing = " << tokenizeForIndexing); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( ctx->authenticationToken(), guid, @@ -7563,6 +7662,8 @@ QString NoteStore::getNoteSearchText( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteSearchTextReadReply(reply); } @@ -7592,6 +7693,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteSearchTextReadReplyAsync); } @@ -7639,8 +7741,6 @@ QByteArray NoteStoreGetResourceSearchTextPrepareParams( QString NoteStoreGetResourceSearchTextReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceSearchTextReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -7750,13 +7850,15 @@ QString NoteStore::getResourceSearchText( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceSearchText"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceSearchText: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( ctx->authenticationToken(), guid); @@ -7766,6 +7868,8 @@ QString NoteStore::getResourceSearchText( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceSearchTextReadReply(reply); } @@ -7789,6 +7893,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceSearchTextReadReplyAsync); } @@ -7836,8 +7941,6 @@ QByteArray NoteStoreGetNoteTagNamesPrepareParams( QStringList NoteStoreGetNoteTagNamesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteTagNamesReadReply"); - bool resultIsSet = false; QStringList result = QStringList(); ThriftBinaryBufferReader reader(reply); @@ -7961,13 +8064,15 @@ QStringList NoteStore::getNoteTagNames( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteTagNames"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getNoteTagNames: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( ctx->authenticationToken(), guid); @@ -7977,6 +8082,8 @@ QStringList NoteStore::getNoteTagNames( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteTagNamesReadReply(reply); } @@ -8000,6 +8107,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteTagNamesReadReplyAsync); } @@ -8047,8 +8155,6 @@ QByteArray NoteStoreCreateNotePrepareParams( Note NoteStoreCreateNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateNoteReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -8158,13 +8264,15 @@ Note NoteStore::createNote( const Note & note, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + QByteArray params = NoteStoreCreateNotePrepareParams( ctx->authenticationToken(), note); @@ -8174,6 +8282,8 @@ Note NoteStore::createNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateNoteReadReply(reply); } @@ -8197,6 +8307,7 @@ AsyncResult * NoteStore::createNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateNoteReadReplyAsync); } @@ -8244,8 +8355,6 @@ QByteArray NoteStoreUpdateNotePrepareParams( Note NoteStoreUpdateNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateNoteReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -8355,13 +8464,15 @@ Note NoteStore::updateNote( const Note & note, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + QByteArray params = NoteStoreUpdateNotePrepareParams( ctx->authenticationToken(), note); @@ -8371,6 +8482,8 @@ Note NoteStore::updateNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateNoteReadReply(reply); } @@ -8394,6 +8507,7 @@ AsyncResult * NoteStore::updateNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateNoteReadReplyAsync); } @@ -8441,8 +8555,6 @@ QByteArray NoteStoreDeleteNotePrepareParams( qint32 NoteStoreDeleteNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreDeleteNoteReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -8552,13 +8664,15 @@ qint32 NoteStore::deleteNote( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::deleteNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::deleteNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreDeleteNotePrepareParams( ctx->authenticationToken(), guid); @@ -8568,6 +8682,8 @@ qint32 NoteStore::deleteNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreDeleteNoteReadReply(reply); } @@ -8591,6 +8707,7 @@ AsyncResult * NoteStore::deleteNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreDeleteNoteReadReplyAsync); } @@ -8638,8 +8755,6 @@ QByteArray NoteStoreExpungeNotePrepareParams( qint32 NoteStoreExpungeNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreExpungeNoteReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -8749,13 +8864,15 @@ qint32 NoteStore::expungeNote( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::expungeNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::expungeNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreExpungeNotePrepareParams( ctx->authenticationToken(), guid); @@ -8765,6 +8882,8 @@ qint32 NoteStore::expungeNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreExpungeNoteReadReply(reply); } @@ -8788,6 +8907,7 @@ AsyncResult * NoteStore::expungeNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreExpungeNoteReadReplyAsync); } @@ -8844,8 +8964,6 @@ QByteArray NoteStoreCopyNotePrepareParams( Note NoteStoreCopyNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCopyNoteReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -8956,14 +9074,16 @@ Note NoteStore::copyNote( Guid toNotebookGuid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::copyNote"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::copyNote: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " noteGuid = " << noteGuid << "\n" << " toNotebookGuid = " << toNotebookGuid); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreCopyNotePrepareParams( ctx->authenticationToken(), noteGuid, @@ -8974,6 +9094,8 @@ Note NoteStore::copyNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCopyNoteReadReply(reply); } @@ -9000,6 +9122,7 @@ AsyncResult * NoteStore::copyNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCopyNoteReadReplyAsync); } @@ -9047,8 +9170,6 @@ QByteArray NoteStoreListNoteVersionsPrepareParams( QList NoteStoreListNoteVersionsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListNoteVersionsReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -9172,13 +9293,15 @@ QList NoteStore::listNoteVersions( Guid noteGuid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listNoteVersions"); - QEC_TRACE("note_store", "Parameters:\n" - << " noteGuid = " << noteGuid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listNoteVersions: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " noteGuid = " << noteGuid); + QByteArray params = NoteStoreListNoteVersionsPrepareParams( ctx->authenticationToken(), noteGuid); @@ -9188,6 +9311,8 @@ QList NoteStore::listNoteVersions( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListNoteVersionsReadReply(reply); } @@ -9211,6 +9336,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListNoteVersionsReadReplyAsync); } @@ -9294,8 +9420,6 @@ QByteArray NoteStoreGetNoteVersionPrepareParams( Note NoteStoreGetNoteVersionReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNoteVersionReadReply"); - bool resultIsSet = false; Note result = Note(); ThriftBinaryBufferReader reader(reply); @@ -9409,7 +9533,12 @@ Note NoteStore::getNoteVersion( bool withResourcesAlternateData, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNoteVersion"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getNoteVersion: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " noteGuid = " << noteGuid << "\n" << " updateSequenceNum = " << updateSequenceNum << "\n" @@ -9417,9 +9546,6 @@ Note NoteStore::getNoteVersion( << " withResourcesRecognition = " << withResourcesRecognition << "\n" << " withResourcesAlternateData = " << withResourcesAlternateData); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetNoteVersionPrepareParams( ctx->authenticationToken(), noteGuid, @@ -9433,6 +9559,8 @@ Note NoteStore::getNoteVersion( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNoteVersionReadReply(reply); } @@ -9468,6 +9596,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNoteVersionReadReplyAsync); } @@ -9551,8 +9680,6 @@ QByteArray NoteStoreGetResourcePrepareParams( Resource NoteStoreGetResourceReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceReadReply"); - bool resultIsSet = false; Resource result = Resource(); ThriftBinaryBufferReader reader(reply); @@ -9666,7 +9793,12 @@ Resource NoteStore::getResource( bool withAlternateData, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResource"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getResource: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " withData = " << withData << "\n" @@ -9674,9 +9806,6 @@ Resource NoteStore::getResource( << " withAttributes = " << withAttributes << "\n" << " withAlternateData = " << withAlternateData); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetResourcePrepareParams( ctx->authenticationToken(), guid, @@ -9690,6 +9819,8 @@ Resource NoteStore::getResource( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceReadReply(reply); } @@ -9725,6 +9856,7 @@ AsyncResult * NoteStore::getResourceAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceReadReplyAsync); } @@ -9772,8 +9904,6 @@ QByteArray NoteStoreGetResourceApplicationDataPrepareParams( LazyMap NoteStoreGetResourceApplicationDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataReadReply"); - bool resultIsSet = false; LazyMap result = LazyMap(); ThriftBinaryBufferReader reader(reply); @@ -9883,13 +10013,15 @@ LazyMap NoteStore::getResourceApplicationData( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( ctx->authenticationToken(), guid); @@ -9899,6 +10031,8 @@ LazyMap NoteStore::getResourceApplicationData( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceApplicationDataReadReply(reply); } @@ -9922,6 +10056,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceApplicationDataReadReplyAsync); } @@ -9978,8 +10113,6 @@ QByteArray NoteStoreGetResourceApplicationDataEntryPrepareParams( QString NoteStoreGetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceApplicationDataEntryReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -10090,14 +10223,16 @@ QString NoteStore::getResourceApplicationDataEntry( QString key, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -10108,6 +10243,8 @@ QString NoteStore::getResourceApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceApplicationDataEntryReadReply(reply); } @@ -10134,6 +10271,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceApplicationDataEntryReadReplyAsync); } @@ -10199,8 +10337,6 @@ QByteArray NoteStoreSetResourceApplicationDataEntryPrepareParams( qint32 NoteStoreSetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreSetResourceApplicationDataEntryReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -10312,15 +10448,17 @@ qint32 NoteStore::setResourceApplicationDataEntry( QString value, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key << "\n" << " value = " << value); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -10332,6 +10470,8 @@ qint32 NoteStore::setResourceApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreSetResourceApplicationDataEntryReadReply(reply); } @@ -10361,6 +10501,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreSetResourceApplicationDataEntryReadReplyAsync); } @@ -10417,8 +10558,6 @@ QByteArray NoteStoreUnsetResourceApplicationDataEntryPrepareParams( qint32 NoteStoreUnsetResourceApplicationDataEntryReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUnsetResourceApplicationDataEntryReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -10529,14 +10668,16 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( QString key, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " key = " << key); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( ctx->authenticationToken(), guid, @@ -10547,6 +10688,8 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUnsetResourceApplicationDataEntryReadReply(reply); } @@ -10573,6 +10716,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUnsetResourceApplicationDataEntryReadReplyAsync); } @@ -10620,8 +10764,6 @@ QByteArray NoteStoreUpdateResourcePrepareParams( qint32 NoteStoreUpdateResourceReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateResourceReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -10731,13 +10873,15 @@ qint32 NoteStore::updateResource( const Resource & resource, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateResource"); - QEC_TRACE("note_store", "Parameters:\n" - << " resource = " << resource); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateResource: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " resource = " << resource); + QByteArray params = NoteStoreUpdateResourcePrepareParams( ctx->authenticationToken(), resource); @@ -10747,6 +10891,8 @@ qint32 NoteStore::updateResource( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateResourceReadReply(reply); } @@ -10770,6 +10916,7 @@ AsyncResult * NoteStore::updateResourceAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateResourceReadReplyAsync); } @@ -10817,8 +10964,6 @@ QByteArray NoteStoreGetResourceDataPrepareParams( QByteArray NoteStoreGetResourceDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceDataReadReply"); - bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader reader(reply); @@ -10928,13 +11073,15 @@ QByteArray NoteStore::getResourceData( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceData"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceData: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceDataPrepareParams( ctx->authenticationToken(), guid); @@ -10944,6 +11091,8 @@ QByteArray NoteStore::getResourceData( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceDataReadReply(reply); } @@ -10967,6 +11116,7 @@ AsyncResult * NoteStore::getResourceDataAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceDataReadReplyAsync); } @@ -11050,8 +11200,6 @@ QByteArray NoteStoreGetResourceByHashPrepareParams( Resource NoteStoreGetResourceByHashReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceByHashReadReply"); - bool resultIsSet = false; Resource result = Resource(); ThriftBinaryBufferReader reader(reply); @@ -11165,7 +11313,12 @@ Resource NoteStore::getResourceByHash( bool withAlternateData, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceByHash"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getResourceByHash: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " noteGuid = " << noteGuid << "\n" << " contentHash = " << contentHash << "\n" @@ -11173,9 +11326,6 @@ Resource NoteStore::getResourceByHash( << " withRecognition = " << withRecognition << "\n" << " withAlternateData = " << withAlternateData); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetResourceByHashPrepareParams( ctx->authenticationToken(), noteGuid, @@ -11189,6 +11339,8 @@ Resource NoteStore::getResourceByHash( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceByHashReadReply(reply); } @@ -11224,6 +11376,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceByHashReadReplyAsync); } @@ -11271,8 +11424,6 @@ QByteArray NoteStoreGetResourceRecognitionPrepareParams( QByteArray NoteStoreGetResourceRecognitionReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceRecognitionReadReply"); - bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader reader(reply); @@ -11382,13 +11533,15 @@ QByteArray NoteStore::getResourceRecognition( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceRecognition"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceRecognition: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( ctx->authenticationToken(), guid); @@ -11398,6 +11551,8 @@ QByteArray NoteStore::getResourceRecognition( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceRecognitionReadReply(reply); } @@ -11421,6 +11576,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceRecognitionReadReplyAsync); } @@ -11468,8 +11624,6 @@ QByteArray NoteStoreGetResourceAlternateDataPrepareParams( QByteArray NoteStoreGetResourceAlternateDataReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceAlternateDataReadReply"); - bool resultIsSet = false; QByteArray result = QByteArray(); ThriftBinaryBufferReader reader(reply); @@ -11579,13 +11733,15 @@ QByteArray NoteStore::getResourceAlternateData( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( ctx->authenticationToken(), guid); @@ -11595,6 +11751,8 @@ QByteArray NoteStore::getResourceAlternateData( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceAlternateDataReadReply(reply); } @@ -11618,6 +11776,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceAlternateDataReadReplyAsync); } @@ -11665,8 +11824,6 @@ QByteArray NoteStoreGetResourceAttributesPrepareParams( ResourceAttributes NoteStoreGetResourceAttributesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetResourceAttributesReadReply"); - bool resultIsSet = false; ResourceAttributes result = ResourceAttributes(); ThriftBinaryBufferReader reader(reply); @@ -11776,13 +11933,15 @@ ResourceAttributes NoteStore::getResourceAttributes( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getResourceAttributes"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getResourceAttributes: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreGetResourceAttributesPrepareParams( ctx->authenticationToken(), guid); @@ -11792,6 +11951,8 @@ ResourceAttributes NoteStore::getResourceAttributes( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetResourceAttributesReadReply(reply); } @@ -11815,6 +11976,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetResourceAttributesReadReplyAsync); } @@ -11862,8 +12024,6 @@ QByteArray NoteStoreGetPublicNotebookPrepareParams( Notebook NoteStoreGetPublicNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetPublicNotebookReadReply"); - bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader reader(reply); @@ -11963,14 +12123,16 @@ Notebook NoteStore::getPublicNotebook( QString publicUri, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getPublicNotebook"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::getPublicNotebook: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " userId = " << userId << "\n" << " publicUri = " << publicUri); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreGetPublicNotebookPrepareParams( userId, publicUri); @@ -11980,6 +12142,8 @@ Notebook NoteStore::getPublicNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetPublicNotebookReadReply(reply); } @@ -12005,6 +12169,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetPublicNotebookReadReplyAsync); } @@ -12061,8 +12226,6 @@ QByteArray NoteStoreShareNotebookPrepareParams( SharedNotebook NoteStoreShareNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreShareNotebookReadReply"); - bool resultIsSet = false; SharedNotebook result = SharedNotebook(); ThriftBinaryBufferReader reader(reply); @@ -12173,14 +12336,16 @@ SharedNotebook NoteStore::shareNotebook( QString message, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::shareNotebook"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::shareNotebook: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " sharedNotebook = " << sharedNotebook << "\n" << " message = " << message); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreShareNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook, @@ -12191,6 +12356,8 @@ SharedNotebook NoteStore::shareNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreShareNotebookReadReply(reply); } @@ -12217,6 +12384,7 @@ AsyncResult * NoteStore::shareNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreShareNotebookReadReplyAsync); } @@ -12264,8 +12432,6 @@ QByteArray NoteStoreCreateOrUpdateNotebookSharesPrepareParams( CreateOrUpdateNotebookSharesResult NoteStoreCreateOrUpdateNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateOrUpdateNotebookSharesReadReply"); - bool resultIsSet = false; CreateOrUpdateNotebookSharesResult result = CreateOrUpdateNotebookSharesResult(); ThriftBinaryBufferReader reader(reply); @@ -12386,13 +12552,15 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( const NotebookShareTemplate & shareTemplate, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares"); - QEC_TRACE("note_store", "Parameters:\n" - << " shareTemplate = " << shareTemplate); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " shareTemplate = " << shareTemplate); + QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( ctx->authenticationToken(), shareTemplate); @@ -12402,6 +12570,8 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateOrUpdateNotebookSharesReadReply(reply); } @@ -12425,6 +12595,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateOrUpdateNotebookSharesReadReplyAsync); } @@ -12472,8 +12643,6 @@ QByteArray NoteStoreUpdateSharedNotebookPrepareParams( qint32 NoteStoreUpdateSharedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateSharedNotebookReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -12583,13 +12752,15 @@ qint32 NoteStore::updateSharedNotebook( const SharedNotebook & sharedNotebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " sharedNotebook = " << sharedNotebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " sharedNotebook = " << sharedNotebook); + QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( ctx->authenticationToken(), sharedNotebook); @@ -12599,6 +12770,8 @@ qint32 NoteStore::updateSharedNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateSharedNotebookReadReply(reply); } @@ -12622,6 +12795,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateSharedNotebookReadReplyAsync); } @@ -12678,8 +12852,6 @@ QByteArray NoteStoreSetNotebookRecipientSettingsPrepareParams( Notebook NoteStoreSetNotebookRecipientSettingsReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreSetNotebookRecipientSettingsReadReply"); - bool resultIsSet = false; Notebook result = Notebook(); ThriftBinaryBufferReader reader(reply); @@ -12790,14 +12962,16 @@ Notebook NoteStore::setNotebookRecipientSettings( const NotebookRecipientSettings & recipientSettings, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " notebookGuid = " << notebookGuid << "\n" << " recipientSettings = " << recipientSettings); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( ctx->authenticationToken(), notebookGuid, @@ -12808,6 +12982,8 @@ Notebook NoteStore::setNotebookRecipientSettings( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreSetNotebookRecipientSettingsReadReply(reply); } @@ -12834,6 +13010,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreSetNotebookRecipientSettingsReadReplyAsync); } @@ -12872,8 +13049,6 @@ QByteArray NoteStoreListSharedNotebooksPrepareParams( QList NoteStoreListSharedNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListSharedNotebooksReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -12996,11 +13171,13 @@ QVariant NoteStoreListSharedNotebooksReadReplyAsync(QByteArray reply) QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListSharedNotebooksPrepareParams( ctx->authenticationToken()); @@ -13009,6 +13186,8 @@ QList NoteStore::listSharedNotebooks( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListSharedNotebooksReadReply(reply); } @@ -13028,6 +13207,7 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListSharedNotebooksReadReplyAsync); } @@ -13075,8 +13255,6 @@ QByteArray NoteStoreCreateLinkedNotebookPrepareParams( LinkedNotebook NoteStoreCreateLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreCreateLinkedNotebookReadReply"); - bool resultIsSet = false; LinkedNotebook result = LinkedNotebook(); ThriftBinaryBufferReader reader(reply); @@ -13186,13 +13364,15 @@ LinkedNotebook NoteStore::createLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -13202,6 +13382,8 @@ LinkedNotebook NoteStore::createLinkedNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreCreateLinkedNotebookReadReply(reply); } @@ -13225,6 +13407,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreCreateLinkedNotebookReadReplyAsync); } @@ -13272,8 +13455,6 @@ QByteArray NoteStoreUpdateLinkedNotebookPrepareParams( qint32 NoteStoreUpdateLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateLinkedNotebookReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -13383,13 +13564,15 @@ qint32 NoteStore::updateLinkedNotebook( const LinkedNotebook & linkedNotebook, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " linkedNotebook = " << linkedNotebook); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " linkedNotebook = " << linkedNotebook); + QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( ctx->authenticationToken(), linkedNotebook); @@ -13399,6 +13582,8 @@ qint32 NoteStore::updateLinkedNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateLinkedNotebookReadReply(reply); } @@ -13422,6 +13607,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateLinkedNotebookReadReplyAsync); } @@ -13460,8 +13646,6 @@ QByteArray NoteStoreListLinkedNotebooksPrepareParams( QList NoteStoreListLinkedNotebooksReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreListLinkedNotebooksReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -13584,11 +13768,13 @@ QVariant NoteStoreListLinkedNotebooksReadReplyAsync(QByteArray reply) QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( ctx->authenticationToken()); @@ -13597,6 +13783,8 @@ QList NoteStore::listLinkedNotebooks( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreListLinkedNotebooksReadReply(reply); } @@ -13616,6 +13804,7 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreListLinkedNotebooksReadReplyAsync); } @@ -13663,8 +13852,6 @@ QByteArray NoteStoreExpungeLinkedNotebookPrepareParams( qint32 NoteStoreExpungeLinkedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreExpungeLinkedNotebookReadReply"); - bool resultIsSet = false; qint32 result = qint32(); ThriftBinaryBufferReader reader(reply); @@ -13774,13 +13961,15 @@ qint32 NoteStore::expungeLinkedNotebook( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( ctx->authenticationToken(), guid); @@ -13790,6 +13979,8 @@ qint32 NoteStore::expungeLinkedNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreExpungeLinkedNotebookReadReply(reply); } @@ -13813,6 +14004,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreExpungeLinkedNotebookReadReplyAsync); } @@ -13860,8 +14052,6 @@ QByteArray NoteStoreAuthenticateToSharedNotebookPrepareParams( AuthenticationResult NoteStoreAuthenticateToSharedNotebookReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNotebookReadReply"); - bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader reader(reply); @@ -13971,13 +14161,15 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( QString shareKeyOrGlobalId, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook"); - QEC_TRACE("note_store", "Parameters:\n" - << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); + QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( shareKeyOrGlobalId, ctx->authenticationToken()); @@ -13987,6 +14179,8 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreAuthenticateToSharedNotebookReadReply(reply); } @@ -14010,6 +14204,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreAuthenticateToSharedNotebookReadReplyAsync); } @@ -14048,8 +14243,6 @@ QByteArray NoteStoreGetSharedNotebookByAuthPrepareParams( SharedNotebook NoteStoreGetSharedNotebookByAuthReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetSharedNotebookByAuthReadReply"); - bool resultIsSet = false; SharedNotebook result = SharedNotebook(); ThriftBinaryBufferReader reader(reply); @@ -14158,11 +14351,13 @@ QVariant NoteStoreGetSharedNotebookByAuthReadReplyAsync(QByteArray reply) SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth: request id = " + << ctx->requestId()); + QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( ctx->authenticationToken()); @@ -14171,6 +14366,8 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetSharedNotebookByAuthReadReply(reply); } @@ -14190,6 +14387,7 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetSharedNotebookByAuthReadReplyAsync); } @@ -14237,8 +14435,6 @@ QByteArray NoteStoreEmailNotePrepareParams( void NoteStoreEmailNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreEmailNoteReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -14328,13 +14524,15 @@ void NoteStore::emailNote( const NoteEmailParameters & parameters, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::emailNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " parameters = " << parameters); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::emailNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + QByteArray params = NoteStoreEmailNotePrepareParams( ctx->authenticationToken(), parameters); @@ -14344,6 +14542,8 @@ void NoteStore::emailNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); NoteStoreEmailNoteReadReply(reply); } @@ -14367,6 +14567,7 @@ AsyncResult * NoteStore::emailNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreEmailNoteReadReplyAsync); } @@ -14414,8 +14615,6 @@ QByteArray NoteStoreShareNotePrepareParams( QString NoteStoreShareNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreShareNoteReadReply"); - bool resultIsSet = false; QString result = QString(); ThriftBinaryBufferReader reader(reply); @@ -14525,13 +14724,15 @@ QString NoteStore::shareNote( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::shareNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::shareNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreShareNotePrepareParams( ctx->authenticationToken(), guid); @@ -14541,6 +14742,8 @@ QString NoteStore::shareNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreShareNoteReadReply(reply); } @@ -14564,6 +14767,7 @@ AsyncResult * NoteStore::shareNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreShareNoteReadReplyAsync); } @@ -14611,8 +14815,6 @@ QByteArray NoteStoreStopSharingNotePrepareParams( void NoteStoreStopSharingNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreStopSharingNoteReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -14702,13 +14904,15 @@ void NoteStore::stopSharingNote( Guid guid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::stopSharingNote"); - QEC_TRACE("note_store", "Parameters:\n" - << " guid = " << guid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::stopSharingNote: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " guid = " << guid); + QByteArray params = NoteStoreStopSharingNotePrepareParams( ctx->authenticationToken(), guid); @@ -14718,6 +14922,8 @@ void NoteStore::stopSharingNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); NoteStoreStopSharingNoteReadReply(reply); } @@ -14741,6 +14947,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreStopSharingNoteReadReplyAsync); } @@ -14797,8 +15004,6 @@ QByteArray NoteStoreAuthenticateToSharedNotePrepareParams( AuthenticationResult NoteStoreAuthenticateToSharedNoteReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreAuthenticateToSharedNoteReadReply"); - bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader reader(reply); @@ -14909,14 +15114,16 @@ AuthenticationResult NoteStore::authenticateToSharedNote( QString noteKey, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " guid = " << guid << "\n" << " noteKey = " << noteKey); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( guid, noteKey, @@ -14927,6 +15134,8 @@ AuthenticationResult NoteStore::authenticateToSharedNote( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreAuthenticateToSharedNoteReadReply(reply); } @@ -14953,6 +15162,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreAuthenticateToSharedNoteReadReplyAsync); } @@ -15009,8 +15219,6 @@ QByteArray NoteStoreFindRelatedPrepareParams( RelatedResult NoteStoreFindRelatedReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreFindRelatedReadReply"); - bool resultIsSet = false; RelatedResult result = RelatedResult(); ThriftBinaryBufferReader reader(reply); @@ -15121,14 +15329,16 @@ RelatedResult NoteStore::findRelated( const RelatedResultSpec & resultSpec, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::findRelated"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("note_store", "NoteStore::findRelated: request id = " + << ctx->requestId()); QEC_TRACE("note_store", "Parameters:\n" << " query = " << query << "\n" << " resultSpec = " << resultSpec); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = NoteStoreFindRelatedPrepareParams( ctx->authenticationToken(), query, @@ -15139,6 +15349,8 @@ RelatedResult NoteStore::findRelated( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreFindRelatedReadReply(reply); } @@ -15165,6 +15377,7 @@ AsyncResult * NoteStore::findRelatedAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreFindRelatedReadReplyAsync); } @@ -15212,8 +15425,6 @@ QByteArray NoteStoreUpdateNoteIfUsnMatchesPrepareParams( UpdateNoteIfUsnMatchesResult NoteStoreUpdateNoteIfUsnMatchesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreUpdateNoteIfUsnMatchesReadReply"); - bool resultIsSet = false; UpdateNoteIfUsnMatchesResult result = UpdateNoteIfUsnMatchesResult(); ThriftBinaryBufferReader reader(reply); @@ -15323,13 +15534,15 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( const Note & note, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches"); - QEC_TRACE("note_store", "Parameters:\n" - << " note = " << note); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " note = " << note); + QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( ctx->authenticationToken(), note); @@ -15339,6 +15552,8 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreUpdateNoteIfUsnMatchesReadReply(reply); } @@ -15362,6 +15577,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreUpdateNoteIfUsnMatchesReadReplyAsync); } @@ -15409,8 +15625,6 @@ QByteArray NoteStoreManageNotebookSharesPrepareParams( ManageNotebookSharesResult NoteStoreManageNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreManageNotebookSharesReadReply"); - bool resultIsSet = false; ManageNotebookSharesResult result = ManageNotebookSharesResult(); ThriftBinaryBufferReader reader(reply); @@ -15520,13 +15734,15 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( const ManageNotebookSharesParameters & parameters, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::manageNotebookShares"); - QEC_TRACE("note_store", "Parameters:\n" - << " parameters = " << parameters); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::manageNotebookShares: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " parameters = " << parameters); + QByteArray params = NoteStoreManageNotebookSharesPrepareParams( ctx->authenticationToken(), parameters); @@ -15536,6 +15752,8 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreManageNotebookSharesReadReply(reply); } @@ -15559,6 +15777,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreManageNotebookSharesReadReplyAsync); } @@ -15606,8 +15825,6 @@ QByteArray NoteStoreGetNotebookSharesPrepareParams( ShareRelationships NoteStoreGetNotebookSharesReadReply(QByteArray reply) { - QEC_DEBUG("note_store", "NoteStoreGetNotebookSharesReadReply"); - bool resultIsSet = false; ShareRelationships result = ShareRelationships(); ThriftBinaryBufferReader reader(reply); @@ -15717,13 +15934,15 @@ ShareRelationships NoteStore::getNotebookShares( QString notebookGuid, IRequestContextPtr ctx) { - QEC_DEBUG("note_store", "NoteStore::getNotebookShares"); - QEC_TRACE("note_store", "Parameters:\n" - << " notebookGuid = " << notebookGuid); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("note_store", "NoteStore::getNotebookShares: request id = " + << ctx->requestId()); + QEC_TRACE("note_store", "Parameters:\n" + << " notebookGuid = " << notebookGuid); + QByteArray params = NoteStoreGetNotebookSharesPrepareParams( ctx->authenticationToken(), notebookGuid); @@ -15733,6 +15952,8 @@ ShareRelationships NoteStore::getNotebookShares( params, ctx->requestTimeout()); + QEC_DEBUG("note_store", "received reply for request with id = " + << ctx->requestId()); return NoteStoreGetNotebookSharesReadReply(reply); } @@ -15756,6 +15977,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), NoteStoreGetNotebookSharesReadReplyAsync); } @@ -15974,8 +16196,6 @@ QByteArray UserStoreCheckVersionPrepareParams( bool UserStoreCheckVersionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreCheckVersionReadReply"); - bool resultIsSet = false; bool result = bool(); ThriftBinaryBufferReader reader(reply); @@ -16054,15 +16274,17 @@ bool UserStore::checkVersion( qint16 edamVersionMinor, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::checkVersion"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("user_store", "UserStore::checkVersion: request id = " + << ctx->requestId()); QEC_TRACE("user_store", "Parameters:\n" << " clientName = " << clientName << "\n" << " edamVersionMajor = " << edamVersionMajor << "\n" << " edamVersionMinor = " << edamVersionMinor); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = UserStoreCheckVersionPrepareParams( clientName, edamVersionMajor, @@ -16073,6 +16295,8 @@ bool UserStore::checkVersion( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreCheckVersionReadReply(reply); } @@ -16101,6 +16325,7 @@ AsyncResult * UserStore::checkVersionAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreCheckVersionReadReplyAsync); } @@ -16139,8 +16364,6 @@ QByteArray UserStoreGetBootstrapInfoPrepareParams( BootstrapInfo UserStoreGetBootstrapInfoReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreGetBootstrapInfoReadReply"); - bool resultIsSet = false; BootstrapInfo result = BootstrapInfo(); ThriftBinaryBufferReader reader(reply); @@ -16217,13 +16440,15 @@ BootstrapInfo UserStore::getBootstrapInfo( QString locale, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::getBootstrapInfo"); - QEC_TRACE("user_store", "Parameters:\n" - << " locale = " << locale); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::getBootstrapInfo: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " locale = " << locale); + QByteArray params = UserStoreGetBootstrapInfoPrepareParams( locale); @@ -16232,6 +16457,8 @@ BootstrapInfo UserStore::getBootstrapInfo( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreGetBootstrapInfoReadReply(reply); } @@ -16254,6 +16481,7 @@ AsyncResult * UserStore::getBootstrapInfoAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreGetBootstrapInfoReadReplyAsync); } @@ -16346,8 +16574,6 @@ QByteArray UserStoreAuthenticateLongSessionPrepareParams( AuthenticationResult UserStoreAuthenticateLongSessionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreAuthenticateLongSessionReadReply"); - bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader reader(reply); @@ -16452,16 +16678,18 @@ AuthenticationResult UserStore::authenticateLongSession( bool supportsTwoFactor, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::authenticateLongSession"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("user_store", "UserStore::authenticateLongSession: request id = " + << ctx->requestId()); QEC_TRACE("user_store", "Parameters:\n" << " username = " << username << "\n" << " deviceIdentifier = " << deviceIdentifier << "\n" << " deviceDescription = " << deviceDescription << "\n" << " supportsTwoFactor = " << supportsTwoFactor); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( username, password, @@ -16476,6 +16704,8 @@ AuthenticationResult UserStore::authenticateLongSession( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreAuthenticateLongSessionReadReply(reply); } @@ -16513,6 +16743,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreAuthenticateLongSessionReadReplyAsync); } @@ -16578,8 +16809,6 @@ QByteArray UserStoreCompleteTwoFactorAuthenticationPrepareParams( AuthenticationResult UserStoreCompleteTwoFactorAuthenticationReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreCompleteTwoFactorAuthenticationReadReply"); - bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader reader(reply); @@ -16680,14 +16909,16 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( QString deviceDescription, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication: request id = " + << ctx->requestId()); QEC_TRACE("user_store", "Parameters:\n" << " deviceIdentifier = " << deviceIdentifier << "\n" << " deviceDescription = " << deviceDescription); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( ctx->authenticationToken(), oneTimeCode, @@ -16699,6 +16930,8 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreCompleteTwoFactorAuthenticationReadReply(reply); } @@ -16727,6 +16960,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreCompleteTwoFactorAuthenticationReadReplyAsync); } @@ -16765,8 +16999,6 @@ QByteArray UserStoreRevokeLongSessionPrepareParams( void UserStoreRevokeLongSessionReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreRevokeLongSessionReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -16844,11 +17076,13 @@ QVariant UserStoreRevokeLongSessionReadReplyAsync(QByteArray reply) void UserStore::revokeLongSession( IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::revokeLongSession"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::revokeLongSession: request id = " + << ctx->requestId()); + QByteArray params = UserStoreRevokeLongSessionPrepareParams( ctx->authenticationToken()); @@ -16857,6 +17091,8 @@ void UserStore::revokeLongSession( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); UserStoreRevokeLongSessionReadReply(reply); } @@ -16876,6 +17112,7 @@ AsyncResult * UserStore::revokeLongSessionAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreRevokeLongSessionReadReplyAsync); } @@ -16914,8 +17151,6 @@ QByteArray UserStoreAuthenticateToBusinessPrepareParams( AuthenticationResult UserStoreAuthenticateToBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreAuthenticateToBusinessReadReply"); - bool resultIsSet = false; AuthenticationResult result = AuthenticationResult(); ThriftBinaryBufferReader reader(reply); @@ -17013,11 +17248,13 @@ QVariant UserStoreAuthenticateToBusinessReadReplyAsync(QByteArray reply) AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::authenticateToBusiness"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::authenticateToBusiness: request id = " + << ctx->requestId()); + QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( ctx->authenticationToken()); @@ -17026,6 +17263,8 @@ AuthenticationResult UserStore::authenticateToBusiness( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreAuthenticateToBusinessReadReply(reply); } @@ -17045,6 +17284,7 @@ AsyncResult * UserStore::authenticateToBusinessAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreAuthenticateToBusinessReadReplyAsync); } @@ -17083,8 +17323,6 @@ QByteArray UserStoreGetUserPrepareParams( User UserStoreGetUserReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreGetUserReadReply"); - bool resultIsSet = false; User result = User(); ThriftBinaryBufferReader reader(reply); @@ -17182,11 +17420,13 @@ QVariant UserStoreGetUserReadReplyAsync(QByteArray reply) User UserStore::getUser( IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::getUser"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::getUser: request id = " + << ctx->requestId()); + QByteArray params = UserStoreGetUserPrepareParams( ctx->authenticationToken()); @@ -17195,6 +17435,8 @@ User UserStore::getUser( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreGetUserReadReply(reply); } @@ -17214,6 +17456,7 @@ AsyncResult * UserStore::getUserAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreGetUserReadReplyAsync); } @@ -17252,8 +17495,6 @@ QByteArray UserStoreGetPublicUserInfoPrepareParams( PublicUserInfo UserStoreGetPublicUserInfoReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreGetPublicUserInfoReadReply"); - bool resultIsSet = false; PublicUserInfo result = PublicUserInfo(); ThriftBinaryBufferReader reader(reply); @@ -17363,13 +17604,15 @@ PublicUserInfo UserStore::getPublicUserInfo( QString username, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::getPublicUserInfo"); - QEC_TRACE("user_store", "Parameters:\n" - << " username = " << username); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::getPublicUserInfo: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " username = " << username); + QByteArray params = UserStoreGetPublicUserInfoPrepareParams( username); @@ -17378,6 +17621,8 @@ PublicUserInfo UserStore::getPublicUserInfo( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreGetPublicUserInfoReadReply(reply); } @@ -17400,6 +17645,7 @@ AsyncResult * UserStore::getPublicUserInfoAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreGetPublicUserInfoReadReplyAsync); } @@ -17438,8 +17684,6 @@ QByteArray UserStoreGetUserUrlsPrepareParams( UserUrls UserStoreGetUserUrlsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreGetUserUrlsReadReply"); - bool resultIsSet = false; UserUrls result = UserUrls(); ThriftBinaryBufferReader reader(reply); @@ -17537,11 +17781,13 @@ QVariant UserStoreGetUserUrlsReadReplyAsync(QByteArray reply) UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::getUserUrls"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::getUserUrls: request id = " + << ctx->requestId()); + QByteArray params = UserStoreGetUserUrlsPrepareParams( ctx->authenticationToken()); @@ -17550,6 +17796,8 @@ UserUrls UserStore::getUserUrls( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreGetUserUrlsReadReply(reply); } @@ -17569,6 +17817,7 @@ AsyncResult * UserStore::getUserUrlsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreGetUserUrlsReadReplyAsync); } @@ -17616,8 +17865,6 @@ QByteArray UserStoreInviteToBusinessPrepareParams( void UserStoreInviteToBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreInviteToBusinessReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -17696,13 +17943,15 @@ void UserStore::inviteToBusiness( QString emailAddress, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::inviteToBusiness"); - QEC_TRACE("user_store", "Parameters:\n" - << " emailAddress = " << emailAddress); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::inviteToBusiness: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + QByteArray params = UserStoreInviteToBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -17712,6 +17961,8 @@ void UserStore::inviteToBusiness( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); UserStoreInviteToBusinessReadReply(reply); } @@ -17735,6 +17986,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreInviteToBusinessReadReplyAsync); } @@ -17782,8 +18034,6 @@ QByteArray UserStoreRemoveFromBusinessPrepareParams( void UserStoreRemoveFromBusinessReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreRemoveFromBusinessReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -17873,13 +18123,15 @@ void UserStore::removeFromBusiness( QString emailAddress, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::removeFromBusiness"); - QEC_TRACE("user_store", "Parameters:\n" - << " emailAddress = " << emailAddress); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::removeFromBusiness: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " emailAddress = " << emailAddress); + QByteArray params = UserStoreRemoveFromBusinessPrepareParams( ctx->authenticationToken(), emailAddress); @@ -17889,6 +18141,8 @@ void UserStore::removeFromBusiness( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); UserStoreRemoveFromBusinessReadReply(reply); } @@ -17912,6 +18166,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreRemoveFromBusinessReadReplyAsync); } @@ -17968,8 +18223,6 @@ QByteArray UserStoreUpdateBusinessUserIdentifierPrepareParams( void UserStoreUpdateBusinessUserIdentifierReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreUpdateBusinessUserIdentifierReadReply"); - ThriftBinaryBufferReader reader(reply); qint32 rseqid = 0; QString fname; @@ -18060,14 +18313,16 @@ void UserStore::updateBusinessUserIdentifier( QString newEmailAddress, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier"); + if (!ctx) { + ctx = m_ctx; + } + + QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier: request id = " + << ctx->requestId()); QEC_TRACE("user_store", "Parameters:\n" << " oldEmailAddress = " << oldEmailAddress << "\n" << " newEmailAddress = " << newEmailAddress); - if (!ctx) { - ctx = m_ctx; - } QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( ctx->authenticationToken(), oldEmailAddress, @@ -18078,6 +18333,8 @@ void UserStore::updateBusinessUserIdentifier( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); UserStoreUpdateBusinessUserIdentifierReadReply(reply); } @@ -18104,6 +18361,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreUpdateBusinessUserIdentifierReadReplyAsync); } @@ -18142,8 +18400,6 @@ QByteArray UserStoreListBusinessUsersPrepareParams( QList UserStoreListBusinessUsersReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreListBusinessUsersReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -18255,11 +18511,13 @@ QVariant UserStoreListBusinessUsersReadReplyAsync(QByteArray reply) QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::listBusinessUsers"); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::listBusinessUsers: request id = " + << ctx->requestId()); + QByteArray params = UserStoreListBusinessUsersPrepareParams( ctx->authenticationToken()); @@ -18268,6 +18526,8 @@ QList UserStore::listBusinessUsers( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreListBusinessUsersReadReply(reply); } @@ -18287,6 +18547,7 @@ AsyncResult * UserStore::listBusinessUsersAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreListBusinessUsersReadReplyAsync); } @@ -18334,8 +18595,6 @@ QByteArray UserStoreListBusinessInvitationsPrepareParams( QList UserStoreListBusinessInvitationsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreListBusinessInvitationsReadReply"); - bool resultIsSet = false; QList result = QList(); ThriftBinaryBufferReader reader(reply); @@ -18448,13 +18707,15 @@ QList UserStore::listBusinessInvitations( bool includeRequestedInvitations, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::listBusinessInvitations"); - QEC_TRACE("user_store", "Parameters:\n" - << " includeRequestedInvitations = " << includeRequestedInvitations); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::listBusinessInvitations: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " includeRequestedInvitations = " << includeRequestedInvitations); + QByteArray params = UserStoreListBusinessInvitationsPrepareParams( ctx->authenticationToken(), includeRequestedInvitations); @@ -18464,6 +18725,8 @@ QList UserStore::listBusinessInvitations( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreListBusinessInvitationsReadReply(reply); } @@ -18487,6 +18750,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreListBusinessInvitationsReadReplyAsync); } @@ -18525,8 +18789,6 @@ QByteArray UserStoreGetAccountLimitsPrepareParams( AccountLimits UserStoreGetAccountLimitsReadReply(QByteArray reply) { - QEC_DEBUG("user_store", "UserStoreGetAccountLimitsReadReply"); - bool resultIsSet = false; AccountLimits result = AccountLimits(); ThriftBinaryBufferReader reader(reply); @@ -18614,13 +18876,15 @@ AccountLimits UserStore::getAccountLimits( ServiceLevel serviceLevel, IRequestContextPtr ctx) { - QEC_DEBUG("user_store", "UserStore::getAccountLimits"); - QEC_TRACE("user_store", "Parameters:\n" - << " serviceLevel = " << serviceLevel); - if (!ctx) { ctx = m_ctx; } + + QEC_DEBUG("user_store", "UserStore::getAccountLimits: request id = " + << ctx->requestId()); + QEC_TRACE("user_store", "Parameters:\n" + << " serviceLevel = " << serviceLevel); + QByteArray params = UserStoreGetAccountLimitsPrepareParams( serviceLevel); @@ -18629,6 +18893,8 @@ AccountLimits UserStore::getAccountLimits( params, ctx->requestTimeout()); + QEC_DEBUG("user_store", "received reply for request with id = " + << ctx->requestId()); return UserStoreGetAccountLimitsReadReply(reply); } @@ -18651,6 +18917,7 @@ AsyncResult * UserStore::getAccountLimitsAsync( m_url, params, ctx->requestTimeout(), + ctx->requestId(), UserStoreGetAccountLimitsReadReplyAsync); } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index ee09f42d..403578c2 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -81,7 +81,7 @@ void DurableServiceTester::shouldExecuteAsyncServiceCall() [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); serviceCallDetected = true; - return new AsyncResult(value, {}); + return new AsyncResult(value, {}, ctx->requestId()); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -179,10 +179,10 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() data = e.exceptionData(); } - return new AsyncResult(QVariant(), data); + return new AsyncResult(QVariant(), data, ctx->requestId()); } - return new AsyncResult(value, {}); + return new AsyncResult(value, {}, ctx->requestId()); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -279,7 +279,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() data = e.exceptionData(); } - return new AsyncResult(QVariant(), data); + return new AsyncResult(QVariant(), data, ctx->requestId()); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -390,7 +390,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro data = e.exceptionData(); } - return new AsyncResult(QVariant(), data); + return new AsyncResult(QVariant(), data, ctx->requestId()); }); AsyncResult * result = durableService->executeAsyncRequest( From 01db41d3360c19fe3a1411ccf095a01de6fef4a1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 18 Nov 2019 07:15:49 +0300 Subject: [PATCH 075/188] Replace Q_DECL_OVERRIDE with override keyword --- QEverCloud/headers/EverCloudException.h | 4 ++-- QEverCloud/headers/OAuth.h | 14 +++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index a8e7efba..356e7fe0 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -155,7 +155,7 @@ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException explicit EvernoteException(const std::string & error); explicit EvernoteException(const char * error); - virtual QSharedPointer exceptionData() const Q_DECL_OVERRIDE; + virtual QSharedPointer exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// @@ -170,7 +170,7 @@ class QEVERCLOUD_EXPORT EvernoteExceptionData: public EverCloudExceptionData Q_DISABLE_COPY(EvernoteExceptionData) public: explicit EvernoteExceptionData(QString error); - virtual void throwException() const Q_DECL_OVERRIDE; + virtual void throwException() const override; }; } // namespace qevercloud diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index 3393042f..cec24f7d 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -112,7 +112,7 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget /** The method is useful to specify default size for a EverOAuthWebView. */ void setSizeHint(QSize sizeHint); - virtual QSize sizeHint() const Q_DECL_OVERRIDE; + virtual QSize sizeHint() const override; Q_SIGNALS: /** Emitted when the OAuth sequence started with authenticate() call is finished */ @@ -221,19 +221,11 @@ class QEVERCLOUD_EXPORT EvernoteOAuthDialog: public QDialog * @return * QDialog::Accepted on a successful authentication. */ -#if QT_VERSION < 0x050000 - int exec(); -#else - virtual int exec() Q_DECL_OVERRIDE; -#endif + virtual int exec() override; /** Shows the dialog as a window modal dialog, returning immediately. */ -#if QT_VERSION < 0x050000 - void open(); -#else - virtual void open() Q_DECL_OVERRIDE; -#endif + virtual void open() override; private: EvernoteOAuthDialogPrivate * const d_ptr; From 2abc3dc2cc3310e16eb85a8903c07f8c46442479 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 18 Nov 2019 07:37:54 +0300 Subject: [PATCH 076/188] Add functions to generate random values of "primitive" types --- QEverCloud/src/tests/Common.cpp | 85 +++++++++++++++++++++++++++++++++ QEverCloud/src/tests/Common.h | 24 ++++++++++ 2 files changed, 109 insertions(+) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 6f528636..dee9b34c 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -11,11 +11,96 @@ #include #include +#include #include +#include namespace qevercloud { namespace tests { +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +static const QString randomStringAvailableCharacters = QStringLiteral( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); + +template +T generateRandomIntType() +{ + return static_cast(rand() % std::numeric_limits::max()); +} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + +QString generateRandomString(int len) +{ + if (len <= 0) { + return {}; + } + + QString res; + res.reserve(len); + for(int i = 0; i < len; ++i) { + int index = rand() % randomStringAvailableCharacters.length(); + res.append(randomStringAvailableCharacters.at(index)); + } + + return res; +} + +qint8 generateRandomInt8() +{ + return generateRandomIntType(); +} + +qint16 generateRandomInt16() +{ + return generateRandomIntType(); +} + +qint32 generateRandomInt32() +{ + return generateRandomIntType(); +} + +qint64 generateRandomInt64() +{ + return generateRandomIntType(); +} + +quint8 generateRandomUint8() +{ + return generateRandomIntType(); +} + +quint16 generateRandomUint16() +{ + return generateRandomIntType(); +} + +quint32 generateRandomUint32() +{ + return generateRandomIntType(); +} + +quint64 generateRandomUint64() +{ + return generateRandomIntType(); +} + +double generateRandomDouble() +{ + double minval = std::numeric_limits::min(); + double maxval = std::numeric_limits::max(); + double f = (double)rand() / RAND_MAX; + return minval + f * (maxval - minval); +} + +//////////////////////////////////////////////////////////////////////////////// + SyncState generateSyncState() { SyncState state; diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index d453bd33..83631c7f 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -22,6 +22,30 @@ namespace qevercloud { namespace tests { +//////////////////////////////////////////////////////////////////////////////// + +QString generateRandomString(int len = 10); + +qint8 generateRandomInt8(); + +qint16 generateRandomInt16(); + +qint32 generateRandomInt32(); + +qint64 generateRandomInt64(); + +quint8 generateRandomUint8(); + +quint16 generateRandomUint16(); + +quint32 generateRandomUint32(); + +quint64 generateRandomUint64(); + +double generateRandomDouble(); + +//////////////////////////////////////////////////////////////////////////////// + SyncState generateSyncState(); SyncChunkFilter generateSyncChunkFilter(); From eea7e5b2de071e8cce95877f71ae821c3b465dfb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 18 Nov 2019 07:47:37 +0300 Subject: [PATCH 077/188] Add method for extraction of body from http request --- QEverCloud/src/tests/Common.cpp | 14 ++++++++++++++ QEverCloud/src/tests/Common.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index dee9b34c..9f688e2e 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -101,6 +101,20 @@ double generateRandomDouble() //////////////////////////////////////////////////////////////////////////////// +QByteArray extractBodyFromHttpRequest(const QByteArray & requestData) +{ + QString requestDataStr = QString::fromUtf8(requestData); + int index = requestDataStr.indexOf(QStringLiteral("\r\n\r\n")); + if (index < 0) { + return {}; + } + + requestDataStr.remove(0, index); + return requestDataStr.trimmed().toUtf8(); +} + +//////////////////////////////////////////////////////////////////////////////// + SyncState generateSyncState() { SyncState state; diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index 83631c7f..dacd86f4 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -46,6 +46,10 @@ double generateRandomDouble(); //////////////////////////////////////////////////////////////////////////////// +QByteArray extractBodyFromHttpRequest(const QByteArray & requestData); + +//////////////////////////////////////////////////////////////////////////////// + SyncState generateSyncState(); SyncChunkFilter generateSyncChunkFilter(); From 2b48eeba11814ef5669fe0e58a190e6a906a2939 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 19 Nov 2019 07:51:47 +0300 Subject: [PATCH 078/188] Update generated code --- QEverCloud/headers/generated/Services.h | 1 + QEverCloud/src/generated/Services.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 10a35342..5ebb625c 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -3310,6 +3310,7 @@ INoteStore * newNoteStore( IUserStore * newUserStore( QString host, + quint16 port, IRequestContextPtr ctx = {}, QObject * parent = nullptr); diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 53f2b230..1655d97f 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15990,6 +15990,7 @@ class Q_DECL_HIDDEN UserStore: public IUserStore public: explicit UserStore( QString host, + quint16 port, IRequestContextPtr ctx = {}, QObject * parent = nullptr) : IUserStore(parent), @@ -16002,6 +16003,7 @@ class Q_DECL_HIDDEN UserStore: public IUserStore QUrl url; url.setScheme(QStringLiteral("https")); url.setHost(host); + url.setPort(static_cast(port)); url.setPath(QStringLiteral("/edam/user")); m_url = url.toString(QUrl::StripTrailingSlash); } @@ -25750,10 +25752,11 @@ INoteStore * newNoteStore( IUserStore * newUserStore( QString host, + quint16 port, IRequestContextPtr ctx, QObject * parent) { - return new UserStore(host, ctx, parent); + return new UserStore(host, port, ctx, parent); } } // namespace qevercloud From 8dde19af78ac958166512dd72476996d627f5ef2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 20 Nov 2019 07:41:41 +0300 Subject: [PATCH 079/188] Update generated code --- QEverCloud/headers/generated/Services.h | 1 + QEverCloud/src/generated/Services.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 5ebb625c..da062700 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -3311,6 +3311,7 @@ INoteStore * newNoteStore( IUserStore * newUserStore( QString host, quint16 port, + QString urlScheme = QStringLiteral("https"), IRequestContextPtr ctx = {}, QObject * parent = nullptr); diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 1655d97f..af3ceec8 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15991,6 +15991,7 @@ class Q_DECL_HIDDEN UserStore: public IUserStore explicit UserStore( QString host, quint16 port, + QString urlScheme, IRequestContextPtr ctx = {}, QObject * parent = nullptr) : IUserStore(parent), @@ -16001,7 +16002,7 @@ class Q_DECL_HIDDEN UserStore: public IUserStore } QUrl url; - url.setScheme(QStringLiteral("https")); + url.setScheme(urlScheme); url.setHost(host); url.setPort(static_cast(port)); url.setPath(QStringLiteral("/edam/user")); @@ -25753,10 +25754,11 @@ INoteStore * newNoteStore( IUserStore * newUserStore( QString host, quint16 port, + QString urlScheme, IRequestContextPtr ctx, QObject * parent) { - return new UserStore(host, port, ctx, parent); + return new UserStore(host, port, urlScheme, ctx, parent); } } // namespace qevercloud From 5a2112f732f4713bbc584f14f776b6de01f8034b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 21 Nov 2019 07:59:29 +0300 Subject: [PATCH 080/188] Correct the implementation of extracting body data from post HTTP request --- QEverCloud/src/tests/Common.cpp | 9 ++++----- QEverCloud/src/tests/Common.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 9f688e2e..573b1ca1 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -101,16 +101,15 @@ double generateRandomDouble() //////////////////////////////////////////////////////////////////////////////// -QByteArray extractBodyFromHttpRequest(const QByteArray & requestData) +QByteArray extractBodyFromHttpRequest(QByteArray requestData) { - QString requestDataStr = QString::fromUtf8(requestData); - int index = requestDataStr.indexOf(QStringLiteral("\r\n\r\n")); + int index = requestData.indexOf("\r\n\r\n"); if (index < 0) { return {}; } - requestDataStr.remove(0, index); - return requestDataStr.trimmed().toUtf8(); + requestData.remove(0, index + 4); + return requestData; } //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index dacd86f4..db01cace 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -46,7 +46,7 @@ double generateRandomDouble(); //////////////////////////////////////////////////////////////////////////////// -QByteArray extractBodyFromHttpRequest(const QByteArray & requestData); +QByteArray extractBodyFromHttpRequest(QByteArray requestData); //////////////////////////////////////////////////////////////////////////////// From a097693e9e9830cce208dfa1d1ddf84a5c8cf030 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 22 Nov 2019 07:56:17 +0300 Subject: [PATCH 081/188] Add proper way to read whole request data from tcp socket --- QEverCloud/src/tests/Common.cpp | 128 ++++++++++++++++++++++++++++++++ QEverCloud/src/tests/Common.h | 6 ++ 2 files changed, 134 insertions(+) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 573b1ca1..945c6a4f 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include @@ -35,6 +37,130 @@ T generateRandomIntType() //////////////////////////////////////////////////////////////////////////////// +class ThriftRequestExtractor: public QObject +{ + Q_OBJECT +public: + explicit ThriftRequestExtractor(QTcpSocket & socket, QObject * parent = nullptr) : + QObject(parent) + { + QObject::connect( + &socket, + &QIODevice::readyRead, + this, + &ThriftRequestExtractor::onSocketReadyRead, + Qt::QueuedConnection); + } + + bool status() const { return m_status; } + + const QByteArray & data() { return m_data; } + +Q_SIGNALS: + void finished(); + void failed(); + +private Q_SLOTS: + void onSocketReadyRead() + { + QTcpSocket * pSocket = qobject_cast(sender()); + Q_ASSERT(pSocket); + + m_data.append(pSocket->read(pSocket->bytesAvailable())); + tryParseData(); + } + +private: + void tryParseData() + { + // Data read from socket should be a http request with headers and body + + // First parse headers, find Content-Length one to figure out the size + // of request body + int contentLengthIndex = m_data.indexOf("Content-Length:"); + if (contentLengthIndex < 0) { + // No Content-Length header, probably not all data has arrived yet + return; + } + + int contentLengthLineEndIndex = m_data.indexOf("\r\n", contentLengthIndex); + if (contentLengthLineEndIndex < 0) { + // No line end after Content-Length header, probably not all data + // has arrived yet + return; + } + + int contentLengthLen = contentLengthLineEndIndex - contentLengthIndex - 15; + QString contentLengthStr = + QString::fromUtf8(m_data.mid(contentLengthIndex + 15, contentLengthLen)); + + bool conversionResult = false; + int contentLength = contentLengthStr.toInt(&conversionResult); + if (Q_UNLIKELY(!conversionResult)) { + m_status = false; + Q_EMIT failed(); + return; + } + + // Now see whether whole body data is present + int headersEndIndex = m_data.indexOf("\r\n\r\n", contentLengthLineEndIndex); + if (headersEndIndex < 0) { + // No empty line after http headers, probably not all data has + // arrived yet + return; + } + + QByteArray body = m_data; + body.remove(0, headersEndIndex + 4); + if (body.size() < contentLength) { + // Not all data has arrived yet + return; + } + + m_data = body; + m_status = true; + Q_EMIT finished(); + } + +private: + bool m_status = false; + QByteArray m_data; +}; + +//////////////////////////////////////////////////////////////////////////////// + +QByteArray readThriftRequestFromSocket(QTcpSocket & socket) +{ + if (!socket.waitForConnected()) { + return QByteArray(); + } + + QEventLoop loop; + ThriftRequestExtractor extractor(socket); + + QObject::connect( + &extractor, + &ThriftRequestExtractor::finished, + &loop, + &QEventLoop::quit); + + QObject::connect( + &extractor, + &ThriftRequestExtractor::failed, + &loop, + &QEventLoop::quit); + + loop.exec(); + + if (!extractor.status()) { + return QByteArray(); + } + + return extractor.data(); +} + +//////////////////////////////////////////////////////////////////////////////// + QString generateRandomString(int len) { if (len <= 0) { @@ -1313,3 +1439,5 @@ ManageNoteSharesResult generateManageNoteSharesResult() } // namespace tests } // namespace qevercloud + +#include diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index db01cace..313afe03 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -11,6 +11,8 @@ #include +#include + #ifdef QEVERCLOUD_SHARED_LIBRARY #undef QEVERCLOUD_SHARED_LIBRARY #endif @@ -24,6 +26,10 @@ namespace tests { //////////////////////////////////////////////////////////////////////////////// +QByteArray readThriftRequestFromSocket(QTcpSocket & socket); + +//////////////////////////////////////////////////////////////////////////////// + QString generateRandomString(int len = 10); qint8 generateRandomInt8(); From 754b5b374d4e833e2510b9613cb4f00b8b4f09c5 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 23 Nov 2019 21:24:12 +0300 Subject: [PATCH 082/188] Add method for proper writing of data to TCP socket --- QEverCloud/src/tests/Common.cpp | 23 +++++++++++++++++++++++ QEverCloud/src/tests/Common.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 945c6a4f..47bb5221 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -159,6 +159,29 @@ QByteArray readThriftRequestFromSocket(QTcpSocket & socket) return extractor.data(); } +bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket) +{ + int remaining = data.size(); + const char * pData = data.constData(); + while(socket.isOpen() && remaining>0) + { + // If the output buffer has become large, then wait until it has been sent. + if (socket.bytesToWrite() > 16384) + { + socket.waitForBytesWritten(-1); + } + + qint64 written = socket.write(pData, remaining); + if (written < 0) { + return false; + } + + pData += written; + remaining -= written; + } + return true; +} + //////////////////////////////////////////////////////////////////////////////// QString generateRandomString(int len) diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index 313afe03..37064f84 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -28,6 +28,8 @@ namespace tests { QByteArray readThriftRequestFromSocket(QTcpSocket & socket); +bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket); + //////////////////////////////////////////////////////////////////////////////// QString generateRandomString(int len = 10); From 7df44d0437321ebf13269bdfa4bf3448cf9c5776 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 23 Nov 2019 21:31:31 +0300 Subject: [PATCH 083/188] Update generated code --- QEverCloud/src/generated/Servers.cpp | 445 +++++++++++++++++++++------ 1 file changed, 356 insertions(+), 89 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index 0adc518b..33393c81 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -29,7 +29,7 @@ void parseNoteStoreGetSyncStateParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getSyncState_pargs"); reader.readStructBegin(fname); @@ -78,7 +78,7 @@ void parseNoteStoreGetFilteredSyncChunkParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getFilteredSyncChunk_pargs"); reader.readStructBegin(fname); @@ -158,7 +158,7 @@ void parseNoteStoreGetLinkedNotebookSyncStateParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getLinkedNotebookSyncState_pargs"); reader.readStructBegin(fname); @@ -219,7 +219,7 @@ void parseNoteStoreGetLinkedNotebookSyncChunkParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getLinkedNotebookSyncChunk_pargs"); reader.readStructBegin(fname); @@ -309,7 +309,7 @@ void parseNoteStoreListNotebooksParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listNotebooks_pargs"); reader.readStructBegin(fname); @@ -355,7 +355,7 @@ void parseNoteStoreListAccessibleBusinessNotebooksParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listAccessibleBusinessNotebooks_pargs"); reader.readStructBegin(fname); @@ -402,7 +402,7 @@ void parseNoteStoreGetNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNotebook_pargs"); reader.readStructBegin(fname); @@ -459,7 +459,7 @@ void parseNoteStoreGetDefaultNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getDefaultNotebook_pargs"); reader.readStructBegin(fname); @@ -506,7 +506,7 @@ void parseNoteStoreCreateNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createNotebook_pargs"); reader.readStructBegin(fname); @@ -564,7 +564,7 @@ void parseNoteStoreUpdateNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateNotebook_pargs"); reader.readStructBegin(fname); @@ -622,7 +622,7 @@ void parseNoteStoreExpungeNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_expungeNotebook_pargs"); reader.readStructBegin(fname); @@ -679,7 +679,7 @@ void parseNoteStoreListTagsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listTags_pargs"); reader.readStructBegin(fname); @@ -726,7 +726,7 @@ void parseNoteStoreListTagsByNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listTagsByNotebook_pargs"); reader.readStructBegin(fname); @@ -784,7 +784,7 @@ void parseNoteStoreGetTagParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getTag_pargs"); reader.readStructBegin(fname); @@ -842,7 +842,7 @@ void parseNoteStoreCreateTagParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createTag_pargs"); reader.readStructBegin(fname); @@ -900,7 +900,7 @@ void parseNoteStoreUpdateTagParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateTag_pargs"); reader.readStructBegin(fname); @@ -958,7 +958,7 @@ void parseNoteStoreUntagAllParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_untagAll_pargs"); reader.readStructBegin(fname); @@ -1016,7 +1016,7 @@ void parseNoteStoreExpungeTagParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_expungeTag_pargs"); reader.readStructBegin(fname); @@ -1073,7 +1073,7 @@ void parseNoteStoreListSearchesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listSearches_pargs"); reader.readStructBegin(fname); @@ -1120,7 +1120,7 @@ void parseNoteStoreGetSearchParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getSearch_pargs"); reader.readStructBegin(fname); @@ -1178,7 +1178,7 @@ void parseNoteStoreCreateSearchParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createSearch_pargs"); reader.readStructBegin(fname); @@ -1236,7 +1236,7 @@ void parseNoteStoreUpdateSearchParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateSearch_pargs"); reader.readStructBegin(fname); @@ -1294,7 +1294,7 @@ void parseNoteStoreExpungeSearchParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_expungeSearch_pargs"); reader.readStructBegin(fname); @@ -1353,7 +1353,7 @@ void parseNoteStoreFindNoteOffsetParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_findNoteOffset_pargs"); reader.readStructBegin(fname); @@ -1425,7 +1425,7 @@ void parseNoteStoreFindNotesMetadataParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_findNotesMetadata_pargs"); reader.readStructBegin(fname); @@ -1517,7 +1517,7 @@ void parseNoteStoreFindNoteCountsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_findNoteCounts_pargs"); reader.readStructBegin(fname); @@ -1587,7 +1587,7 @@ void parseNoteStoreGetNoteWithResultSpecParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteWithResultSpec_pargs"); reader.readStructBegin(fname); @@ -1660,7 +1660,7 @@ void parseNoteStoreGetNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNote_pargs"); reader.readStructBegin(fname); @@ -1762,7 +1762,7 @@ void parseNoteStoreGetNoteApplicationDataParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteApplicationData_pargs"); reader.readStructBegin(fname); @@ -1821,7 +1821,7 @@ void parseNoteStoreGetNoteApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -1892,7 +1892,7 @@ void parseNoteStoreSetNoteApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_setNoteApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -1973,7 +1973,7 @@ void parseNoteStoreUnsetNoteApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_unsetNoteApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -2042,7 +2042,7 @@ void parseNoteStoreGetNoteContentParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteContent_pargs"); reader.readStructBegin(fname); @@ -2102,7 +2102,7 @@ void parseNoteStoreGetNoteSearchTextParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteSearchText_pargs"); reader.readStructBegin(fname); @@ -2182,7 +2182,7 @@ void parseNoteStoreGetResourceSearchTextParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceSearchText_pargs"); reader.readStructBegin(fname); @@ -2240,7 +2240,7 @@ void parseNoteStoreGetNoteTagNamesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteTagNames_pargs"); reader.readStructBegin(fname); @@ -2298,7 +2298,7 @@ void parseNoteStoreCreateNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createNote_pargs"); reader.readStructBegin(fname); @@ -2356,7 +2356,7 @@ void parseNoteStoreUpdateNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateNote_pargs"); reader.readStructBegin(fname); @@ -2414,7 +2414,7 @@ void parseNoteStoreDeleteNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_deleteNote_pargs"); reader.readStructBegin(fname); @@ -2472,7 +2472,7 @@ void parseNoteStoreExpungeNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_expungeNote_pargs"); reader.readStructBegin(fname); @@ -2531,7 +2531,7 @@ void parseNoteStoreCopyNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_copyNote_pargs"); reader.readStructBegin(fname); @@ -2600,7 +2600,7 @@ void parseNoteStoreListNoteVersionsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listNoteVersions_pargs"); reader.readStructBegin(fname); @@ -2662,7 +2662,7 @@ void parseNoteStoreGetNoteVersionParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNoteVersion_pargs"); reader.readStructBegin(fname); @@ -2768,7 +2768,7 @@ void parseNoteStoreGetResourceParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResource_pargs"); reader.readStructBegin(fname); @@ -2870,7 +2870,7 @@ void parseNoteStoreGetResourceApplicationDataParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceApplicationData_pargs"); reader.readStructBegin(fname); @@ -2929,7 +2929,7 @@ void parseNoteStoreGetResourceApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -3000,7 +3000,7 @@ void parseNoteStoreSetResourceApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_setResourceApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -3081,7 +3081,7 @@ void parseNoteStoreUnsetResourceApplicationDataEntryParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_unsetResourceApplicationDataEntry_pargs"); reader.readStructBegin(fname); @@ -3150,7 +3150,7 @@ void parseNoteStoreUpdateResourceParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateResource_pargs"); reader.readStructBegin(fname); @@ -3208,7 +3208,7 @@ void parseNoteStoreGetResourceDataParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceData_pargs"); reader.readStructBegin(fname); @@ -3270,7 +3270,7 @@ void parseNoteStoreGetResourceByHashParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceByHash_pargs"); reader.readStructBegin(fname); @@ -3372,7 +3372,7 @@ void parseNoteStoreGetResourceRecognitionParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceRecognition_pargs"); reader.readStructBegin(fname); @@ -3430,7 +3430,7 @@ void parseNoteStoreGetResourceAlternateDataParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceAlternateData_pargs"); reader.readStructBegin(fname); @@ -3488,7 +3488,7 @@ void parseNoteStoreGetResourceAttributesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getResourceAttributes_pargs"); reader.readStructBegin(fname); @@ -3546,7 +3546,7 @@ void parseNoteStoreGetPublicNotebookParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("NoteStore_getPublicNotebook_pargs"); reader.readStructBegin(fname); @@ -3605,7 +3605,7 @@ void parseNoteStoreShareNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_shareNotebook_pargs"); reader.readStructBegin(fname); @@ -3674,7 +3674,7 @@ void parseNoteStoreCreateOrUpdateNotebookSharesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createOrUpdateNotebookShares_pargs"); reader.readStructBegin(fname); @@ -3732,7 +3732,7 @@ void parseNoteStoreUpdateSharedNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateSharedNotebook_pargs"); reader.readStructBegin(fname); @@ -3791,7 +3791,7 @@ void parseNoteStoreSetNotebookRecipientSettingsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_setNotebookRecipientSettings_pargs"); reader.readStructBegin(fname); @@ -3859,7 +3859,7 @@ void parseNoteStoreListSharedNotebooksParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listSharedNotebooks_pargs"); reader.readStructBegin(fname); @@ -3906,7 +3906,7 @@ void parseNoteStoreCreateLinkedNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_createLinkedNotebook_pargs"); reader.readStructBegin(fname); @@ -3964,7 +3964,7 @@ void parseNoteStoreUpdateLinkedNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateLinkedNotebook_pargs"); reader.readStructBegin(fname); @@ -4021,7 +4021,7 @@ void parseNoteStoreListLinkedNotebooksParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_listLinkedNotebooks_pargs"); reader.readStructBegin(fname); @@ -4068,7 +4068,7 @@ void parseNoteStoreExpungeLinkedNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_expungeLinkedNotebook_pargs"); reader.readStructBegin(fname); @@ -4126,7 +4126,7 @@ void parseNoteStoreAuthenticateToSharedNotebookParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_authenticateToSharedNotebook_pargs"); reader.readStructBegin(fname); @@ -4183,7 +4183,7 @@ void parseNoteStoreGetSharedNotebookByAuthParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getSharedNotebookByAuth_pargs"); reader.readStructBegin(fname); @@ -4230,7 +4230,7 @@ void parseNoteStoreEmailNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_emailNote_pargs"); reader.readStructBegin(fname); @@ -4288,7 +4288,7 @@ void parseNoteStoreShareNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_shareNote_pargs"); reader.readStructBegin(fname); @@ -4346,7 +4346,7 @@ void parseNoteStoreStopSharingNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_stopSharingNote_pargs"); reader.readStructBegin(fname); @@ -4405,7 +4405,7 @@ void parseNoteStoreAuthenticateToSharedNoteParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_authenticateToSharedNote_pargs"); reader.readStructBegin(fname); @@ -4475,7 +4475,7 @@ void parseNoteStoreFindRelatedParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_findRelated_pargs"); reader.readStructBegin(fname); @@ -4544,7 +4544,7 @@ void parseNoteStoreUpdateNoteIfUsnMatchesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_updateNoteIfUsnMatches_pargs"); reader.readStructBegin(fname); @@ -4602,7 +4602,7 @@ void parseNoteStoreManageNotebookSharesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_manageNotebookShares_pargs"); reader.readStructBegin(fname); @@ -4660,7 +4660,7 @@ void parseNoteStoreGetNotebookSharesParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("NoteStore_getNotebookShares_pargs"); reader.readStructBegin(fname); @@ -4719,7 +4719,7 @@ void parseUserStoreCheckVersionParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("UserStore_checkVersion_pargs"); reader.readStructBegin(fname); @@ -4787,7 +4787,7 @@ void parseUserStoreGetBootstrapInfoParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("UserStore_getBootstrapInfo_pargs"); reader.readStructBegin(fname); @@ -4839,7 +4839,7 @@ void parseUserStoreAuthenticateLongSessionParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("UserStore_authenticateLongSession_pargs"); reader.readStructBegin(fname); @@ -4954,7 +4954,7 @@ void parseUserStoreCompleteTwoFactorAuthenticationParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_completeTwoFactorAuthentication_pargs"); reader.readStructBegin(fname); @@ -5033,7 +5033,7 @@ void parseUserStoreRevokeLongSessionParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_revokeLongSession_pargs"); reader.readStructBegin(fname); @@ -5079,7 +5079,7 @@ void parseUserStoreAuthenticateToBusinessParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_authenticateToBusiness_pargs"); reader.readStructBegin(fname); @@ -5125,7 +5125,7 @@ void parseUserStoreGetUserParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_getUser_pargs"); reader.readStructBegin(fname); @@ -5171,7 +5171,7 @@ void parseUserStoreGetPublicUserInfoParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("UserStore_getPublicUserInfo_pargs"); reader.readStructBegin(fname); @@ -5217,7 +5217,7 @@ void parseUserStoreGetUserUrlsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_getUserUrls_pargs"); reader.readStructBegin(fname); @@ -5264,7 +5264,7 @@ void parseUserStoreInviteToBusinessParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_inviteToBusiness_pargs"); reader.readStructBegin(fname); @@ -5322,7 +5322,7 @@ void parseUserStoreRemoveFromBusinessParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_removeFromBusiness_pargs"); reader.readStructBegin(fname); @@ -5381,7 +5381,7 @@ void parseUserStoreUpdateBusinessUserIdentifierParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_updateBusinessUserIdentifier_pargs"); reader.readStructBegin(fname); @@ -5449,7 +5449,7 @@ void parseUserStoreListBusinessUsersParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_listBusinessUsers_pargs"); reader.readStructBegin(fname); @@ -5496,7 +5496,7 @@ void parseUserStoreListBusinessInvitationsParams( qint16 fieldId; QString authenticationToken; - QString fname = + QString fname = QStringLiteral("UserStore_listBusinessInvitations_pargs"); reader.readStructBegin(fname); @@ -5553,7 +5553,7 @@ void parseUserStoreGetAccountLimitsParams( ThriftFieldType fieldType; qint16 fieldId; - QString fname = + QString fname = QStringLiteral("UserStore_getAccountLimits_pargs"); reader.readStructBegin(fname); @@ -6843,6 +6843,9 @@ void NoteStoreServer::onGetSyncStateRequestReady( writeSyncState(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -6942,6 +6945,9 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( writeSyncChunk(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7056,6 +7062,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( writeSyncState(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7170,6 +7179,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( writeSyncChunk(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7273,6 +7285,9 @@ void NoteStoreServer::onListNotebooksRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7376,6 +7391,9 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7490,6 +7508,9 @@ void NoteStoreServer::onGetNotebookRequestReady( writeNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7589,6 +7610,9 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( writeNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7703,6 +7727,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( writeNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7817,6 +7844,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -7931,6 +7961,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8034,6 +8067,9 @@ void NoteStoreServer::onListTagsRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8152,6 +8188,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8266,6 +8305,9 @@ void NoteStoreServer::onGetTagRequestReady( writeTag(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8380,6 +8422,9 @@ void NoteStoreServer::onCreateTagRequestReady( writeTag(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8494,6 +8539,9 @@ void NoteStoreServer::onUpdateTagRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8606,6 +8654,9 @@ void NoteStoreServer::onUntagAllRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8720,6 +8771,9 @@ void NoteStoreServer::onExpungeTagRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8823,6 +8877,9 @@ void NoteStoreServer::onListSearchesRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -8937,6 +8994,9 @@ void NoteStoreServer::onGetSearchRequestReady( writeSavedSearch(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9036,6 +9096,9 @@ void NoteStoreServer::onCreateSearchRequestReady( writeSavedSearch(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9150,6 +9213,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9264,6 +9330,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9378,6 +9447,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9492,6 +9564,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( writeNotesMetadataList(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9606,6 +9681,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( writeNoteCollectionCounts(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9720,6 +9798,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9834,6 +9915,9 @@ void NoteStoreServer::onGetNoteRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -9948,6 +10032,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( writeLazyMap(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10062,6 +10149,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10176,6 +10266,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10290,6 +10383,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10404,6 +10500,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10518,6 +10617,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10632,6 +10734,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10750,6 +10855,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10864,6 +10972,9 @@ void NoteStoreServer::onCreateNoteRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -10978,6 +11089,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11092,6 +11206,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11206,6 +11323,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11320,6 +11440,9 @@ void NoteStoreServer::onCopyNoteRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11438,6 +11561,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11552,6 +11678,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( writeNote(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11666,6 +11795,9 @@ void NoteStoreServer::onGetResourceRequestReady( writeResource(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11780,6 +11912,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( writeLazyMap(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -11894,6 +12029,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12008,6 +12146,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12122,6 +12263,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12236,6 +12380,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12350,6 +12497,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( writer.writeBinary(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12464,6 +12614,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( writeResource(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12578,6 +12731,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( writer.writeBinary(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12692,6 +12848,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( writer.writeBinary(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12806,6 +12965,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( writeResourceAttributes(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -12905,6 +13067,9 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( writeNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13019,6 +13184,9 @@ void NoteStoreServer::onShareNotebookRequestReady( writeSharedNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13148,6 +13316,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( writeCreateOrUpdateNotebookSharesResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13262,6 +13433,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13376,6 +13550,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( writeNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13494,6 +13671,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13608,6 +13788,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( writeLinkedNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13722,6 +13905,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13840,6 +14026,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -13954,6 +14143,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( writer.writeI32(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14068,6 +14260,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( writeAuthenticationResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14182,6 +14377,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( writeSharedNotebook(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14294,6 +14492,9 @@ void NoteStoreServer::onEmailNoteRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14408,6 +14609,9 @@ void NoteStoreServer::onShareNoteRequestReady( writer.writeString(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14520,6 +14724,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14634,6 +14841,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( writeAuthenticationResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14748,6 +14958,9 @@ void NoteStoreServer::onFindRelatedRequestReady( writeRelatedResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14862,6 +15075,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( writeUpdateNoteIfUsnMatchesResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -14976,6 +15192,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( writeManageNotebookSharesResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15090,6 +15309,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( writeShareRelationships(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15391,6 +15613,9 @@ void UserStoreServer::onCheckVersionRequestReady( writer.writeBool(value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15442,6 +15667,9 @@ void UserStoreServer::onGetBootstrapInfoRequestReady( writeBootstrapInfo(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15541,6 +15769,9 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( writeAuthenticationResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15640,6 +15871,9 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( writeAuthenticationResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15737,6 +15971,9 @@ void UserStoreServer::onRevokeLongSessionRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15836,6 +16073,9 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( writeAuthenticationResult(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -15935,6 +16175,9 @@ void UserStoreServer::onGetUserRequestReady( writeUser(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16049,6 +16292,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( writePublicUserInfo(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16148,6 +16394,9 @@ void UserStoreServer::onGetUserUrlsRequestReady( writeUserUrls(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16245,6 +16494,9 @@ void UserStoreServer::onInviteToBusinessRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16357,6 +16609,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16469,6 +16724,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( 0); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16572,6 +16830,9 @@ void UserStoreServer::onListBusinessUsersRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16675,6 +16936,9 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( writer.writeListEnd(); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); @@ -16759,6 +17023,9 @@ void UserStoreServer::onGetAccountLimitsRequestReady( writeAccountLimits(writer, value); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); writer.writeMessageEnd(); From 679d00e2f31f3cca47fffa25bc2ded8cf42f073c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 24 Nov 2019 12:22:13 +0300 Subject: [PATCH 084/188] Add method to generate random bool value --- QEverCloud/src/tests/Common.cpp | 5 +++++ QEverCloud/src/tests/Common.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp index 47bb5221..11718a04 100644 --- a/QEverCloud/src/tests/Common.cpp +++ b/QEverCloud/src/tests/Common.cpp @@ -248,6 +248,11 @@ double generateRandomDouble() return minval + f * (maxval - minval); } +bool generateRandomBool() +{ + return generateRandomInt8() >= 0; +} + //////////////////////////////////////////////////////////////////////////////// QByteArray extractBodyFromHttpRequest(QByteArray requestData) diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h index 37064f84..94087abd 100644 --- a/QEverCloud/src/tests/Common.h +++ b/QEverCloud/src/tests/Common.h @@ -52,6 +52,8 @@ quint64 generateRandomUint64(); double generateRandomDouble(); +bool generateRandomBool(); + //////////////////////////////////////////////////////////////////////////////// QByteArray extractBodyFromHttpRequest(QByteArray requestData); From 1d036f327a3358b9b847f289daf5e3fadeda8ad2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 27 Nov 2019 07:55:56 +0300 Subject: [PATCH 085/188] Update generated code --- .../src/tests/generated/TestNoteStore.cpp | 5780 ++++++++++++++++- .../src/tests/generated/TestUserStore.cpp | 1182 +++- 2 files changed, 6873 insertions(+), 89 deletions(-) diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index d35b9089..8289d287 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -11,7 +11,11 @@ #include "TestNoteStore.h" #include "../../Impl.h" +#include "../Common.h" #include +#include +#include +#include namespace qevercloud { @@ -3892,518 +3896,6146 @@ public Q_SLOTS: void NoteStoreTester::shouldExecuteGetSyncState() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncState response = tests::generateSyncState(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncState res = noteStore->getSyncState( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() { - // TODO: implement + qint32 afterUSN = tests::generateRandomInt32(); + qint32 maxEntries = tests::generateRandomInt32(); + SyncChunkFilter filter = tests::generateSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = tests::generateSyncChunk(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() { - // TODO: implement + LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncState response = tests::generateSyncState(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() { - // TODO: implement + LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + qint32 afterUSN = tests::generateRandomInt32(); + qint32 maxEntries = tests::generateRandomInt32(); + bool fullSyncOnly = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = tests::generateSyncChunk(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListNotebooks() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateNotebook(); + response << tests::generateNotebook(); + response << tests::generateNotebook(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listNotebooks( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateNotebook(); + response << tests::generateNotebook(); + response << tests::generateNotebook(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNotebook() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = tests::generateNotebook(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getNotebook( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetDefaultNotebook() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = tests::generateNotebook(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getDefaultNotebook( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateNotebook() { - // TODO: implement + Notebook notebook = tests::generateNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = tests::generateNotebook(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->createNotebook( + notebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateNotebook() { - // TODO: implement + Notebook notebook = tests::generateNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeNotebook() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListTags() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateTag(); + response << tests::generateTag(); + response << tests::generateTag(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTags( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListTagsByNotebook() { - // TODO: implement + Guid notebookGuid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateTag(); + response << tests::generateTag(); + response << tests::generateTag(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetTag() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = tests::generateTag(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->getTag( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateTag() { - // TODO: implement + Tag tag = tests::generateTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = tests::generateTag(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->createTag( + tag, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateTag() { - // TODO: implement + Tag tag = tests::generateTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateTag( + tag, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUntagAll() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->untagAll( + guid, + ctx); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeTag() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeTag( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListSearches() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateSavedSearch(); + response << tests::generateSavedSearch(); + response << tests::generateSavedSearch(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listSearches( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetSearch() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = tests::generateSavedSearch(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->getSearch( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateSearch() { - // TODO: implement + SavedSearch search = tests::generateSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = tests::generateSavedSearch(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->createSearch( + search, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateSearch() { - // TODO: implement + SavedSearch search = tests::generateSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSearch( + search, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeSearch() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeSearch( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteFindNoteOffset() { - // TODO: implement + NoteFilter filter = tests::generateNoteFilter(); + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteFindNotesMetadata() { - // TODO: implement + NoteFilter filter = tests::generateNoteFilter(); + qint32 offset = tests::generateRandomInt32(); + qint32 maxNotes = tests::generateRandomInt32(); + NotesMetadataResultSpec resultSpec = tests::generateNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NotesMetadataList response = tests::generateNotesMetadataList(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteFindNoteCounts() { - // TODO: implement + NoteFilter filter = tests::generateNoteFilter(); + bool withTrash = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteCollectionCounts response = tests::generateNoteCollectionCounts(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() { - // TODO: implement + Guid guid = tests::generateRandomString(); + NoteResultSpec resultSpec = tests::generateNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNote() { - // TODO: implement + Guid guid = tests::generateRandomString(); + bool withContent = tests::generateRandomBool(); + bool withResourcesData = tests::generateRandomBool(); + bool withResourcesRecognition = tests::generateRandomBool(); + bool withResourcesAlternateData = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteApplicationData() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = tests::generateLazyMap(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + QString value = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteContent() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteContent( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteSearchText() { - // TODO: implement + Guid guid = tests::generateRandomString(); + bool noteOnly = tests::generateRandomBool(); + bool tokenizeForIndexing = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceSearchText() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getResourceSearchText( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteTagNames() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QStringList response; + response << tests::generateRandomString(); + response << tests::generateRandomString(); + response << tests::generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateNote() { - // TODO: implement + Note note = tests::generateNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->createNote( + note, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateNote() { - // TODO: implement + Note note = tests::generateNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->updateNote( + note, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteDeleteNote() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->deleteNote( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeNote() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeNote( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCopyNote() { - // TODO: implement + Guid noteGuid = tests::generateRandomString(); + Guid toNotebookGuid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListNoteVersions() { - // TODO: implement + Guid noteGuid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateNoteVersionId(); + response << tests::generateNoteVersionId(); + response << tests::generateNoteVersionId(); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteVersion() { - // TODO: implement + Guid noteGuid = tests::generateRandomString(); + qint32 updateSequenceNum = tests::generateRandomInt32(); + bool withResourcesData = tests::generateRandomBool(); + bool withResourcesRecognition = tests::generateRandomBool(); + bool withResourcesAlternateData = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = tests::generateNote(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResource() { - // TODO: implement + Guid guid = tests::generateRandomString(); + bool withData = tests::generateRandomBool(); + bool withRecognition = tests::generateRandomBool(); + bool withAttributes = tests::generateRandomBool(); + bool withAlternateData = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Resource response = tests::generateResource(); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceApplicationData() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = tests::generateLazyMap(); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + QString value = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() { - // TODO: implement + Guid guid = tests::generateRandomString(); + QString key = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateResource() { - // TODO: implement + Resource resource = tests::generateResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateResource( + resource, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceData() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = tests::generateRandomString().toUtf8(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceData( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceByHash() { - // TODO: implement + Guid noteGuid = tests::generateRandomString(); + QByteArray contentHash = tests::generateRandomString().toUtf8(); + bool withData = tests::generateRandomBool(); + bool withRecognition = tests::generateRandomBool(); + bool withAlternateData = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Resource response = tests::generateResource(); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceRecognition() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = tests::generateRandomString().toUtf8(); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceAlternateData() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = tests::generateRandomString().toUtf8(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceAttributes() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + ResourceAttributes response = tests::generateResourceAttributes(); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetPublicNotebook() { - // TODO: implement + UserID userId = tests::generateRandomInt32(); + QString publicUri = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + Notebook response = tests::generateNotebook(); + + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequest, + &helper, + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &server, + &NoteStoreServer::onGetPublicNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteShareNotebook() { - // TODO: implement + SharedNotebook sharedNotebook = tests::generateSharedNotebook(); + QString message = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SharedNotebook response = tests::generateSharedNotebook(); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() { - // TODO: implement + NotebookShareTemplate shareTemplate = tests::generateNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + CreateOrUpdateNotebookSharesResult response = tests::generateCreateOrUpdateNotebookSharesResult(); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateSharedNotebook() { - // TODO: implement + SharedNotebook sharedNotebook = tests::generateSharedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequest, + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() { - // TODO: implement + QString notebookGuid = tests::generateRandomString(); + NotebookRecipientSettings recipientSettings = tests::generateNotebookRecipientSettings(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = tests::generateNotebook(); + + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNotebookRecipientSettingsRequest, + &helper, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &server, + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListSharedNotebooks() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateSharedNotebook(); + response << tests::generateSharedNotebook(); + response << tests::generateSharedNotebook(); + + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSharedNotebooksRequest, + &helper, + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &server, + &NoteStoreServer::onListSharedNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSharedNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listSharedNotebooks( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateLinkedNotebook() { - // TODO: implement + LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LinkedNotebook response = tests::generateLinkedNotebook(); + + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createLinkedNotebookRequest, + &helper, + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onCreateLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() { - // TODO: implement + LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateLinkedNotebookRequest, + &helper, + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListLinkedNotebooks() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateLinkedNotebook(); + response << tests::generateLinkedNotebook(); + response << tests::generateLinkedNotebook(); + + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listLinkedNotebooksRequest, + &helper, + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &server, + &NoteStoreServer::onListLinkedNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listLinkedNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listLinkedNotebooks( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = tests::generateRandomInt32(); + + NoteStoreExpungeLinkedNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequest, + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeLinkedNotebook( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() { - // TODO: implement + QString shareKeyOrGlobalId = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = tests::generateAuthenticationResult(); + + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNotebookRequest, + &helper, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &server, + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SharedNotebook response = tests::generateSharedNotebook(); + + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequest, + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &server, + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteEmailNote() { - // TODO: implement + NoteEmailParameters parameters = tests::generateNoteEmailParameters(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::emailNoteRequest, + &helper, + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &server, + &NoteStoreServer::onEmailNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::emailNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->emailNote( + parameters, + ctx); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteShareNote() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = tests::generateRandomString(); + + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequest, + &helper, + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &server, + &NoteStoreServer::onShareNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->shareNote( + guid, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteStopSharingNote() { - // TODO: implement + Guid guid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::stopSharingNoteRequest, + &helper, + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &server, + &NoteStoreServer::onStopSharingNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::stopSharingNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->stopSharingNote( + guid, + ctx); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() { - // TODO: implement + QString guid = tests::generateRandomString(); + QString noteKey = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = tests::generateAuthenticationResult(); + + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNoteRequest, + &helper, + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &server, + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteFindRelated() { - // TODO: implement + RelatedQuery query = tests::generateRelatedQuery(); + RelatedResultSpec resultSpec = tests::generateRelatedResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + RelatedResult response = tests::generateRelatedResult(); + + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findRelatedRequest, + &helper, + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &server, + &NoteStoreServer::onFindRelatedRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findRelatedRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + RelatedResult res = noteStore->findRelated( + query, + resultSpec, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() { - // TODO: implement + Note note = tests::generateNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UpdateNoteIfUsnMatchesResult response = tests::generateUpdateNoteIfUsnMatchesResult(); + + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &helper, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &server, + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteManageNotebookShares() { - // TODO: implement + ManageNotebookSharesParameters parameters = tests::generateManageNotebookSharesParameters(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + ManageNotebookSharesResult response = tests::generateManageNotebookSharesResult(); + + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::manageNotebookSharesRequest, + &helper, + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &server, + &NoteStoreServer::onManageNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::manageNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNotebookShares() { - // TODO: implement + QString notebookGuid = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + ShareRelationships response = tests::generateShareRelationships(); + + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequest, + &helper, + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, + &server, + &NoteStoreServer::onGetNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, + ctx); + QVERIFY(res == response); } } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 37c6eda4..f5543ec2 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -11,7 +11,11 @@ #include "TestUserStore.h" #include "../../Impl.h" +#include "../Common.h" #include +#include +#include +#include namespace qevercloud { @@ -796,105 +800,1253 @@ public Q_SLOTS: void UserStoreTester::shouldExecuteCheckVersion() { - // TODO: implement + QString clientName = tests::generateRandomString(); + qint16 edamVersionMajor = tests::generateRandomInt16(); + qint16 edamVersionMinor = tests::generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + bool response = tests::generateRandomBool(); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool res = userStore->checkVersion( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetBootstrapInfo() { - // TODO: implement + QString locale = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + BootstrapInfo response = tests::generateBootstrapInfo(); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(locale == localeParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + BootstrapInfo res = userStore->getBootstrapInfo( + locale, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteAuthenticateLongSession() { - // TODO: implement + QString username = tests::generateRandomString(); + QString password = tests::generateRandomString(); + QString consumerKey = tests::generateRandomString(); + QString consumerSecret = tests::generateRandomString(); + QString deviceIdentifier = tests::generateRandomString(); + QString deviceDescription = tests::generateRandomString(); + bool supportsTwoFactor = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + AuthenticationResult response = tests::generateAuthenticationResult(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() { - // TODO: implement + QString oneTimeCode = tests::generateRandomString(); + QString deviceIdentifier = tests::generateRandomString(); + QString deviceDescription = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = tests::generateAuthenticationResult(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteRevokeLongSession() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->revokeLongSession( + ctx); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteAuthenticateToBusiness() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = tests::generateAuthenticationResult(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetUser() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + User response = tests::generateUser(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + User res = userStore->getUser( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetPublicUserInfo() { - // TODO: implement + QString username = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + PublicUserInfo response = tests::generatePublicUserInfo(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(username == usernameParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetUserUrls() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserUrls response = tests::generateUserUrls(); + + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequest, + &helper, + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &server, + &UserStoreServer::onGetUserUrlsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + UserUrls res = userStore->getUserUrls( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteInviteToBusiness() { - // TODO: implement + QString emailAddress = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequest, + &helper, + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &server, + &UserStoreServer::onInviteToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->inviteToBusiness( + emailAddress, + ctx); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteRemoveFromBusiness() { - // TODO: implement + QString emailAddress = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->removeFromBusiness( + emailAddress, + ctx); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() { - // TODO: implement + QString oldEmailAddress = tests::generateRandomString(); + QString newEmailAddress = tests::generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequest, + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + QObject::connect( + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &server, + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteListBusinessUsers() { - // TODO: implement + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateUserProfile(); + response << tests::generateUserProfile(); + response << tests::generateUserProfile(); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequest, + &helper, + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + QObject::connect( + &helper, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &server, + &UserStoreServer::onListBusinessUsersRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + QList res = userStore->listBusinessUsers( + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteListBusinessInvitations() { - // TODO: implement + bool includeRequestedInvitations = tests::generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << tests::generateBusinessInvitation(); + response << tests::generateBusinessInvitation(); + response << tests::generateBusinessInvitation(); + + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::listBusinessInvitationsRequest, + &helper, + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + QObject::connect( + &helper, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &server, + &UserStoreServer::onListBusinessInvitationsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::listBusinessInvitationsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + QVERIFY(res == response); } //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetAccountLimits() { - // TODO: implement + ServiceLevel serviceLevel = ServiceLevel::BASIC; + IRequestContextPtr ctx = newRequestContext(); + + AccountLimits response = tests::generateAccountLimits(); + + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) + { + Q_ASSERT(serviceLevel == serviceLevelParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getAccountLimitsRequest, + &helper, + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, + &server, + &UserStoreServer::onGetAccountLimitsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getAccountLimitsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!tests::writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AccountLimits res = userStore->getAccountLimits( + serviceLevel, + ctx); + QVERIFY(res == response); } } // namespace qevercloud From f600a39390166004e163d03c304fe8e009c80586 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 29 Nov 2019 08:22:19 +0300 Subject: [PATCH 086/188] Rearrange tests code a bit + update generated code --- QEverCloud/CMakeLists.txt | 6 +- QEverCloud/src/tests/Common.cpp | 1471 ----------------- QEverCloud/src/tests/Common.h | 214 --- QEverCloud/src/tests/SocketHelpers.cpp | 171 ++ QEverCloud/src/tests/SocketHelpers.h | 34 + QEverCloud/src/tests/TestDurableService.h | 2 - QEverCloud/src/tests/TestOptional.h | 2 - QEverCloud/src/tests/TestQEverCloud.cpp | 5 + .../tests/generated/RandomDataGenerators.cpp | 1313 +++++++++++++++ .../tests/generated/RandomDataGenerators.h | 195 +++ .../src/tests/generated/TestNoteStore.cpp | 693 ++++---- .../src/tests/generated/TestNoteStore.h | 2 +- .../src/tests/generated/TestUserStore.cpp | 135 +- .../src/tests/generated/TestUserStore.h | 2 +- 14 files changed, 2139 insertions(+), 2106 deletions(-) delete mode 100644 QEverCloud/src/tests/Common.cpp delete mode 100644 QEverCloud/src/tests/Common.h create mode 100644 QEverCloud/src/tests/SocketHelpers.cpp create mode 100644 QEverCloud/src/tests/SocketHelpers.h create mode 100644 QEverCloud/src/tests/generated/RandomDataGenerators.cpp create mode 100644 QEverCloud/src/tests/generated/RandomDataGenerators.h diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 0f0386cc..e9a47448 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -143,16 +143,18 @@ add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM find_package(Qt5Test QUIET) if(Qt5Test_FOUND) set(TEST_HEADERS - src/tests/Common.h + src/tests/SocketHelpers.h src/tests/TestDurableService.h src/tests/TestOptional.h + src/tests/generated/RandomDataGenerators.h src/tests/generated/TestNoteStore.h src/tests/generated/TestUserStore.h) set(TEST_SOURCES - src/tests/Common.cpp + src/tests/SocketHelpers.cpp src/tests/TestDurableService.cpp src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp + src/tests/generated/RandomDataGenerators.cpp src/tests/generated/TestNoteStore.cpp src/tests/generated/TestUserStore.cpp) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) diff --git a/QEverCloud/src/tests/Common.cpp b/QEverCloud/src/tests/Common.cpp deleted file mode 100644 index 11718a04..00000000 --- a/QEverCloud/src/tests/Common.cpp +++ /dev/null @@ -1,1471 +0,0 @@ -/** - * Copyright (c) 2019 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms - * of MIT license: - * https://opensource.org/licenses/MIT - */ - -#include "Common.h" - -#include -#include -#include -#include - -#include -#include -#include - -namespace qevercloud { -namespace tests { - -namespace { - -//////////////////////////////////////////////////////////////////////////////// - -static const QString randomStringAvailableCharacters = QStringLiteral( - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); - -template -T generateRandomIntType() -{ - return static_cast(rand() % std::numeric_limits::max()); -} - -} // namespace - -//////////////////////////////////////////////////////////////////////////////// - -class ThriftRequestExtractor: public QObject -{ - Q_OBJECT -public: - explicit ThriftRequestExtractor(QTcpSocket & socket, QObject * parent = nullptr) : - QObject(parent) - { - QObject::connect( - &socket, - &QIODevice::readyRead, - this, - &ThriftRequestExtractor::onSocketReadyRead, - Qt::QueuedConnection); - } - - bool status() const { return m_status; } - - const QByteArray & data() { return m_data; } - -Q_SIGNALS: - void finished(); - void failed(); - -private Q_SLOTS: - void onSocketReadyRead() - { - QTcpSocket * pSocket = qobject_cast(sender()); - Q_ASSERT(pSocket); - - m_data.append(pSocket->read(pSocket->bytesAvailable())); - tryParseData(); - } - -private: - void tryParseData() - { - // Data read from socket should be a http request with headers and body - - // First parse headers, find Content-Length one to figure out the size - // of request body - int contentLengthIndex = m_data.indexOf("Content-Length:"); - if (contentLengthIndex < 0) { - // No Content-Length header, probably not all data has arrived yet - return; - } - - int contentLengthLineEndIndex = m_data.indexOf("\r\n", contentLengthIndex); - if (contentLengthLineEndIndex < 0) { - // No line end after Content-Length header, probably not all data - // has arrived yet - return; - } - - int contentLengthLen = contentLengthLineEndIndex - contentLengthIndex - 15; - QString contentLengthStr = - QString::fromUtf8(m_data.mid(contentLengthIndex + 15, contentLengthLen)); - - bool conversionResult = false; - int contentLength = contentLengthStr.toInt(&conversionResult); - if (Q_UNLIKELY(!conversionResult)) { - m_status = false; - Q_EMIT failed(); - return; - } - - // Now see whether whole body data is present - int headersEndIndex = m_data.indexOf("\r\n\r\n", contentLengthLineEndIndex); - if (headersEndIndex < 0) { - // No empty line after http headers, probably not all data has - // arrived yet - return; - } - - QByteArray body = m_data; - body.remove(0, headersEndIndex + 4); - if (body.size() < contentLength) { - // Not all data has arrived yet - return; - } - - m_data = body; - m_status = true; - Q_EMIT finished(); - } - -private: - bool m_status = false; - QByteArray m_data; -}; - -//////////////////////////////////////////////////////////////////////////////// - -QByteArray readThriftRequestFromSocket(QTcpSocket & socket) -{ - if (!socket.waitForConnected()) { - return QByteArray(); - } - - QEventLoop loop; - ThriftRequestExtractor extractor(socket); - - QObject::connect( - &extractor, - &ThriftRequestExtractor::finished, - &loop, - &QEventLoop::quit); - - QObject::connect( - &extractor, - &ThriftRequestExtractor::failed, - &loop, - &QEventLoop::quit); - - loop.exec(); - - if (!extractor.status()) { - return QByteArray(); - } - - return extractor.data(); -} - -bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket) -{ - int remaining = data.size(); - const char * pData = data.constData(); - while(socket.isOpen() && remaining>0) - { - // If the output buffer has become large, then wait until it has been sent. - if (socket.bytesToWrite() > 16384) - { - socket.waitForBytesWritten(-1); - } - - qint64 written = socket.write(pData, remaining); - if (written < 0) { - return false; - } - - pData += written; - remaining -= written; - } - return true; -} - -//////////////////////////////////////////////////////////////////////////////// - -QString generateRandomString(int len) -{ - if (len <= 0) { - return {}; - } - - QString res; - res.reserve(len); - for(int i = 0; i < len; ++i) { - int index = rand() % randomStringAvailableCharacters.length(); - res.append(randomStringAvailableCharacters.at(index)); - } - - return res; -} - -qint8 generateRandomInt8() -{ - return generateRandomIntType(); -} - -qint16 generateRandomInt16() -{ - return generateRandomIntType(); -} - -qint32 generateRandomInt32() -{ - return generateRandomIntType(); -} - -qint64 generateRandomInt64() -{ - return generateRandomIntType(); -} - -quint8 generateRandomUint8() -{ - return generateRandomIntType(); -} - -quint16 generateRandomUint16() -{ - return generateRandomIntType(); -} - -quint32 generateRandomUint32() -{ - return generateRandomIntType(); -} - -quint64 generateRandomUint64() -{ - return generateRandomIntType(); -} - -double generateRandomDouble() -{ - double minval = std::numeric_limits::min(); - double maxval = std::numeric_limits::max(); - double f = (double)rand() / RAND_MAX; - return minval + f * (maxval - minval); -} - -bool generateRandomBool() -{ - return generateRandomInt8() >= 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -QByteArray extractBodyFromHttpRequest(QByteArray requestData) -{ - int index = requestData.indexOf("\r\n\r\n"); - if (index < 0) { - return {}; - } - - requestData.remove(0, index + 4); - return requestData; -} - -//////////////////////////////////////////////////////////////////////////////// - -SyncState generateSyncState() -{ - SyncState state; - state.currentTime = QDateTime::currentMSecsSinceEpoch(); - state.fullSyncBefore = state.currentTime + 100000; - state.updateCount = 10; - state.uploaded = 20000; - state.userLastUpdated = state.currentTime - 20; - state.userMaxMessageEventId = 50000; - - return state; -} - -SyncChunkFilter generateSyncChunkFilter() -{ - SyncChunkFilter filter; - filter.includeNotes = true; - filter.includeNoteResources = false; - filter.includeNoteAttributes = true; - filter.includeNotebooks = false; - filter.includeTags = true; - filter.includeSearches = false; - filter.includeResources = true; - filter.includeLinkedNotebooks = false; - filter.includeExpunged = true; - filter.includeNoteApplicationDataFullMap = false; - filter.includeResourceApplicationDataFullMap = true; - filter.includeNoteResourceApplicationDataFullMap = false; - filter.includeSharedNotes = true; - filter.omitSharedNotebooks = false; - filter.requireNoteContentClass = true; - filter.notebookGuids = QSet() << QStringLiteral("guid1") - << QStringLiteral("guid2") << QStringLiteral("guid3"); - - return filter; -} - -NoteFilter generateNoteFilter() -{ - NoteFilter filter; - filter.order = 5; - filter.ascending = false; - filter.words = QStringLiteral("words"); - filter.notebookGuid = QStringLiteral("notebookGuid"); - filter.tagGuids = QList() << QStringLiteral("tagGuid1") - << QStringLiteral("tagGuid2") << QStringLiteral("tagGuid3"); - filter.timeZone = QStringLiteral("America/Los_Angeles"); - filter.inactive = false; - filter.emphasized = QStringLiteral("emphasized"); - filter.includeAllReadableNotebooks = true; - filter.includeAllReadableWorkspaces = false; - filter.context = QStringLiteral("context"); - filter.rawWords = QStringLiteral("rawWords"); - filter.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); - - return filter; -} - -NotesMetadataResultSpec generateNotesMetadataResultSpec() -{ - NotesMetadataResultSpec spec; - spec.includeTitle = true; - spec.includeContentLength = false; - spec.includeCreated = true; - spec.includeUpdated = false; - spec.includeDeleted = true; - spec.includeUpdateSequenceNum = false; - spec.includeNotebookGuid = true; - spec.includeTagGuids = false; - spec.includeAttributes = true; - spec.includeLargestResourceMime = false; - spec.includeLargestResourceSize = true; - - return spec; -} - -NoteCollectionCounts generateNoteCollectionCounts() -{ - NoteCollectionCounts counts; - - QMap notebookCounts; - notebookCounts[QStringLiteral("notebookGuid1")] = 2; - notebookCounts[QStringLiteral("notebookGuid2")] = 3; - notebookCounts[QStringLiteral("notebookGuid3")] = 4; - counts.notebookCounts = notebookCounts; - - QMap tagCounts; - tagCounts[QStringLiteral("tagGuid1")] = 2; - tagCounts[QStringLiteral("tagGuid2")] = 3; - tagCounts[QStringLiteral("tagGuid3")] = 4; - counts.tagCounts = tagCounts; - - counts.trashCount = 15; - - return counts; -} - -NoteResultSpec generateNoteResultSpec() -{ - NoteResultSpec spec; - spec.includeContent = true; - spec.includeResourcesData = false; - spec.includeResourcesRecognition = true; - spec.includeResourcesAlternateData = false; - spec.includeSharedNotes = true; - spec.includeNoteAppDataValues = false; - spec.includeResourceAppDataValues = true; - spec.includeAccountLimits = false; - - return spec; -} - -NoteVersionId generateNoteVersionId() -{ - NoteVersionId id; - id.updateSequenceNum = 95; - id.updated = QDateTime::currentMSecsSinceEpoch(); - id.saved = id.updated - 100; - id.title = QStringLiteral("title"); - id.lastEditorId = 72; - - return id; -} - -RelatedQuery generateRelatedQuery() -{ - RelatedQuery query; - query.noteGuid = QStringLiteral("noteGuid"); - query.plainText = QStringLiteral("plainText"); - query.filter = generateNoteFilter(); - query.referenceUri = QStringLiteral("referenceUri"); - query.context = QStringLiteral("context"); - query.cacheKey = QStringLiteral("cacheKey"); - - return query; -} - -RelatedResultSpec generateRelatedResultSpec() -{ - RelatedResultSpec spec; - spec.maxNotes = 30; - spec.maxNotebooks = 10; - spec.maxTags = 20; - spec.writableNotebooksOnly = false; - spec.includeContainingNotebooks = true; - spec.includeDebugInfo = false; - spec.maxExperts = 5; - spec.maxRelatedContent = 3; - spec.relatedContentTypes = QSet() - << RelatedContentType::NEWS_ARTICLE - << RelatedContentType::PROFILE_ORGANIZATION - << RelatedContentType::PROFILE_PERSON; - - return spec; -} - -ShareRelationshipRestrictions generateShareRelationshipRestrictions() -{ - ShareRelationshipRestrictions r; - r.noSetReadOnly = false; - r.noSetReadPlusActivity = true; - r.noSetModify = false; - r.noSetFullAccess = true; - - return r; -} - -MemberShareRelationship generateMemberShareRelationship() -{ - MemberShareRelationship r; - r.displayName = QStringLiteral("displayName"); - r.recipientUserId = 5; - r.bestPrivilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; - r.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; - r.restrictions = generateShareRelationshipRestrictions(); - r.sharerUserId = 10; - - return r; -} - -NoteShareRelationshipRestrictions generateNoteShareRelationshipRestrictions() -{ - NoteShareRelationshipRestrictions r; - r.noSetReadNote = false; - r.noSetModifyNote = true; - r.noSetFullAccess = false; - - return r; -} - -NoteMemberShareRelationship generateNoteMemberShareRelationship() -{ - NoteMemberShareRelationship r; - r.displayName = QStringLiteral("displayName"); - r.recipientUserId = 7; - r.privilege = SharedNotePrivilegeLevel::READ_NOTE; - r.restrictions = generateNoteShareRelationshipRestrictions(); - r.sharerUserId = 19; - - return r; -} - -NoteInvitationShareRelationship generateNoteInvitationShareRelationship() -{ - NoteInvitationShareRelationship r; - r.displayName = QStringLiteral("displayName"); - r.recipientIdentityId = 124; - r.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; - r.sharerUserId = 231; - - return r; -} - -NoteShareRelationships generateNoteShareRelationships() -{ - NoteShareRelationships r; - r.invitations = QList() - << generateNoteInvitationShareRelationship(); - r.memberships = QList() - << generateNoteMemberShareRelationship(); - r.invitationRestrictions = generateNoteShareRelationshipRestrictions(); - - return r; -} - -ManageNoteSharesParameters generateManageNoteSharesParameters() -{ - ManageNoteSharesParameters p; - p.noteGuid = QStringLiteral("noteGuid"); - p.membershipsToUpdate = QList() - << generateNoteMemberShareRelationship(); - p.invitationsToUpdate = QList() - << generateNoteInvitationShareRelationship(); - p.membershipsToUnshare = QList() << 27 << 81 << 32; - p.invitationsToUnshare = QList() << 22 << 46 << 73; - - return p; -} - -Data generateData() -{ - Data data; - data.body = QString(QStringLiteral("data body ") + QString::number(rand() % 101)).toUtf8(); - data.size = data.body->size(); - data.bodyHash = QCryptographicHash::hash(data.body.ref(), QCryptographicHash::Md5); - - return data; -} - -UserAttributes generateUserAttributes() -{ - UserAttributes a; - a.defaultLocationName = QStringLiteral("defaultLocationName"); - a.defaultLatitude = 0.1; - a.defaultLongitude = 0.2; - a.preactivation = false; - a.viewedPromotions = QStringList() - << QStringLiteral("viewedPromotion1") - << QStringLiteral("viewedPromotion2") - << QStringLiteral("viewedPromotion3"); - a.incomingEmailAddress = QStringLiteral("incomingEmailAddress"); - a.recentMailedAddresses = QStringList() - << QStringLiteral("recentMailedAddress1") - << QStringLiteral("recentMailedAddress2") - << QStringLiteral("recentMailedAddress3"); - a.comments = QStringLiteral("comments"); - a.dateAgreedToTermsOfService = QDateTime::currentMSecsSinceEpoch(); - a.maxReferrals = 11; - a.referralCount = 9; - a.refererCode = QStringLiteral("refererCode"); - a.sentEmailDate = QDateTime::currentMSecsSinceEpoch(); - a.sentEmailCount = 8; - a.dailyEmailLimit = 22; - a.emailOptOutDate = QDateTime::currentMSecsSinceEpoch(); - a.partnerEmailOptInDate = QDateTime::currentMSecsSinceEpoch(); - a.preferredLanguage = QStringLiteral("en"); - a.preferredCountry = QStringLiteral("US"); - a.clipFullPage = false; - a.twitterUserName = QStringLiteral("twitterUserName"); - a.twitterId = QStringLiteral("twitterId"); - a.groupName = QStringLiteral("groupName"); - a.recognitionLanguage = QStringLiteral("ru"); - a.referralProof = QStringLiteral("referralProof"); - a.educationalDiscount = false; - a.businessAddress = QStringLiteral("businessAddress"); - a.hideSponsorBilling = true; - a.useEmailAutoFiling = false; - a.reminderEmailConfig = ReminderEmailConfig::DO_NOT_SEND; - a.passwordUpdated = QDateTime::currentMSecsSinceEpoch(); - a.salesforcePushEnabled = false; - a.shouldLogClientEvent = true; - a.optOutMachineLearning = false; - - return a; -} - -BusinessUserAttributes generateBusinessUserAttributes() -{ - BusinessUserAttributes a; - a.title = QStringLiteral("title"); - a.location = QStringLiteral("location"); - a.department = QStringLiteral("department"); - a.mobilePhone = QStringLiteral("mobilePhone"); - a.linkedInProfileUrl = QStringLiteral("linkedInProfileUrl"); - a.workPhone = QStringLiteral("workPhone"); - a.companyStartDate = QDateTime::currentMSecsSinceEpoch(); - - return a; -} - -Accounting generateAccounting() -{ - Accounting a; - a.uploadLimitEnd = QDateTime::currentMSecsSinceEpoch() + 10000; - a.uploadLimitNextMonth = 700; - a.premiumServiceStatus = PremiumOrderStatus::PENDING; - a.premiumOrderNumber = QStringLiteral("premiumOrderNumber"); - a.premiumCommerceService = QStringLiteral("premiumCommerceService"); - a.premiumServiceStart = QDateTime::currentMSecsSinceEpoch(); - a.premiumServiceSKU = QStringLiteral("premiumServiceSKU"); - a.lastSuccessfulCharge = QDateTime::currentMSecsSinceEpoch(); - a.lastFailedCharge = QDateTime::currentMSecsSinceEpoch(); - a.lastFailedChargeReason = QStringLiteral("lastFailedChargeReason"); - a.nextPaymentDue = QDateTime::currentMSecsSinceEpoch() + 200; - a.premiumLockUntil = QDateTime::currentMSecsSinceEpoch() + 100; - a.updated = QDateTime::currentMSecsSinceEpoch() + 50; - a.premiumSubscriptionNumber = QStringLiteral("premiumSubscriptionNumber"); - a.lastRequestedCharge = QDateTime::currentMSecsSinceEpoch() - 50; - a.currency = QStringLiteral("currency"); - a.unitPrice = 19; - a.businessId = 21; - a.businessName = QStringLiteral("businessName"); - a.businessRole = BusinessUserRole::NORMAL; - a.unitDiscount = 14; - a.nextChargeDate = QDateTime::currentMSecsSinceEpoch() + 400; - a.availablePoints = 11; - - return a; -} - -BusinessUserInfo generateBusinessUserInfo() -{ - BusinessUserInfo info; - info.businessId = 13; - info.businessName = QStringLiteral("businessName"); - info.role = BusinessUserRole::NORMAL; - info.email = QStringLiteral("email"); - info.updated = QDateTime::currentMSecsSinceEpoch(); - - return info; -} - -AccountLimits generateAccountLimits() -{ - AccountLimits limits; - limits.userMailLimitDaily = 9; - limits.noteSizeMax = 300; - limits.resourceSizeMax = 200; - limits.userLinkedNotebookMax = 30; - limits.uploadLimit = 500; - limits.userNoteCountMax = 40; - limits.userNotebookCountMax = 35; - limits.userTagCountMax = 45; - limits.noteTagCountMax = 20; - limits.userSavedSearchesMax = 50; - limits.noteResourceCountMax = 60; - - return limits; -} - -User generateUser() -{ - User user; - user.id = 19; - user.username = QStringLiteral("username"); - user.email = QStringLiteral("email"); - user.name = QStringLiteral("name"); - user.timezone = QStringLiteral("America/Los_Angeles"); - user.privilege = PrivilegeLevel::MANAGER; - user.serviceLevel = ServiceLevel::BASIC; - user.created = QDateTime::currentMSecsSinceEpoch(); - user.updated = QDateTime::currentMSecsSinceEpoch(); - user.deleted = QDateTime::currentMSecsSinceEpoch(); - user.active = true; - user.shardId = QStringLiteral("shardId"); - user.attributes = generateUserAttributes(); - user.accounting = generateAccounting(); - user.businessUserInfo = generateBusinessUserInfo(); - user.photoUrl = QStringLiteral("photoUrl"); - user.photoLastUpdated = QDateTime::currentMSecsSinceEpoch(); - user.accountLimits = generateAccountLimits(); - - return user; -} - -Contact generateContact() -{ - Contact contact; - contact.name = QStringLiteral("name"); - contact.id = QStringLiteral("id"); - contact.type = ContactType::EVERNOTE; - contact.photoUrl = QStringLiteral("photoUrl"); - contact.photoLastUpdated = QDateTime::currentMSecsSinceEpoch() - 20; - contact.messagingPermit = QStringLiteral("messagingPermit").toUtf8(); - contact.messagingPermitExpires = QDateTime::currentMSecsSinceEpoch(); - - return contact; -} - -Identity generateIdentity() -{ - Identity identity; - identity.id = 200; - identity.contact = generateContact(); - identity.userId = 30; - identity.deactivated = false; - identity.sameBusiness = true; - identity.blocked = false; - identity.userConnected = true; - identity.eventId = 341; - - return identity; -} - -Tag generateTag() -{ - Tag tag; - tag.guid = QStringLiteral("guid"); - tag.name = QStringLiteral("name"); - tag.parentGuid = QStringLiteral("parentGuid"); - tag.updateSequenceNum = 30; - - return tag; -} - -LazyMap generateLazyMap() -{ - LazyMap lazyMap; - - QSet keysOnly; - keysOnly << QStringLiteral("key1"); - keysOnly << QStringLiteral("key2"); - keysOnly << QStringLiteral("key3"); - lazyMap.keysOnly = keysOnly; - - QMap fullMap; - fullMap[QStringLiteral("key1")] = QStringLiteral("value1"); - fullMap[QStringLiteral("key2")] = QStringLiteral("value2"); - fullMap[QStringLiteral("key3")] = QStringLiteral("value3"); - lazyMap.fullMap = fullMap; - - return lazyMap; -} - -ResourceAttributes generateResourceAttributes() -{ - ResourceAttributes a; - a.sourceURL = QStringLiteral("sourceURL"); - a.timestamp = QDateTime::currentMSecsSinceEpoch(); - a.latitude = 0.1; - a.longitude = 0.2; - a.altitude = 0.3; - a.cameraMake = QStringLiteral("cameraMake"); - a.clientWillIndex = false; - a.recoType = QStringLiteral("recoType"); - a.fileName = QStringLiteral("fileName"); - a.attachment = false; - a.applicationData = generateLazyMap(); - - return a; -} - -Resource generateResource() -{ - Resource r; - r.guid = QStringLiteral("guid"); - r.noteGuid = QStringLiteral("noteGuid"); - r.data = generateData(); - r.mime = QStringLiteral("mime"); - r.width = 23; - r.height = 19; - r.duration = 13; - r.active = true; - r.recognition = generateData(); - r.attributes = generateResourceAttributes(); - r.updateSequenceNum = 31; - r.alternateData = generateData(); - - return r; -} - -NoteAttributes generateNoteAttributes() -{ - NoteAttributes a; - a.subjectDate = QDateTime::currentMSecsSinceEpoch(); - a.latitude = 0.1; - a.longitude = 0.2; - a.altitude = 0.3; - a.author = QStringLiteral("author"); - a.source = QStringLiteral("source"); - a.sourceURL = QStringLiteral("sourceURL"); - a.sourceApplication = QStringLiteral("sourceApplication"); - a.shareDate = QDateTime::currentMSecsSinceEpoch() - 20; - a.reminderOrder = 20; - a.reminderDoneTime = QDateTime::currentMSecsSinceEpoch() - 300; - a.reminderTime = QDateTime::currentMSecsSinceEpoch() - 100; - a.placeName = QStringLiteral("placeName"); - a.contentClass = QStringLiteral("contentClass"); - a.applicationData = generateLazyMap(); - a.lastEditedBy = QStringLiteral("lastEditedBy"); - - QMap classifications; - classifications[QStringLiteral("key1")] = QStringLiteral("value1"); - classifications[QStringLiteral("key2")] = QStringLiteral("value2"); - classifications[QStringLiteral("key3")] = QStringLiteral("value3"); - a.classifications = classifications; - - a.creatorId = 18; - a.lastEditorId = 16; - a.sharedWithBusiness = false; - a.conflictSourceNoteGuid = QStringLiteral("conflictSourceNoteGuid"); - a.noteTitleQuality = 2; - - return a; -} - -SharedNote generateSharedNote() -{ - SharedNote n; - n.sharerUserID = 19; - n.recipientIdentity = generateIdentity(); - n.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; - n.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 20; - n.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 10; - n.serviceAssigned = QDateTime::currentMSecsSinceEpoch(); - - return n; -} - -NoteRestrictions generateNoteRestrictions() -{ - NoteRestrictions r; - r.noUpdateTitle = true; - r.noUpdateContent = false; - r.noEmail = true; - r.noShare = false; - r.noSharePublicly = true; - - return r; -} - -NoteLimits generateNoteLimits() -{ - NoteLimits limits; - limits.noteResourceCountMax = 10; - limits.uploadLimit = 100; - limits.resourceSizeMax = 20; - limits.noteSizeMax = 40; - limits.uploaded = 50; - - return limits; -} - -Note generateNote() -{ - Note note; - note.guid = QStringLiteral("guid"); - note.title = QStringLiteral("title"); - note.content = QStringLiteral("content"); - note.contentHash = QCryptographicHash::hash( - note.content.ref().toUtf8(), - QCryptographicHash::Md5); - note.contentLength = note.content->size(); - note.created = QDateTime::currentMSecsSinceEpoch() - 20; - note.updated = QDateTime::currentMSecsSinceEpoch() - 10; - note.deleted = QDateTime::currentMSecsSinceEpoch(); - note.active = true; - note.updateSequenceNum = 20; - note.notebookGuid = QStringLiteral("notebookGuid"); - note.tagGuids = QList() - << QStringLiteral("tagGuid1") - << QStringLiteral("tagGuid2") - << QStringLiteral("tagGuid3"); - note.resources = QList() - << generateResource(); - note.attributes = generateNoteAttributes(); - note.tagNames = QStringList() - << QStringLiteral("tagName1") - << QStringLiteral("tagName2") - << QStringLiteral("tagName3"); - note.sharedNotes = QList() - << generateSharedNote(); - note.restrictions = generateNoteRestrictions(); - note.limits = generateNoteLimits(); - - return note; -} - -Publishing generatePublishing() -{ - Publishing p; - p.uri = QStringLiteral("uri"); - p.order = NoteSortOrder::UPDATED; - p.ascending = true; - p.publicDescription = QStringLiteral("publicDescription"); - - return p; -} - -BusinessNotebook generateBusinessNotebook() -{ - BusinessNotebook notebook; - notebook.notebookDescription = QStringLiteral("notebookDescription"); - notebook.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK; - notebook.recommended = true; - - return notebook; -} - -SavedSearchScope generateSavedSearchScope() -{ - SavedSearchScope scope; - scope.includeAccount = true; - scope.includePersonalLinkedNotebooks = true; - scope.includeBusinessLinkedNotebooks = false; - - return scope; -} - -SavedSearch generateSavedSearch() -{ - SavedSearch search; - search.guid = QStringLiteral("guid"); - search.name = QStringLiteral("name"); - search.query = QStringLiteral("query"); - search.format = QueryFormat::USER; - search.updateSequenceNum = 13; - search.scope = generateSavedSearchScope(); - - return search; -} - -SharedNotebookRecipientSettings generateSharedNotebookRecipientSettings() -{ - SharedNotebookRecipientSettings s; - s.reminderNotifyEmail = true; - s.reminderNotifyInApp = false; - - return s; -} - -NotebookRecipientSettings generateNotebookRecipientSettings() -{ - NotebookRecipientSettings s; - s.reminderNotifyEmail = true; - s.reminderNotifyInApp = false; - s.inMyList = true; - s.stack = QStringLiteral("stack"); - s.recipientStatus = RecipientStatus::IN_MY_LIST; - - return s; -} - -SharedNotebook generateSharedNotebook() -{ - SharedNotebook notebook; - notebook.id = 201; - notebook.userId = 102; - notebook.notebookGuid = QStringLiteral("notebookGuid"); - notebook.email = QStringLiteral("email"); - notebook.recipientIdentityId = 172; - notebook.notebookModifiable = true; - notebook.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 200; - notebook.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 100; - notebook.globalId = QStringLiteral("globalId"); - notebook.username = QStringLiteral("username"); - notebook.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; - notebook.recipientSettings = generateSharedNotebookRecipientSettings(); - notebook.sharerUserId = 314; - notebook.recipientUsername = QStringLiteral("recipientUsername"); - notebook.recipientUserId = 635; - notebook.serviceAssigned = QDateTime::currentMSecsSinceEpoch() - 50; - - return notebook; -} - -CanMoveToContainerRestrictions generateCanMoveToContainerRestrictions() -{ - CanMoveToContainerRestrictions r; - r.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; - - return r; -} - -NotebookRestrictions generateNotebookRestrictions() -{ - NotebookRestrictions r; - r.noReadNotes = true; - r.noCreateNotes = false; - r.noUpdateNotes = false; - r.noExpungeNotes = true; - r.noShareNotes = false; - r.noEmailNotes = true; - r.noSendMessageToRecipients = false; - r.noUpdateNotebook = true; - r.noExpungeNotebook = false; - r.noSetDefaultNotebook = true; - r.noSetNotebookStack = false; - r.noPublishToPublic = true; - r.noPublishToBusinessLibrary = false; - r.noCreateTags = true; - r.noUpdateTags = false; - r.noExpungeTags = true; - r.noSetParentTag = true; - r.noCreateSharedNotebooks = false; - r.updateWhichSharedNotebookRestrictions = - SharedNotebookInstanceRestrictions::ASSIGNED; - r.expungeWhichSharedNotebookRestrictions = - SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; - r.noShareNotesWithBusiness = false; - r.noRenameNotebook = true; - r.noSetInMyList = false; - r.noChangeContact = true; - r.canMoveToContainerRestrictions = generateCanMoveToContainerRestrictions(); - r.noSetReminderNotifyEmail = true; - r.noSetReminderNotifyInApp = false; - r.noSetRecipientSettingsStack = true; - r.noCanMoveNote = false; - - return r; -} - -Notebook generateNotebook() -{ - Notebook notebook; - notebook.guid = QStringLiteral("guid"); - notebook.name = QStringLiteral("name"); - notebook.updateSequenceNum = 31; - notebook.defaultNotebook = false; - notebook.serviceCreated = QDateTime::currentMSecsSinceEpoch() - 200; - notebook.serviceUpdated = QDateTime::currentMSecsSinceEpoch() - 100; - notebook.publishing = generatePublishing(); - notebook.published = true; - notebook.stack = QStringLiteral("stack"); - notebook.sharedNotebookIds = QList() << 45; - notebook.sharedNotebooks = QList() - << generateSharedNotebook(); - notebook.businessNotebook = generateBusinessNotebook(); - notebook.contact = generateUser(); - notebook.restrictions = generateNotebookRestrictions(); - notebook.recipientSettings = generateNotebookRecipientSettings(); - - return notebook; -} - -LinkedNotebook generateLinkedNotebook() -{ - LinkedNotebook notebook; - notebook.shareName = QStringLiteral("shareName"); - notebook.username = QStringLiteral("username"); - notebook.shardId = QStringLiteral("shardId"); - notebook.sharedNotebookGlobalId = QStringLiteral("sharedNotebookGlobalId"); - notebook.uri = QStringLiteral("uri"); - notebook.guid = QStringLiteral("guid"); - notebook.updateSequenceNum = 823; - notebook.noteStoreUrl = QStringLiteral("noteStoreUrl"); - notebook.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); - notebook.stack = QStringLiteral("stack"); - notebook.businessId = 71; - - return notebook; -} - -NotebookDescriptor generateNotebookDescriptor() -{ - NotebookDescriptor d; - d.guid = QStringLiteral("guid"); - d.notebookDisplayName = QStringLiteral("notebookDisplayName"); - d.contactName = QStringLiteral("contactName"); - d.hasSharedNotebook = false; - d.joinedUserCount = 23; - - return d; -} - -UserProfile generateUserProfile() -{ - UserProfile p; - p.id = 23; - p.name = QStringLiteral("name"); - p.email = QStringLiteral("email"); - p.username = QStringLiteral("username"); - p.attributes = generateBusinessUserAttributes(); - p.joined = QDateTime::currentMSecsSinceEpoch(); - p.photoLastUpdated = QDateTime::currentMSecsSinceEpoch() - 100; - p.photoUrl = QStringLiteral("photoUrl"); - p.role = BusinessUserRole::NORMAL; - p.status = BusinessUserStatus::ACTIVE; - - return p; -} - -RelatedContentImage generateRelatedContentImage() -{ - RelatedContentImage i; - i.url = QStringLiteral("url"); - i.width = 20; - i.height = 30; - i.pixelRatio = 0.2; - i.fileSize = 315; - - return i; -} - -RelatedContent generateRelatedContent() -{ - RelatedContent c; - c.contentId = QStringLiteral("contentId"); - c.title = QStringLiteral("title"); - c.url = QStringLiteral("url"); - c.sourceId = QStringLiteral("sourceId"); - c.sourceUrl = QStringLiteral("sourceUrl"); - c.sourceFaviconUrl = QStringLiteral("sourceFaviconUrl"); - c.sourceName = QStringLiteral("sourceName"); - c.date = QDateTime::currentMSecsSinceEpoch(); - c.teaser = QStringLiteral("teaser"); - c.thumbnails = QList() << generateRelatedContentImage(); - c.contentType = RelatedContentType::NEWS_ARTICLE; - c.accessType = RelatedContentAccess::DIRECT_LINK_ACCESS_OK; - c.visibleUrl = QStringLiteral("visibleUrl"); - c.clipUrl = QStringLiteral("clipUrl"); - c.contact = generateContact(); - c.authors = QStringList() - << QStringLiteral("author1") - << QStringLiteral("author2") - << QStringLiteral("author3"); - - return c; -} - -BusinessInvitation generateBusinessInvitation() -{ - BusinessInvitation i; - i.businessId = 22; - i.email = QStringLiteral("email"); - i.role = BusinessUserRole::NORMAL; - i.status = BusinessInvitationStatus::APPROVED; - i.requesterId = 13; - i.fromWorkChat = false; - i.created = QDateTime::currentMSecsSinceEpoch(); - i.mostRecentReminder = QDateTime::currentMSecsSinceEpoch(); - - return i; -} - -UserIdentity generateUserIdentity() -{ - UserIdentity i; - i.type = UserIdentityType::EMAIL; - i.stringIdentifier = QStringLiteral("stringIdentifier"); - i.longIdentifier = 346; - - return i; -} - -PublicUserInfo generatePublicUserInfo() -{ - PublicUserInfo i; - i.userId = 34; - i.serviceLevel = ServiceLevel::BASIC; - i.username = QStringLiteral("username"); - i.noteStoreUrl = QStringLiteral("noteStoreUrl"); - i.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); - - return i; -} - -UserUrls generateUserUrls() -{ - UserUrls u; - u.noteStoreUrl = QStringLiteral("noteStoreUrl"); - u.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); - u.userStoreUrl = QStringLiteral("userStoreUrl"); - u.utilityUrl = QStringLiteral("utilityUrl"); - u.messageStoreUrl = QStringLiteral("messageStoreUrl"); - u.userWebSocketUrl = QStringLiteral("userWebSocketUrl"); - - return u; -} - -AuthenticationResult generateAuthenticationResult() -{ - AuthenticationResult r; - r.currentTime = QDateTime::currentMSecsSinceEpoch(); - r.authenticationToken = QStringLiteral("authenticationToken"); - r.expiration = QDateTime::currentMSecsSinceEpoch(); - r.user = generateUser(); - r.publicUserInfo = generatePublicUserInfo(); - r.noteStoreUrl = QStringLiteral("noteStoreUrl"); - r.webApiUrlPrefix = QStringLiteral("webApiUrlPrefix"); - r.secondFactorRequired = false; - r.secondFactorDeliveryHint = QStringLiteral("secondFactorDeliveryHint"); - r.urls = generateUserUrls(); - - return r; -} - -BootstrapSettings generateBootstrapSettings() -{ - BootstrapSettings s; - s.serviceHost = QStringLiteral("serviceHost"); - s.marketingUrl = QStringLiteral("marketingUrl"); - s.supportUrl = QStringLiteral("supportUrl"); - s.accountEmailDomain = QStringLiteral("accountEmailDomain"); - s.enableFacebookSharing = false; - s.enableGiftSubscriptions = true; - s.enableSupportTickets = false; - s.enableSharedNotebooks = true; - s.enableSingleNoteSharing = false; - s.enableSponsoredAccounts = true; - s.enableTwitterSharing = false; - s.enableLinkedInSharing = true; - s.enablePublicNotebooks = false; - s.enableGoogle = true; - - return s; -} - -BootstrapProfile generateBootstrapProfile() -{ - BootstrapProfile p; - p.name = QStringLiteral("name"); - p.settings = generateBootstrapSettings(); - - return p; -} - -BootstrapInfo generateBootstrapInfo() -{ - BootstrapInfo i; - i.profiles = QList() << generateBootstrapProfile(); - - return i; -} - -SyncChunk generateSyncChunk() -{ - SyncChunk c; - c.currentTime = QDateTime::currentMSecsSinceEpoch(); - c.chunkHighUSN = 32; - c.updateCount = 17; - c.notes = QList() << generateNote(); - c.notebooks = QList() << generateNotebook(); - c.tags = QList() << generateTag(); - c.searches = QList() << generateSavedSearch(); - c.resources = QList() << generateResource(); - c.expungedNotes = QList() << QStringLiteral("expungedNoteGuid"); - c.expungedNotebooks = QList() << QStringLiteral("expungedNotebookGuid"); - c.expungedTags = QList() << QStringLiteral("expungedTagGuid"); - c.expungedSearches = QList() << QStringLiteral("expungedSearcheGuid"); - c.linkedNotebooks = QList() << generateLinkedNotebook(); - c.expungedLinkedNotebooks = QList() - << QStringLiteral("expungedLinkedNotebookGuid"); - - return c; -} - -NoteList generateNoteList() -{ - NoteList l; - l.startIndex = 2; - l.totalNotes = 1; - l.notes = QList() << generateNote(); - l.stoppedWords = QStringList() - << QStringLiteral("stoppedWord1") - << QStringLiteral("stoppedWord2") - << QStringLiteral("stoppedWord3"); - l.searchedWords = QStringList() - << QStringLiteral("seachedWord1") - << QStringLiteral("seachedWord2") - << QStringLiteral("seachedWord3"); - l.updateCount = 34; - l.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); - l.debugInfo = QStringLiteral("debugInfo"); - - return l; -} - -NoteMetadata generateNoteMetadata() -{ - NoteMetadata m; - m.guid = QStringLiteral("guid"); - m.title = QStringLiteral("title"); - m.contentLength = 23; - m.created = QDateTime::currentMSecsSinceEpoch() - 200; - m.updated = QDateTime::currentMSecsSinceEpoch() - 100; - m.deleted = QDateTime::currentMSecsSinceEpoch() - 50; - m.updateSequenceNum = 345; - m.notebookGuid = QStringLiteral("notebookGuid"); - m.tagGuids = QList() - << QStringLiteral("tagGuid1") - << QStringLiteral("tagGuid2") - << QStringLiteral("tagGuid3"); - m.attributes = generateNoteAttributes(); - m.largestResourceMime = QStringLiteral("largestResourceMime"); - m.largestResourceSize = 378; - - return m; -} - -NotesMetadataList generateNotesMetadataList() -{ - NotesMetadataList l; - l.startIndex = 2; - l.totalNotes = 1; - l.notes = QList() << generateNoteMetadata(); - l.stoppedWords = QStringList() - << QStringLiteral("stoppedWord1") - << QStringLiteral("stoppedWord2") - << QStringLiteral("stoppedWord3"); - l.searchedWords = QStringList() - << QStringLiteral("seachedWord1") - << QStringLiteral("seachedWord2") - << QStringLiteral("seachedWord3"); - l.updateCount = 34; - l.searchContextBytes = QStringLiteral("searchContextBytes").toUtf8(); - l.debugInfo = QStringLiteral("debugInfo"); - - return l; -} - -NoteEmailParameters generateNoteEmailParameters() -{ - NoteEmailParameters p; - p.guid = QStringLiteral("guid"); - p.note = generateNote(); - p.toAddresses = QStringList() - << QStringLiteral("address1") - << QStringLiteral("address2") - << QStringLiteral("address3"); - p.ccAddresses = QStringList() - << QStringLiteral("ccAddress1") - << QStringLiteral("ccAddress2") - << QStringLiteral("ccAddress3"); - p.subject = QStringLiteral("subject"); - p.message = QStringLiteral("message"); - - return p; -} - -RelatedResult generateRelatedResult() -{ - RelatedResult r; - r.notes = QList() << generateNote(); - r.notebooks = QList() << generateNotebook(); - r.tags = QList() << generateTag(); - r.containingNotebooks = QList() - << generateNotebookDescriptor(); - r.debugInfo = QStringLiteral("debugInfo"); - r.experts = QList() << generateUserProfile(); - r.relatedContent = QList() << generateRelatedContent(); - r.cacheKey = QStringLiteral("cacheKey"); - r.cacheExpires = 320; - - return r; -} - -UpdateNoteIfUsnMatchesResult generateUpdateNoteIfUsnMatchesResult() -{ - UpdateNoteIfUsnMatchesResult r; - r.note = generateNote(); - r.updated = true; - - return r; -} - -InvitationShareRelationship generateInvitationShareRelationship() -{ - InvitationShareRelationship r; - r.displayName = QStringLiteral("displayName"); - r.recipientUserIdentity = generateUserIdentity(); - r.privilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; - r.sharerUserId = 341; - - return r; -} - -ShareRelationships generateShareRelationships() -{ - ShareRelationships r; - r.invitations = QList() - << generateInvitationShareRelationship(); - r.memberships = QList() - << generateMemberShareRelationship(); - r.invitationRestrictions = generateShareRelationshipRestrictions(); - - return r; -} - -ManageNotebookSharesParameters generateManageNotebookSharesParameters() -{ - ManageNotebookSharesParameters p; - p.notebookGuid = QStringLiteral("notebookGuid"); - p.inviteMessage = QStringLiteral("inviteMessage"); - p.membershipsToUpdate = QList() - << generateMemberShareRelationship(); - p.invitationsToCreateOrUpdate = QList() - << generateInvitationShareRelationship(); - p.unshares = QList() << generateUserIdentity(); - - return p; -} - -ManageNotebookSharesError generateManageNotebookSharesError() -{ - ManageNotebookSharesError e; - e.userIdentity = generateUserIdentity(); - - e.userException = EDAMUserException(); - e.userException->errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - e.userException->parameter = QStringLiteral("userException"); - - e.notFoundException = EDAMNotFoundException(); - e.notFoundException->identifier = QStringLiteral("identfier"); - e.notFoundException->key = QStringLiteral("key"); - - return e; -} - -ManageNotebookSharesResult generateManageNotebookSharesResult() -{ - ManageNotebookSharesResult r; - r.errors = QList() - << generateManageNotebookSharesError(); - - return r; -} - -SharedNoteTemplate generateSharedNoteTemplate() -{ - SharedNoteTemplate t; - t.noteGuid = QStringLiteral("noteGuid"); - t.recipientThreadId = 23; - t.recipientContacts = QList() - << generateContact(); - t.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; - - return t; -} - -NotebookShareTemplate generateNotebookShareTemplate() -{ - NotebookShareTemplate t; - t.notebookGuid = QStringLiteral("notebookGuid"); - t.recipientThreadId = 23; - t.recipientContacts = QList() - << generateContact(); - t.privilege = SharedNotebookPrivilegeLevel::GROUP; - - return t; -} - -CreateOrUpdateNotebookSharesResult generateCreateOrUpdateNotebookSharesResult() -{ - CreateOrUpdateNotebookSharesResult r; - r.updateSequenceNum = 34; - r.matchingShares = QList() << generateSharedNotebook(); - - return r; -} - -ManageNoteSharesError generateManageNoteSharesError() -{ - ManageNoteSharesError e; - e.identityID = 54; - e.userID = 34; - - e.userException = EDAMUserException(); - e.userException->errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - e.userException->parameter = QStringLiteral("userException"); - - e.notFoundException = EDAMNotFoundException(); - e.notFoundException->identifier = QStringLiteral("identfier"); - e.notFoundException->key = QStringLiteral("key"); - - return e; -} - -ManageNoteSharesResult generateManageNoteSharesResult() -{ - ManageNoteSharesResult r; - r.errors = QList() - << generateManageNoteSharesError(); - - return r; -} - -} // namespace tests -} // namespace qevercloud - -#include diff --git a/QEverCloud/src/tests/Common.h b/QEverCloud/src/tests/Common.h deleted file mode 100644 index 94087abd..00000000 --- a/QEverCloud/src/tests/Common.h +++ /dev/null @@ -1,214 +0,0 @@ -/** - * Copyright (c) 2019 Dmitry Ivanov - * - * This file is a part of QEverCloud project and is distributed under the terms - * of MIT license: - * https://opensource.org/licenses/MIT - */ - -#ifndef QEVERCLOUD_TEST_COMMON_H -#define QEVERCLOUD_TEST_COMMON_H - -#include - -#include - -#ifdef QEVERCLOUD_SHARED_LIBRARY -#undef QEVERCLOUD_SHARED_LIBRARY -#endif - -#ifdef QEVERCLOUD_STATIC_LIBRARY -#undef QEVERCLOUD_STATIC_LIBRARY -#endif - -namespace qevercloud { -namespace tests { - -//////////////////////////////////////////////////////////////////////////////// - -QByteArray readThriftRequestFromSocket(QTcpSocket & socket); - -bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket); - -//////////////////////////////////////////////////////////////////////////////// - -QString generateRandomString(int len = 10); - -qint8 generateRandomInt8(); - -qint16 generateRandomInt16(); - -qint32 generateRandomInt32(); - -qint64 generateRandomInt64(); - -quint8 generateRandomUint8(); - -quint16 generateRandomUint16(); - -quint32 generateRandomUint32(); - -quint64 generateRandomUint64(); - -double generateRandomDouble(); - -bool generateRandomBool(); - -//////////////////////////////////////////////////////////////////////////////// - -QByteArray extractBodyFromHttpRequest(QByteArray requestData); - -//////////////////////////////////////////////////////////////////////////////// - -SyncState generateSyncState(); - -SyncChunkFilter generateSyncChunkFilter(); - -NoteFilter generateNoteFilter(); - -NotesMetadataResultSpec generateNotesMetadataResultSpec(); - -NoteCollectionCounts generateNoteCollectionCounts(); - -NoteResultSpec generateNoteResultSpec(); - -NoteVersionId generateNoteVersionId(); - -RelatedQuery generateRelatedQuery(); - -RelatedResultSpec generateRelatedResultSpec(); - -ShareRelationshipRestrictions generateShareRelationshipRestrictions(); - -MemberShareRelationship generateMemberShareRelationship(); - -NoteShareRelationshipRestrictions generateNoteShareRelationshipRestrictions(); - -NoteMemberShareRelationship generateNoteMemberShareRelationship(); - -NoteInvitationShareRelationship generateNoteInvitationShareRelationship(); - -NoteShareRelationships generateNoteShareRelationships(); - -ManageNoteSharesParameters generateManageNoteSharesParameters(); - -Data generateData(); - -UserAttributes generateUserAttributes(); - -BusinessUserAttributes generateBusinessUserAttributes(); - -Accounting generateAccounting(); - -BusinessUserInfo generateBusinessUserInfo(); - -AccountLimits generateAccountLimits(); - -User generateUser(); - -Contact generateContact(); - -Identity generateIdentity(); - -Tag generateTag(); - -LazyMap generateLazyMap(); - -ResourceAttributes generateResourceAttributes(); - -Resource generateResource(); - -NoteAttributes generateNoteAttributes(); - -SharedNote generateSharedNote(); - -NoteRestrictions generateNoteRestrictions(); - -NoteLimits generateNoteLimits(); - -Note generateNote(); - -Publishing generatePublishing(); - -BusinessNotebook generateBusinessNotebook(); - -SavedSearchScope generateSavedSearchScope(); - -SavedSearch generateSavedSearch(); - -SharedNotebookRecipientSettings generateSharedNotebookRecipientSettings(); - -NotebookRecipientSettings generateNotebookRecipientSettings(); - -SharedNotebook generateSharedNotebook(); - -CanMoveToContainerRestrictions generateCanMoveToContainerRestrictions(); - -NotebookRestrictions generateNotebookRestrictions(); - -Notebook generateNotebook(); - -LinkedNotebook generateLinkedNotebook(); - -NotebookDescriptor generateNotebookDescriptor(); - -UserProfile generateUserProfile(); - -RelatedContentImage generateRelatedContentImage(); - -RelatedContent generateRelatedContent(); - -BusinessInvitation generateBusinessInvitation(); - -UserIdentity generateUserIdentity(); - -PublicUserInfo generatePublicUserInfo(); - -UserUrls generateUserUrls(); - -AuthenticationResult generateAuthenticationResult(); - -BootstrapSettings generateBootstrapSettings(); - -BootstrapProfile generateBootstrapProfile(); - -BootstrapInfo generateBootstrapInfo(); - -SyncChunk generateSyncChunk(); - -NoteList generateNoteList(); - -NoteMetadata generateNoteMetadata(); - -NotesMetadataList generateNotesMetadataList(); - -NoteEmailParameters generateNoteEmailParameters(); - -RelatedResult generateRelatedResult(); - -UpdateNoteIfUsnMatchesResult generateUpdateNoteIfUsnMatchesResult(); - -InvitationShareRelationship generateInvitationShareRelationship(); - -ShareRelationships generateShareRelationships(); - -ManageNotebookSharesParameters generateManageNotebookSharesParameters(); - -ManageNotebookSharesError generateManageNotebookSharesError(); - -ManageNotebookSharesResult generateManageNotebookSharesResult(); - -SharedNoteTemplate generateSharedNoteTemplate(); - -NotebookShareTemplate generateNotebookShareTemplate(); - -CreateOrUpdateNotebookSharesResult generateCreateOrUpdateNotebookSharesResult(); - -ManageNoteSharesError generateManageNoteSharesError(); - -ManageNoteSharesResult generateManageNoteSharesResult(); - -} // namespace tests -} // namespace qevercloud - -#endif // QEVERCLOUD_TEST_COMMON_H diff --git a/QEverCloud/src/tests/SocketHelpers.cpp b/QEverCloud/src/tests/SocketHelpers.cpp new file mode 100644 index 00000000..09e8466b --- /dev/null +++ b/QEverCloud/src/tests/SocketHelpers.cpp @@ -0,0 +1,171 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#include "SocketHelpers.h" + +#include +#include +#include +#include + +#include +#include +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +class ThriftRequestExtractor: public QObject +{ + Q_OBJECT +public: + explicit ThriftRequestExtractor(QTcpSocket & socket, QObject * parent = nullptr) : + QObject(parent) + { + QObject::connect( + &socket, + &QIODevice::readyRead, + this, + &ThriftRequestExtractor::onSocketReadyRead, + Qt::QueuedConnection); + } + + bool status() const { return m_status; } + + const QByteArray & data() { return m_data; } + +Q_SIGNALS: + void finished(); + void failed(); + +private Q_SLOTS: + void onSocketReadyRead() + { + QTcpSocket * pSocket = qobject_cast(sender()); + Q_ASSERT(pSocket); + + m_data.append(pSocket->read(pSocket->bytesAvailable())); + tryParseData(); + } + +private: + void tryParseData() + { + // Data read from socket should be a http request with headers and body + + // First parse headers, find Content-Length one to figure out the size + // of request body + int contentLengthIndex = m_data.indexOf("Content-Length:"); + if (contentLengthIndex < 0) { + // No Content-Length header, probably not all data has arrived yet + return; + } + + int contentLengthLineEndIndex = m_data.indexOf("\r\n", contentLengthIndex); + if (contentLengthLineEndIndex < 0) { + // No line end after Content-Length header, probably not all data + // has arrived yet + return; + } + + int contentLengthLen = contentLengthLineEndIndex - contentLengthIndex - 15; + QString contentLengthStr = + QString::fromUtf8(m_data.mid(contentLengthIndex + 15, contentLengthLen)); + + bool conversionResult = false; + int contentLength = contentLengthStr.toInt(&conversionResult); + if (Q_UNLIKELY(!conversionResult)) { + m_status = false; + Q_EMIT failed(); + return; + } + + // Now see whether whole body data is present + int headersEndIndex = m_data.indexOf("\r\n\r\n", contentLengthLineEndIndex); + if (headersEndIndex < 0) { + // No empty line after http headers, probably not all data has + // arrived yet + return; + } + + QByteArray body = m_data; + body.remove(0, headersEndIndex + 4); + if (body.size() < contentLength) { + // Not all data has arrived yet + return; + } + + m_data = body; + m_status = true; + Q_EMIT finished(); + } + +private: + bool m_status = false; + QByteArray m_data; +}; + +//////////////////////////////////////////////////////////////////////////////// + +QByteArray readThriftRequestFromSocket(QTcpSocket & socket) +{ + if (!socket.waitForConnected()) { + return QByteArray(); + } + + QEventLoop loop; + ThriftRequestExtractor extractor(socket); + + QObject::connect( + &extractor, + &ThriftRequestExtractor::finished, + &loop, + &QEventLoop::quit); + + QObject::connect( + &extractor, + &ThriftRequestExtractor::failed, + &loop, + &QEventLoop::quit); + + loop.exec(); + + if (!extractor.status()) { + return QByteArray(); + } + + return extractor.data(); +} + +bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket) +{ + int remaining = data.size(); + const char * pData = data.constData(); + while(socket.isOpen() && remaining>0) + { + // If the output buffer has become large, then wait until it has been sent. + if (socket.bytesToWrite() > 16384) + { + socket.waitForBytesWritten(-1); + } + + qint64 written = socket.write(pData, remaining); + if (written < 0) { + return false; + } + + pData += written; + remaining -= written; + } + return true; +} + +} // namespace qevercloud + +#include diff --git a/QEverCloud/src/tests/SocketHelpers.h b/QEverCloud/src/tests/SocketHelpers.h new file mode 100644 index 00000000..e0838430 --- /dev/null +++ b/QEverCloud/src/tests/SocketHelpers.h @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + */ + +#ifndef QEVERCLOUD_TEST_COMMON_H +#define QEVERCLOUD_TEST_COMMON_H + +#include + +#include + +#ifdef QEVERCLOUD_SHARED_LIBRARY +#undef QEVERCLOUD_SHARED_LIBRARY +#endif + +#ifdef QEVERCLOUD_STATIC_LIBRARY +#undef QEVERCLOUD_STATIC_LIBRARY +#endif + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +QByteArray readThriftRequestFromSocket(QTcpSocket & socket); + +bool writeBufferToSocket(const QByteArray & data, QTcpSocket & socket); + +} // namespace qevercloud + +#endif // QEVERCLOUD_TEST_COMMON_H diff --git a/QEverCloud/src/tests/TestDurableService.h b/QEverCloud/src/tests/TestDurableService.h index 219fe25a..06c85fd2 100644 --- a/QEverCloud/src/tests/TestDurableService.h +++ b/QEverCloud/src/tests/TestDurableService.h @@ -9,8 +9,6 @@ #ifndef QEVERCLOUD_TEST_DURABLE_SERVICE_H #define QEVERCLOUD_TEST_DURABLE_SERVICE_H -#include "Common.h" - #include namespace qevercloud { diff --git a/QEverCloud/src/tests/TestOptional.h b/QEverCloud/src/tests/TestOptional.h index e74c5c40..e9c0d325 100644 --- a/QEverCloud/src/tests/TestOptional.h +++ b/QEverCloud/src/tests/TestOptional.h @@ -9,8 +9,6 @@ #ifndef QEVERCLOUD_TEST_OPTIONAL_H #define QEVERCLOUD_TEST_OPTIONAL_H -#include "Common.h" - #include namespace qevercloud { diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 287df084..f527ee6b 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -14,10 +14,15 @@ #include #include +#include + using namespace qevercloud; int main(int argc, char *argv[]) { + // Fixed seed for rand() calls + std::srand(1575003691); + int res = 0; QCoreApplication app(argc, argv); diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp new file mode 100644 index 00000000..bfcde439 --- /dev/null +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -0,0 +1,1313 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#include "RandomDataGenerators.h" +#include "../../Impl.h" +#include +#include +#include +#include +#include +#include +#include + +namespace qevercloud { + +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +static const QString randomStringAvailableCharacters = QStringLiteral( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); + +template +T generateRandomIntType() +{ + T min = std::numeric_limits::min() / 4; + T max = std::numeric_limits::max() / 4; + return min + (rand() % static_cast(max - min + 1)); +} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + +QString generateRandomString(int len) +{ + if (len <= 0) { + return {}; + } + + QString res; + res.reserve(len); + for(int i = 0; i < len; ++i) { + int index = rand() % randomStringAvailableCharacters.length(); + res.append(randomStringAvailableCharacters.at(index)); } + + return res; +} + +qint8 generateRandomInt8() +{ + return generateRandomIntType(); +} + +qint16 generateRandomInt16() +{ + return generateRandomIntType(); +} + +qint32 generateRandomInt32() +{ + return generateRandomIntType(); +} + +qint64 generateRandomInt64() +{ + return generateRandomIntType(); +} + +quint8 generateRandomUint8() +{ + return generateRandomIntType(); +} + +quint16 generateRandomUint16() +{ + return generateRandomIntType(); +} + +quint32 generateRandomUint32() +{ + return generateRandomIntType(); +} + +quint64 generateRandomUint64() +{ + return generateRandomIntType(); +} + +double generateRandomDouble() +{ + double minval = std::numeric_limits::min(); + double maxval = std::numeric_limits::max(); + double f = (double)rand() / RAND_MAX; + return minval + f * (maxval - minval); +} + +bool generateRandomBool() +{ + return generateRandomInt8() >= 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +SyncState generateRandomSyncState() +{ + SyncState result; + result.currentTime = generateRandomInt64(); + result.fullSyncBefore = generateRandomInt64(); + result.updateCount = generateRandomInt32(); + result.uploaded = generateRandomInt64(); + result.userLastUpdated = generateRandomInt64(); + result.userMaxMessageEventId = generateRandomInt64(); + return result; +} + +SyncChunk generateRandomSyncChunk() +{ + SyncChunk result; + result.currentTime = generateRandomInt64(); + result.chunkHighUSN = generateRandomInt32(); + result.updateCount = generateRandomInt32(); + result.notes = QList(); + result.notes.ref() << generateRandomNote(); + result.notes.ref() << generateRandomNote(); + result.notes.ref() << generateRandomNote(); + result.notebooks = QList(); + result.notebooks.ref() << generateRandomNotebook(); + result.notebooks.ref() << generateRandomNotebook(); + result.notebooks.ref() << generateRandomNotebook(); + result.tags = QList(); + result.tags.ref() << generateRandomTag(); + result.tags.ref() << generateRandomTag(); + result.tags.ref() << generateRandomTag(); + result.searches = QList(); + result.searches.ref() << generateRandomSavedSearch(); + result.searches.ref() << generateRandomSavedSearch(); + result.searches.ref() << generateRandomSavedSearch(); + result.resources = QList(); + result.resources.ref() << generateRandomResource(); + result.resources.ref() << generateRandomResource(); + result.resources.ref() << generateRandomResource(); + result.expungedNotes = QList(); + result.expungedNotes.ref() << generateRandomString(); + result.expungedNotes.ref() << generateRandomString(); + result.expungedNotes.ref() << generateRandomString(); + result.expungedNotebooks = QList(); + result.expungedNotebooks.ref() << generateRandomString(); + result.expungedNotebooks.ref() << generateRandomString(); + result.expungedNotebooks.ref() << generateRandomString(); + result.expungedTags = QList(); + result.expungedTags.ref() << generateRandomString(); + result.expungedTags.ref() << generateRandomString(); + result.expungedTags.ref() << generateRandomString(); + result.expungedSearches = QList(); + result.expungedSearches.ref() << generateRandomString(); + result.expungedSearches.ref() << generateRandomString(); + result.expungedSearches.ref() << generateRandomString(); + result.linkedNotebooks = QList(); + result.linkedNotebooks.ref() << generateRandomLinkedNotebook(); + result.linkedNotebooks.ref() << generateRandomLinkedNotebook(); + result.linkedNotebooks.ref() << generateRandomLinkedNotebook(); + result.expungedLinkedNotebooks = QList(); + result.expungedLinkedNotebooks.ref() << generateRandomString(); + result.expungedLinkedNotebooks.ref() << generateRandomString(); + result.expungedLinkedNotebooks.ref() << generateRandomString(); + return result; +} + +SyncChunkFilter generateRandomSyncChunkFilter() +{ + SyncChunkFilter result; + result.includeNotes = generateRandomBool(); + result.includeNoteResources = generateRandomBool(); + result.includeNoteAttributes = generateRandomBool(); + result.includeNotebooks = generateRandomBool(); + result.includeTags = generateRandomBool(); + result.includeSearches = generateRandomBool(); + result.includeResources = generateRandomBool(); + result.includeLinkedNotebooks = generateRandomBool(); + result.includeExpunged = generateRandomBool(); + result.includeNoteApplicationDataFullMap = generateRandomBool(); + result.includeResourceApplicationDataFullMap = generateRandomBool(); + result.includeNoteResourceApplicationDataFullMap = generateRandomBool(); + result.includeSharedNotes = generateRandomBool(); + result.omitSharedNotebooks = generateRandomBool(); + result.requireNoteContentClass = generateRandomString(); + result.notebookGuids = QSet(); + Q_UNUSED(result.notebookGuids->insert(generateRandomString())) + Q_UNUSED(result.notebookGuids->insert(generateRandomString())) + Q_UNUSED(result.notebookGuids->insert(generateRandomString())) + return result; +} + +NoteFilter generateRandomNoteFilter() +{ + NoteFilter result; + result.order = generateRandomInt32(); + result.ascending = generateRandomBool(); + result.words = generateRandomString(); + result.notebookGuid = generateRandomString(); + result.tagGuids = QList(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.timeZone = generateRandomString(); + result.inactive = generateRandomBool(); + result.emphasized = generateRandomString(); + result.includeAllReadableNotebooks = generateRandomBool(); + result.includeAllReadableWorkspaces = generateRandomBool(); + result.context = generateRandomString(); + result.rawWords = generateRandomString(); + result.searchContextBytes = generateRandomString().toUtf8(); + return result; +} + +NoteList generateRandomNoteList() +{ + NoteList result; + result.startIndex = generateRandomInt32(); + result.totalNotes = generateRandomInt32(); + result.notes << generateRandomNote(); + result.notes << generateRandomNote(); + result.notes << generateRandomNote(); + result.stoppedWords = QList(); + result.stoppedWords.ref() << generateRandomString(); + result.stoppedWords.ref() << generateRandomString(); + result.stoppedWords.ref() << generateRandomString(); + result.searchedWords = QList(); + result.searchedWords.ref() << generateRandomString(); + result.searchedWords.ref() << generateRandomString(); + result.searchedWords.ref() << generateRandomString(); + result.updateCount = generateRandomInt32(); + result.searchContextBytes = generateRandomString().toUtf8(); + result.debugInfo = generateRandomString(); + return result; +} + +NoteMetadata generateRandomNoteMetadata() +{ + NoteMetadata result; + result.guid = generateRandomString(); + result.title = generateRandomString(); + result.contentLength = generateRandomInt32(); + result.created = generateRandomInt64(); + result.updated = generateRandomInt64(); + result.deleted = generateRandomInt64(); + result.updateSequenceNum = generateRandomInt32(); + result.notebookGuid = generateRandomString(); + result.tagGuids = QList(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.attributes = generateRandomNoteAttributes(); + result.largestResourceMime = generateRandomString(); + result.largestResourceSize = generateRandomInt32(); + return result; +} + +NotesMetadataList generateRandomNotesMetadataList() +{ + NotesMetadataList result; + result.startIndex = generateRandomInt32(); + result.totalNotes = generateRandomInt32(); + result.notes << generateRandomNoteMetadata(); + result.notes << generateRandomNoteMetadata(); + result.notes << generateRandomNoteMetadata(); + result.stoppedWords = QList(); + result.stoppedWords.ref() << generateRandomString(); + result.stoppedWords.ref() << generateRandomString(); + result.stoppedWords.ref() << generateRandomString(); + result.searchedWords = QList(); + result.searchedWords.ref() << generateRandomString(); + result.searchedWords.ref() << generateRandomString(); + result.searchedWords.ref() << generateRandomString(); + result.updateCount = generateRandomInt32(); + result.searchContextBytes = generateRandomString().toUtf8(); + result.debugInfo = generateRandomString(); + return result; +} + +NotesMetadataResultSpec generateRandomNotesMetadataResultSpec() +{ + NotesMetadataResultSpec result; + result.includeTitle = generateRandomBool(); + result.includeContentLength = generateRandomBool(); + result.includeCreated = generateRandomBool(); + result.includeUpdated = generateRandomBool(); + result.includeDeleted = generateRandomBool(); + result.includeUpdateSequenceNum = generateRandomBool(); + result.includeNotebookGuid = generateRandomBool(); + result.includeTagGuids = generateRandomBool(); + result.includeAttributes = generateRandomBool(); + result.includeLargestResourceMime = generateRandomBool(); + result.includeLargestResourceSize = generateRandomBool(); + return result; +} + +NoteCollectionCounts generateRandomNoteCollectionCounts() +{ + NoteCollectionCounts result; + result.notebookCounts = QMap(); + result.notebookCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.notebookCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.notebookCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.tagCounts = QMap(); + result.tagCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.tagCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.tagCounts.ref()[generateRandomString()] = generateRandomInt32(); + result.trashCount = generateRandomInt32(); + return result; +} + +NoteResultSpec generateRandomNoteResultSpec() +{ + NoteResultSpec result; + result.includeContent = generateRandomBool(); + result.includeResourcesData = generateRandomBool(); + result.includeResourcesRecognition = generateRandomBool(); + result.includeResourcesAlternateData = generateRandomBool(); + result.includeSharedNotes = generateRandomBool(); + result.includeNoteAppDataValues = generateRandomBool(); + result.includeResourceAppDataValues = generateRandomBool(); + result.includeAccountLimits = generateRandomBool(); + return result; +} + +NoteEmailParameters generateRandomNoteEmailParameters() +{ + NoteEmailParameters result; + result.guid = generateRandomString(); + result.note = generateRandomNote(); + result.toAddresses = QList(); + result.toAddresses.ref() << generateRandomString(); + result.toAddresses.ref() << generateRandomString(); + result.toAddresses.ref() << generateRandomString(); + result.ccAddresses = QList(); + result.ccAddresses.ref() << generateRandomString(); + result.ccAddresses.ref() << generateRandomString(); + result.ccAddresses.ref() << generateRandomString(); + result.subject = generateRandomString(); + result.message = generateRandomString(); + return result; +} + +NoteVersionId generateRandomNoteVersionId() +{ + NoteVersionId result; + result.updateSequenceNum = generateRandomInt32(); + result.updated = generateRandomInt64(); + result.saved = generateRandomInt64(); + result.title = generateRandomString(); + result.lastEditorId = generateRandomInt32(); + return result; +} + +RelatedQuery generateRandomRelatedQuery() +{ + RelatedQuery result; + result.noteGuid = generateRandomString(); + result.plainText = generateRandomString(); + result.filter = generateRandomNoteFilter(); + result.referenceUri = generateRandomString(); + result.context = generateRandomString(); + result.cacheKey = generateRandomString(); + return result; +} + +RelatedResult generateRandomRelatedResult() +{ + RelatedResult result; + result.notes = QList(); + result.notes.ref() << generateRandomNote(); + result.notes.ref() << generateRandomNote(); + result.notes.ref() << generateRandomNote(); + result.notebooks = QList(); + result.notebooks.ref() << generateRandomNotebook(); + result.notebooks.ref() << generateRandomNotebook(); + result.notebooks.ref() << generateRandomNotebook(); + result.tags = QList(); + result.tags.ref() << generateRandomTag(); + result.tags.ref() << generateRandomTag(); + result.tags.ref() << generateRandomTag(); + result.containingNotebooks = QList(); + result.containingNotebooks.ref() << generateRandomNotebookDescriptor(); + result.containingNotebooks.ref() << generateRandomNotebookDescriptor(); + result.containingNotebooks.ref() << generateRandomNotebookDescriptor(); + result.debugInfo = generateRandomString(); + result.experts = QList(); + result.experts.ref() << generateRandomUserProfile(); + result.experts.ref() << generateRandomUserProfile(); + result.experts.ref() << generateRandomUserProfile(); + result.relatedContent = QList(); + result.relatedContent.ref() << generateRandomRelatedContent(); + result.relatedContent.ref() << generateRandomRelatedContent(); + result.relatedContent.ref() << generateRandomRelatedContent(); + result.cacheKey = generateRandomString(); + result.cacheExpires = generateRandomInt32(); + return result; +} + +RelatedResultSpec generateRandomRelatedResultSpec() +{ + RelatedResultSpec result; + result.maxNotes = generateRandomInt32(); + result.maxNotebooks = generateRandomInt32(); + result.maxTags = generateRandomInt32(); + result.writableNotebooksOnly = generateRandomBool(); + result.includeContainingNotebooks = generateRandomBool(); + result.includeDebugInfo = generateRandomBool(); + result.maxExperts = generateRandomInt32(); + result.maxRelatedContent = generateRandomInt32(); + result.relatedContentTypes = QSet(); + Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::REFERENCE_MATERIAL)) + Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE)) + Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON)) + return result; +} + +UpdateNoteIfUsnMatchesResult generateRandomUpdateNoteIfUsnMatchesResult() +{ + UpdateNoteIfUsnMatchesResult result; + result.note = generateRandomNote(); + result.updated = generateRandomBool(); + return result; +} + +ShareRelationshipRestrictions generateRandomShareRelationshipRestrictions() +{ + ShareRelationshipRestrictions result; + result.noSetReadOnly = generateRandomBool(); + result.noSetReadPlusActivity = generateRandomBool(); + result.noSetModify = generateRandomBool(); + result.noSetFullAccess = generateRandomBool(); + return result; +} + +InvitationShareRelationship generateRandomInvitationShareRelationship() +{ + InvitationShareRelationship result; + result.displayName = generateRandomString(); + result.recipientUserIdentity = generateRandomUserIdentity(); + result.privilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; + result.sharerUserId = generateRandomInt32(); + return result; +} + +MemberShareRelationship generateRandomMemberShareRelationship() +{ + MemberShareRelationship result; + result.displayName = generateRandomString(); + result.recipientUserId = generateRandomInt32(); + result.bestPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.restrictions = generateRandomShareRelationshipRestrictions(); + result.sharerUserId = generateRandomInt32(); + return result; +} + +ShareRelationships generateRandomShareRelationships() +{ + ShareRelationships result; + result.invitations = QList(); + result.invitations.ref() << generateRandomInvitationShareRelationship(); + result.invitations.ref() << generateRandomInvitationShareRelationship(); + result.invitations.ref() << generateRandomInvitationShareRelationship(); + result.memberships = QList(); + result.memberships.ref() << generateRandomMemberShareRelationship(); + result.memberships.ref() << generateRandomMemberShareRelationship(); + result.memberships.ref() << generateRandomMemberShareRelationship(); + result.invitationRestrictions = generateRandomShareRelationshipRestrictions(); + return result; +} + +ManageNotebookSharesParameters generateRandomManageNotebookSharesParameters() +{ + ManageNotebookSharesParameters result; + result.notebookGuid = generateRandomString(); + result.inviteMessage = generateRandomString(); + result.membershipsToUpdate = QList(); + result.membershipsToUpdate.ref() << generateRandomMemberShareRelationship(); + result.membershipsToUpdate.ref() << generateRandomMemberShareRelationship(); + result.membershipsToUpdate.ref() << generateRandomMemberShareRelationship(); + result.invitationsToCreateOrUpdate = QList(); + result.invitationsToCreateOrUpdate.ref() << generateRandomInvitationShareRelationship(); + result.invitationsToCreateOrUpdate.ref() << generateRandomInvitationShareRelationship(); + result.invitationsToCreateOrUpdate.ref() << generateRandomInvitationShareRelationship(); + result.unshares = QList(); + result.unshares.ref() << generateRandomUserIdentity(); + result.unshares.ref() << generateRandomUserIdentity(); + result.unshares.ref() << generateRandomUserIdentity(); + return result; +} + +ManageNotebookSharesError generateRandomManageNotebookSharesError() +{ + ManageNotebookSharesError result; + result.userIdentity = generateRandomUserIdentity(); + return result; +} + +ManageNotebookSharesResult generateRandomManageNotebookSharesResult() +{ + ManageNotebookSharesResult result; + result.errors = QList(); + result.errors.ref() << generateRandomManageNotebookSharesError(); + result.errors.ref() << generateRandomManageNotebookSharesError(); + result.errors.ref() << generateRandomManageNotebookSharesError(); + return result; +} + +SharedNoteTemplate generateRandomSharedNoteTemplate() +{ + SharedNoteTemplate result; + result.noteGuid = generateRandomString(); + result.recipientThreadId = generateRandomInt64(); + result.recipientContacts = QList(); + result.recipientContacts.ref() << generateRandomContact(); + result.recipientContacts.ref() << generateRandomContact(); + result.recipientContacts.ref() << generateRandomContact(); + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + return result; +} + +NotebookShareTemplate generateRandomNotebookShareTemplate() +{ + NotebookShareTemplate result; + result.notebookGuid = generateRandomString(); + result.recipientThreadId = generateRandomInt64(); + result.recipientContacts = QList(); + result.recipientContacts.ref() << generateRandomContact(); + result.recipientContacts.ref() << generateRandomContact(); + result.recipientContacts.ref() << generateRandomContact(); + result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + return result; +} + +CreateOrUpdateNotebookSharesResult generateRandomCreateOrUpdateNotebookSharesResult() +{ + CreateOrUpdateNotebookSharesResult result; + result.updateSequenceNum = generateRandomInt32(); + result.matchingShares = QList(); + result.matchingShares.ref() << generateRandomSharedNotebook(); + result.matchingShares.ref() << generateRandomSharedNotebook(); + result.matchingShares.ref() << generateRandomSharedNotebook(); + return result; +} + +NoteShareRelationshipRestrictions generateRandomNoteShareRelationshipRestrictions() +{ + NoteShareRelationshipRestrictions result; + result.noSetReadNote = generateRandomBool(); + result.noSetModifyNote = generateRandomBool(); + result.noSetFullAccess = generateRandomBool(); + return result; +} + +NoteMemberShareRelationship generateRandomNoteMemberShareRelationship() +{ + NoteMemberShareRelationship result; + result.displayName = generateRandomString(); + result.recipientUserId = generateRandomInt32(); + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.restrictions = generateRandomNoteShareRelationshipRestrictions(); + result.sharerUserId = generateRandomInt32(); + return result; +} + +NoteInvitationShareRelationship generateRandomNoteInvitationShareRelationship() +{ + NoteInvitationShareRelationship result; + result.displayName = generateRandomString(); + result.recipientIdentityId = generateRandomInt64(); + result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + result.sharerUserId = generateRandomInt32(); + return result; +} + +NoteShareRelationships generateRandomNoteShareRelationships() +{ + NoteShareRelationships result; + result.invitations = QList(); + result.invitations.ref() << generateRandomNoteInvitationShareRelationship(); + result.invitations.ref() << generateRandomNoteInvitationShareRelationship(); + result.invitations.ref() << generateRandomNoteInvitationShareRelationship(); + result.memberships = QList(); + result.memberships.ref() << generateRandomNoteMemberShareRelationship(); + result.memberships.ref() << generateRandomNoteMemberShareRelationship(); + result.memberships.ref() << generateRandomNoteMemberShareRelationship(); + result.invitationRestrictions = generateRandomNoteShareRelationshipRestrictions(); + return result; +} + +ManageNoteSharesParameters generateRandomManageNoteSharesParameters() +{ + ManageNoteSharesParameters result; + result.noteGuid = generateRandomString(); + result.membershipsToUpdate = QList(); + result.membershipsToUpdate.ref() << generateRandomNoteMemberShareRelationship(); + result.membershipsToUpdate.ref() << generateRandomNoteMemberShareRelationship(); + result.membershipsToUpdate.ref() << generateRandomNoteMemberShareRelationship(); + result.invitationsToUpdate = QList(); + result.invitationsToUpdate.ref() << generateRandomNoteInvitationShareRelationship(); + result.invitationsToUpdate.ref() << generateRandomNoteInvitationShareRelationship(); + result.invitationsToUpdate.ref() << generateRandomNoteInvitationShareRelationship(); + result.membershipsToUnshare = QList(); + result.membershipsToUnshare.ref() << generateRandomInt32(); + result.membershipsToUnshare.ref() << generateRandomInt32(); + result.membershipsToUnshare.ref() << generateRandomInt32(); + result.invitationsToUnshare = QList(); + result.invitationsToUnshare.ref() << generateRandomInt64(); + result.invitationsToUnshare.ref() << generateRandomInt64(); + result.invitationsToUnshare.ref() << generateRandomInt64(); + return result; +} + +ManageNoteSharesError generateRandomManageNoteSharesError() +{ + ManageNoteSharesError result; + result.identityID = generateRandomInt64(); + result.userID = generateRandomInt32(); + return result; +} + +ManageNoteSharesResult generateRandomManageNoteSharesResult() +{ + ManageNoteSharesResult result; + result.errors = QList(); + result.errors.ref() << generateRandomManageNoteSharesError(); + result.errors.ref() << generateRandomManageNoteSharesError(); + result.errors.ref() << generateRandomManageNoteSharesError(); + return result; +} + +Data generateRandomData() +{ + Data result; + result.bodyHash = generateRandomString().toUtf8(); + result.size = generateRandomInt32(); + result.body = generateRandomString().toUtf8(); + return result; +} + +UserAttributes generateRandomUserAttributes() +{ + UserAttributes result; + result.defaultLocationName = generateRandomString(); + result.defaultLatitude = generateRandomDouble(); + result.defaultLongitude = generateRandomDouble(); + result.preactivation = generateRandomBool(); + result.viewedPromotions = QList(); + result.viewedPromotions.ref() << generateRandomString(); + result.viewedPromotions.ref() << generateRandomString(); + result.viewedPromotions.ref() << generateRandomString(); + result.incomingEmailAddress = generateRandomString(); + result.recentMailedAddresses = QList(); + result.recentMailedAddresses.ref() << generateRandomString(); + result.recentMailedAddresses.ref() << generateRandomString(); + result.recentMailedAddresses.ref() << generateRandomString(); + result.comments = generateRandomString(); + result.dateAgreedToTermsOfService = generateRandomInt64(); + result.maxReferrals = generateRandomInt32(); + result.referralCount = generateRandomInt32(); + result.refererCode = generateRandomString(); + result.sentEmailDate = generateRandomInt64(); + result.sentEmailCount = generateRandomInt32(); + result.dailyEmailLimit = generateRandomInt32(); + result.emailOptOutDate = generateRandomInt64(); + result.partnerEmailOptInDate = generateRandomInt64(); + result.preferredLanguage = generateRandomString(); + result.preferredCountry = generateRandomString(); + result.clipFullPage = generateRandomBool(); + result.twitterUserName = generateRandomString(); + result.twitterId = generateRandomString(); + result.groupName = generateRandomString(); + result.recognitionLanguage = generateRandomString(); + result.referralProof = generateRandomString(); + result.educationalDiscount = generateRandomBool(); + result.businessAddress = generateRandomString(); + result.hideSponsorBilling = generateRandomBool(); + result.useEmailAutoFiling = generateRandomBool(); + result.reminderEmailConfig = ReminderEmailConfig::DO_NOT_SEND; + result.emailAddressLastConfirmed = generateRandomInt64(); + result.passwordUpdated = generateRandomInt64(); + result.salesforcePushEnabled = generateRandomBool(); + result.shouldLogClientEvent = generateRandomBool(); + result.optOutMachineLearning = generateRandomBool(); + return result; +} + +BusinessUserAttributes generateRandomBusinessUserAttributes() +{ + BusinessUserAttributes result; + result.title = generateRandomString(); + result.location = generateRandomString(); + result.department = generateRandomString(); + result.mobilePhone = generateRandomString(); + result.linkedInProfileUrl = generateRandomString(); + result.workPhone = generateRandomString(); + result.companyStartDate = generateRandomInt64(); + return result; +} + +Accounting generateRandomAccounting() +{ + Accounting result; + result.uploadLimitEnd = generateRandomInt64(); + result.uploadLimitNextMonth = generateRandomInt64(); + result.premiumServiceStatus = PremiumOrderStatus::FAILED; + result.premiumOrderNumber = generateRandomString(); + result.premiumCommerceService = generateRandomString(); + result.premiumServiceStart = generateRandomInt64(); + result.premiumServiceSKU = generateRandomString(); + result.lastSuccessfulCharge = generateRandomInt64(); + result.lastFailedCharge = generateRandomInt64(); + result.lastFailedChargeReason = generateRandomString(); + result.nextPaymentDue = generateRandomInt64(); + result.premiumLockUntil = generateRandomInt64(); + result.updated = generateRandomInt64(); + result.premiumSubscriptionNumber = generateRandomString(); + result.lastRequestedCharge = generateRandomInt64(); + result.currency = generateRandomString(); + result.unitPrice = generateRandomInt32(); + result.businessId = generateRandomInt32(); + result.businessName = generateRandomString(); + result.businessRole = BusinessUserRole::ADMIN; + result.unitDiscount = generateRandomInt32(); + result.nextChargeDate = generateRandomInt64(); + result.availablePoints = generateRandomInt32(); + return result; +} + +BusinessUserInfo generateRandomBusinessUserInfo() +{ + BusinessUserInfo result; + result.businessId = generateRandomInt32(); + result.businessName = generateRandomString(); + result.role = BusinessUserRole::NORMAL; + result.email = generateRandomString(); + result.updated = generateRandomInt64(); + return result; +} + +AccountLimits generateRandomAccountLimits() +{ + AccountLimits result; + result.userMailLimitDaily = generateRandomInt32(); + result.noteSizeMax = generateRandomInt64(); + result.resourceSizeMax = generateRandomInt64(); + result.userLinkedNotebookMax = generateRandomInt32(); + result.uploadLimit = generateRandomInt64(); + result.userNoteCountMax = generateRandomInt32(); + result.userNotebookCountMax = generateRandomInt32(); + result.userTagCountMax = generateRandomInt32(); + result.noteTagCountMax = generateRandomInt32(); + result.userSavedSearchesMax = generateRandomInt32(); + result.noteResourceCountMax = generateRandomInt32(); + return result; +} + +User generateRandomUser() +{ + User result; + result.id = generateRandomInt32(); + result.username = generateRandomString(); + result.email = generateRandomString(); + result.name = generateRandomString(); + result.timezone = generateRandomString(); + result.privilege = PrivilegeLevel::VIP; + result.serviceLevel = ServiceLevel::PLUS; + result.created = generateRandomInt64(); + result.updated = generateRandomInt64(); + result.deleted = generateRandomInt64(); + result.active = generateRandomBool(); + result.shardId = generateRandomString(); + result.attributes = generateRandomUserAttributes(); + result.accounting = generateRandomAccounting(); + result.businessUserInfo = generateRandomBusinessUserInfo(); + result.photoUrl = generateRandomString(); + result.photoLastUpdated = generateRandomInt64(); + result.accountLimits = generateRandomAccountLimits(); + return result; +} + +Contact generateRandomContact() +{ + Contact result; + result.name = generateRandomString(); + result.id = generateRandomString(); + result.type = ContactType::LINKEDIN; + result.photoUrl = generateRandomString(); + result.photoLastUpdated = generateRandomInt64(); + result.messagingPermit = generateRandomString().toUtf8(); + result.messagingPermitExpires = generateRandomInt64(); + return result; +} + +Identity generateRandomIdentity() +{ + Identity result; + result.id = generateRandomInt64(); + result.contact = generateRandomContact(); + result.userId = generateRandomInt32(); + result.deactivated = generateRandomBool(); + result.sameBusiness = generateRandomBool(); + result.blocked = generateRandomBool(); + result.userConnected = generateRandomBool(); + result.eventId = generateRandomInt64(); + return result; +} + +Tag generateRandomTag() +{ + Tag result; + result.guid = generateRandomString(); + result.name = generateRandomString(); + result.parentGuid = generateRandomString(); + result.updateSequenceNum = generateRandomInt32(); + return result; +} + +LazyMap generateRandomLazyMap() +{ + LazyMap result; + result.keysOnly = QSet(); + Q_UNUSED(result.keysOnly->insert(generateRandomString())) + Q_UNUSED(result.keysOnly->insert(generateRandomString())) + Q_UNUSED(result.keysOnly->insert(generateRandomString())) + result.fullMap = QMap(); + result.fullMap.ref()[generateRandomString()] = generateRandomString(); + result.fullMap.ref()[generateRandomString()] = generateRandomString(); + result.fullMap.ref()[generateRandomString()] = generateRandomString(); + return result; +} + +ResourceAttributes generateRandomResourceAttributes() +{ + ResourceAttributes result; + result.sourceURL = generateRandomString(); + result.timestamp = generateRandomInt64(); + result.latitude = generateRandomDouble(); + result.longitude = generateRandomDouble(); + result.altitude = generateRandomDouble(); + result.cameraMake = generateRandomString(); + result.cameraModel = generateRandomString(); + result.clientWillIndex = generateRandomBool(); + result.recoType = generateRandomString(); + result.fileName = generateRandomString(); + result.attachment = generateRandomBool(); + result.applicationData = generateRandomLazyMap(); + return result; +} + +Resource generateRandomResource() +{ + Resource result; + result.guid = generateRandomString(); + result.noteGuid = generateRandomString(); + result.data = generateRandomData(); + result.mime = generateRandomString(); + result.width = generateRandomInt16(); + result.height = generateRandomInt16(); + result.duration = generateRandomInt16(); + result.active = generateRandomBool(); + result.recognition = generateRandomData(); + result.attributes = generateRandomResourceAttributes(); + result.updateSequenceNum = generateRandomInt32(); + result.alternateData = generateRandomData(); + return result; +} + +NoteAttributes generateRandomNoteAttributes() +{ + NoteAttributes result; + result.subjectDate = generateRandomInt64(); + result.latitude = generateRandomDouble(); + result.longitude = generateRandomDouble(); + result.altitude = generateRandomDouble(); + result.author = generateRandomString(); + result.source = generateRandomString(); + result.sourceURL = generateRandomString(); + result.sourceApplication = generateRandomString(); + result.shareDate = generateRandomInt64(); + result.reminderOrder = generateRandomInt64(); + result.reminderDoneTime = generateRandomInt64(); + result.reminderTime = generateRandomInt64(); + result.placeName = generateRandomString(); + result.contentClass = generateRandomString(); + result.applicationData = generateRandomLazyMap(); + result.lastEditedBy = generateRandomString(); + result.classifications = QMap(); + result.classifications.ref()[generateRandomString()] = generateRandomString(); + result.classifications.ref()[generateRandomString()] = generateRandomString(); + result.classifications.ref()[generateRandomString()] = generateRandomString(); + result.creatorId = generateRandomInt32(); + result.lastEditorId = generateRandomInt32(); + result.sharedWithBusiness = generateRandomBool(); + result.conflictSourceNoteGuid = generateRandomString(); + result.noteTitleQuality = generateRandomInt32(); + return result; +} + +SharedNote generateRandomSharedNote() +{ + SharedNote result; + result.sharerUserID = generateRandomInt32(); + result.recipientIdentity = generateRandomIdentity(); + result.privilege = SharedNotePrivilegeLevel::READ_NOTE; + result.serviceCreated = generateRandomInt64(); + result.serviceUpdated = generateRandomInt64(); + result.serviceAssigned = generateRandomInt64(); + return result; +} + +NoteRestrictions generateRandomNoteRestrictions() +{ + NoteRestrictions result; + result.noUpdateTitle = generateRandomBool(); + result.noUpdateContent = generateRandomBool(); + result.noEmail = generateRandomBool(); + result.noShare = generateRandomBool(); + result.noSharePublicly = generateRandomBool(); + return result; +} + +NoteLimits generateRandomNoteLimits() +{ + NoteLimits result; + result.noteResourceCountMax = generateRandomInt32(); + result.uploadLimit = generateRandomInt64(); + result.resourceSizeMax = generateRandomInt64(); + result.noteSizeMax = generateRandomInt64(); + result.uploaded = generateRandomInt64(); + return result; +} + +Note generateRandomNote() +{ + Note result; + result.guid = generateRandomString(); + result.title = generateRandomString(); + result.content = generateRandomString(); + result.contentHash = generateRandomString().toUtf8(); + result.contentLength = generateRandomInt32(); + result.created = generateRandomInt64(); + result.updated = generateRandomInt64(); + result.deleted = generateRandomInt64(); + result.active = generateRandomBool(); + result.updateSequenceNum = generateRandomInt32(); + result.notebookGuid = generateRandomString(); + result.tagGuids = QList(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.tagGuids.ref() << generateRandomString(); + result.resources = QList(); + result.resources.ref() << generateRandomResource(); + result.resources.ref() << generateRandomResource(); + result.resources.ref() << generateRandomResource(); + result.attributes = generateRandomNoteAttributes(); + result.tagNames = QList(); + result.tagNames.ref() << generateRandomString(); + result.tagNames.ref() << generateRandomString(); + result.tagNames.ref() << generateRandomString(); + result.sharedNotes = QList(); + result.sharedNotes.ref() << generateRandomSharedNote(); + result.sharedNotes.ref() << generateRandomSharedNote(); + result.sharedNotes.ref() << generateRandomSharedNote(); + result.restrictions = generateRandomNoteRestrictions(); + result.limits = generateRandomNoteLimits(); + return result; +} + +Publishing generateRandomPublishing() +{ + Publishing result; + result.uri = generateRandomString(); + result.order = NoteSortOrder::RELEVANCE; + result.ascending = generateRandomBool(); + result.publicDescription = generateRandomString(); + return result; +} + +BusinessNotebook generateRandomBusinessNotebook() +{ + BusinessNotebook result; + result.notebookDescription = generateRandomString(); + result.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.recommended = generateRandomBool(); + return result; +} + +SavedSearchScope generateRandomSavedSearchScope() +{ + SavedSearchScope result; + result.includeAccount = generateRandomBool(); + result.includePersonalLinkedNotebooks = generateRandomBool(); + result.includeBusinessLinkedNotebooks = generateRandomBool(); + return result; +} + +SavedSearch generateRandomSavedSearch() +{ + SavedSearch result; + result.guid = generateRandomString(); + result.name = generateRandomString(); + result.query = generateRandomString(); + result.format = QueryFormat::USER; + result.updateSequenceNum = generateRandomInt32(); + result.scope = generateRandomSavedSearchScope(); + return result; +} + +SharedNotebookRecipientSettings generateRandomSharedNotebookRecipientSettings() +{ + SharedNotebookRecipientSettings result; + result.reminderNotifyEmail = generateRandomBool(); + result.reminderNotifyInApp = generateRandomBool(); + return result; +} + +NotebookRecipientSettings generateRandomNotebookRecipientSettings() +{ + NotebookRecipientSettings result; + result.reminderNotifyEmail = generateRandomBool(); + result.reminderNotifyInApp = generateRandomBool(); + result.inMyList = generateRandomBool(); + result.stack = generateRandomString(); + result.recipientStatus = RecipientStatus::NOT_IN_MY_LIST; + return result; +} + +SharedNotebook generateRandomSharedNotebook() +{ + SharedNotebook result; + result.id = generateRandomInt64(); + result.userId = generateRandomInt32(); + result.notebookGuid = generateRandomString(); + result.email = generateRandomString(); + result.recipientIdentityId = generateRandomInt64(); + result.notebookModifiable = generateRandomBool(); + result.serviceCreated = generateRandomInt64(); + result.serviceUpdated = generateRandomInt64(); + result.globalId = generateRandomString(); + result.username = generateRandomString(); + result.privilege = SharedNotebookPrivilegeLevel::GROUP; + result.recipientSettings = generateRandomSharedNotebookRecipientSettings(); + result.sharerUserId = generateRandomInt32(); + result.recipientUsername = generateRandomString(); + result.recipientUserId = generateRandomInt32(); + result.serviceAssigned = generateRandomInt64(); + return result; +} + +CanMoveToContainerRestrictions generateRandomCanMoveToContainerRestrictions() +{ + CanMoveToContainerRestrictions result; + result.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; + return result; +} + +NotebookRestrictions generateRandomNotebookRestrictions() +{ + NotebookRestrictions result; + result.noReadNotes = generateRandomBool(); + result.noCreateNotes = generateRandomBool(); + result.noUpdateNotes = generateRandomBool(); + result.noExpungeNotes = generateRandomBool(); + result.noShareNotes = generateRandomBool(); + result.noEmailNotes = generateRandomBool(); + result.noSendMessageToRecipients = generateRandomBool(); + result.noUpdateNotebook = generateRandomBool(); + result.noExpungeNotebook = generateRandomBool(); + result.noSetDefaultNotebook = generateRandomBool(); + result.noSetNotebookStack = generateRandomBool(); + result.noPublishToPublic = generateRandomBool(); + result.noPublishToBusinessLibrary = generateRandomBool(); + result.noCreateTags = generateRandomBool(); + result.noUpdateTags = generateRandomBool(); + result.noExpungeTags = generateRandomBool(); + result.noSetParentTag = generateRandomBool(); + result.noCreateSharedNotebooks = generateRandomBool(); + result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; + result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; + result.noShareNotesWithBusiness = generateRandomBool(); + result.noRenameNotebook = generateRandomBool(); + result.noSetInMyList = generateRandomBool(); + result.noChangeContact = generateRandomBool(); + result.canMoveToContainerRestrictions = generateRandomCanMoveToContainerRestrictions(); + result.noSetReminderNotifyEmail = generateRandomBool(); + result.noSetReminderNotifyInApp = generateRandomBool(); + result.noSetRecipientSettingsStack = generateRandomBool(); + result.noCanMoveNote = generateRandomBool(); + return result; +} + +Notebook generateRandomNotebook() +{ + Notebook result; + result.guid = generateRandomString(); + result.name = generateRandomString(); + result.updateSequenceNum = generateRandomInt32(); + result.defaultNotebook = generateRandomBool(); + result.serviceCreated = generateRandomInt64(); + result.serviceUpdated = generateRandomInt64(); + result.publishing = generateRandomPublishing(); + result.published = generateRandomBool(); + result.stack = generateRandomString(); + result.sharedNotebookIds = QList(); + result.sharedNotebookIds.ref() << generateRandomInt64(); + result.sharedNotebookIds.ref() << generateRandomInt64(); + result.sharedNotebookIds.ref() << generateRandomInt64(); + result.sharedNotebooks = QList(); + result.sharedNotebooks.ref() << generateRandomSharedNotebook(); + result.sharedNotebooks.ref() << generateRandomSharedNotebook(); + result.sharedNotebooks.ref() << generateRandomSharedNotebook(); + result.businessNotebook = generateRandomBusinessNotebook(); + result.contact = generateRandomUser(); + result.restrictions = generateRandomNotebookRestrictions(); + result.recipientSettings = generateRandomNotebookRecipientSettings(); + return result; +} + +LinkedNotebook generateRandomLinkedNotebook() +{ + LinkedNotebook result; + result.shareName = generateRandomString(); + result.username = generateRandomString(); + result.shardId = generateRandomString(); + result.sharedNotebookGlobalId = generateRandomString(); + result.uri = generateRandomString(); + result.guid = generateRandomString(); + result.updateSequenceNum = generateRandomInt32(); + result.noteStoreUrl = generateRandomString(); + result.webApiUrlPrefix = generateRandomString(); + result.stack = generateRandomString(); + result.businessId = generateRandomInt32(); + return result; +} + +NotebookDescriptor generateRandomNotebookDescriptor() +{ + NotebookDescriptor result; + result.guid = generateRandomString(); + result.notebookDisplayName = generateRandomString(); + result.contactName = generateRandomString(); + result.hasSharedNotebook = generateRandomBool(); + result.joinedUserCount = generateRandomInt32(); + return result; +} + +UserProfile generateRandomUserProfile() +{ + UserProfile result; + result.id = generateRandomInt32(); + result.name = generateRandomString(); + result.email = generateRandomString(); + result.username = generateRandomString(); + result.attributes = generateRandomBusinessUserAttributes(); + result.joined = generateRandomInt64(); + result.photoLastUpdated = generateRandomInt64(); + result.photoUrl = generateRandomString(); + result.role = BusinessUserRole::ADMIN; + result.status = BusinessUserStatus::DEACTIVATED; + return result; +} + +RelatedContentImage generateRandomRelatedContentImage() +{ + RelatedContentImage result; + result.url = generateRandomString(); + result.width = generateRandomInt32(); + result.height = generateRandomInt32(); + result.pixelRatio = generateRandomDouble(); + result.fileSize = generateRandomInt32(); + return result; +} + +RelatedContent generateRandomRelatedContent() +{ + RelatedContent result; + result.contentId = generateRandomString(); + result.title = generateRandomString(); + result.url = generateRandomString(); + result.sourceId = generateRandomString(); + result.sourceUrl = generateRandomString(); + result.sourceFaviconUrl = generateRandomString(); + result.sourceName = generateRandomString(); + result.date = generateRandomInt64(); + result.teaser = generateRandomString(); + result.thumbnails = QList(); + result.thumbnails.ref() << generateRandomRelatedContentImage(); + result.thumbnails.ref() << generateRandomRelatedContentImage(); + result.thumbnails.ref() << generateRandomRelatedContentImage(); + result.contentType = RelatedContentType::PROFILE_ORGANIZATION; + result.accessType = RelatedContentAccess::NOT_ACCESSIBLE; + result.visibleUrl = generateRandomString(); + result.clipUrl = generateRandomString(); + result.contact = generateRandomContact(); + result.authors = QList(); + result.authors.ref() << generateRandomString(); + result.authors.ref() << generateRandomString(); + result.authors.ref() << generateRandomString(); + return result; +} + +BusinessInvitation generateRandomBusinessInvitation() +{ + BusinessInvitation result; + result.businessId = generateRandomInt32(); + result.email = generateRandomString(); + result.role = BusinessUserRole::ADMIN; + result.status = BusinessInvitationStatus::REDEEMED; + result.requesterId = generateRandomInt32(); + result.fromWorkChat = generateRandomBool(); + result.created = generateRandomInt64(); + result.mostRecentReminder = generateRandomInt64(); + return result; +} + +UserIdentity generateRandomUserIdentity() +{ + UserIdentity result; + result.type = UserIdentityType::EMAIL; + result.stringIdentifier = generateRandomString(); + result.longIdentifier = generateRandomInt64(); + return result; +} + +PublicUserInfo generateRandomPublicUserInfo() +{ + PublicUserInfo result; + result.userId = generateRandomInt32(); + result.serviceLevel = ServiceLevel::BUSINESS; + result.username = generateRandomString(); + result.noteStoreUrl = generateRandomString(); + result.webApiUrlPrefix = generateRandomString(); + return result; +} + +UserUrls generateRandomUserUrls() +{ + UserUrls result; + result.noteStoreUrl = generateRandomString(); + result.webApiUrlPrefix = generateRandomString(); + result.userStoreUrl = generateRandomString(); + result.utilityUrl = generateRandomString(); + result.messageStoreUrl = generateRandomString(); + result.userWebSocketUrl = generateRandomString(); + return result; +} + +AuthenticationResult generateRandomAuthenticationResult() +{ + AuthenticationResult result; + result.currentTime = generateRandomInt64(); + result.authenticationToken = generateRandomString(); + result.expiration = generateRandomInt64(); + result.user = generateRandomUser(); + result.publicUserInfo = generateRandomPublicUserInfo(); + result.noteStoreUrl = generateRandomString(); + result.webApiUrlPrefix = generateRandomString(); + result.secondFactorRequired = generateRandomBool(); + result.secondFactorDeliveryHint = generateRandomString(); + result.urls = generateRandomUserUrls(); + return result; +} + +BootstrapSettings generateRandomBootstrapSettings() +{ + BootstrapSettings result; + result.serviceHost = generateRandomString(); + result.marketingUrl = generateRandomString(); + result.supportUrl = generateRandomString(); + result.accountEmailDomain = generateRandomString(); + result.enableFacebookSharing = generateRandomBool(); + result.enableGiftSubscriptions = generateRandomBool(); + result.enableSupportTickets = generateRandomBool(); + result.enableSharedNotebooks = generateRandomBool(); + result.enableSingleNoteSharing = generateRandomBool(); + result.enableSponsoredAccounts = generateRandomBool(); + result.enableTwitterSharing = generateRandomBool(); + result.enableLinkedInSharing = generateRandomBool(); + result.enablePublicNotebooks = generateRandomBool(); + result.enableGoogle = generateRandomBool(); + return result; +} + +BootstrapProfile generateRandomBootstrapProfile() +{ + BootstrapProfile result; + result.name = generateRandomString(); + result.settings = generateRandomBootstrapSettings(); + return result; +} + +BootstrapInfo generateRandomBootstrapInfo() +{ + BootstrapInfo result; + result.profiles << generateRandomBootstrapProfile(); + result.profiles << generateRandomBootstrapProfile(); + result.profiles << generateRandomBootstrapProfile(); + return result; +} + +} // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.h b/QEverCloud/src/tests/generated/RandomDataGenerators.h new file mode 100644 index 00000000..f8087a2f --- /dev/null +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.h @@ -0,0 +1,195 @@ +/** + * Original work: Copyright (c) 2014 Sergey Skoblikov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: + * https://opensource.org/licenses/MIT + * + * This file was generated from Evernote Thrift API + */ + +#ifndef QEVERCLOUD_GENERATED_RANDOMDATAGENERATORS_H +#define QEVERCLOUD_GENERATED_RANDOMDATAGENERATORS_H + +#include + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + +QString generateRandomString(int len = 10); + +qint8 generateRandomInt8(); + +qint16 generateRandomInt16(); + +qint32 generateRandomInt32(); + +qint64 generateRandomInt64(); + +quint8 generateRandomUint8(); + +quint16 generateRandomUint16(); + +quint32 generateRandomUint32(); + +quint64 generateRandomUint64(); + +double generateRandomDouble(); + +bool generateRandomBool(); + +//////////////////////////////////////////////////////////////////////////////// + +SyncState generateRandomSyncState(); + +SyncChunk generateRandomSyncChunk(); + +SyncChunkFilter generateRandomSyncChunkFilter(); + +NoteFilter generateRandomNoteFilter(); + +NoteList generateRandomNoteList(); + +NoteMetadata generateRandomNoteMetadata(); + +NotesMetadataList generateRandomNotesMetadataList(); + +NotesMetadataResultSpec generateRandomNotesMetadataResultSpec(); + +NoteCollectionCounts generateRandomNoteCollectionCounts(); + +NoteResultSpec generateRandomNoteResultSpec(); + +NoteEmailParameters generateRandomNoteEmailParameters(); + +NoteVersionId generateRandomNoteVersionId(); + +RelatedQuery generateRandomRelatedQuery(); + +RelatedResult generateRandomRelatedResult(); + +RelatedResultSpec generateRandomRelatedResultSpec(); + +UpdateNoteIfUsnMatchesResult generateRandomUpdateNoteIfUsnMatchesResult(); + +ShareRelationshipRestrictions generateRandomShareRelationshipRestrictions(); + +InvitationShareRelationship generateRandomInvitationShareRelationship(); + +MemberShareRelationship generateRandomMemberShareRelationship(); + +ShareRelationships generateRandomShareRelationships(); + +ManageNotebookSharesParameters generateRandomManageNotebookSharesParameters(); + +ManageNotebookSharesError generateRandomManageNotebookSharesError(); + +ManageNotebookSharesResult generateRandomManageNotebookSharesResult(); + +SharedNoteTemplate generateRandomSharedNoteTemplate(); + +NotebookShareTemplate generateRandomNotebookShareTemplate(); + +CreateOrUpdateNotebookSharesResult generateRandomCreateOrUpdateNotebookSharesResult(); + +NoteShareRelationshipRestrictions generateRandomNoteShareRelationshipRestrictions(); + +NoteMemberShareRelationship generateRandomNoteMemberShareRelationship(); + +NoteInvitationShareRelationship generateRandomNoteInvitationShareRelationship(); + +NoteShareRelationships generateRandomNoteShareRelationships(); + +ManageNoteSharesParameters generateRandomManageNoteSharesParameters(); + +ManageNoteSharesError generateRandomManageNoteSharesError(); + +ManageNoteSharesResult generateRandomManageNoteSharesResult(); + +Data generateRandomData(); + +UserAttributes generateRandomUserAttributes(); + +BusinessUserAttributes generateRandomBusinessUserAttributes(); + +Accounting generateRandomAccounting(); + +BusinessUserInfo generateRandomBusinessUserInfo(); + +AccountLimits generateRandomAccountLimits(); + +User generateRandomUser(); + +Contact generateRandomContact(); + +Identity generateRandomIdentity(); + +Tag generateRandomTag(); + +LazyMap generateRandomLazyMap(); + +ResourceAttributes generateRandomResourceAttributes(); + +Resource generateRandomResource(); + +NoteAttributes generateRandomNoteAttributes(); + +SharedNote generateRandomSharedNote(); + +NoteRestrictions generateRandomNoteRestrictions(); + +NoteLimits generateRandomNoteLimits(); + +Note generateRandomNote(); + +Publishing generateRandomPublishing(); + +BusinessNotebook generateRandomBusinessNotebook(); + +SavedSearchScope generateRandomSavedSearchScope(); + +SavedSearch generateRandomSavedSearch(); + +SharedNotebookRecipientSettings generateRandomSharedNotebookRecipientSettings(); + +NotebookRecipientSettings generateRandomNotebookRecipientSettings(); + +SharedNotebook generateRandomSharedNotebook(); + +CanMoveToContainerRestrictions generateRandomCanMoveToContainerRestrictions(); + +NotebookRestrictions generateRandomNotebookRestrictions(); + +Notebook generateRandomNotebook(); + +LinkedNotebook generateRandomLinkedNotebook(); + +NotebookDescriptor generateRandomNotebookDescriptor(); + +UserProfile generateRandomUserProfile(); + +RelatedContentImage generateRandomRelatedContentImage(); + +RelatedContent generateRandomRelatedContent(); + +BusinessInvitation generateRandomBusinessInvitation(); + +UserIdentity generateRandomUserIdentity(); + +PublicUserInfo generateRandomPublicUserInfo(); + +UserUrls generateRandomUserUrls(); + +AuthenticationResult generateRandomAuthenticationResult(); + +BootstrapSettings generateRandomBootstrapSettings(); + +BootstrapProfile generateRandomBootstrapProfile(); + +BootstrapInfo generateRandomBootstrapInfo(); + +} // namespace qevercloud + +#endif // QEVERCLOUD_GENERATED_RANDOMDATAGENERATORS_H diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 8289d287..494487f8 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -11,7 +11,8 @@ #include "TestNoteStore.h" #include "../../Impl.h" -#include "../Common.h" +#include "../SocketHelpers.h" +#include "RandomDataGenerators.h" #include #include #include @@ -3899,7 +3900,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncState response = tests::generateSyncState(); + SyncState response = generateRandomSyncState(); NoteStoreGetSyncStateTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -3940,7 +3941,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -3957,7 +3958,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -3973,13 +3974,13 @@ void NoteStoreTester::shouldExecuteGetSyncState() void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() { - qint32 afterUSN = tests::generateRandomInt32(); - qint32 maxEntries = tests::generateRandomInt32(); - SyncChunkFilter filter = tests::generateSyncChunkFilter(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = tests::generateSyncChunk(); + SyncChunk response = generateRandomSyncChunk(); NoteStoreGetFilteredSyncChunkTesterHelper helper( [&] (qint32 afterUSNParam, @@ -4026,7 +4027,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4043,7 +4044,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4062,11 +4063,11 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() { - LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncState response = tests::generateSyncState(); + SyncState response = generateRandomSyncState(); NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -4109,7 +4110,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4126,7 +4127,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4143,14 +4144,14 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() { - LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); - qint32 afterUSN = tests::generateRandomInt32(); - qint32 maxEntries = tests::generateRandomInt32(); - bool fullSyncOnly = tests::generateRandomBool(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = tests::generateSyncChunk(); + SyncChunk response = generateRandomSyncChunk(); NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -4199,7 +4200,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4216,7 +4217,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4240,9 +4241,9 @@ void NoteStoreTester::shouldExecuteListNotebooks() QStringLiteral("authenticationToken")); QList response; - response << tests::generateNotebook(); - response << tests::generateNotebook(); - response << tests::generateNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); NoteStoreListNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -4283,7 +4284,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4300,7 +4301,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4320,9 +4321,9 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QStringLiteral("authenticationToken")); QList response; - response << tests::generateNotebook(); - response << tests::generateNotebook(); - response << tests::generateNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -4363,7 +4364,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4380,7 +4381,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4396,11 +4397,11 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() void NoteStoreTester::shouldExecuteGetNotebook() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = tests::generateNotebook(); + Notebook response = generateRandomNotebook(); NoteStoreGetNotebookTesterHelper helper( [&] (const Guid & guidParam, @@ -4443,7 +4444,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4460,7 +4461,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4480,7 +4481,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = tests::generateNotebook(); + Notebook response = generateRandomNotebook(); NoteStoreGetDefaultNotebookTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -4521,7 +4522,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4538,7 +4539,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4554,11 +4555,11 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() void NoteStoreTester::shouldExecuteCreateNotebook() { - Notebook notebook = tests::generateNotebook(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = tests::generateNotebook(); + Notebook response = generateRandomNotebook(); NoteStoreCreateNotebookTesterHelper helper( [&] (const Notebook & notebookParam, @@ -4601,7 +4602,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4618,7 +4619,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4635,11 +4636,11 @@ void NoteStoreTester::shouldExecuteCreateNotebook() void NoteStoreTester::shouldExecuteUpdateNotebook() { - Notebook notebook = tests::generateNotebook(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateNotebookTesterHelper helper( [&] (const Notebook & notebookParam, @@ -4682,7 +4683,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4699,7 +4700,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4716,11 +4717,11 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() void NoteStoreTester::shouldExecuteExpungeNotebook() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreExpungeNotebookTesterHelper helper( [&] (const Guid & guidParam, @@ -4763,7 +4764,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4780,7 +4781,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4801,9 +4802,9 @@ void NoteStoreTester::shouldExecuteListTags() QStringLiteral("authenticationToken")); QList response; - response << tests::generateTag(); - response << tests::generateTag(); - response << tests::generateTag(); + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); NoteStoreListTagsTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -4844,7 +4845,7 @@ void NoteStoreTester::shouldExecuteListTags() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4861,7 +4862,7 @@ void NoteStoreTester::shouldExecuteListTags() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4877,14 +4878,14 @@ void NoteStoreTester::shouldExecuteListTags() void NoteStoreTester::shouldExecuteListTagsByNotebook() { - Guid notebookGuid = tests::generateRandomString(); + Guid notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); QList response; - response << tests::generateTag(); - response << tests::generateTag(); - response << tests::generateTag(); + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); NoteStoreListTagsByNotebookTesterHelper helper( [&] (const Guid & notebookGuidParam, @@ -4927,7 +4928,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -4944,7 +4945,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -4961,11 +4962,11 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() void NoteStoreTester::shouldExecuteGetTag() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = tests::generateTag(); + Tag response = generateRandomTag(); NoteStoreGetTagTesterHelper helper( [&] (const Guid & guidParam, @@ -5008,7 +5009,7 @@ void NoteStoreTester::shouldExecuteGetTag() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5025,7 +5026,7 @@ void NoteStoreTester::shouldExecuteGetTag() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5042,11 +5043,11 @@ void NoteStoreTester::shouldExecuteGetTag() void NoteStoreTester::shouldExecuteCreateTag() { - Tag tag = tests::generateTag(); + Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = tests::generateTag(); + Tag response = generateRandomTag(); NoteStoreCreateTagTesterHelper helper( [&] (const Tag & tagParam, @@ -5089,7 +5090,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5106,7 +5107,7 @@ void NoteStoreTester::shouldExecuteCreateTag() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5123,11 +5124,11 @@ void NoteStoreTester::shouldExecuteCreateTag() void NoteStoreTester::shouldExecuteUpdateTag() { - Tag tag = tests::generateTag(); + Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, @@ -5170,7 +5171,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5187,7 +5188,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5204,7 +5205,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() void NoteStoreTester::shouldExecuteUntagAll() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -5249,7 +5250,7 @@ void NoteStoreTester::shouldExecuteUntagAll() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5266,7 +5267,7 @@ void NoteStoreTester::shouldExecuteUntagAll() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5282,11 +5283,11 @@ void NoteStoreTester::shouldExecuteUntagAll() void NoteStoreTester::shouldExecuteExpungeTag() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, @@ -5329,7 +5330,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5346,7 +5347,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5367,9 +5368,9 @@ void NoteStoreTester::shouldExecuteListSearches() QStringLiteral("authenticationToken")); QList response; - response << tests::generateSavedSearch(); - response << tests::generateSavedSearch(); - response << tests::generateSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); NoteStoreListSearchesTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -5410,7 +5411,7 @@ void NoteStoreTester::shouldExecuteListSearches() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5427,7 +5428,7 @@ void NoteStoreTester::shouldExecuteListSearches() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5443,11 +5444,11 @@ void NoteStoreTester::shouldExecuteListSearches() void NoteStoreTester::shouldExecuteGetSearch() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SavedSearch response = tests::generateSavedSearch(); + SavedSearch response = generateRandomSavedSearch(); NoteStoreGetSearchTesterHelper helper( [&] (const Guid & guidParam, @@ -5490,7 +5491,7 @@ void NoteStoreTester::shouldExecuteGetSearch() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5507,7 +5508,7 @@ void NoteStoreTester::shouldExecuteGetSearch() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5524,11 +5525,11 @@ void NoteStoreTester::shouldExecuteGetSearch() void NoteStoreTester::shouldExecuteCreateSearch() { - SavedSearch search = tests::generateSavedSearch(); + SavedSearch search = generateRandomSavedSearch(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SavedSearch response = tests::generateSavedSearch(); + SavedSearch response = generateRandomSavedSearch(); NoteStoreCreateSearchTesterHelper helper( [&] (const SavedSearch & searchParam, @@ -5571,7 +5572,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5588,7 +5589,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5605,11 +5606,11 @@ void NoteStoreTester::shouldExecuteCreateSearch() void NoteStoreTester::shouldExecuteUpdateSearch() { - SavedSearch search = tests::generateSavedSearch(); + SavedSearch search = generateRandomSavedSearch(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateSearchTesterHelper helper( [&] (const SavedSearch & searchParam, @@ -5652,7 +5653,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5669,7 +5670,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5686,11 +5687,11 @@ void NoteStoreTester::shouldExecuteUpdateSearch() void NoteStoreTester::shouldExecuteExpungeSearch() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreExpungeSearchTesterHelper helper( [&] (const Guid & guidParam, @@ -5733,7 +5734,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5750,7 +5751,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5767,12 +5768,12 @@ void NoteStoreTester::shouldExecuteExpungeSearch() void NoteStoreTester::shouldExecuteFindNoteOffset() { - NoteFilter filter = tests::generateNoteFilter(); - Guid guid = tests::generateRandomString(); + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreFindNoteOffsetTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -5817,7 +5818,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5834,7 +5835,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5852,14 +5853,14 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() void NoteStoreTester::shouldExecuteFindNotesMetadata() { - NoteFilter filter = tests::generateNoteFilter(); - qint32 offset = tests::generateRandomInt32(); - qint32 maxNotes = tests::generateRandomInt32(); - NotesMetadataResultSpec resultSpec = tests::generateNotesMetadataResultSpec(); + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NotesMetadataList response = tests::generateNotesMetadataList(); + NotesMetadataList response = generateRandomNotesMetadataList(); NoteStoreFindNotesMetadataTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -5908,7 +5909,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -5925,7 +5926,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -5945,12 +5946,12 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() void NoteStoreTester::shouldExecuteFindNoteCounts() { - NoteFilter filter = tests::generateNoteFilter(); - bool withTrash = tests::generateRandomBool(); + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteCollectionCounts response = tests::generateNoteCollectionCounts(); + NoteCollectionCounts response = generateRandomNoteCollectionCounts(); NoteStoreFindNoteCountsTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -5995,7 +5996,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6012,7 +6013,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6030,12 +6031,12 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() { - Guid guid = tests::generateRandomString(); - NoteResultSpec resultSpec = tests::generateNoteResultSpec(); + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreGetNoteWithResultSpecTesterHelper helper( [&] (const Guid & guidParam, @@ -6080,7 +6081,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6097,7 +6098,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6115,15 +6116,15 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() void NoteStoreTester::shouldExecuteGetNote() { - Guid guid = tests::generateRandomString(); - bool withContent = tests::generateRandomBool(); - bool withResourcesData = tests::generateRandomBool(); - bool withResourcesRecognition = tests::generateRandomBool(); - bool withResourcesAlternateData = tests::generateRandomBool(); + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreGetNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -6174,7 +6175,7 @@ void NoteStoreTester::shouldExecuteGetNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6191,7 +6192,7 @@ void NoteStoreTester::shouldExecuteGetNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6212,11 +6213,11 @@ void NoteStoreTester::shouldExecuteGetNote() void NoteStoreTester::shouldExecuteGetNoteApplicationData() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = tests::generateLazyMap(); + LazyMap response = generateRandomLazyMap(); NoteStoreGetNoteApplicationDataTesterHelper helper( [&] (const Guid & guidParam, @@ -6259,7 +6260,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6276,7 +6277,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6293,12 +6294,12 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreGetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -6343,7 +6344,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6360,7 +6361,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6378,13 +6379,13 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); - QString value = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreSetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -6431,7 +6432,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6448,7 +6449,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6467,12 +6468,12 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -6517,7 +6518,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6534,7 +6535,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6552,11 +6553,11 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() void NoteStoreTester::shouldExecuteGetNoteContent() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreGetNoteContentTesterHelper helper( [&] (const Guid & guidParam, @@ -6599,7 +6600,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6616,7 +6617,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6633,13 +6634,13 @@ void NoteStoreTester::shouldExecuteGetNoteContent() void NoteStoreTester::shouldExecuteGetNoteSearchText() { - Guid guid = tests::generateRandomString(); - bool noteOnly = tests::generateRandomBool(); - bool tokenizeForIndexing = tests::generateRandomBool(); + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreGetNoteSearchTextTesterHelper helper( [&] (const Guid & guidParam, @@ -6686,7 +6687,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6703,7 +6704,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6722,11 +6723,11 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() void NoteStoreTester::shouldExecuteGetResourceSearchText() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreGetResourceSearchTextTesterHelper helper( [&] (const Guid & guidParam, @@ -6769,7 +6770,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6786,7 +6787,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6803,14 +6804,14 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() void NoteStoreTester::shouldExecuteGetNoteTagNames() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); QStringList response; - response << tests::generateRandomString(); - response << tests::generateRandomString(); - response << tests::generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); NoteStoreGetNoteTagNamesTesterHelper helper( [&] (const Guid & guidParam, @@ -6853,7 +6854,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6870,7 +6871,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6887,11 +6888,11 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() void NoteStoreTester::shouldExecuteCreateNote() { - Note note = tests::generateNote(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreCreateNoteTesterHelper helper( [&] (const Note & noteParam, @@ -6934,7 +6935,7 @@ void NoteStoreTester::shouldExecuteCreateNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -6951,7 +6952,7 @@ void NoteStoreTester::shouldExecuteCreateNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -6968,11 +6969,11 @@ void NoteStoreTester::shouldExecuteCreateNote() void NoteStoreTester::shouldExecuteUpdateNote() { - Note note = tests::generateNote(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreUpdateNoteTesterHelper helper( [&] (const Note & noteParam, @@ -7015,7 +7016,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7032,7 +7033,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7049,11 +7050,11 @@ void NoteStoreTester::shouldExecuteUpdateNote() void NoteStoreTester::shouldExecuteDeleteNote() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreDeleteNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -7096,7 +7097,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7113,7 +7114,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7130,11 +7131,11 @@ void NoteStoreTester::shouldExecuteDeleteNote() void NoteStoreTester::shouldExecuteExpungeNote() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreExpungeNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -7177,7 +7178,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7194,7 +7195,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7211,12 +7212,12 @@ void NoteStoreTester::shouldExecuteExpungeNote() void NoteStoreTester::shouldExecuteCopyNote() { - Guid noteGuid = tests::generateRandomString(); - Guid toNotebookGuid = tests::generateRandomString(); + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreCopyNoteTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -7261,7 +7262,7 @@ void NoteStoreTester::shouldExecuteCopyNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7278,7 +7279,7 @@ void NoteStoreTester::shouldExecuteCopyNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7296,14 +7297,14 @@ void NoteStoreTester::shouldExecuteCopyNote() void NoteStoreTester::shouldExecuteListNoteVersions() { - Guid noteGuid = tests::generateRandomString(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); QList response; - response << tests::generateNoteVersionId(); - response << tests::generateNoteVersionId(); - response << tests::generateNoteVersionId(); + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); NoteStoreListNoteVersionsTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -7346,7 +7347,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7363,7 +7364,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7380,15 +7381,15 @@ void NoteStoreTester::shouldExecuteListNoteVersions() void NoteStoreTester::shouldExecuteGetNoteVersion() { - Guid noteGuid = tests::generateRandomString(); - qint32 updateSequenceNum = tests::generateRandomInt32(); - bool withResourcesData = tests::generateRandomBool(); - bool withResourcesRecognition = tests::generateRandomBool(); - bool withResourcesAlternateData = tests::generateRandomBool(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = tests::generateNote(); + Note response = generateRandomNote(); NoteStoreGetNoteVersionTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -7439,7 +7440,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7456,7 +7457,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7477,15 +7478,15 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() void NoteStoreTester::shouldExecuteGetResource() { - Guid guid = tests::generateRandomString(); - bool withData = tests::generateRandomBool(); - bool withRecognition = tests::generateRandomBool(); - bool withAttributes = tests::generateRandomBool(); - bool withAlternateData = tests::generateRandomBool(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = tests::generateResource(); + Resource response = generateRandomResource(); NoteStoreGetResourceTesterHelper helper( [&] (const Guid & guidParam, @@ -7536,7 +7537,7 @@ void NoteStoreTester::shouldExecuteGetResource() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7553,7 +7554,7 @@ void NoteStoreTester::shouldExecuteGetResource() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7574,11 +7575,11 @@ void NoteStoreTester::shouldExecuteGetResource() void NoteStoreTester::shouldExecuteGetResourceApplicationData() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = tests::generateLazyMap(); + LazyMap response = generateRandomLazyMap(); NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, @@ -7621,7 +7622,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7638,7 +7639,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7655,12 +7656,12 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -7705,7 +7706,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7722,7 +7723,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7740,13 +7741,13 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); - QString value = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -7793,7 +7794,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7810,7 +7811,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7829,12 +7830,12 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() { - Guid guid = tests::generateRandomString(); - QString key = tests::generateRandomString(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -7879,7 +7880,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7896,7 +7897,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7914,11 +7915,11 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() void NoteStoreTester::shouldExecuteUpdateResource() { - Resource resource = tests::generateResource(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateResourceTesterHelper helper( [&] (const Resource & resourceParam, @@ -7961,7 +7962,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -7978,7 +7979,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -7995,11 +7996,11 @@ void NoteStoreTester::shouldExecuteUpdateResource() void NoteStoreTester::shouldExecuteGetResourceData() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = tests::generateRandomString().toUtf8(); + QByteArray response = generateRandomString().toUtf8(); NoteStoreGetResourceDataTesterHelper helper( [&] (const Guid & guidParam, @@ -8042,7 +8043,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8059,7 +8060,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8076,15 +8077,15 @@ void NoteStoreTester::shouldExecuteGetResourceData() void NoteStoreTester::shouldExecuteGetResourceByHash() { - Guid noteGuid = tests::generateRandomString(); - QByteArray contentHash = tests::generateRandomString().toUtf8(); - bool withData = tests::generateRandomBool(); - bool withRecognition = tests::generateRandomBool(); - bool withAlternateData = tests::generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = tests::generateResource(); + Resource response = generateRandomResource(); NoteStoreGetResourceByHashTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -8135,7 +8136,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8152,7 +8153,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8173,11 +8174,11 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() void NoteStoreTester::shouldExecuteGetResourceRecognition() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = tests::generateRandomString().toUtf8(); + QByteArray response = generateRandomString().toUtf8(); NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, @@ -8220,7 +8221,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8237,7 +8238,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8254,11 +8255,11 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() void NoteStoreTester::shouldExecuteGetResourceAlternateData() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = tests::generateRandomString().toUtf8(); + QByteArray response = generateRandomString().toUtf8(); NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, @@ -8301,7 +8302,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8318,7 +8319,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8335,11 +8336,11 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() void NoteStoreTester::shouldExecuteGetResourceAttributes() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ResourceAttributes response = tests::generateResourceAttributes(); + ResourceAttributes response = generateRandomResourceAttributes(); NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, @@ -8382,7 +8383,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8399,7 +8400,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8416,11 +8417,11 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() void NoteStoreTester::shouldExecuteGetPublicNotebook() { - UserID userId = tests::generateRandomInt32(); - QString publicUri = tests::generateRandomString(); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - Notebook response = tests::generateNotebook(); + Notebook response = generateRandomNotebook(); NoteStoreGetPublicNotebookTesterHelper helper( [&] (const UserID & userIdParam, @@ -8464,7 +8465,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8481,7 +8482,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8499,12 +8500,12 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() void NoteStoreTester::shouldExecuteShareNotebook() { - SharedNotebook sharedNotebook = tests::generateSharedNotebook(); - QString message = tests::generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = tests::generateSharedNotebook(); + SharedNotebook response = generateRandomSharedNotebook(); NoteStoreShareNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -8549,7 +8550,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8566,7 +8567,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8584,11 +8585,11 @@ void NoteStoreTester::shouldExecuteShareNotebook() void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() { - NotebookShareTemplate shareTemplate = tests::generateNotebookShareTemplate(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - CreateOrUpdateNotebookSharesResult response = tests::generateCreateOrUpdateNotebookSharesResult(); + CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( [&] (const NotebookShareTemplate & shareTemplateParam, @@ -8631,7 +8632,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8648,7 +8649,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8665,11 +8666,11 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() void NoteStoreTester::shouldExecuteUpdateSharedNotebook() { - SharedNotebook sharedNotebook = tests::generateSharedNotebook(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateSharedNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -8712,7 +8713,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8729,7 +8730,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8746,12 +8747,12 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() { - QString notebookGuid = tests::generateRandomString(); - NotebookRecipientSettings recipientSettings = tests::generateNotebookRecipientSettings(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = tests::generateNotebook(); + Notebook response = generateRandomNotebook(); NoteStoreSetNotebookRecipientSettingsTesterHelper helper( [&] (const QString & notebookGuidParam, @@ -8796,7 +8797,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8813,7 +8814,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8835,9 +8836,9 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() QStringLiteral("authenticationToken")); QList response; - response << tests::generateSharedNotebook(); - response << tests::generateSharedNotebook(); - response << tests::generateSharedNotebook(); + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); NoteStoreListSharedNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -8878,7 +8879,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8895,7 +8896,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8911,11 +8912,11 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() void NoteStoreTester::shouldExecuteCreateLinkedNotebook() { - LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LinkedNotebook response = tests::generateLinkedNotebook(); + LinkedNotebook response = generateRandomLinkedNotebook(); NoteStoreCreateLinkedNotebookTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -8958,7 +8959,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -8975,7 +8976,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -8992,11 +8993,11 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() { - LinkedNotebook linkedNotebook = tests::generateLinkedNotebook(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreUpdateLinkedNotebookTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -9039,7 +9040,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9056,7 +9057,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9077,9 +9078,9 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QStringLiteral("authenticationToken")); QList response; - response << tests::generateLinkedNotebook(); - response << tests::generateLinkedNotebook(); - response << tests::generateLinkedNotebook(); + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); NoteStoreListLinkedNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -9120,7 +9121,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9137,7 +9138,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9153,11 +9154,11 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = tests::generateRandomInt32(); + qint32 response = generateRandomInt32(); NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, @@ -9200,7 +9201,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9217,7 +9218,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9234,11 +9235,11 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() { - QString shareKeyOrGlobalId = tests::generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = tests::generateAuthenticationResult(); + AuthenticationResult response = generateRandomAuthenticationResult(); NoteStoreAuthenticateToSharedNotebookTesterHelper helper( [&] (const QString & shareKeyOrGlobalIdParam, @@ -9281,7 +9282,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9298,7 +9299,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9318,7 +9319,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = tests::generateSharedNotebook(); + SharedNotebook response = generateRandomSharedNotebook(); NoteStoreGetSharedNotebookByAuthTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -9359,7 +9360,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9376,7 +9377,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9392,7 +9393,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() void NoteStoreTester::shouldExecuteEmailNote() { - NoteEmailParameters parameters = tests::generateNoteEmailParameters(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -9437,7 +9438,7 @@ void NoteStoreTester::shouldExecuteEmailNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9454,7 +9455,7 @@ void NoteStoreTester::shouldExecuteEmailNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9470,11 +9471,11 @@ void NoteStoreTester::shouldExecuteEmailNote() void NoteStoreTester::shouldExecuteShareNote() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = tests::generateRandomString(); + QString response = generateRandomString(); NoteStoreShareNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -9517,7 +9518,7 @@ void NoteStoreTester::shouldExecuteShareNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9534,7 +9535,7 @@ void NoteStoreTester::shouldExecuteShareNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9551,7 +9552,7 @@ void NoteStoreTester::shouldExecuteShareNote() void NoteStoreTester::shouldExecuteStopSharingNote() { - Guid guid = tests::generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -9596,7 +9597,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9613,7 +9614,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9629,12 +9630,12 @@ void NoteStoreTester::shouldExecuteStopSharingNote() void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() { - QString guid = tests::generateRandomString(); - QString noteKey = tests::generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = tests::generateAuthenticationResult(); + AuthenticationResult response = generateRandomAuthenticationResult(); NoteStoreAuthenticateToSharedNoteTesterHelper helper( [&] (const QString & guidParam, @@ -9679,7 +9680,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9696,7 +9697,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9714,12 +9715,12 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() void NoteStoreTester::shouldExecuteFindRelated() { - RelatedQuery query = tests::generateRelatedQuery(); - RelatedResultSpec resultSpec = tests::generateRelatedResultSpec(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - RelatedResult response = tests::generateRelatedResult(); + RelatedResult response = generateRandomRelatedResult(); NoteStoreFindRelatedTesterHelper helper( [&] (const RelatedQuery & queryParam, @@ -9764,7 +9765,7 @@ void NoteStoreTester::shouldExecuteFindRelated() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9781,7 +9782,7 @@ void NoteStoreTester::shouldExecuteFindRelated() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9799,11 +9800,11 @@ void NoteStoreTester::shouldExecuteFindRelated() void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() { - Note note = tests::generateNote(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UpdateNoteIfUsnMatchesResult response = tests::generateUpdateNoteIfUsnMatchesResult(); + UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( [&] (const Note & noteParam, @@ -9846,7 +9847,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9863,7 +9864,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9880,11 +9881,11 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() void NoteStoreTester::shouldExecuteManageNotebookShares() { - ManageNotebookSharesParameters parameters = tests::generateManageNotebookSharesParameters(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ManageNotebookSharesResult response = tests::generateManageNotebookSharesResult(); + ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); NoteStoreManageNotebookSharesTesterHelper helper( [&] (const ManageNotebookSharesParameters & parametersParam, @@ -9927,7 +9928,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -9944,7 +9945,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -9961,11 +9962,11 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() void NoteStoreTester::shouldExecuteGetNotebookShares() { - QString notebookGuid = tests::generateRandomString(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ShareRelationships response = tests::generateShareRelationships(); + ShareRelationships response = generateRandomShareRelationships(); NoteStoreGetNotebookSharesTesterHelper helper( [&] (const QString & notebookGuidParam, @@ -10008,7 +10009,7 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -10025,7 +10026,7 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); diff --git a/QEverCloud/src/tests/generated/TestNoteStore.h b/QEverCloud/src/tests/generated/TestNoteStore.h index ba460458..a831b122 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.h +++ b/QEverCloud/src/tests/generated/TestNoteStore.h @@ -12,7 +12,7 @@ #ifndef QEVERCLOUD_GENERATED_TESTNOTESTORE_H #define QEVERCLOUD_GENERATED_TESTNOTESTORE_H -#include "../Common.h" +#include "../SocketHelpers.h" #include namespace qevercloud { diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index f5543ec2..010c7015 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -11,7 +11,8 @@ #include "TestUserStore.h" #include "../../Impl.h" -#include "../Common.h" +#include "../SocketHelpers.h" +#include "RandomDataGenerators.h" #include #include #include @@ -800,12 +801,12 @@ public Q_SLOTS: void UserStoreTester::shouldExecuteCheckVersion() { - QString clientName = tests::generateRandomString(); - qint16 edamVersionMajor = tests::generateRandomInt16(); - qint16 edamVersionMinor = tests::generateRandomInt16(); + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); IRequestContextPtr ctx = newRequestContext(); - bool response = tests::generateRandomBool(); + bool response = generateRandomBool(); UserStoreCheckVersionTesterHelper helper( [&] (const QString & clientNameParam, @@ -851,7 +852,7 @@ void UserStoreTester::shouldExecuteCheckVersion() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -868,7 +869,7 @@ void UserStoreTester::shouldExecuteCheckVersion() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -889,10 +890,10 @@ void UserStoreTester::shouldExecuteCheckVersion() void UserStoreTester::shouldExecuteGetBootstrapInfo() { - QString locale = tests::generateRandomString(); + QString locale = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - BootstrapInfo response = tests::generateBootstrapInfo(); + BootstrapInfo response = generateRandomBootstrapInfo(); UserStoreGetBootstrapInfoTesterHelper helper( [&] (const QString & localeParam, @@ -934,7 +935,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -951,7 +952,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -970,16 +971,16 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() void UserStoreTester::shouldExecuteAuthenticateLongSession() { - QString username = tests::generateRandomString(); - QString password = tests::generateRandomString(); - QString consumerKey = tests::generateRandomString(); - QString consumerSecret = tests::generateRandomString(); - QString deviceIdentifier = tests::generateRandomString(); - QString deviceDescription = tests::generateRandomString(); - bool supportsTwoFactor = tests::generateRandomBool(); + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); IRequestContextPtr ctx = newRequestContext(); - AuthenticationResult response = tests::generateAuthenticationResult(); + AuthenticationResult response = generateRandomAuthenticationResult(); UserStoreAuthenticateLongSessionTesterHelper helper( [&] (const QString & usernameParam, @@ -1033,7 +1034,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1050,7 +1051,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1075,13 +1076,13 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() { - QString oneTimeCode = tests::generateRandomString(); - QString deviceIdentifier = tests::generateRandomString(); - QString deviceDescription = tests::generateRandomString(); + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = tests::generateAuthenticationResult(); + AuthenticationResult response = generateRandomAuthenticationResult(); UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( [&] (const QString & oneTimeCodeParam, @@ -1128,7 +1129,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1145,7 +1146,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1208,7 +1209,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1225,7 +1226,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1245,7 +1246,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = tests::generateAuthenticationResult(); + AuthenticationResult response = generateRandomAuthenticationResult(); UserStoreAuthenticateToBusinessTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -1286,7 +1287,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1303,7 +1304,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1324,7 +1325,7 @@ void UserStoreTester::shouldExecuteGetUser() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - User response = tests::generateUser(); + User response = generateRandomUser(); UserStoreGetUserTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -1365,7 +1366,7 @@ void UserStoreTester::shouldExecuteGetUser() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1382,7 +1383,7 @@ void UserStoreTester::shouldExecuteGetUser() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1400,10 +1401,10 @@ void UserStoreTester::shouldExecuteGetUser() void UserStoreTester::shouldExecuteGetPublicUserInfo() { - QString username = tests::generateRandomString(); + QString username = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - PublicUserInfo response = tests::generatePublicUserInfo(); + PublicUserInfo response = generateRandomPublicUserInfo(); UserStoreGetPublicUserInfoTesterHelper helper( [&] (const QString & usernameParam, @@ -1445,7 +1446,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1462,7 +1463,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1484,7 +1485,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserUrls response = tests::generateUserUrls(); + UserUrls response = generateRandomUserUrls(); UserStoreGetUserUrlsTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -1525,7 +1526,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1542,7 +1543,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1560,7 +1561,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() void UserStoreTester::shouldExecuteInviteToBusiness() { - QString emailAddress = tests::generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -1605,7 +1606,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1622,7 +1623,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1640,7 +1641,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() void UserStoreTester::shouldExecuteRemoveFromBusiness() { - QString emailAddress = tests::generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -1685,7 +1686,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1702,7 +1703,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1720,8 +1721,8 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() { - QString oldEmailAddress = tests::generateRandomString(); - QString newEmailAddress = tests::generateRandomString(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -1768,7 +1769,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1785,7 +1786,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1808,9 +1809,9 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QStringLiteral("authenticationToken")); QList response; - response << tests::generateUserProfile(); - response << tests::generateUserProfile(); - response << tests::generateUserProfile(); + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); UserStoreListBusinessUsersTesterHelper helper( [&] (IRequestContextPtr ctxParam) @@ -1851,7 +1852,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1868,7 +1869,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1886,14 +1887,14 @@ void UserStoreTester::shouldExecuteListBusinessUsers() void UserStoreTester::shouldExecuteListBusinessInvitations() { - bool includeRequestedInvitations = tests::generateRandomBool(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); QList response; - response << tests::generateBusinessInvitation(); - response << tests::generateBusinessInvitation(); - response << tests::generateBusinessInvitation(); + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); UserStoreListBusinessInvitationsTesterHelper helper( [&] (bool includeRequestedInvitationsParam, @@ -1936,7 +1937,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -1953,7 +1954,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); @@ -1972,10 +1973,10 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() void UserStoreTester::shouldExecuteGetAccountLimits() { - ServiceLevel serviceLevel = ServiceLevel::BASIC; + ServiceLevel serviceLevel = ServiceLevel::BUSINESS; IRequestContextPtr ctx = newRequestContext(); - AccountLimits response = tests::generateAccountLimits(); + AccountLimits response = generateRandomAccountLimits(); UserStoreGetAccountLimitsTesterHelper helper( [&] (const ServiceLevel & serviceLevelParam, @@ -2017,7 +2018,7 @@ void UserStoreTester::shouldExecuteGetAccountLimits() QFAIL("Failed to establish connection"); } - QByteArray requestData = tests::readThriftRequestFromSocket(*pSocket); + QByteArray requestData = readThriftRequestFromSocket(*pSocket); server.onRequest(requestData); }); @@ -2034,7 +2035,7 @@ void UserStoreTester::shouldExecuteGetAccountLimits() buffer.append("Content-Type: application/x-thrift\r\n\r\n"); buffer.append(responseData); - if (!tests::writeBufferToSocket(buffer, *pSocket)) { + if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } }); diff --git a/QEverCloud/src/tests/generated/TestUserStore.h b/QEverCloud/src/tests/generated/TestUserStore.h index d1cde949..bb66f96f 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.h +++ b/QEverCloud/src/tests/generated/TestUserStore.h @@ -12,7 +12,7 @@ #ifndef QEVERCLOUD_GENERATED_TESTUSERSTORE_H #define QEVERCLOUD_GENERATED_TESTUSERSTORE_H -#include "../Common.h" +#include "../SocketHelpers.h" #include namespace qevercloud { From ad856d774dcb7c9070f2a7eb647dd32546394ddb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 29 Nov 2019 22:51:24 +0300 Subject: [PATCH 087/188] Update generated code --- .../tests/generated/RandomDataGenerators.cpp | 76 +++++++++++-------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp index bfcde439..572065f0 100644 --- a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -194,9 +194,9 @@ SyncChunkFilter generateRandomSyncChunkFilter() result.omitSharedNotebooks = generateRandomBool(); result.requireNoteContentClass = generateRandomString(); result.notebookGuids = QSet(); - Q_UNUSED(result.notebookGuids->insert(generateRandomString())) - Q_UNUSED(result.notebookGuids->insert(generateRandomString())) - Q_UNUSED(result.notebookGuids->insert(generateRandomString())) + result.notebookGuids->insert(generateRandomString()); + result.notebookGuids->insert(generateRandomString()); + result.notebookGuids->insert(generateRandomString()); return result; } @@ -419,9 +419,9 @@ RelatedResultSpec generateRandomRelatedResultSpec() result.maxExperts = generateRandomInt32(); result.maxRelatedContent = generateRandomInt32(); result.relatedContentTypes = QSet(); - Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::REFERENCE_MATERIAL)) - Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE)) - Q_UNUSED(result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON)) + result.relatedContentTypes->insert(RelatedContentType::REFERENCE_MATERIAL); + result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE); + result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); return result; } @@ -504,6 +504,12 @@ ManageNotebookSharesError generateRandomManageNotebookSharesError() { ManageNotebookSharesError result; result.userIdentity = generateRandomUserIdentity(); + result.userException = EDAMUserException(); + result.userException->errorCode = EDAMErrorCode::AUTH_EXPIRED; + result.userException->parameter = generateRandomString(); + result.notFoundException = EDAMNotFoundException(); + result.notFoundException->identifier = generateRandomString(); + result.notFoundException->key = generateRandomString(); return result; } @@ -526,7 +532,7 @@ SharedNoteTemplate generateRandomSharedNoteTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; return result; } @@ -539,7 +545,7 @@ NotebookShareTemplate generateRandomNotebookShareTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS; return result; } @@ -568,7 +574,7 @@ NoteMemberShareRelationship generateRandomNoteMemberShareRelationship() NoteMemberShareRelationship result; result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); - result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; result.restrictions = generateRandomNoteShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -579,7 +585,7 @@ NoteInvitationShareRelationship generateRandomNoteInvitationShareRelationship() NoteInvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientIdentityId = generateRandomInt64(); - result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; result.sharerUserId = generateRandomInt32(); return result; } @@ -627,6 +633,12 @@ ManageNoteSharesError generateRandomManageNoteSharesError() ManageNoteSharesError result; result.identityID = generateRandomInt64(); result.userID = generateRandomInt32(); + result.userException = EDAMUserException(); + result.userException->errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + result.userException->parameter = generateRandomString(); + result.notFoundException = EDAMNotFoundException(); + result.notFoundException->identifier = generateRandomString(); + result.notFoundException->key = generateRandomString(); return result; } @@ -714,7 +726,7 @@ Accounting generateRandomAccounting() Accounting result; result.uploadLimitEnd = generateRandomInt64(); result.uploadLimitNextMonth = generateRandomInt64(); - result.premiumServiceStatus = PremiumOrderStatus::FAILED; + result.premiumServiceStatus = PremiumOrderStatus::PENDING; result.premiumOrderNumber = generateRandomString(); result.premiumCommerceService = generateRandomString(); result.premiumServiceStart = generateRandomInt64(); @@ -774,8 +786,8 @@ User generateRandomUser() result.email = generateRandomString(); result.name = generateRandomString(); result.timezone = generateRandomString(); - result.privilege = PrivilegeLevel::VIP; - result.serviceLevel = ServiceLevel::PLUS; + result.privilege = PrivilegeLevel::ADMIN; + result.serviceLevel = ServiceLevel::BUSINESS; result.created = generateRandomInt64(); result.updated = generateRandomInt64(); result.deleted = generateRandomInt64(); @@ -795,7 +807,7 @@ Contact generateRandomContact() Contact result; result.name = generateRandomString(); result.id = generateRandomString(); - result.type = ContactType::LINKEDIN; + result.type = ContactType::SMS; result.photoUrl = generateRandomString(); result.photoLastUpdated = generateRandomInt64(); result.messagingPermit = generateRandomString().toUtf8(); @@ -831,9 +843,9 @@ LazyMap generateRandomLazyMap() { LazyMap result; result.keysOnly = QSet(); - Q_UNUSED(result.keysOnly->insert(generateRandomString())) - Q_UNUSED(result.keysOnly->insert(generateRandomString())) - Q_UNUSED(result.keysOnly->insert(generateRandomString())) + result.keysOnly->insert(generateRandomString()); + result.keysOnly->insert(generateRandomString()); + result.keysOnly->insert(generateRandomString()); result.fullMap = QMap(); result.fullMap.ref()[generateRandomString()] = generateRandomString(); result.fullMap.ref()[generateRandomString()] = generateRandomString(); @@ -913,7 +925,7 @@ SharedNote generateRandomSharedNote() SharedNote result; result.sharerUserID = generateRandomInt32(); result.recipientIdentity = generateRandomIdentity(); - result.privilege = SharedNotePrivilegeLevel::READ_NOTE; + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; result.serviceCreated = generateRandomInt64(); result.serviceUpdated = generateRandomInt64(); result.serviceAssigned = generateRandomInt64(); @@ -982,7 +994,7 @@ Publishing generateRandomPublishing() { Publishing result; result.uri = generateRandomString(); - result.order = NoteSortOrder::RELEVANCE; + result.order = NoteSortOrder::TITLE; result.ascending = generateRandomBool(); result.publicDescription = generateRandomString(); return result; @@ -992,7 +1004,7 @@ BusinessNotebook generateRandomBusinessNotebook() { BusinessNotebook result; result.notebookDescription = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = SharedNotebookPrivilegeLevel::GROUP; result.recommended = generateRandomBool(); return result; } @@ -1012,7 +1024,7 @@ SavedSearch generateRandomSavedSearch() result.guid = generateRandomString(); result.name = generateRandomString(); result.query = generateRandomString(); - result.format = QueryFormat::USER; + result.format = QueryFormat::SEXP; result.updateSequenceNum = generateRandomInt32(); result.scope = generateRandomSavedSearchScope(); return result; @@ -1033,7 +1045,7 @@ NotebookRecipientSettings generateRandomNotebookRecipientSettings() result.reminderNotifyInApp = generateRandomBool(); result.inMyList = generateRandomBool(); result.stack = generateRandomString(); - result.recipientStatus = RecipientStatus::NOT_IN_MY_LIST; + result.recipientStatus = RecipientStatus::IN_MY_LIST; return result; } @@ -1050,7 +1062,7 @@ SharedNotebook generateRandomSharedNotebook() result.serviceUpdated = generateRandomInt64(); result.globalId = generateRandomString(); result.username = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::GROUP; + result.privilege = SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS; result.recipientSettings = generateRandomSharedNotebookRecipientSettings(); result.sharerUserId = generateRandomInt32(); result.recipientUsername = generateRandomString(); @@ -1062,7 +1074,7 @@ SharedNotebook generateRandomSharedNotebook() CanMoveToContainerRestrictions generateRandomCanMoveToContainerRestrictions() { CanMoveToContainerRestrictions result; - result.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; + result.canMoveToContainer = CanMoveToContainerStatus::CAN_BE_MOVED; return result; } @@ -1087,8 +1099,8 @@ NotebookRestrictions generateRandomNotebookRestrictions() result.noExpungeTags = generateRandomBool(); result.noSetParentTag = generateRandomBool(); result.noCreateSharedNotebooks = generateRandomBool(); - result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; - result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; + result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; + result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; result.noShareNotesWithBusiness = generateRandomBool(); result.noRenameNotebook = generateRandomBool(); result.noSetInMyList = generateRandomBool(); @@ -1168,7 +1180,7 @@ UserProfile generateRandomUserProfile() result.photoLastUpdated = generateRandomInt64(); result.photoUrl = generateRandomString(); result.role = BusinessUserRole::ADMIN; - result.status = BusinessUserStatus::DEACTIVATED; + result.status = BusinessUserStatus::ACTIVE; return result; } @@ -1200,7 +1212,7 @@ RelatedContent generateRandomRelatedContent() result.thumbnails.ref() << generateRandomRelatedContentImage(); result.thumbnails.ref() << generateRandomRelatedContentImage(); result.contentType = RelatedContentType::PROFILE_ORGANIZATION; - result.accessType = RelatedContentAccess::NOT_ACCESSIBLE; + result.accessType = RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED; result.visibleUrl = generateRandomString(); result.clipUrl = generateRandomString(); result.contact = generateRandomContact(); @@ -1216,8 +1228,8 @@ BusinessInvitation generateRandomBusinessInvitation() BusinessInvitation result; result.businessId = generateRandomInt32(); result.email = generateRandomString(); - result.role = BusinessUserRole::ADMIN; - result.status = BusinessInvitationStatus::REDEEMED; + result.role = BusinessUserRole::NORMAL; + result.status = BusinessInvitationStatus::APPROVED; result.requesterId = generateRandomInt32(); result.fromWorkChat = generateRandomBool(); result.created = generateRandomInt64(); @@ -1228,7 +1240,7 @@ BusinessInvitation generateRandomBusinessInvitation() UserIdentity generateRandomUserIdentity() { UserIdentity result; - result.type = UserIdentityType::EMAIL; + result.type = UserIdentityType::IDENTITYID; result.stringIdentifier = generateRandomString(); result.longIdentifier = generateRandomInt64(); return result; @@ -1238,7 +1250,7 @@ PublicUserInfo generateRandomPublicUserInfo() { PublicUserInfo result; result.userId = generateRandomInt32(); - result.serviceLevel = ServiceLevel::BUSINESS; + result.serviceLevel = ServiceLevel::PREMIUM; result.username = generateRandomString(); result.noteStoreUrl = generateRandomString(); result.webApiUrlPrefix = generateRandomString(); From 98a322b93acfcab7c92c18bfb2aa26e842a472ec Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 19:05:53 +0300 Subject: [PATCH 088/188] Update generated code --- QEverCloud/src/generated/Servers.cpp | 993 + .../tests/generated/RandomDataGenerators.cpp | 48 +- .../src/tests/generated/TestNoteStore.cpp | 23003 +++++++++++++++- .../src/tests/generated/TestNoteStore.h | 214 + .../src/tests/generated/TestUserStore.cpp | 3008 +- .../src/tests/generated/TestUserStore.h | 28 + 6 files changed, 25681 insertions(+), 1613 deletions(-) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index 33393c81..4bbd153a 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -6772,6 +6772,9 @@ void NoteStoreServer::onGetSyncStateRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getSyncStateRequestReady( + writer.buffer()); return; } catch(...) @@ -6807,6 +6810,9 @@ void NoteStoreServer::onGetSyncStateRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSyncStateRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -6822,6 +6828,9 @@ void NoteStoreServer::onGetSyncStateRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSyncStateRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -6874,6 +6883,9 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getFilteredSyncChunkRequestReady( + writer.buffer()); return; } catch(...) @@ -6909,6 +6921,9 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getFilteredSyncChunkRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -6924,6 +6939,9 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getFilteredSyncChunkRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -6976,6 +6994,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + writer.buffer()); return; } catch(...) @@ -7011,6 +7032,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7026,6 +7050,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7041,6 +7068,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncStateRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7093,6 +7123,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + writer.buffer()); return; } catch(...) @@ -7128,6 +7161,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7143,6 +7179,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7158,6 +7197,9 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getLinkedNotebookSyncChunkRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7210,6 +7252,9 @@ void NoteStoreServer::onListNotebooksRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listNotebooksRequestReady( + writer.buffer()); return; } catch(...) @@ -7245,6 +7290,9 @@ void NoteStoreServer::onListNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7260,6 +7308,9 @@ void NoteStoreServer::onListNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNotebooksRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7316,6 +7367,9 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + writer.buffer()); return; } catch(...) @@ -7351,6 +7405,9 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7366,6 +7423,9 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listAccessibleBusinessNotebooksRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7422,6 +7482,9 @@ void NoteStoreServer::onGetNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -7457,6 +7520,9 @@ void NoteStoreServer::onGetNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7472,6 +7538,9 @@ void NoteStoreServer::onGetNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7487,6 +7556,9 @@ void NoteStoreServer::onGetNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7539,6 +7611,9 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getDefaultNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -7574,6 +7649,9 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getDefaultNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7589,6 +7667,9 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getDefaultNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7641,6 +7722,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -7676,6 +7760,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7691,6 +7778,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7706,6 +7796,9 @@ void NoteStoreServer::onCreateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7758,6 +7851,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -7793,6 +7889,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7808,6 +7907,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7823,6 +7925,9 @@ void NoteStoreServer::onUpdateNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7875,6 +7980,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT expungeNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -7910,6 +8018,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -7925,6 +8036,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -7940,6 +8054,9 @@ void NoteStoreServer::onExpungeNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -7992,6 +8109,9 @@ void NoteStoreServer::onListTagsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listTagsRequestReady( + writer.buffer()); return; } catch(...) @@ -8027,6 +8147,9 @@ void NoteStoreServer::onListTagsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8042,6 +8165,9 @@ void NoteStoreServer::onListTagsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8098,6 +8224,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listTagsByNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -8133,6 +8262,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsByNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8148,6 +8280,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsByNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8163,6 +8298,9 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listTagsByNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8219,6 +8357,9 @@ void NoteStoreServer::onGetTagRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getTagRequestReady( + writer.buffer()); return; } catch(...) @@ -8254,6 +8395,9 @@ void NoteStoreServer::onGetTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getTagRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8269,6 +8413,9 @@ void NoteStoreServer::onGetTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getTagRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8284,6 +8431,9 @@ void NoteStoreServer::onGetTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getTagRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8336,6 +8486,9 @@ void NoteStoreServer::onCreateTagRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createTagRequestReady( + writer.buffer()); return; } catch(...) @@ -8371,6 +8524,9 @@ void NoteStoreServer::onCreateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createTagRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8386,6 +8542,9 @@ void NoteStoreServer::onCreateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createTagRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8401,6 +8560,9 @@ void NoteStoreServer::onCreateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createTagRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8453,6 +8615,9 @@ void NoteStoreServer::onUpdateTagRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateTagRequestReady( + writer.buffer()); return; } catch(...) @@ -8488,6 +8653,9 @@ void NoteStoreServer::onUpdateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateTagRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8503,6 +8671,9 @@ void NoteStoreServer::onUpdateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateTagRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8518,6 +8689,9 @@ void NoteStoreServer::onUpdateTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateTagRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8569,6 +8743,9 @@ void NoteStoreServer::onUntagAllRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT untagAllRequestReady( + writer.buffer()); return; } catch(...) @@ -8604,6 +8781,9 @@ void NoteStoreServer::onUntagAllRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT untagAllRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8619,6 +8799,9 @@ void NoteStoreServer::onUntagAllRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT untagAllRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8634,6 +8817,9 @@ void NoteStoreServer::onUntagAllRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT untagAllRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8685,6 +8871,9 @@ void NoteStoreServer::onExpungeTagRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT expungeTagRequestReady( + writer.buffer()); return; } catch(...) @@ -8720,6 +8909,9 @@ void NoteStoreServer::onExpungeTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeTagRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8735,6 +8927,9 @@ void NoteStoreServer::onExpungeTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeTagRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8750,6 +8945,9 @@ void NoteStoreServer::onExpungeTagRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeTagRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8802,6 +9000,9 @@ void NoteStoreServer::onListSearchesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listSearchesRequestReady( + writer.buffer()); return; } catch(...) @@ -8837,6 +9038,9 @@ void NoteStoreServer::onListSearchesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSearchesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8852,6 +9056,9 @@ void NoteStoreServer::onListSearchesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSearchesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -8908,6 +9115,9 @@ void NoteStoreServer::onGetSearchRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getSearchRequestReady( + writer.buffer()); return; } catch(...) @@ -8943,6 +9153,9 @@ void NoteStoreServer::onGetSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSearchRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -8958,6 +9171,9 @@ void NoteStoreServer::onGetSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSearchRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -8973,6 +9189,9 @@ void NoteStoreServer::onGetSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSearchRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9025,6 +9244,9 @@ void NoteStoreServer::onCreateSearchRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createSearchRequestReady( + writer.buffer()); return; } catch(...) @@ -9060,6 +9282,9 @@ void NoteStoreServer::onCreateSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createSearchRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9075,6 +9300,9 @@ void NoteStoreServer::onCreateSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createSearchRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9127,6 +9355,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateSearchRequestReady( + writer.buffer()); return; } catch(...) @@ -9162,6 +9393,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSearchRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9177,6 +9411,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSearchRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9192,6 +9429,9 @@ void NoteStoreServer::onUpdateSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSearchRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9244,6 +9484,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT expungeSearchRequestReady( + writer.buffer()); return; } catch(...) @@ -9279,6 +9522,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeSearchRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9294,6 +9540,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeSearchRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9309,6 +9558,9 @@ void NoteStoreServer::onExpungeSearchRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeSearchRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9361,6 +9613,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT findNoteOffsetRequestReady( + writer.buffer()); return; } catch(...) @@ -9396,6 +9651,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteOffsetRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9411,6 +9669,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteOffsetRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9426,6 +9687,9 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteOffsetRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9478,6 +9742,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT findNotesMetadataRequestReady( + writer.buffer()); return; } catch(...) @@ -9513,6 +9780,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNotesMetadataRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9528,6 +9798,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNotesMetadataRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9543,6 +9816,9 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNotesMetadataRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9595,6 +9871,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT findNoteCountsRequestReady( + writer.buffer()); return; } catch(...) @@ -9630,6 +9909,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteCountsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9645,6 +9927,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteCountsRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9660,6 +9945,9 @@ void NoteStoreServer::onFindNoteCountsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findNoteCountsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9712,6 +10000,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteWithResultSpecRequestReady( + writer.buffer()); return; } catch(...) @@ -9747,6 +10038,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteWithResultSpecRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9762,6 +10056,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteWithResultSpecRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9777,6 +10074,9 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteWithResultSpecRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9829,6 +10129,9 @@ void NoteStoreServer::onGetNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -9864,6 +10167,9 @@ void NoteStoreServer::onGetNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9879,6 +10185,9 @@ void NoteStoreServer::onGetNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -9894,6 +10203,9 @@ void NoteStoreServer::onGetNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -9946,6 +10258,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataRequestReady( + writer.buffer()); return; } catch(...) @@ -9981,6 +10296,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -9996,6 +10314,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10011,6 +10332,9 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10063,6 +10387,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -10098,6 +10425,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10113,6 +10443,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10128,6 +10461,9 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10180,6 +10516,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT setNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -10215,6 +10554,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10230,6 +10572,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10245,6 +10590,9 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10297,6 +10645,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -10332,6 +10683,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10347,6 +10701,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10362,6 +10719,9 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetNoteApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10414,6 +10774,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteContentRequestReady( + writer.buffer()); return; } catch(...) @@ -10449,6 +10812,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteContentRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10464,6 +10830,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteContentRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10479,6 +10848,9 @@ void NoteStoreServer::onGetNoteContentRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteContentRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10531,6 +10903,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteSearchTextRequestReady( + writer.buffer()); return; } catch(...) @@ -10566,6 +10941,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteSearchTextRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10581,6 +10959,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteSearchTextRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10596,6 +10977,9 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteSearchTextRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10648,6 +11032,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceSearchTextRequestReady( + writer.buffer()); return; } catch(...) @@ -10683,6 +11070,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceSearchTextRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10698,6 +11088,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceSearchTextRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10713,6 +11106,9 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceSearchTextRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10765,6 +11161,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteTagNamesRequestReady( + writer.buffer()); return; } catch(...) @@ -10800,6 +11199,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteTagNamesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10815,6 +11217,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteTagNamesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10830,6 +11235,9 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteTagNamesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -10886,6 +11294,9 @@ void NoteStoreServer::onCreateNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -10921,6 +11332,9 @@ void NoteStoreServer::onCreateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -10936,6 +11350,9 @@ void NoteStoreServer::onCreateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -10951,6 +11368,9 @@ void NoteStoreServer::onCreateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11003,6 +11423,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -11038,6 +11461,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11053,6 +11479,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11068,6 +11497,9 @@ void NoteStoreServer::onUpdateNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11120,6 +11552,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT deleteNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -11155,6 +11590,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT deleteNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11170,6 +11608,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT deleteNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11185,6 +11626,9 @@ void NoteStoreServer::onDeleteNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT deleteNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11237,6 +11681,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT expungeNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -11272,6 +11719,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11287,6 +11737,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11302,6 +11755,9 @@ void NoteStoreServer::onExpungeNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11354,6 +11810,9 @@ void NoteStoreServer::onCopyNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT copyNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -11389,6 +11848,9 @@ void NoteStoreServer::onCopyNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT copyNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11404,6 +11866,9 @@ void NoteStoreServer::onCopyNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT copyNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11419,6 +11884,9 @@ void NoteStoreServer::onCopyNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT copyNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11471,6 +11939,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listNoteVersionsRequestReady( + writer.buffer()); return; } catch(...) @@ -11506,6 +11977,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNoteVersionsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11521,6 +11995,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNoteVersionsRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11536,6 +12013,9 @@ void NoteStoreServer::onListNoteVersionsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listNoteVersionsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11592,6 +12072,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNoteVersionRequestReady( + writer.buffer()); return; } catch(...) @@ -11627,6 +12110,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteVersionRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11642,6 +12128,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteVersionRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11657,6 +12146,9 @@ void NoteStoreServer::onGetNoteVersionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNoteVersionRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11709,6 +12201,9 @@ void NoteStoreServer::onGetResourceRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceRequestReady( + writer.buffer()); return; } catch(...) @@ -11744,6 +12239,9 @@ void NoteStoreServer::onGetResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11759,6 +12257,9 @@ void NoteStoreServer::onGetResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11774,6 +12275,9 @@ void NoteStoreServer::onGetResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11826,6 +12330,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataRequestReady( + writer.buffer()); return; } catch(...) @@ -11861,6 +12368,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11876,6 +12386,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -11891,6 +12404,9 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -11943,6 +12459,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -11978,6 +12497,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -11993,6 +12515,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12008,6 +12533,9 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12060,6 +12588,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT setResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -12095,6 +12626,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12110,6 +12644,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12125,6 +12662,9 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12177,6 +12717,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(...) @@ -12212,6 +12755,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12227,6 +12773,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12242,6 +12791,9 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT unsetResourceApplicationDataEntryRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12294,6 +12846,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateResourceRequestReady( + writer.buffer()); return; } catch(...) @@ -12329,6 +12884,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateResourceRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12344,6 +12902,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateResourceRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12359,6 +12920,9 @@ void NoteStoreServer::onUpdateResourceRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateResourceRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12411,6 +12975,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceDataRequestReady( + writer.buffer()); return; } catch(...) @@ -12446,6 +13013,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceDataRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12461,6 +13031,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceDataRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12476,6 +13049,9 @@ void NoteStoreServer::onGetResourceDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceDataRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12528,6 +13104,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceByHashRequestReady( + writer.buffer()); return; } catch(...) @@ -12563,6 +13142,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceByHashRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12578,6 +13160,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceByHashRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12593,6 +13178,9 @@ void NoteStoreServer::onGetResourceByHashRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceByHashRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12645,6 +13233,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceRecognitionRequestReady( + writer.buffer()); return; } catch(...) @@ -12680,6 +13271,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRecognitionRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12695,6 +13289,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRecognitionRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12710,6 +13307,9 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceRecognitionRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12762,6 +13362,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceAlternateDataRequestReady( + writer.buffer()); return; } catch(...) @@ -12797,6 +13400,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAlternateDataRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12812,6 +13418,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAlternateDataRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12827,6 +13436,9 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAlternateDataRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12879,6 +13491,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getResourceAttributesRequestReady( + writer.buffer()); return; } catch(...) @@ -12914,6 +13529,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAttributesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -12929,6 +13547,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAttributesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -12944,6 +13565,9 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getResourceAttributesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -12996,6 +13620,9 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getPublicNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -13031,6 +13658,9 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13046,6 +13676,9 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13098,6 +13731,9 @@ void NoteStoreServer::onShareNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT shareNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -13133,6 +13769,9 @@ void NoteStoreServer::onShareNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13148,6 +13787,9 @@ void NoteStoreServer::onShareNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13163,6 +13805,9 @@ void NoteStoreServer::onShareNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13215,6 +13860,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); return; } catch(...) @@ -13250,6 +13898,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13265,6 +13916,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13280,6 +13934,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMInvalidContactsException & e) @@ -13295,6 +13952,9 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createOrUpdateNotebookSharesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13347,6 +14007,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateSharedNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -13382,6 +14045,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSharedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13397,6 +14063,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSharedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13412,6 +14081,9 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateSharedNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13464,6 +14136,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT setNotebookRecipientSettingsRequestReady( + writer.buffer()); return; } catch(...) @@ -13499,6 +14174,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNotebookRecipientSettingsRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13514,6 +14192,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNotebookRecipientSettingsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13529,6 +14210,9 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT setNotebookRecipientSettingsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13581,6 +14265,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listSharedNotebooksRequestReady( + writer.buffer()); return; } catch(...) @@ -13616,6 +14303,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSharedNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13631,6 +14321,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSharedNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13646,6 +14339,9 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listSharedNotebooksRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13702,6 +14398,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT createLinkedNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -13737,6 +14436,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13752,6 +14454,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13767,6 +14472,9 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT createLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13819,6 +14527,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateLinkedNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -13854,6 +14565,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13869,6 +14583,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -13884,6 +14601,9 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -13936,6 +14656,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listLinkedNotebooksRequestReady( + writer.buffer()); return; } catch(...) @@ -13971,6 +14694,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listLinkedNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -13986,6 +14712,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listLinkedNotebooksRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14001,6 +14730,9 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listLinkedNotebooksRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14057,6 +14789,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT expungeLinkedNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -14092,6 +14827,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14107,6 +14845,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14122,6 +14863,9 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT expungeLinkedNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14174,6 +14918,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNotebookRequestReady( + writer.buffer()); return; } catch(...) @@ -14209,6 +14956,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14224,6 +14974,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNotebookRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14239,6 +14992,9 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNotebookRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14291,6 +15047,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getSharedNotebookByAuthRequestReady( + writer.buffer()); return; } catch(...) @@ -14326,6 +15085,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSharedNotebookByAuthRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14341,6 +15103,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSharedNotebookByAuthRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14356,6 +15121,9 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getSharedNotebookByAuthRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14407,6 +15175,9 @@ void NoteStoreServer::onEmailNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT emailNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -14442,6 +15213,9 @@ void NoteStoreServer::onEmailNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT emailNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14457,6 +15231,9 @@ void NoteStoreServer::onEmailNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT emailNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14472,6 +15249,9 @@ void NoteStoreServer::onEmailNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT emailNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14523,6 +15303,9 @@ void NoteStoreServer::onShareNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT shareNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -14558,6 +15341,9 @@ void NoteStoreServer::onShareNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14573,6 +15359,9 @@ void NoteStoreServer::onShareNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14588,6 +15377,9 @@ void NoteStoreServer::onShareNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT shareNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14639,6 +15431,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT stopSharingNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -14674,6 +15469,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT stopSharingNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14689,6 +15487,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT stopSharingNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14704,6 +15505,9 @@ void NoteStoreServer::onStopSharingNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT stopSharingNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14755,6 +15559,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNoteRequestReady( + writer.buffer()); return; } catch(...) @@ -14790,6 +15597,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNoteRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14805,6 +15615,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNoteRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14820,6 +15633,9 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToSharedNoteRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14872,6 +15688,9 @@ void NoteStoreServer::onFindRelatedRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT findRelatedRequestReady( + writer.buffer()); return; } catch(...) @@ -14907,6 +15726,9 @@ void NoteStoreServer::onFindRelatedRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findRelatedRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -14922,6 +15744,9 @@ void NoteStoreServer::onFindRelatedRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findRelatedRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -14937,6 +15762,9 @@ void NoteStoreServer::onFindRelatedRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT findRelatedRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -14989,6 +15817,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + writer.buffer()); return; } catch(...) @@ -15024,6 +15855,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -15039,6 +15873,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15054,6 +15891,9 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateNoteIfUsnMatchesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -15106,6 +15946,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT manageNotebookSharesRequestReady( + writer.buffer()); return; } catch(...) @@ -15141,6 +15984,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT manageNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -15156,6 +16002,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT manageNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15171,6 +16020,9 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT manageNotebookSharesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -15223,6 +16075,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getNotebookSharesRequestReady( + writer.buffer()); return; } catch(...) @@ -15258,6 +16113,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -15273,6 +16131,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookSharesRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15288,6 +16149,9 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getNotebookSharesRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -15590,6 +16454,9 @@ void UserStoreServer::onCheckVersionRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT checkVersionRequestReady( + writer.buffer()); return; } catch(...) @@ -15644,6 +16511,9 @@ void UserStoreServer::onGetBootstrapInfoRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getBootstrapInfoRequestReady( + writer.buffer()); return; } catch(...) @@ -15698,6 +16568,9 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT authenticateLongSessionRequestReady( + writer.buffer()); return; } catch(...) @@ -15733,6 +16606,9 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateLongSessionRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15748,6 +16624,9 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateLongSessionRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -15800,6 +16679,9 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT completeTwoFactorAuthenticationRequestReady( + writer.buffer()); return; } catch(...) @@ -15835,6 +16717,9 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT completeTwoFactorAuthenticationRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15850,6 +16735,9 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT completeTwoFactorAuthenticationRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -15901,6 +16789,9 @@ void UserStoreServer::onRevokeLongSessionRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT revokeLongSessionRequestReady( + writer.buffer()); return; } catch(...) @@ -15936,6 +16827,9 @@ void UserStoreServer::onRevokeLongSessionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT revokeLongSessionRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -15951,6 +16845,9 @@ void UserStoreServer::onRevokeLongSessionRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT revokeLongSessionRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16002,6 +16899,9 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT authenticateToBusinessRequestReady( + writer.buffer()); return; } catch(...) @@ -16037,6 +16937,9 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToBusinessRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16052,6 +16955,9 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT authenticateToBusinessRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16104,6 +17010,9 @@ void UserStoreServer::onGetUserRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getUserRequestReady( + writer.buffer()); return; } catch(...) @@ -16139,6 +17048,9 @@ void UserStoreServer::onGetUserRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16154,6 +17066,9 @@ void UserStoreServer::onGetUserRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16206,6 +17121,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getPublicUserInfoRequestReady( + writer.buffer()); return; } catch(...) @@ -16241,6 +17159,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicUserInfoRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16256,6 +17177,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicUserInfoRequestReady( + writer.buffer()); return; } catch(const EDAMUserException & e) @@ -16271,6 +17195,9 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getPublicUserInfoRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16323,6 +17250,9 @@ void UserStoreServer::onGetUserUrlsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getUserUrlsRequestReady( + writer.buffer()); return; } catch(...) @@ -16358,6 +17288,9 @@ void UserStoreServer::onGetUserUrlsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserUrlsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16373,6 +17306,9 @@ void UserStoreServer::onGetUserUrlsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getUserUrlsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16424,6 +17360,9 @@ void UserStoreServer::onInviteToBusinessRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT inviteToBusinessRequestReady( + writer.buffer()); return; } catch(...) @@ -16459,6 +17398,9 @@ void UserStoreServer::onInviteToBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT inviteToBusinessRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16474,6 +17416,9 @@ void UserStoreServer::onInviteToBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT inviteToBusinessRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16524,6 +17469,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT removeFromBusinessRequestReady( + writer.buffer()); return; } catch(...) @@ -16559,6 +17507,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT removeFromBusinessRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16574,6 +17525,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT removeFromBusinessRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -16589,6 +17543,9 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT removeFromBusinessRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16639,6 +17596,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT updateBusinessUserIdentifierRequestReady( + writer.buffer()); return; } catch(...) @@ -16674,6 +17634,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateBusinessUserIdentifierRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16689,6 +17652,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateBusinessUserIdentifierRequestReady( + writer.buffer()); return; } catch(const EDAMNotFoundException & e) @@ -16704,6 +17670,9 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT updateBusinessUserIdentifierRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16755,6 +17724,9 @@ void UserStoreServer::onListBusinessUsersRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listBusinessUsersRequestReady( + writer.buffer()); return; } catch(...) @@ -16790,6 +17762,9 @@ void UserStoreServer::onListBusinessUsersRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessUsersRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16805,6 +17780,9 @@ void UserStoreServer::onListBusinessUsersRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessUsersRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16861,6 +17839,9 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT listBusinessInvitationsRequestReady( + writer.buffer()); return; } catch(...) @@ -16896,6 +17877,9 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessInvitationsRequestReady( + writer.buffer()); return; } catch(const EDAMSystemException & e) @@ -16911,6 +17895,9 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT listBusinessInvitationsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) @@ -16967,6 +17954,9 @@ void UserStoreServer::onGetAccountLimitsRequestReady( cseqid); writeThriftException(writer, exception); writer.writeMessageEnd(); + + Q_EMIT getAccountLimitsRequestReady( + writer.buffer()); return; } catch(...) @@ -17002,6 +17992,9 @@ void UserStoreServer::onGetAccountLimitsRequestReady( // Finalize message and return immediately writer.writeStructEnd(); writer.writeMessageEnd(); + + Q_EMIT getAccountLimitsRequestReady( + writer.buffer()); return; } catch(const std::exception & e) diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp index 572065f0..dfcc81ce 100644 --- a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -419,9 +419,9 @@ RelatedResultSpec generateRandomRelatedResultSpec() result.maxExperts = generateRandomInt32(); result.maxRelatedContent = generateRandomInt32(); result.relatedContentTypes = QSet(); - result.relatedContentTypes->insert(RelatedContentType::REFERENCE_MATERIAL); - result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE); result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); + result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); + result.relatedContentTypes->insert(RelatedContentType::PROFILE_ORGANIZATION); return result; } @@ -448,7 +448,7 @@ InvitationShareRelationship generateRandomInvitationShareRelationship() InvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientUserIdentity = generateRandomUserIdentity(); - result.privilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; + result.privilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; result.sharerUserId = generateRandomInt32(); return result; } @@ -458,8 +458,8 @@ MemberShareRelationship generateRandomMemberShareRelationship() MemberShareRelationship result; result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); - result.bestPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; - result.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.bestPrivilege = ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + result.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; result.restrictions = generateRandomShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -505,7 +505,7 @@ ManageNotebookSharesError generateRandomManageNotebookSharesError() ManageNotebookSharesError result; result.userIdentity = generateRandomUserIdentity(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::AUTH_EXPIRED; + result.userException->errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -532,7 +532,7 @@ SharedNoteTemplate generateRandomSharedNoteTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; return result; } @@ -545,7 +545,7 @@ NotebookShareTemplate generateRandomNotebookShareTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS; + result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; return result; } @@ -585,7 +585,7 @@ NoteInvitationShareRelationship generateRandomNoteInvitationShareRelationship() NoteInvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientIdentityId = generateRandomInt64(); - result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotePrivilegeLevel::READ_NOTE; result.sharerUserId = generateRandomInt32(); return result; } @@ -634,7 +634,7 @@ ManageNoteSharesError generateRandomManageNoteSharesError() result.identityID = generateRandomInt64(); result.userID = generateRandomInt32(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + result.userException->errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -726,7 +726,7 @@ Accounting generateRandomAccounting() Accounting result; result.uploadLimitEnd = generateRandomInt64(); result.uploadLimitNextMonth = generateRandomInt64(); - result.premiumServiceStatus = PremiumOrderStatus::PENDING; + result.premiumServiceStatus = PremiumOrderStatus::CANCELED; result.premiumOrderNumber = generateRandomString(); result.premiumCommerceService = generateRandomString(); result.premiumServiceStart = generateRandomInt64(); @@ -743,7 +743,7 @@ Accounting generateRandomAccounting() result.unitPrice = generateRandomInt32(); result.businessId = generateRandomInt32(); result.businessName = generateRandomString(); - result.businessRole = BusinessUserRole::ADMIN; + result.businessRole = BusinessUserRole::NORMAL; result.unitDiscount = generateRandomInt32(); result.nextChargeDate = generateRandomInt64(); result.availablePoints = generateRandomInt32(); @@ -786,8 +786,8 @@ User generateRandomUser() result.email = generateRandomString(); result.name = generateRandomString(); result.timezone = generateRandomString(); - result.privilege = PrivilegeLevel::ADMIN; - result.serviceLevel = ServiceLevel::BUSINESS; + result.privilege = PrivilegeLevel::VIP; + result.serviceLevel = ServiceLevel::PLUS; result.created = generateRandomInt64(); result.updated = generateRandomInt64(); result.deleted = generateRandomInt64(); @@ -807,7 +807,7 @@ Contact generateRandomContact() Contact result; result.name = generateRandomString(); result.id = generateRandomString(); - result.type = ContactType::SMS; + result.type = ContactType::EVERNOTE; result.photoUrl = generateRandomString(); result.photoLastUpdated = generateRandomInt64(); result.messagingPermit = generateRandomString().toUtf8(); @@ -925,7 +925,7 @@ SharedNote generateRandomSharedNote() SharedNote result; result.sharerUserID = generateRandomInt32(); result.recipientIdentity = generateRandomIdentity(); - result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotePrivilegeLevel::READ_NOTE; result.serviceCreated = generateRandomInt64(); result.serviceUpdated = generateRandomInt64(); result.serviceAssigned = generateRandomInt64(); @@ -1004,7 +1004,7 @@ BusinessNotebook generateRandomBusinessNotebook() { BusinessNotebook result; result.notebookDescription = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::GROUP; + result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; result.recommended = generateRandomBool(); return result; } @@ -1024,7 +1024,7 @@ SavedSearch generateRandomSavedSearch() result.guid = generateRandomString(); result.name = generateRandomString(); result.query = generateRandomString(); - result.format = QueryFormat::SEXP; + result.format = QueryFormat::USER; result.updateSequenceNum = generateRandomInt32(); result.scope = generateRandomSavedSearchScope(); return result; @@ -1045,7 +1045,7 @@ NotebookRecipientSettings generateRandomNotebookRecipientSettings() result.reminderNotifyInApp = generateRandomBool(); result.inMyList = generateRandomBool(); result.stack = generateRandomString(); - result.recipientStatus = RecipientStatus::IN_MY_LIST; + result.recipientStatus = RecipientStatus::NOT_IN_MY_LIST; return result; } @@ -1074,7 +1074,7 @@ SharedNotebook generateRandomSharedNotebook() CanMoveToContainerRestrictions generateRandomCanMoveToContainerRestrictions() { CanMoveToContainerRestrictions result; - result.canMoveToContainer = CanMoveToContainerStatus::CAN_BE_MOVED; + result.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE; return result; } @@ -1099,8 +1099,8 @@ NotebookRestrictions generateRandomNotebookRestrictions() result.noExpungeTags = generateRandomBool(); result.noSetParentTag = generateRandomBool(); result.noCreateSharedNotebooks = generateRandomBool(); - result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; - result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; + result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; + result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; result.noShareNotesWithBusiness = generateRandomBool(); result.noRenameNotebook = generateRandomBool(); result.noSetInMyList = generateRandomBool(); @@ -1240,7 +1240,7 @@ BusinessInvitation generateRandomBusinessInvitation() UserIdentity generateRandomUserIdentity() { UserIdentity result; - result.type = UserIdentityType::IDENTITYID; + result.type = UserIdentityType::EMAIL; result.stringIdentifier = generateRandomString(); result.longIdentifier = generateRandomInt64(); return result; @@ -1250,7 +1250,7 @@ PublicUserInfo generateRandomPublicUserInfo() { PublicUserInfo result; result.userId = generateRandomInt32(); - result.serviceLevel = ServiceLevel::PREMIUM; + result.serviceLevel = ServiceLevel::BUSINESS; result.username = generateRandomString(); result.noteStoreUrl = generateRandomString(); result.webApiUrlPrefix = generateRandomString(); diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 494487f8..af99117d 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -3903,7 +3903,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() SyncState response = generateRandomSyncState(); NoteStoreGetSyncStateTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + [&] (IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; @@ -3970,42 +3970,33 @@ void NoteStoreTester::shouldExecuteGetSyncState() QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() { - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - SyncChunkFilter filter = generateRandomSyncChunkFilter(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = generateRandomSyncChunk(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); - NoteStoreGetFilteredSyncChunkTesterHelper helper( - [&] (qint32 afterUSNParam, - qint32 maxEntriesParam, - const SyncChunkFilter & filterParam, - IRequestContextPtr ctxParam) + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(filter == filterParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequest, + &NoteStoreServer::getSyncStateRequest, &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, &server, - &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + &NoteStoreServer::onGetSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4033,7 +4024,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequestReady, + &NoteStoreServer::getSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4051,44 +4042,50 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncChunk res = noteStore->getFilteredSyncChunk( - afterUSN, - maxEntries, - filter, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncState response = generateRandomSyncState(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::getSyncStateRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onGetSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4116,7 +4113,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::getSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4134,51 +4131,58 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); qint32 afterUSN = generateRandomInt32(); qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); SyncChunk response = generateRandomSyncChunk(); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); Q_ASSERT(afterUSN == afterUSNParam); Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + Q_ASSERT(filter == filterParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::getFilteredSyncChunkRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4206,7 +4210,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::getFilteredSyncChunkRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4224,45 +4228,50 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, + SyncChunk res = noteStore->getFilteredSyncChunk( afterUSN, maxEntries, - fullSyncOnly, + filter, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() { + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::getFilteredSyncChunkRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4290,7 +4299,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::getFilteredSyncChunkRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4308,41 +4317,62 @@ void NoteStoreTester::shouldExecuteListNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listNotebooks( - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() { + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::getFilteredSyncChunkRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4370,7 +4400,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::getFilteredSyncChunkRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4388,41 +4418,55 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listAccessibleBusinessNotebooks( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNotebook() +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + SyncState response = generateRandomSyncState(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4450,7 +4494,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4468,39 +4512,42 @@ void NoteStoreTester::shouldExecuteGetNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getNotebook( - guid, + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState() { + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4528,7 +4575,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4546,41 +4593,54 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getDefaultNotebook( - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState() { - Notebook notebook = generateRandomNotebook(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4608,7 +4668,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4626,42 +4686,19484 @@ void NoteStoreTester::shouldExecuteCreateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->createNotebook( - notebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = generateRandomSyncChunk(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listNotebooks( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getNotebook( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getDefaultNotebook( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->createNotebook( + notebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTags( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->getTag( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->createTag( + tag, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateTag( + tag, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->untagAll( + guid, + ctx); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeTag( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listSearches( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->getSearch( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TAKEN_DOWN; + userException.parameter = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->createSearch( + search, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSearch( + search, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeSearch( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NotesMetadataList response = generateRandomNotesMetadataList(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = generateRandomLazyMap(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteContent( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_FEW; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getResourceSearchText( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QStringList response; + response << generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->createNote( + note, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->updateNote( + note, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->deleteNote( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->deleteNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->deleteNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->deleteNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeNote( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.parameter = generateRandomString(); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCopyNote() +{ + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() +{ + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() +{ + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() +{ + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNoteVersions() +{ + Guid noteGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() +{ + Guid noteGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() +{ + Guid noteGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() +{ + Guid noteGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteVersion() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResource() +{ + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Resource response = generateRandomResource(); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() +{ + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() +{ + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() +{ + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = generateRandomLazyMap(); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateResource() +{ + Resource resource = generateRandomResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateResource( + resource, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() +{ + Resource resource = generateRandomResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateResource( + resource, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() +{ + Resource resource = generateRandomResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateResource( + resource, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() +{ + Resource resource = generateRandomResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateResource( + resource, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = generateRandomString().toUtf8(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceData( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceByHash() +{ + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Resource response = generateRandomResource(); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() +{ + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() +{ + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() +{ + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceRecognition() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = generateRandomString().toUtf8(); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceAlternateData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = generateRandomString().toUtf8(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceAttributes() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + ResourceAttributes response = generateRandomResourceAttributes(); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> ResourceAttributes + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> ResourceAttributes + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> ResourceAttributes + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> ResourceAttributes + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetPublicNotebook() +{ + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequest, + &helper, + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &server, + &NoteStoreServer::onGetPublicNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() +{ + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequest, + &helper, + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &server, + &NoteStoreServer::onGetPublicNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() +{ + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequest, + &helper, + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &server, + &NoteStoreServer::onGetPublicNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteShareNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SharedNotebook response = generateRandomSharedNotebook(); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto invalidContactsException = EDAMInvalidContactsException(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.parameter = generateRandomString(); + invalidContactsException.reasons = QList(); + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::BAD_ADDRESS; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + throw invalidContactsException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const EDAMInvalidContactsException & e) + { + caughtException = true; + QVERIFY(e == invalidContactsException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteUpdateNotebook() +void NoteStoreTester::shouldExecuteUpdateSharedNotebook() { - Notebook notebook = generateRandomNotebook(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4689,7 +24191,273 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequest, + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequest, + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequest, + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4707,42 +24475,56 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateNotebook( - notebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteExpungeNotebook() +void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() { - Guid guid = generateRandomString(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + Notebook response = generateRandomNotebook(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4770,7 +24552,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4788,42 +24570,46 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeNotebook( - guid, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListTags() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings() { + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4851,7 +24637,7 @@ void NoteStoreTester::shouldExecuteListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4869,44 +24655,57 @@ void NoteStoreTester::shouldExecuteListTags() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTags( - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings() { - Guid notebookGuid = generateRandomString(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(notebookGuid == notebookGuidParam); - return response; + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4934,7 +24733,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4952,42 +24751,58 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTagsByNotebook( - notebookGuid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings() { - Guid guid = generateRandomString(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetTagTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5015,7 +24830,7 @@ void NoteStoreTester::shouldExecuteGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5033,42 +24848,54 @@ void NoteStoreTester::shouldExecuteGetTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->getTag( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteCreateTag() +void NoteStoreTester::shouldExecuteListSharedNotebooks() { - Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + QList response; + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5096,7 +24923,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5114,42 +24941,38 @@ void NoteStoreTester::shouldExecuteCreateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->createTag( - tag, + QList res = noteStore->listSharedNotebooks( ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() { - Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5177,7 +25000,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5195,40 +25018,49 @@ void NoteStoreTester::shouldExecuteUpdateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateTag( - tag, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QList res = noteStore->listSharedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUntagAll() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreUntagAllTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5256,7 +25088,7 @@ void NoteStoreTester::shouldExecuteUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5274,41 +25106,50 @@ void NoteStoreTester::shouldExecuteUntagAll() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->untagAll( - guid, - ctx); -} + bool caughtException = false; + try + { + QList res = noteStore->listSharedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteExpungeTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeTagTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5336,7 +25177,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5354,42 +25195,52 @@ void NoteStoreTester::shouldExecuteExpungeTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeTag( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = noteStore->listSharedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteListSearches() +void NoteStoreTester::shouldExecuteCreateLinkedNotebook() { + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); + LinkedNotebook response = generateRandomLinkedNotebook(); - NoteStoreListSearchesTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSearchesRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onListSearchesRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5417,7 +25268,7 @@ void NoteStoreTester::shouldExecuteListSearches() QObject::connect( &server, - &NoteStoreServer::listSearchesRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5435,41 +25286,42 @@ void NoteStoreTester::shouldExecuteListSearches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listSearches( + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetSearch() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SavedSearch response = generateRandomSavedSearch(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); - NoteStoreGetSearchTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSearchRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetSearchRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5497,7 +25349,7 @@ void NoteStoreTester::shouldExecuteGetSearch() QObject::connect( &server, - &NoteStoreServer::getSearchRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5515,42 +25367,53 @@ void NoteStoreTester::shouldExecuteGetSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SavedSearch res = noteStore->getSearch( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCreateSearch() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() { - SavedSearch search = generateRandomSavedSearch(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SavedSearch response = generateRandomSavedSearch(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createSearchRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onCreateSearchRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5578,7 +25441,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() QObject::connect( &server, - &NoteStoreServer::createSearchRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5596,42 +25459,54 @@ void NoteStoreTester::shouldExecuteCreateSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SavedSearch res = noteStore->createSearch( - search, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUpdateSearch() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() { - SavedSearch search = generateRandomSavedSearch(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSearchRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateSearchRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5659,7 +25534,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() QObject::connect( &server, - &NoteStoreServer::updateSearchRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5677,42 +25552,53 @@ void NoteStoreTester::shouldExecuteUpdateSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateSearch( - search, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteExpungeSearch() +void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5740,7 +25626,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5758,45 +25644,42 @@ void NoteStoreTester::shouldExecuteExpungeSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5824,7 +25707,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5842,52 +25725,53 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->findNoteOffset( - filter, - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteFindNotesMetadata() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NotesMetadataList response = generateRandomNotesMetadataList(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5915,7 +25799,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5933,48 +25817,54 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6002,7 +25892,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6018,48 +25908,55 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() } }); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, - ctx); - QVERIFY(res == response); + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() +void NoteStoreTester::shouldExecuteListLinkedNotebooks() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + QList response; + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6087,7 +25984,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6105,55 +26002,38 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + QList res = noteStore->listLinkedNotebooks( ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6181,7 +26061,7 @@ void NoteStoreTester::shouldExecuteGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6199,46 +26079,49 @@ void NoteStoreTester::shouldExecuteGetNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QList res = noteStore->listLinkedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetNoteApplicationData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = generateRandomLazyMap(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetNoteApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6266,7 +26149,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6284,45 +26167,50 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LazyMap res = noteStore->getNoteApplicationData( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QList res = noteStore->listLinkedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6350,7 +26238,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6368,49 +26256,52 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteApplicationDataEntry( - guid, - key, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = noteStore->listLinkedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6438,7 +26329,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6456,47 +26347,42 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->setNoteApplicationDataEntry( + qint32 res = noteStore->expungeLinkedNotebook( guid, - key, - value, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6524,7 +26410,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6542,43 +26428,53 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->unsetNoteApplicationDataEntry( - guid, - key, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + qint32 res = noteStore->expungeLinkedNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetNoteContent() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6606,7 +26502,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6624,48 +26520,54 @@ void NoteStoreTester::shouldExecuteGetNoteContent() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteContent( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + qint32 res = noteStore->expungeLinkedNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetNoteSearchText() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6693,7 +26595,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6709,46 +26611,55 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() } }); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteSearchText( - guid, - noteOnly, - tokenizeForIndexing, - ctx); - QVERIFY(res == response); + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeLinkedNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceSearchText() +void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() { - Guid guid = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6776,7 +26687,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6794,45 +26705,42 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getResourceSearchText( - guid, + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook() { - Guid guid = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QStringList response; - response << generateRandomString(); - response << generateRandomString(); - response << generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6860,7 +26768,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6878,42 +26786,53 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QStringList res = noteStore->getNoteTagNames( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCreateNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook() { - Note note = generateRandomNote(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6941,7 +26860,7 @@ void NoteStoreTester::shouldExecuteCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6959,42 +26878,54 @@ void NoteStoreTester::shouldExecuteCreateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->createNote( - note, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUpdateNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook() { - Note note = generateRandomNote(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7022,7 +26953,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7040,42 +26971,50 @@ void NoteStoreTester::shouldExecuteUpdateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->updateNote( - note, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteDeleteNote() +void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + SharedNotebook response = generateRandomSharedNotebook(); - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7103,7 +27042,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7121,42 +27060,38 @@ void NoteStoreTester::shouldExecuteDeleteNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->deleteNote( - guid, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7184,7 +27119,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7202,45 +27137,49 @@ void NoteStoreTester::shouldExecuteExpungeNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeNote( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCopyNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7268,7 +27207,7 @@ void NoteStoreTester::shouldExecuteCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7286,46 +27225,50 @@ void NoteStoreTester::shouldExecuteCopyNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteListNoteVersions() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth() { - Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNoteVersionId(); - response << generateRandomNoteVersionId(); - response << generateRandomNoteVersionId(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7353,7 +27296,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7371,54 +27314,50 @@ void NoteStoreTester::shouldExecuteListNoteVersions() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listNoteVersions( - noteGuid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteVersion() +void NoteStoreTester::shouldExecuteEmailNote() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); - - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - return response; + Q_ASSERT(parameters == parametersParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7446,7 +27385,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7464,58 +27403,41 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + noteStore->emailNote( + parameters, ctx); - QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResource() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = generateRandomResource(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7543,7 +27465,7 @@ void NoteStoreTester::shouldExecuteGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7561,46 +27483,52 @@ void NoteStoreTester::shouldExecuteGetResource() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + noteStore->emailNote( + parameters, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetResourceApplicationData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() { - Guid guid = generateRandomString(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = generateRandomLazyMap(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7628,7 +27556,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7646,45 +27574,53 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LazyMap res = noteStore->getResourceApplicationData( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + noteStore->emailNote( + parameters, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7712,7 +27648,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7730,49 +27666,52 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + noteStore->emailNote( + parameters, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() +void NoteStoreTester::shouldExecuteShareNote() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + QString response = generateRandomString(); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + NoteStoreShareNoteTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7800,7 +27739,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7818,47 +27757,42 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->setResourceApplicationDataEntry( + QString res = noteStore->shareNote( guid, - key, - value, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + NoteStoreShareNoteTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7886,7 +27820,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7904,43 +27838,53 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QString res = noteStore->shareNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUpdateResource() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() { - Resource resource = generateRandomResource(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, - IRequestContextPtr ctxParam) + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); - return response; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7968,7 +27912,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7986,42 +27930,54 @@ void NoteStoreTester::shouldExecuteUpdateResource() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateResource( - resource, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QString res = noteStore->shareNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetResourceData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceDataTesterHelper helper( + NoteStoreShareNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8049,7 +28005,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8067,54 +28023,51 @@ void NoteStoreTester::shouldExecuteGetResourceData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceData( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QString res = noteStore->shareNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceByHash() +void NoteStoreTester::shouldExecuteStopSharingNote() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = generateRandomResource(); - - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - return response; + Q_ASSERT(guid == guidParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8142,7 +28095,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8160,46 +28113,41 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + noteStore->stopSharingNote( + guid, ctx); - QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResourceRecognition() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + userException.parameter = generateRandomString(); - NoteStoreGetResourceRecognitionTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8227,7 +28175,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8245,42 +28193,52 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceRecognition( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + noteStore->stopSharingNote( + guid, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8308,7 +28266,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8326,42 +28284,53 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceAlternateData( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + noteStore->stopSharingNote( + guid, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetResourceAttributes() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ResourceAttributes response = generateRandomResourceAttributes(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceAttributesTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8389,7 +28358,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8407,43 +28376,55 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ResourceAttributes res = noteStore->getResourceAttributes( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + noteStore->stopSharingNote( + guid, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetPublicNotebook() +void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() { - UserID userId = generateRandomInt32(); - QString publicUri = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreGetPublicNotebookTesterHelper helper( - [&] (const UserID & userIdParam, - const QString & publicUriParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(userId == userIdParam); - Q_ASSERT(publicUri == publicUriParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetPublicNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8471,7 +28452,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8489,46 +28470,46 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getPublicNotebook( - userId, - publicUri, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteShareNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = generateRandomSharedNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8556,7 +28537,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8574,43 +28555,57 @@ void NoteStoreTester::shouldExecuteShareNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); - return response; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8638,7 +28633,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8656,42 +28651,58 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8719,7 +28730,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8737,45 +28748,57 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() +void NoteStoreTester::shouldExecuteFindRelated() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + RelatedResult response = generateRandomRelatedResult(); - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8803,7 +28826,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8821,43 +28844,46 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListSharedNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() { + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomSharedNotebook(); - response << generateRandomSharedNotebook(); - response << generateRandomSharedNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8885,7 +28911,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8903,41 +28929,58 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listSharedNotebooks( - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + RelatedResult res = noteStore->findRelated( + query, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteCreateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LinkedNotebook response = generateRandomLinkedNotebook(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - return response; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8965,7 +29008,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8983,42 +29026,57 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + RelatedResult res = noteStore->findRelated( + query, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - return response; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9046,7 +29104,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9064,42 +29122,54 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + RelatedResult res = noteStore->findRelated( + query, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteListLinkedNotebooks() +void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() { + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomLinkedNotebook(); - response << generateRandomLinkedNotebook(); - response << generateRandomLinkedNotebook(); + UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9127,7 +29197,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9145,41 +29215,42 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listLinkedNotebooks( + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); - NoteStoreExpungeLinkedNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(note == noteParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9207,7 +29278,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9225,42 +29296,53 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeLinkedNotebook( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches() { - QString shareKeyOrGlobalId = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, - IRequestContextPtr ctxParam) + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(note == noteParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9288,7 +29370,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9306,39 +29388,54 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() { + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = generateRandomSharedNotebook(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(note == noteParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9366,7 +29463,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9384,39 +29481,53 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SharedNotebook res = noteStore->getSharedNotebookByAuth( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteEmailNote() +void NoteStoreTester::shouldExecuteManageNotebookShares() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) + ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); + + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(parameters == parametersParam); - return; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9444,7 +29555,7 @@ void NoteStoreTester::shouldExecuteEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9462,41 +29573,42 @@ void NoteStoreTester::shouldExecuteEmailNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->emailNote( + ManageNotebookSharesResult res = noteStore->manageNotebookShares( parameters, ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteShareNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() { - Guid guid = generateRandomString(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.parameter = generateRandomString(); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9524,7 +29636,7 @@ void NoteStoreTester::shouldExecuteShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9542,40 +29654,53 @@ void NoteStoreTester::shouldExecuteShareNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->shareNote( - guid, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() { - Guid guid = generateRandomString(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return; + Q_ASSERT(parameters == parametersParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9603,7 +29728,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9621,44 +29746,54 @@ void NoteStoreTester::shouldExecuteStopSharingNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->stopSharingNote( - guid, - ctx); -} + bool caughtException = false; + try + { + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(parameters == parametersParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9686,7 +29821,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9704,46 +29839,53 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteFindRelated() +void NoteStoreTester::shouldExecuteGetNotebookShares() { - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - RelatedResult response = generateRandomRelatedResult(); + ShareRelationships response = generateRandomShareRelationships(); - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(notebookGuid == notebookGuidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findRelatedRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onFindRelatedRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9771,7 +29913,7 @@ void NoteStoreTester::shouldExecuteFindRelated() QObject::connect( &server, - &NoteStoreServer::findRelatedRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9789,43 +29931,42 @@ void NoteStoreTester::shouldExecuteFindRelated() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - RelatedResult res = noteStore->findRelated( - query, - resultSpec, + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() { - Note note = generateRandomNote(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + Q_ASSERT(notebookGuid == notebookGuidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9853,7 +29994,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9871,42 +30012,53 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteManageNotebookShares() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() { - ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreManageNotebookSharesTesterHelper helper( - [&] (const ManageNotebookSharesParameters & parametersParam, - IRequestContextPtr ctxParam) + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); - return response; + Q_ASSERT(notebookGuid == notebookGuidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onManageNotebookSharesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9934,7 +30086,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9952,29 +30104,41 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void NoteStoreTester::shouldExecuteGetNotebookShares() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ShareRelationships response = generateRandomShareRelationships(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreGetNotebookSharesTesterHelper helper( [&] (const QString & notebookGuidParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(notebookGuid == notebookGuidParam); - return response; + throw systemException; }); NoteStoreServer server; @@ -10033,10 +30197,21 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ShareRelationships res = noteStore->getNotebookShares( - notebookGuid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestNoteStore.h b/QEverCloud/src/tests/generated/TestNoteStore.h index a831b122..45390c54 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.h +++ b/QEverCloud/src/tests/generated/TestNoteStore.h @@ -27,79 +27,293 @@ class NoteStoreTester: public QObject private Q_SLOTS: void shouldExecuteGetSyncState(); + void shouldDeliverEDAMUserExceptionInGetSyncState(); + void shouldDeliverEDAMSystemExceptionInGetSyncState(); void shouldExecuteGetFilteredSyncChunk(); + void shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk(); + void shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk(); void shouldExecuteGetLinkedNotebookSyncState(); + void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState(); + void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState(); + void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState(); void shouldExecuteGetLinkedNotebookSyncChunk(); + void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk(); + void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk(); + void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk(); void shouldExecuteListNotebooks(); + void shouldDeliverEDAMUserExceptionInListNotebooks(); + void shouldDeliverEDAMSystemExceptionInListNotebooks(); void shouldExecuteListAccessibleBusinessNotebooks(); + void shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks(); + void shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks(); void shouldExecuteGetNotebook(); + void shouldDeliverEDAMUserExceptionInGetNotebook(); + void shouldDeliverEDAMSystemExceptionInGetNotebook(); + void shouldDeliverEDAMNotFoundExceptionInGetNotebook(); void shouldExecuteGetDefaultNotebook(); + void shouldDeliverEDAMUserExceptionInGetDefaultNotebook(); + void shouldDeliverEDAMSystemExceptionInGetDefaultNotebook(); void shouldExecuteCreateNotebook(); + void shouldDeliverEDAMUserExceptionInCreateNotebook(); + void shouldDeliverEDAMSystemExceptionInCreateNotebook(); + void shouldDeliverEDAMNotFoundExceptionInCreateNotebook(); void shouldExecuteUpdateNotebook(); + void shouldDeliverEDAMUserExceptionInUpdateNotebook(); + void shouldDeliverEDAMSystemExceptionInUpdateNotebook(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNotebook(); void shouldExecuteExpungeNotebook(); + void shouldDeliverEDAMUserExceptionInExpungeNotebook(); + void shouldDeliverEDAMSystemExceptionInExpungeNotebook(); + void shouldDeliverEDAMNotFoundExceptionInExpungeNotebook(); void shouldExecuteListTags(); + void shouldDeliverEDAMUserExceptionInListTags(); + void shouldDeliverEDAMSystemExceptionInListTags(); void shouldExecuteListTagsByNotebook(); + void shouldDeliverEDAMUserExceptionInListTagsByNotebook(); + void shouldDeliverEDAMSystemExceptionInListTagsByNotebook(); + void shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook(); void shouldExecuteGetTag(); + void shouldDeliverEDAMUserExceptionInGetTag(); + void shouldDeliverEDAMSystemExceptionInGetTag(); + void shouldDeliverEDAMNotFoundExceptionInGetTag(); void shouldExecuteCreateTag(); + void shouldDeliverEDAMUserExceptionInCreateTag(); + void shouldDeliverEDAMSystemExceptionInCreateTag(); + void shouldDeliverEDAMNotFoundExceptionInCreateTag(); void shouldExecuteUpdateTag(); + void shouldDeliverEDAMUserExceptionInUpdateTag(); + void shouldDeliverEDAMSystemExceptionInUpdateTag(); + void shouldDeliverEDAMNotFoundExceptionInUpdateTag(); void shouldExecuteUntagAll(); + void shouldDeliverEDAMUserExceptionInUntagAll(); + void shouldDeliverEDAMSystemExceptionInUntagAll(); + void shouldDeliverEDAMNotFoundExceptionInUntagAll(); void shouldExecuteExpungeTag(); + void shouldDeliverEDAMUserExceptionInExpungeTag(); + void shouldDeliverEDAMSystemExceptionInExpungeTag(); + void shouldDeliverEDAMNotFoundExceptionInExpungeTag(); void shouldExecuteListSearches(); + void shouldDeliverEDAMUserExceptionInListSearches(); + void shouldDeliverEDAMSystemExceptionInListSearches(); void shouldExecuteGetSearch(); + void shouldDeliverEDAMUserExceptionInGetSearch(); + void shouldDeliverEDAMSystemExceptionInGetSearch(); + void shouldDeliverEDAMNotFoundExceptionInGetSearch(); void shouldExecuteCreateSearch(); + void shouldDeliverEDAMUserExceptionInCreateSearch(); + void shouldDeliverEDAMSystemExceptionInCreateSearch(); void shouldExecuteUpdateSearch(); + void shouldDeliverEDAMUserExceptionInUpdateSearch(); + void shouldDeliverEDAMSystemExceptionInUpdateSearch(); + void shouldDeliverEDAMNotFoundExceptionInUpdateSearch(); void shouldExecuteExpungeSearch(); + void shouldDeliverEDAMUserExceptionInExpungeSearch(); + void shouldDeliverEDAMSystemExceptionInExpungeSearch(); + void shouldDeliverEDAMNotFoundExceptionInExpungeSearch(); void shouldExecuteFindNoteOffset(); + void shouldDeliverEDAMUserExceptionInFindNoteOffset(); + void shouldDeliverEDAMSystemExceptionInFindNoteOffset(); + void shouldDeliverEDAMNotFoundExceptionInFindNoteOffset(); void shouldExecuteFindNotesMetadata(); + void shouldDeliverEDAMUserExceptionInFindNotesMetadata(); + void shouldDeliverEDAMSystemExceptionInFindNotesMetadata(); + void shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata(); void shouldExecuteFindNoteCounts(); + void shouldDeliverEDAMUserExceptionInFindNoteCounts(); + void shouldDeliverEDAMSystemExceptionInFindNoteCounts(); + void shouldDeliverEDAMNotFoundExceptionInFindNoteCounts(); void shouldExecuteGetNoteWithResultSpec(); + void shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec(); + void shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec(); void shouldExecuteGetNote(); + void shouldDeliverEDAMUserExceptionInGetNote(); + void shouldDeliverEDAMSystemExceptionInGetNote(); + void shouldDeliverEDAMNotFoundExceptionInGetNote(); void shouldExecuteGetNoteApplicationData(); + void shouldDeliverEDAMUserExceptionInGetNoteApplicationData(); + void shouldDeliverEDAMSystemExceptionInGetNoteApplicationData(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData(); void shouldExecuteGetNoteApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry(); void shouldExecuteSetNoteApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry(); void shouldExecuteUnsetNoteApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry(); void shouldExecuteGetNoteContent(); + void shouldDeliverEDAMUserExceptionInGetNoteContent(); + void shouldDeliverEDAMSystemExceptionInGetNoteContent(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteContent(); void shouldExecuteGetNoteSearchText(); + void shouldDeliverEDAMUserExceptionInGetNoteSearchText(); + void shouldDeliverEDAMSystemExceptionInGetNoteSearchText(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText(); void shouldExecuteGetResourceSearchText(); + void shouldDeliverEDAMUserExceptionInGetResourceSearchText(); + void shouldDeliverEDAMSystemExceptionInGetResourceSearchText(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText(); void shouldExecuteGetNoteTagNames(); + void shouldDeliverEDAMUserExceptionInGetNoteTagNames(); + void shouldDeliverEDAMSystemExceptionInGetNoteTagNames(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames(); void shouldExecuteCreateNote(); + void shouldDeliverEDAMUserExceptionInCreateNote(); + void shouldDeliverEDAMSystemExceptionInCreateNote(); + void shouldDeliverEDAMNotFoundExceptionInCreateNote(); void shouldExecuteUpdateNote(); + void shouldDeliverEDAMUserExceptionInUpdateNote(); + void shouldDeliverEDAMSystemExceptionInUpdateNote(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNote(); void shouldExecuteDeleteNote(); + void shouldDeliverEDAMUserExceptionInDeleteNote(); + void shouldDeliverEDAMSystemExceptionInDeleteNote(); + void shouldDeliverEDAMNotFoundExceptionInDeleteNote(); void shouldExecuteExpungeNote(); + void shouldDeliverEDAMUserExceptionInExpungeNote(); + void shouldDeliverEDAMSystemExceptionInExpungeNote(); + void shouldDeliverEDAMNotFoundExceptionInExpungeNote(); void shouldExecuteCopyNote(); + void shouldDeliverEDAMUserExceptionInCopyNote(); + void shouldDeliverEDAMSystemExceptionInCopyNote(); + void shouldDeliverEDAMNotFoundExceptionInCopyNote(); void shouldExecuteListNoteVersions(); + void shouldDeliverEDAMUserExceptionInListNoteVersions(); + void shouldDeliverEDAMSystemExceptionInListNoteVersions(); + void shouldDeliverEDAMNotFoundExceptionInListNoteVersions(); void shouldExecuteGetNoteVersion(); + void shouldDeliverEDAMUserExceptionInGetNoteVersion(); + void shouldDeliverEDAMSystemExceptionInGetNoteVersion(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteVersion(); void shouldExecuteGetResource(); + void shouldDeliverEDAMUserExceptionInGetResource(); + void shouldDeliverEDAMSystemExceptionInGetResource(); + void shouldDeliverEDAMNotFoundExceptionInGetResource(); void shouldExecuteGetResourceApplicationData(); + void shouldDeliverEDAMUserExceptionInGetResourceApplicationData(); + void shouldDeliverEDAMSystemExceptionInGetResourceApplicationData(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData(); void shouldExecuteGetResourceApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry(); void shouldExecuteSetResourceApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry(); void shouldExecuteUnsetResourceApplicationDataEntry(); + void shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry(); + void shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry(); + void shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry(); void shouldExecuteUpdateResource(); + void shouldDeliverEDAMUserExceptionInUpdateResource(); + void shouldDeliverEDAMSystemExceptionInUpdateResource(); + void shouldDeliverEDAMNotFoundExceptionInUpdateResource(); void shouldExecuteGetResourceData(); + void shouldDeliverEDAMUserExceptionInGetResourceData(); + void shouldDeliverEDAMSystemExceptionInGetResourceData(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceData(); void shouldExecuteGetResourceByHash(); + void shouldDeliverEDAMUserExceptionInGetResourceByHash(); + void shouldDeliverEDAMSystemExceptionInGetResourceByHash(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceByHash(); void shouldExecuteGetResourceRecognition(); + void shouldDeliverEDAMUserExceptionInGetResourceRecognition(); + void shouldDeliverEDAMSystemExceptionInGetResourceRecognition(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition(); void shouldExecuteGetResourceAlternateData(); + void shouldDeliverEDAMUserExceptionInGetResourceAlternateData(); + void shouldDeliverEDAMSystemExceptionInGetResourceAlternateData(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData(); void shouldExecuteGetResourceAttributes(); + void shouldDeliverEDAMUserExceptionInGetResourceAttributes(); + void shouldDeliverEDAMSystemExceptionInGetResourceAttributes(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes(); void shouldExecuteGetPublicNotebook(); + void shouldDeliverEDAMSystemExceptionInGetPublicNotebook(); + void shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook(); void shouldExecuteShareNotebook(); + void shouldDeliverEDAMUserExceptionInShareNotebook(); + void shouldDeliverEDAMNotFoundExceptionInShareNotebook(); + void shouldDeliverEDAMSystemExceptionInShareNotebook(); void shouldExecuteCreateOrUpdateNotebookShares(); + void shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares(); + void shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares(); + void shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares(); + void shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares(); void shouldExecuteUpdateSharedNotebook(); + void shouldDeliverEDAMUserExceptionInUpdateSharedNotebook(); + void shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook(); + void shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook(); void shouldExecuteSetNotebookRecipientSettings(); + void shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings(); + void shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings(); + void shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings(); void shouldExecuteListSharedNotebooks(); + void shouldDeliverEDAMUserExceptionInListSharedNotebooks(); + void shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks(); + void shouldDeliverEDAMSystemExceptionInListSharedNotebooks(); void shouldExecuteCreateLinkedNotebook(); + void shouldDeliverEDAMUserExceptionInCreateLinkedNotebook(); + void shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook(); + void shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook(); void shouldExecuteUpdateLinkedNotebook(); + void shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook(); + void shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook(); + void shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook(); void shouldExecuteListLinkedNotebooks(); + void shouldDeliverEDAMUserExceptionInListLinkedNotebooks(); + void shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks(); + void shouldDeliverEDAMSystemExceptionInListLinkedNotebooks(); void shouldExecuteExpungeLinkedNotebook(); + void shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook(); + void shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook(); + void shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook(); void shouldExecuteAuthenticateToSharedNotebook(); + void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook(); + void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook(); void shouldExecuteGetSharedNotebookByAuth(); + void shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth(); + void shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth(); + void shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth(); void shouldExecuteEmailNote(); + void shouldDeliverEDAMUserExceptionInEmailNote(); + void shouldDeliverEDAMNotFoundExceptionInEmailNote(); + void shouldDeliverEDAMSystemExceptionInEmailNote(); void shouldExecuteShareNote(); + void shouldDeliverEDAMUserExceptionInShareNote(); + void shouldDeliverEDAMNotFoundExceptionInShareNote(); + void shouldDeliverEDAMSystemExceptionInShareNote(); void shouldExecuteStopSharingNote(); + void shouldDeliverEDAMUserExceptionInStopSharingNote(); + void shouldDeliverEDAMNotFoundExceptionInStopSharingNote(); + void shouldDeliverEDAMSystemExceptionInStopSharingNote(); void shouldExecuteAuthenticateToSharedNote(); + void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote(); + void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote(); void shouldExecuteFindRelated(); + void shouldDeliverEDAMUserExceptionInFindRelated(); + void shouldDeliverEDAMSystemExceptionInFindRelated(); + void shouldDeliverEDAMNotFoundExceptionInFindRelated(); void shouldExecuteUpdateNoteIfUsnMatches(); + void shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches(); + void shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches(); void shouldExecuteManageNotebookShares(); + void shouldDeliverEDAMUserExceptionInManageNotebookShares(); + void shouldDeliverEDAMNotFoundExceptionInManageNotebookShares(); + void shouldDeliverEDAMSystemExceptionInManageNotebookShares(); void shouldExecuteGetNotebookShares(); + void shouldDeliverEDAMUserExceptionInGetNotebookShares(); + void shouldDeliverEDAMNotFoundExceptionInGetNotebookShares(); + void shouldDeliverEDAMSystemExceptionInGetNotebookShares(); }; } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 010c7015..69152f77 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -812,7 +812,7 @@ void UserStoreTester::shouldExecuteCheckVersion() [&] (const QString & clientNameParam, qint16 edamVersionMajorParam, qint16 edamVersionMinorParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> bool { Q_ASSERT(clientName == clientNameParam); Q_ASSERT(edamVersionMajor == edamVersionMajorParam); @@ -897,7 +897,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() UserStoreGetBootstrapInfoTesterHelper helper( [&] (const QString & localeParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> BootstrapInfo { Q_ASSERT(locale == localeParam); return response; @@ -990,7 +990,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() const QString & deviceIdentifierParam, const QString & deviceDescriptionParam, bool supportsTwoFactorParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(username == usernameParam); Q_ASSERT(password == passwordParam); @@ -1072,6 +1072,239 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QVERIFY(res == response); } +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() @@ -1088,7 +1321,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() [&] (const QString & oneTimeCodeParam, const QString & deviceIdentifierParam, const QString & deviceDescriptionParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(oneTimeCode == oneTimeCodeParam); @@ -1163,31 +1396,42 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteRevokeLongSession() +void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication() { + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return; + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::completeTwoFactorAuthenticationRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1215,7 +1459,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1235,37 +1479,62 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->revokeLongSession( - ctx); -} + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void UserStoreTester::shouldExecuteAuthenticateToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication() { + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::completeTwoFactorAuthenticationRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1293,7 +1562,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1313,38 +1582,2357 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->authenticateToBusiness( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteGetUser() +void UserStoreTester::shouldExecuteRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->revokeLongSession( + ctx); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + User response = generateRandomUser(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + User res = userStore->getUser( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + PublicUserInfo response = generateRandomPublicUserInfo(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw notFoundException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.parameter = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUserUrls() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserUrls response = generateRandomUserUrls(); + + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequest, + &helper, + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &server, + &UserStoreServer::onGetUserUrlsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + UserUrls res = userStore->getUserUrls( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequest, + &helper, + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &server, + &UserStoreServer::onGetUserUrlsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + UserUrls res = userStore->getUserUrls( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequest, + &helper, + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &server, + &UserStoreServer::onGetUserUrlsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserUrlsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + UserUrls res = userStore->getUserUrls( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteInviteToBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequest, + &helper, + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &server, + &UserStoreServer::onInviteToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->inviteToBusiness( + emailAddress, + ctx); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequest, + &helper, + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &server, + &UserStoreServer::onInviteToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->inviteToBusiness( + emailAddress, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequest, + &helper, + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &server, + &UserStoreServer::onInviteToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::inviteToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->inviteToBusiness( + emailAddress, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteRemoveFromBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->removeFromBusiness( + emailAddress, + ctx); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->removeFromBusiness( + emailAddress, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->removeFromBusiness( + emailAddress, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw notFoundException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->removeFromBusiness( + emailAddress, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() +{ + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequest, + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + QObject::connect( + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &server, + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier() +{ + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_FEW; + userException.parameter = generateRandomString(); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequest, + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + QObject::connect( + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &server, + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier() +{ + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequest, + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + QObject::connect( + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &server, + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier() { + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - User response = generateRandomUser(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1372,7 +3960,7 @@ void UserStoreTester::shouldExecuteGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1392,39 +3980,53 @@ void UserStoreTester::shouldExecuteGetUser() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - User res = userStore->getUser( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteGetPublicUserInfo() +void UserStoreTester::shouldExecuteListBusinessUsers() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - PublicUserInfo response = generateRandomPublicUserInfo(); + QList response; + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { - Q_ASSERT(username == usernameParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1452,7 +4054,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1472,39 +4074,38 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - PublicUserInfo res = userStore->getPublicUserInfo( - username, + QList res = userStore->listBusinessUsers( ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetUserUrls() +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserUrls response = generateRandomUserUrls(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1532,7 +4133,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1552,39 +4153,50 @@ void UserStoreTester::shouldExecuteGetUserUrls() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - UserUrls res = userStore->getUserUrls( - ctx); - QVERIFY(res == response); -} + bool caughtException = false; + try + { + QList res = userStore->listBusinessUsers( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void UserStoreTester::shouldExecuteInviteToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreInviteToBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - return; + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onInviteToBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1612,7 +4224,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1632,39 +4244,55 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->inviteToBusiness( - emailAddress, - ctx); + bool caughtException = false; + try + { + QList res = userStore->listBusinessUsers( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteRemoveFromBusiness() +void UserStoreTester::shouldExecuteListBusinessInvitations() { - QString emailAddress = generateRandomString(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) + QList response; + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); + + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - return; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1692,7 +4320,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1712,42 +4340,42 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->removeFromBusiness( - emailAddress, + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - return; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1775,7 +4403,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1795,42 +4423,54 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, - ctx); -} + bool caughtException = false; + try + { + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } -//////////////////////////////////////////////////////////////////////////////// + QVERIFY(caughtException); +} -void UserStoreTester::shouldExecuteListBusinessUsers() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations() { + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomUserProfile(); - response << generateRandomUserProfile(); - response << generateRandomUserProfile(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreListBusinessUsersTesterHelper helper( - [&] (IRequestContextPtr ctxParam) + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onListBusinessUsersRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1858,7 +4498,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1878,44 +4518,51 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - QList res = userStore->listBusinessUsers( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteListBusinessInvitations() +void UserStoreTester::shouldExecuteGetAccountLimits() { - bool includeRequestedInvitations = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + ServiceLevel serviceLevel = ServiceLevel::BASIC; + IRequestContextPtr ctx = newRequestContext(); - QList response; - response << generateRandomBusinessInvitation(); - response << generateRandomBusinessInvitation(); - response << generateRandomBusinessInvitation(); + AccountLimits response = generateRandomAccountLimits(); - UserStoreListBusinessInvitationsTesterHelper helper( - [&] (bool includeRequestedInvitationsParam, - IRequestContextPtr ctxParam) + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) -> AccountLimits { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + Q_ASSERT(serviceLevel == serviceLevelParam); return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequest, + &UserStoreServer::getAccountLimitsRequest, &helper, - &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, &server, - &UserStoreServer::onListBusinessInvitationsRequestReady); + &UserStoreServer::onGetAccountLimitsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1943,7 +4590,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequestReady, + &UserStoreServer::getAccountLimitsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1963,27 +4610,27 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - QList res = userStore->listBusinessInvitations( - includeRequestedInvitations, + AccountLimits res = userStore->getAccountLimits( + serviceLevel, ctx); QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetAccountLimits() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() { ServiceLevel serviceLevel = ServiceLevel::BUSINESS; IRequestContextPtr ctx = newRequestContext(); - AccountLimits response = generateRandomAccountLimits(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); UserStoreGetAccountLimitsTesterHelper helper( [&] (const ServiceLevel & serviceLevelParam, - IRequestContextPtr ctxParam) + IRequestContextPtr ctxParam) -> AccountLimits { Q_ASSERT(serviceLevel == serviceLevelParam); - return response; + throw userException; }); UserStoreServer server; @@ -2044,10 +4691,21 @@ void UserStoreTester::shouldExecuteGetAccountLimits() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AccountLimits res = userStore->getAccountLimits( - serviceLevel, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AccountLimits res = userStore->getAccountLimits( + serviceLevel, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.h b/QEverCloud/src/tests/generated/TestUserStore.h index bb66f96f..cd01a7f8 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.h +++ b/QEverCloud/src/tests/generated/TestUserStore.h @@ -29,18 +29,46 @@ private Q_SLOTS: void shouldExecuteCheckVersion(); void shouldExecuteGetBootstrapInfo(); void shouldExecuteAuthenticateLongSession(); + void shouldDeliverEDAMUserExceptionInAuthenticateLongSession(); + void shouldDeliverEDAMSystemExceptionInAuthenticateLongSession(); void shouldExecuteCompleteTwoFactorAuthentication(); + void shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication(); + void shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication(); void shouldExecuteRevokeLongSession(); + void shouldDeliverEDAMUserExceptionInRevokeLongSession(); + void shouldDeliverEDAMSystemExceptionInRevokeLongSession(); void shouldExecuteAuthenticateToBusiness(); + void shouldDeliverEDAMUserExceptionInAuthenticateToBusiness(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness(); void shouldExecuteGetUser(); + void shouldDeliverEDAMUserExceptionInGetUser(); + void shouldDeliverEDAMSystemExceptionInGetUser(); void shouldExecuteGetPublicUserInfo(); + void shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo(); + void shouldDeliverEDAMSystemExceptionInGetPublicUserInfo(); + void shouldDeliverEDAMUserExceptionInGetPublicUserInfo(); void shouldExecuteGetUserUrls(); + void shouldDeliverEDAMUserExceptionInGetUserUrls(); + void shouldDeliverEDAMSystemExceptionInGetUserUrls(); void shouldExecuteInviteToBusiness(); + void shouldDeliverEDAMUserExceptionInInviteToBusiness(); + void shouldDeliverEDAMSystemExceptionInInviteToBusiness(); void shouldExecuteRemoveFromBusiness(); + void shouldDeliverEDAMUserExceptionInRemoveFromBusiness(); + void shouldDeliverEDAMSystemExceptionInRemoveFromBusiness(); + void shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness(); void shouldExecuteUpdateBusinessUserIdentifier(); + void shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier(); + void shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier(); + void shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier(); void shouldExecuteListBusinessUsers(); + void shouldDeliverEDAMUserExceptionInListBusinessUsers(); + void shouldDeliverEDAMSystemExceptionInListBusinessUsers(); void shouldExecuteListBusinessInvitations(); + void shouldDeliverEDAMUserExceptionInListBusinessInvitations(); + void shouldDeliverEDAMSystemExceptionInListBusinessInvitations(); void shouldExecuteGetAccountLimits(); + void shouldDeliverEDAMUserExceptionInGetAccountLimits(); }; } // namespace qevercloud From 270379b06213068794dffba9d12975e8663f6c16 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 20:50:24 +0300 Subject: [PATCH 089/188] Add missing keywords for EverCloudException's destructor and what method --- QEverCloud/headers/EverCloudException.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index 356e7fe0..a946ae84 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -40,9 +40,9 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception explicit EverCloudException(const std::string & error); explicit EverCloudException(const char * error); - ~EverCloudException() noexcept; + virtual ~EverCloudException() noexcept override; - const char * what() const noexcept; + virtual const char * what() const noexcept override; virtual QSharedPointer exceptionData() const; }; From 52fa9902e1e9374341cdbe6f148c9263acb1696e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 20:51:09 +0300 Subject: [PATCH 090/188] Add comparison operators for NetworkException and ThriftException --- QEverCloud/headers/Exceptions.h | 6 ++++++ QEverCloud/src/Exceptions.cpp | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index 7fcdb7f0..d171529c 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -32,6 +32,9 @@ class QEVERCLOUD_EXPORT NetworkException: public EverCloudException NetworkException(); NetworkException(QNetworkReply::NetworkError error); NetworkException(QNetworkReply::NetworkError error, QString message); + virtual ~NetworkException() noexcept override; + + bool operator==(const NetworkException & other) const; QNetworkReply::NetworkError type() const; @@ -83,6 +86,9 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException ThriftException(); ThriftException(Type type); ThriftException(Type type, QString message); + virtual ~ThriftException() noexcept override; + + bool operator==(const ThriftException & other) const; Type type() const; diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 62773e90..82e19241 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -37,6 +37,14 @@ NetworkException::NetworkException( m_type(type) {} +NetworkException::~NetworkException() noexcept +{} + +bool NetworkException::operator==(const NetworkException & other) const +{ + return m_type == other.m_type && m_error == other.m_error; +} + QNetworkReply::NetworkError NetworkException::type() const { return m_type; @@ -161,6 +169,14 @@ ThriftException::ThriftException(ThriftException::Type type, QString message) : m_type(type) {} +ThriftException::~ThriftException() noexcept +{} + +bool ThriftException::operator==(const ThriftException & other) const +{ + return m_type == other.m_type && m_error == other.m_error; +} + ThriftException::Type ThriftException::type() const { return m_type; From c385f63dddc4602d0a2243e383a82ca74909cbbb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 20:59:08 +0300 Subject: [PATCH 091/188] Add unequality checking operators to NetworkException and ThriftException --- QEverCloud/headers/Exceptions.h | 2 ++ QEverCloud/src/Exceptions.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index d171529c..b7f4668c 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -35,6 +35,7 @@ class QEVERCLOUD_EXPORT NetworkException: public EverCloudException virtual ~NetworkException() noexcept override; bool operator==(const NetworkException & other) const; + bool operator!=(const NetworkException & other) const; QNetworkReply::NetworkError type() const; @@ -89,6 +90,7 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException virtual ~ThriftException() noexcept override; bool operator==(const ThriftException & other) const; + bool operator!=(const ThriftException & other) const; Type type() const; diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 82e19241..76f335d0 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -45,6 +45,11 @@ bool NetworkException::operator==(const NetworkException & other) const return m_type == other.m_type && m_error == other.m_error; } +bool NetworkException::operator!=(const NetworkException & other) const +{ + return !operator==(other); +} + QNetworkReply::NetworkError NetworkException::type() const { return m_type; @@ -177,6 +182,11 @@ bool ThriftException::operator==(const ThriftException & other) const return m_type == other.m_type && m_error == other.m_error; } +bool ThriftException::operator!=(const ThriftException & other) const +{ + return !operator==(other); +} + ThriftException::Type ThriftException::type() const { return m_type; From 6c4a7e3ea5d9d8c7a088c3466fd7b2a3106e06cc Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 21:17:13 +0300 Subject: [PATCH 092/188] Add missing stop field for ThriftException writer + add printing of missing ThriftException types in ThriftException::what --- QEverCloud/src/Exceptions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 76f335d0..de4c45a3 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -210,6 +210,10 @@ const char * ThriftException::what() const noexcept return "ThriftException: Bad sequence identifier"; case Type::MISSING_RESULT: return "ThriftException: Missing result"; + case Type::INTERNAL_ERROR: + return "ThriftException: Internal error"; + case Type::PROTOCOL_ERROR: + return "ThriftException: Protocol error"; case Type::INVALID_DATA: return "ThriftException: Invalid data"; default: @@ -359,6 +363,9 @@ void writeThriftException( writer.writeI32(static_cast(exception.type())); writer.writeFieldEnd(); + writer.writeFieldBegin(QString(), ThriftFieldType::T_STOP, 0); + writer.writeFieldEnd(); + writer.writeStructEnd(); } From 9cf2fa51c924fbe208fe820d75c6c88276fc10aa Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 30 Nov 2019 21:19:04 +0300 Subject: [PATCH 093/188] Update generated code --- .../tests/generated/RandomDataGenerators.cpp | 50 +- .../src/tests/generated/TestNoteStore.cpp | 9433 ++++++++++++++--- .../src/tests/generated/TestNoteStore.h | 74 + .../src/tests/generated/TestUserStore.cpp | 2032 +++- .../src/tests/generated/TestUserStore.h | 15 + 5 files changed, 9937 insertions(+), 1667 deletions(-) diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp index dfcc81ce..81b09ac6 100644 --- a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -420,8 +420,8 @@ RelatedResultSpec generateRandomRelatedResultSpec() result.maxRelatedContent = generateRandomInt32(); result.relatedContentTypes = QSet(); result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); - result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); result.relatedContentTypes->insert(RelatedContentType::PROFILE_ORGANIZATION); + result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE); return result; } @@ -448,7 +448,7 @@ InvitationShareRelationship generateRandomInvitationShareRelationship() InvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientUserIdentity = generateRandomUserIdentity(); - result.privilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; + result.privilege = ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; result.sharerUserId = generateRandomInt32(); return result; } @@ -458,8 +458,8 @@ MemberShareRelationship generateRandomMemberShareRelationship() MemberShareRelationship result; result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); - result.bestPrivilege = ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; - result.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; + result.bestPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; + result.individualPrivilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; result.restrictions = generateRandomShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -505,7 +505,7 @@ ManageNotebookSharesError generateRandomManageNotebookSharesError() ManageNotebookSharesError result; result.userIdentity = generateRandomUserIdentity(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + result.userException->errorCode = EDAMErrorCode::TOO_FEW; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -532,7 +532,7 @@ SharedNoteTemplate generateRandomSharedNoteTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; return result; } @@ -545,7 +545,7 @@ NotebookShareTemplate generateRandomNotebookShareTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; return result; } @@ -574,7 +574,7 @@ NoteMemberShareRelationship generateRandomNoteMemberShareRelationship() NoteMemberShareRelationship result; result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); - result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + result.privilege = SharedNotePrivilegeLevel::READ_NOTE; result.restrictions = generateRandomNoteShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -585,7 +585,7 @@ NoteInvitationShareRelationship generateRandomNoteInvitationShareRelationship() NoteInvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientIdentityId = generateRandomInt64(); - result.privilege = SharedNotePrivilegeLevel::READ_NOTE; + result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; result.sharerUserId = generateRandomInt32(); return result; } @@ -634,7 +634,7 @@ ManageNoteSharesError generateRandomManageNoteSharesError() result.identityID = generateRandomInt64(); result.userID = generateRandomInt32(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + result.userException->errorCode = EDAMErrorCode::UNKNOWN; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -699,7 +699,7 @@ UserAttributes generateRandomUserAttributes() result.businessAddress = generateRandomString(); result.hideSponsorBilling = generateRandomBool(); result.useEmailAutoFiling = generateRandomBool(); - result.reminderEmailConfig = ReminderEmailConfig::DO_NOT_SEND; + result.reminderEmailConfig = ReminderEmailConfig::SEND_DAILY_EMAIL; result.emailAddressLastConfirmed = generateRandomInt64(); result.passwordUpdated = generateRandomInt64(); result.salesforcePushEnabled = generateRandomBool(); @@ -726,7 +726,7 @@ Accounting generateRandomAccounting() Accounting result; result.uploadLimitEnd = generateRandomInt64(); result.uploadLimitNextMonth = generateRandomInt64(); - result.premiumServiceStatus = PremiumOrderStatus::CANCELED; + result.premiumServiceStatus = PremiumOrderStatus::PENDING; result.premiumOrderNumber = generateRandomString(); result.premiumCommerceService = generateRandomString(); result.premiumServiceStart = generateRandomInt64(); @@ -755,7 +755,7 @@ BusinessUserInfo generateRandomBusinessUserInfo() BusinessUserInfo result; result.businessId = generateRandomInt32(); result.businessName = generateRandomString(); - result.role = BusinessUserRole::NORMAL; + result.role = BusinessUserRole::ADMIN; result.email = generateRandomString(); result.updated = generateRandomInt64(); return result; @@ -786,8 +786,8 @@ User generateRandomUser() result.email = generateRandomString(); result.name = generateRandomString(); result.timezone = generateRandomString(); - result.privilege = PrivilegeLevel::VIP; - result.serviceLevel = ServiceLevel::PLUS; + result.privilege = PrivilegeLevel::MANAGER; + result.serviceLevel = ServiceLevel::BASIC; result.created = generateRandomInt64(); result.updated = generateRandomInt64(); result.deleted = generateRandomInt64(); @@ -994,7 +994,7 @@ Publishing generateRandomPublishing() { Publishing result; result.uri = generateRandomString(); - result.order = NoteSortOrder::TITLE; + result.order = NoteSortOrder::CREATED; result.ascending = generateRandomBool(); result.publicDescription = generateRandomString(); return result; @@ -1004,7 +1004,7 @@ BusinessNotebook generateRandomBusinessNotebook() { BusinessNotebook result; result.notebookDescription = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; result.recommended = generateRandomBool(); return result; } @@ -1045,7 +1045,7 @@ NotebookRecipientSettings generateRandomNotebookRecipientSettings() result.reminderNotifyInApp = generateRandomBool(); result.inMyList = generateRandomBool(); result.stack = generateRandomString(); - result.recipientStatus = RecipientStatus::NOT_IN_MY_LIST; + result.recipientStatus = RecipientStatus::IN_MY_LIST_AND_DEFAULT_NOTEBOOK; return result; } @@ -1062,7 +1062,7 @@ SharedNotebook generateRandomSharedNotebook() result.serviceUpdated = generateRandomInt64(); result.globalId = generateRandomString(); result.username = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::BUSINESS_FULL_ACCESS; + result.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; result.recipientSettings = generateRandomSharedNotebookRecipientSettings(); result.sharerUserId = generateRandomInt32(); result.recipientUsername = generateRandomString(); @@ -1074,7 +1074,7 @@ SharedNotebook generateRandomSharedNotebook() CanMoveToContainerRestrictions generateRandomCanMoveToContainerRestrictions() { CanMoveToContainerRestrictions result; - result.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_CONTAINER_PRIVILEGE; + result.canMoveToContainer = CanMoveToContainerStatus::INSUFFICIENT_ENTITY_PRIVILEGE; return result; } @@ -1099,7 +1099,7 @@ NotebookRestrictions generateRandomNotebookRestrictions() result.noExpungeTags = generateRandomBool(); result.noSetParentTag = generateRandomBool(); result.noCreateSharedNotebooks = generateRandomBool(); - result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; + result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; result.noShareNotesWithBusiness = generateRandomBool(); result.noRenameNotebook = generateRandomBool(); @@ -1212,7 +1212,7 @@ RelatedContent generateRandomRelatedContent() result.thumbnails.ref() << generateRandomRelatedContentImage(); result.thumbnails.ref() << generateRandomRelatedContentImage(); result.contentType = RelatedContentType::PROFILE_ORGANIZATION; - result.accessType = RelatedContentAccess::DIRECT_LINK_LOGIN_REQUIRED; + result.accessType = RelatedContentAccess::DIRECT_LINK_ACCESS_OK; result.visibleUrl = generateRandomString(); result.clipUrl = generateRandomString(); result.contact = generateRandomContact(); @@ -1228,8 +1228,8 @@ BusinessInvitation generateRandomBusinessInvitation() BusinessInvitation result; result.businessId = generateRandomInt32(); result.email = generateRandomString(); - result.role = BusinessUserRole::NORMAL; - result.status = BusinessInvitationStatus::APPROVED; + result.role = BusinessUserRole::ADMIN; + result.status = BusinessInvitationStatus::REQUESTED; result.requesterId = generateRandomInt32(); result.fromWorkChat = generateRandomBool(); result.created = generateRandomInt64(); @@ -1250,7 +1250,7 @@ PublicUserInfo generateRandomPublicUserInfo() { PublicUserInfo result; result.userId = generateRandomInt32(); - result.serviceLevel = ServiceLevel::BUSINESS; + result.serviceLevel = ServiceLevel::PLUS; result.username = generateRandomString(); result.noteStoreUrl = generateRandomString(); result.webApiUrlPrefix = generateRandomString(); diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index af99117d..58ac96ff 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -4147,6 +4147,92 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() @@ -4437,6 +4523,104 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() @@ -4795,45 +4979,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() { LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = generateRandomSyncChunk(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + IRequestContextPtr ctxParam) -> SyncState { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - return response; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4861,7 +5034,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4879,16 +5052,26 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() { LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); qint32 afterUSN = generateRandomInt32(); @@ -4897,9 +5080,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + SyncChunk response = generateRandomSyncChunk(); NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -4913,7 +5094,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk Q_ASSERT(afterUSN == afterUSNParam); Q_ASSERT(maxEntries == maxEntriesParam); Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw userException; + return response; }); NoteStoreServer server; @@ -4972,27 +5153,16 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + QVERIFY(res == response); +} - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk() { LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); qint32 afterUSN = generateRandomInt32(); @@ -5001,10 +5171,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -5018,7 +5187,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu Q_ASSERT(afterUSN == afterUSNParam); Q_ASSERT(maxEntries == maxEntriesParam); Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw systemException; + throw userException; }); NoteStoreServer server; @@ -5088,16 +5257,16 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk() { LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); qint32 afterUSN = generateRandomInt32(); @@ -5106,9 +5275,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( [&] (const LinkedNotebook & linkedNotebookParam, @@ -5122,7 +5292,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC Q_ASSERT(afterUSN == afterUSNParam); Q_ASSERT(maxEntries == maxEntriesParam); Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; @@ -5192,45 +5362,54 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListNotebooks() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk() { + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5258,7 +5437,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5276,38 +5455,63 @@ void NoteStoreTester::shouldExecuteListNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listNotebooks( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() { + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5335,7 +5539,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5356,34 +5560,40 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() bool caughtException = false; try { - QList res = noteStore->listNotebooks( + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNotebooks() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); NoteStoreListNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + return response; }); NoteStoreServer server; @@ -5442,52 +5652,38 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QList res = noteStore->listNotebooks( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + QList res = noteStore->listNotebooks( + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + NoteStoreListNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::listNotebooksRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onListNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5515,7 +5711,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::listNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5533,38 +5729,50 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listAccessibleBusinessNotebooks( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + NoteStoreListNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::listNotebooksRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onListNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5592,7 +5800,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::listNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5613,47 +5821,44 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote bool caughtException = false; try { - QList res = noteStore->listAccessibleBusinessNotebooks( + QList res = noteStore->listNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + NoteStoreListNotebooksTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::listNotebooksRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onListNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5681,7 +5886,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::listNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5702,14 +5907,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo bool caughtException = false; try { - QList res = noteStore->listAccessibleBusinessNotebooks( + QList res = noteStore->listNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -5717,34 +5922,34 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNotebook() +void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5772,7 +5977,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5790,42 +5995,38 @@ void NoteStoreTester::shouldExecuteGetNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getNotebook( - guid, + QList res = noteStore->listAccessibleBusinessNotebooks( ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.errorCode = EDAMErrorCode::INVALID_AUTH; userException.parameter = generateRandomString(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5853,7 +6054,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5874,8 +6075,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + QList res = noteStore->listAccessibleBusinessNotebooks( ctx); Q_UNUSED(res) } @@ -5888,37 +6088,34 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5946,7 +6143,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5967,8 +6164,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + QList res = noteStore->listAccessibleBusinessNotebooks( ctx); Q_UNUSED(res) } @@ -5981,36 +6177,31 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6038,7 +6229,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6059,15 +6250,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + QList res = noteStore->listAccessibleBusinessNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -6075,31 +6265,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetDefaultNotebook() +void NoteStoreTester::shouldExecuteGetNotebook() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); Notebook response = generateRandomNotebook(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::getNotebookRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onGetNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6127,7 +6320,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::getNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6145,38 +6338,42 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getDefaultNotebook( + Notebook res = noteStore->getNotebook( + guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; userException.parameter = generateRandomString(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::getNotebookRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onGetNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6204,7 +6401,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::getNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6225,7 +6422,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() bool caughtException = false; try { - Notebook res = noteStore->getDefaultNotebook( + Notebook res = noteStore->getNotebook( + guid, ctx); Q_UNUSED(res) } @@ -6238,34 +6436,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::getNotebookRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onGetNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6293,7 +6494,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::getNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6314,7 +6515,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() bool caughtException = false; try { - Notebook res = noteStore->getDefaultNotebook( + Notebook res = noteStore->getNotebook( + guid, ctx); Q_UNUSED(res) } @@ -6327,36 +6529,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() { - Notebook notebook = generateRandomNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - return response; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::getNotebookRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onGetNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6384,7 +6586,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::getNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6402,42 +6604,51 @@ void NoteStoreTester::shouldExecuteCreateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->createNotebook( - notebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() { - Notebook notebook = generateRandomNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - throw userException; + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::getNotebookRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onGetNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6465,7 +6676,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::getNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6486,51 +6697,47 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + Notebook res = noteStore->getNotebook( + guid, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetDefaultNotebook() { - Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + Notebook response = generateRandomNotebook(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - throw systemException; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::getDefaultNotebookRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onGetDefaultNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6558,7 +6765,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::getDefaultNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6576,53 +6783,38 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - Notebook res = noteStore->createNotebook( - notebook, - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + Notebook res = noteStore->getDefaultNotebook( + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() { - Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - throw notFoundException; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::getDefaultNotebookRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onGetDefaultNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6650,7 +6842,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::getDefaultNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6671,50 +6863,47 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + Notebook res = noteStore->getDefaultNotebook( ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() { - Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - return response; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getDefaultNotebookRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetDefaultNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6742,7 +6931,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getDefaultNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6760,42 +6949,47 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateNotebook( - notebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() { - Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); - throw userException; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getDefaultNotebookRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetDefaultNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6823,7 +7017,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getDefaultNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6844,51 +7038,49 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( - notebook, + Notebook res = noteStore->getDefaultNotebook( ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNotebook() { Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_AUTH; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + Notebook response = generateRandomNotebook(); - NoteStoreUpdateNotebookTesterHelper helper( + NoteStoreCreateNotebookTesterHelper helper( [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(notebook == notebookParam); - throw systemException; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::createNotebookRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onCreateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6916,7 +7108,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::createNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6934,53 +7126,42 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->updateNotebook( - notebook, - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + Notebook res = noteStore->createNotebook( + notebook, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() { Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreUpdateNotebookTesterHelper helper( + NoteStoreCreateNotebookTesterHelper helper( [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(notebook == notebookParam); - throw notFoundException; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::createNotebookRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onCreateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7008,7 +7189,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::createNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7029,50 +7210,51 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( + Notebook res = noteStore->createNotebook( notebook, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() { - Guid guid = generateRandomString(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(notebook == notebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::createNotebookRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onCreateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7100,7 +7282,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::createNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7118,42 +7300,53 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeNotebook( - guid, - ctx); - QVERIFY(res == response); -} - -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() { - Guid guid = generateRandomString(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(notebook == notebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::createNotebookRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onCreateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7181,7 +7374,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::createNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7202,51 +7395,48 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeNotebook( - guid, + Notebook res = noteStore->createNotebook( + notebook, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() { - Guid guid = generateRandomString(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(notebook == notebookParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::createNotebookRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onCreateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7274,7 +7464,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::createNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7295,50 +7485,50 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeNotebook( - guid, + Notebook res = noteStore->createNotebook( + notebook, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNotebook() { - Guid guid = generateRandomString(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + qint32 response = generateRandomInt32(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(notebook == notebookParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::updateNotebookRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onUpdateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7366,7 +7556,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::updateNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7384,53 +7574,42 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->expungeNotebook( - guid, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListTags() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() { + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(notebook == notebookParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::updateNotebookRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onUpdateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7458,7 +7637,7 @@ void NoteStoreTester::shouldExecuteListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::updateNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7476,38 +7655,54 @@ void NoteStoreTester::shouldExecuteListTags() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTags( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() { + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(notebook == notebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::updateNotebookRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onUpdateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7535,7 +7730,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::updateNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7556,47 +7751,50 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() bool caughtException = false; try { - QList res = noteStore->listTags( + qint32 res = noteStore->updateNotebook( + notebook, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() { + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(notebook == notebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::updateNotebookRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onUpdateNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7624,7 +7822,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::updateNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7645,52 +7843,140 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() bool caughtException = false; try { - QList res = noteStore->listTags( + qint32 res = noteStore->updateNotebook( + notebook, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListTagsByNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() { - Guid notebookGuid = generateRandomString(); + Notebook notebook = generateRandomNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(notebook == notebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::expungeNotebookRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onExpungeNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7718,7 +8004,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::expungeNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7736,42 +8022,42 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTagsByNotebook( - notebookGuid, + qint32 res = noteStore->expungeNotebook( + guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; userException.parameter = generateRandomString(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::expungeNotebookRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onExpungeNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7799,7 +8085,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::expungeNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7820,8 +8106,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + qint32 res = noteStore->expungeNotebook( + guid, ctx); Q_UNUSED(res) } @@ -7834,37 +8120,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::expungeNotebookRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onExpungeNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7892,7 +8178,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::expungeNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7913,8 +8199,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + qint32 res = noteStore->expungeNotebook( + guid, ctx); Q_UNUSED(res) } @@ -7927,9 +8213,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -7937,26 +8223,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::expungeNotebookRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onExpungeNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7984,7 +8270,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::expungeNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8005,8 +8291,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + qint32 res = noteStore->expungeNotebook( + guid, ctx); Q_UNUSED(res) } @@ -8019,36 +8305,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetTag() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreGetTagTesterHelper helper( + NoteStoreExpungeNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::expungeNotebookRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onExpungeNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8076,7 +8360,7 @@ void NoteStoreTester::shouldExecuteGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::expungeNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8094,42 +8378,1469 @@ void NoteStoreTester::shouldExecuteGetTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->getTag( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTags() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; - userException.parameter = generateRandomString(); + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTags( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->getTag( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->createTag( + tag, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - NoteStoreGetTagTesterHelper helper( - [&] (const Guid & guidParam, + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, IRequestContextPtr ctxParam) -> Tag { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(tag == tagParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::createTagRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onCreateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8157,7 +9868,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::createTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8178,51 +9889,50 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( - guid, + Tag res = noteStore->createTag( + tag, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() { - Guid guid = generateRandomString(); + Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetTagTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, IRequestContextPtr ctxParam) -> Tag { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(tag == tagParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::createTagRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onCreateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8250,7 +9960,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::createTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8271,50 +9981,48 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( - guid, + Tag res = noteStore->createTag( + tag, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() { - Guid guid = generateRandomString(); + Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - NoteStoreGetTagTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, IRequestContextPtr ctxParam) -> Tag { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(tag == tagParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::createTagRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onCreateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8342,7 +10050,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::createTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8363,15 +10071,15 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( - guid, + Tag res = noteStore->createTag( + tag, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -8379,17 +10087,17 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteCreateTag() +void NoteStoreTester::shouldExecuteUpdateTag() { Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + qint32 response = generateRandomInt32(); - NoteStoreCreateTagTesterHelper helper( + NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(tag == tagParam); @@ -8399,14 +10107,14 @@ void NoteStoreTester::shouldExecuteCreateTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::updateTagRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onUpdateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8434,7 +10142,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::updateTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8452,25 +10160,25 @@ void NoteStoreTester::shouldExecuteCreateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->createTag( + qint32 res = noteStore->updateTag( tag, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() { Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreCreateTagTesterHelper helper( + NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(tag == tagParam); @@ -8480,14 +10188,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::updateTagRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onUpdateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8515,7 +10223,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::updateTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8536,7 +10244,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( + qint32 res = noteStore->updateTag( tag, ctx); Q_UNUSED(res) @@ -8550,20 +10258,20 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() { Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateTagTesterHelper helper( + NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(tag == tagParam); @@ -8573,14 +10281,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::updateTagRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onUpdateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8608,7 +10316,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::updateTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8629,7 +10337,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( + qint32 res = noteStore->updateTag( tag, ctx); Q_UNUSED(res) @@ -8643,7 +10351,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() { Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( @@ -8653,9 +10361,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreCreateTagTesterHelper helper( + NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(tag == tagParam); @@ -8665,14 +10373,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::updateTagRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onUpdateTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8700,7 +10408,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::updateTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8721,7 +10429,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( + qint32 res = noteStore->updateTag( tag, ctx); Q_UNUSED(res) @@ -8735,15 +10443,13 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateTag() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() { Tag tag = generateRandomTag(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreUpdateTagTesterHelper helper( [&] (const Tag & tagParam, @@ -8751,7 +10457,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(tag == tagParam); - return response; + throw thriftException; }); NoteStoreServer server; @@ -8810,42 +10516,51 @@ void NoteStoreTester::shouldExecuteUpdateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateTag( - tag, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUntagAll() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - userException.parameter = generateRandomString(); - - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); - throw userException; + Q_ASSERT(guid == guidParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::untagAllRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onUntagAllRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8873,7 +10588,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::untagAllRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8891,54 +10606,41 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->updateTag( - tag, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } - - QVERIFY(caughtException); + noteStore->untagAll( + guid, + ctx); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + QStringLiteral("authenticationToken")); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); - throw systemException; + Q_ASSERT(guid == guidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::untagAllRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onUntagAllRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8966,7 +10668,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::untagAllRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8987,50 +10689,50 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + noteStore->untagAll( + guid, ctx); - Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); - throw notFoundException; + Q_ASSERT(guid == guidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::untagAllRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onUntagAllRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9058,7 +10760,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::untagAllRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9079,35 +10781,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + noteStore->untagAll( + guid, ctx); - Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUntagAll() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + NoteStoreUntagAllTesterHelper helper( [&] (const Guid & guidParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return; + throw notFoundException; }); NoteStoreServer server; @@ -9166,20 +10869,29 @@ void NoteStoreTester::shouldExecuteUntagAll() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->untagAll( - guid, - ctx); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() +void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreUntagAllTesterHelper helper( [&] (const Guid & guidParam, @@ -9187,7 +10899,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + throw thriftException; }); NoteStoreServer server; @@ -9253,46 +10965,45 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() guid, ctx); } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeTag() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + qint32 response = generateRandomInt32(); - NoteStoreUntagAllTesterHelper helper( + NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::expungeTagRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onExpungeTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9320,7 +11031,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::expungeTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9338,52 +11049,42 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - noteStore->untagAll( - guid, - ctx); - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + qint32 res = noteStore->expungeTag( + guid, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); - NoteStoreUntagAllTesterHelper helper( + NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::expungeTagRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onExpungeTagRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9411,7 +11112,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::expungeTagRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9432,28 +11133,30 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() bool caughtException = false; try { - noteStore->untagAll( + qint32 res = noteStore->expungeTag( guid, ctx); + Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, @@ -9461,7 +11164,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw systemException; }); NoteStoreServer server; @@ -9520,21 +11223,32 @@ void NoteStoreTester::shouldExecuteExpungeTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeTag( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, @@ -9542,7 +11256,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + throw notFoundException; }); NoteStoreServer server; @@ -9609,25 +11323,22 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreExpungeTagTesterHelper helper( [&] (const Guid & guidParam, @@ -9635,7 +11346,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -9702,45 +11413,45 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListSearches() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + QList response; + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); - NoteStoreExpungeTagTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::listSearchesRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onListSearchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9768,7 +11479,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::listSearchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9786,40 +11497,25 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->expungeTag( - guid, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); + QList res = noteStore->listSearches( + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListSearches() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); NoteStoreListSearchesTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + throw userException; }); NoteStoreServer server; @@ -9878,25 +11574,37 @@ void NoteStoreTester::shouldExecuteListSearches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listSearches( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ENML_VALIDATION; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreListSearchesTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -9962,30 +11670,27 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() +void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreListSearchesTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -10051,10 +11756,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -10418,6 +12123,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateSearch() @@ -10597,10 +12392,100 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreCreateSearchTesterHelper helper( [&] (const SavedSearch & searchParam, @@ -10608,7 +12493,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(search == searchParam); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -10675,10 +12560,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -11042,6 +12927,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeSearch() @@ -11397,19 +13372,194 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() QVERIFY(e == notFoundException); } - QVERIFY(caughtException); + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() { NoteFilter filter = generateRandomNoteFilter(); Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); NoteStoreFindNoteOffsetTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -11419,7 +13569,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; @@ -11478,23 +13628,35 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->findNoteOffset( - filter, - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() { NoteFilter filter = generateRandomNoteFilter(); Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreFindNoteOffsetTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -11504,7 +13666,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(guid == guidParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -11572,26 +13734,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() { NoteFilter filter = generateRandomNoteFilter(); Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreFindNoteOffsetTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -11601,7 +13762,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -11669,25 +13830,23 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() { NoteFilter filter = generateRandomNoteFilter(); Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreFindNoteOffsetTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -11697,7 +13856,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -11765,10 +13924,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -12180,16 +14339,203 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteFindNoteCounts() +void NoteStoreTester::shouldExecuteFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() { NoteFilter filter = generateRandomNoteFilter(); bool withTrash = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); NoteStoreFindNoteCountsTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -12199,7 +14545,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(withTrash == withTrashParam); - return response; + throw userException; }); NoteStoreServer server; @@ -12258,23 +14604,35 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() { NoteFilter filter = generateRandomNoteFilter(); bool withTrash = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreFindNoteCountsTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -12284,7 +14642,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(withTrash == withTrashParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -12352,26 +14710,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() { NoteFilter filter = generateRandomNoteFilter(); bool withTrash = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_FEW; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreFindNoteCountsTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -12381,7 +14738,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(withTrash == withTrashParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -12449,25 +14806,23 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() { NoteFilter filter = generateRandomNoteFilter(); bool withTrash = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreFindNoteCountsTesterHelper helper( [&] (const NoteFilter & filterParam, @@ -12477,7 +14832,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(filter == filterParam); Q_ASSERT(withTrash == withTrashParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -12545,10 +14900,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -12928,6 +15283,100 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNote() @@ -13350,6 +15799,112 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteApplicationData() @@ -13708,6 +16263,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() @@ -14079,12 +16724,193 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QVERIFY(e == notFoundException); } - QVERIFY(caughtException); + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); @@ -14092,7 +16918,9 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); NoteStoreSetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -14104,7 +16932,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); Q_ASSERT(value == valueParam); - return response; + throw userException; }); NoteStoreServer server; @@ -14163,15 +16991,26 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->setNoteApplicationDataEntry( - guid, - key, - value, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); @@ -14179,9 +17018,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::QUOTA_REACHED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreSetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -14193,7 +17033,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); Q_ASSERT(value == valueParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -14262,16 +17102,16 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); @@ -14279,10 +17119,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreSetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -14294,7 +17133,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); Q_ASSERT(value == valueParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -14363,16 +17202,16 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); @@ -14380,9 +17219,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreSetNoteApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -14394,7 +17231,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); Q_ASSERT(value == valueParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -14463,10 +17300,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -14846,6 +17683,100 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteContent() @@ -15128,7 +18059,97 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; @@ -15195,10 +18216,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -15594,6 +18615,104 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceSearchText() @@ -15949,21 +19068,192 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText( QVERIFY(e == notFoundException); } - QVERIFY(caughtException); + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QStringList response; + response << generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QStringList response; - response << generateRandomString(); - response << generateRandomString(); - response << generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); NoteStoreGetNoteTagNamesTesterHelper helper( [&] (const Guid & guidParam, @@ -15971,7 +19261,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; @@ -16030,21 +19320,33 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QStringList res = noteStore->getNoteTagNames( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreGetNoteTagNamesTesterHelper helper( [&] (const Guid & guidParam, @@ -16052,7 +19354,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -16119,25 +19421,24 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreGetNoteTagNamesTesterHelper helper( [&] (const Guid & guidParam, @@ -16145,7 +19446,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -16212,24 +19513,22 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreGetNoteTagNamesTesterHelper helper( [&] (const Guid & guidParam, @@ -16237,7 +19536,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -16304,10 +19603,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -16671,6 +19970,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateNote() @@ -16931,21 +20320,111 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() { Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreUpdateNoteTesterHelper helper( [&] (const Note & noteParam, @@ -16953,7 +20432,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(note == noteParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -17020,10 +20499,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -17387,6 +20866,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequest, + &helper, + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &server, + &NoteStoreServer::onDeleteNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::deleteNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->deleteNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteExpungeNote() @@ -17745,16 +21314,191 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequest, + &helper, + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &server, + &NoteStoreServer::onExpungeNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCopyNote() +{ + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequest, + &helper, + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &server, + &NoteStoreServer::onCopyNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::copyNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + QVERIFY(res == response); +} -void NoteStoreTester::shouldExecuteCopyNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() { Guid noteGuid = generateRandomString(); Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); NoteStoreCopyNoteTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -17764,7 +21508,7 @@ void NoteStoreTester::shouldExecuteCopyNote() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(noteGuid == noteGuidParam); Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - return response; + throw userException; }); NoteStoreServer server; @@ -17823,23 +21567,35 @@ void NoteStoreTester::shouldExecuteCopyNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() { Guid noteGuid = generateRandomString(); Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreCopyNoteTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -17849,7 +21605,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(noteGuid == noteGuidParam); Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -17917,26 +21673,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() { Guid noteGuid = generateRandomString(); Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreCopyNoteTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -17946,7 +21701,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(noteGuid == noteGuidParam); Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -18014,25 +21769,23 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() +void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() { Guid noteGuid = generateRandomString(); Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreCopyNoteTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -18042,7 +21795,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(noteGuid == noteGuidParam); Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -18110,10 +21863,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -18480,6 +22233,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() +{ + Guid noteGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequest, + &helper, + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &server, + &NoteStoreServer::onListNoteVersionsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNoteVersionsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNoteVersion() @@ -18508,7 +22351,104 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() Q_ASSERT(withResourcesData == withResourcesDataParam); Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - return response; + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw userException; }); NoteStoreServer server; @@ -18567,17 +22507,28 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() { Guid noteGuid = generateRandomString(); qint32 updateSequenceNum = generateRandomInt32(); @@ -18587,9 +22538,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreGetNoteVersionTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -18605,7 +22557,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() Q_ASSERT(withResourcesData == withResourcesDataParam); Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -18676,16 +22628,16 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() { Guid noteGuid = generateRandomString(); qint32 updateSequenceNum = generateRandomInt32(); @@ -18695,10 +22647,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreGetNoteVersionTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -18714,7 +22665,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() Q_ASSERT(withResourcesData == withResourcesDataParam); Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -18785,16 +22736,16 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() { Guid noteGuid = generateRandomString(); qint32 updateSequenceNum = generateRandomInt32(); @@ -18804,9 +22755,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreGetNoteVersionTesterHelper helper( [&] (const Guid & noteGuidParam, @@ -18822,7 +22771,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() Q_ASSERT(withResourcesData == withResourcesDataParam); Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -18893,10 +22842,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -19324,6 +23273,112 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() +{ + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRequest, + &helper, + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &server, + &NoteStoreServer::onGetResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceApplicationData() @@ -19606,7 +23661,97 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequest, + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getResourceApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; @@ -19673,10 +23818,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -20056,6 +24201,100 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequest, + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() @@ -20443,19 +24682,202 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QVERIFY(e == notFoundException); } - QVERIFY(caughtException); -} + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequest, + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setResourceApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); -//////////////////////////////////////////////////////////////////////////////// + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} -void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -20465,7 +24887,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); - return response; + throw userException; }); NoteStoreServer server; @@ -20524,23 +24946,35 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -20550,7 +24984,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -20618,26 +25052,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_FEW; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -20647,7 +25080,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -20715,25 +25148,23 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, @@ -20743,7 +25174,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); Q_ASSERT(key == keyParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -20811,10 +25242,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -21178,6 +25609,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() +{ + Resource resource = generateRandomResource(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(resource == resourceParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequest, + &helper, + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &server, + &NoteStoreServer::onUpdateResourceRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateResourceRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateResource( + resource, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceData() @@ -21527,10 +26048,100 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -21958,6 +26569,112 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() +{ + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequest, + &helper, + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &server, + &NoteStoreServer::onGetResourceByHashRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceByHashRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetResourceRecognition() @@ -22313,18 +27030,189 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QVERIFY(e == notFoundException); } - QVERIFY(caughtException); -} + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceRecognitionTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequest, + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &server, + &NoteStoreServer::onGetResourceRecognitionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceRecognitionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceRecognition( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceAlternateData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QByteArray response = generateRandomString().toUtf8(); + + NoteStoreGetResourceAlternateDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequest, + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &server, + &NoteStoreServer::onGetResourceAlternateDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAlternateDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); -//////////////////////////////////////////////////////////////////////////////// + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + QVERIFY(res == response); +} -void NoteStoreTester::shouldExecuteGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, @@ -22332,7 +27220,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + throw userException; }); NoteStoreServer server; @@ -22391,21 +27279,33 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceAlternateData( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QByteArray res = noteStore->getResourceAlternateData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, @@ -22413,7 +27313,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + throw systemException; }); NoteStoreServer server; @@ -22480,25 +27380,24 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, @@ -22506,7 +27405,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; @@ -22573,24 +27472,22 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, @@ -22598,7 +27495,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -22665,10 +27562,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -23032,6 +27929,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetResourceAttributesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> ResourceAttributes + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequest, + &helper, + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &server, + &NoteStoreServer::onGetResourceAttributesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceAttributesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ResourceAttributes res = noteStore->getResourceAttributes( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetPublicNotebook() @@ -23133,7 +28120,101 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() { Q_ASSERT(userId == userIdParam); Q_ASSERT(publicUri == publicUriParam); - throw systemException; + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequest, + &helper, + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &server, + &NoteStoreServer::onGetPublicNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getPublicNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() +{ + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw notFoundException; }); NoteStoreServer server; @@ -23201,24 +28282,22 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() { UserID userId = generateRandomInt32(); QString publicUri = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreGetPublicNotebookTesterHelper helper( [&] (const UserID & userIdParam, @@ -23227,7 +28306,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() { Q_ASSERT(userId == userIdParam); Q_ASSERT(publicUri == publicUriParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; @@ -23295,10 +28374,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -23678,6 +28757,100 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequest, + &helper, + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &server, + &NoteStoreServer::onShareNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() @@ -24131,18 +29304,189 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QVERIFY(e == invalidContactsException); } - QVERIFY(caughtException); -} + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares() +{ + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(shareTemplate == shareTemplateParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &server, + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateSharedNotebook() +{ + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(sharedNotebook == sharedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequest, + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); -//////////////////////////////////////////////////////////////////////////////// + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + QVERIFY(res == response); +} -void NoteStoreTester::shouldExecuteUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() { SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); NoteStoreUpdateSharedNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -24150,7 +29494,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(sharedNotebook == sharedNotebookParam); - return response; + throw userException; }); NoteStoreServer server; @@ -24209,21 +29553,32 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() { SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreUpdateSharedNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -24231,7 +29586,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(sharedNotebook == sharedNotebookParam); - throw userException; + throw notFoundException; }); NoteStoreServer server; @@ -24298,24 +29653,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() { SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreUpdateSharedNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -24323,7 +29679,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(sharedNotebook == sharedNotebookParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; @@ -24390,25 +29746,22 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() { SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreUpdateSharedNotebookTesterHelper helper( [&] (const SharedNotebook & sharedNotebookParam, @@ -24416,7 +29769,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(sharedNotebook == sharedNotebookParam); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -24483,10 +29836,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -24866,6 +30219,100 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings() +{ + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNotebookRecipientSettingsRequest, + &helper, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &server, + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListSharedNotebooks() @@ -25202,10 +30649,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSharedNotebooksRequest, + &helper, + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &server, + &NoteStoreServer::onListSharedNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSharedNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSharedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -25569,6 +31102,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createLinkedNotebookRequest, + &helper, + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onCreateLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() @@ -25927,6 +31550,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateLinkedNotebookRequest, + &helper, + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteListLinkedNotebooks() @@ -26197,7 +31910,93 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listLinkedNotebooksRequest, + &helper, + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &server, + &NoteStoreServer::onListLinkedNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listLinkedNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listLinkedNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; }); NoteStoreServer server; @@ -26263,10 +32062,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -26630,6 +32429,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreExpungeLinkedNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequest, + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeLinkedNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() @@ -26988,6 +32877,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook() +{ + QString shareKeyOrGlobalId = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNotebookRequest, + &helper, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &server, + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() @@ -27166,7 +33145,96 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw notFoundException; + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequest, + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &server, + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; }); NoteStoreServer server; @@ -27232,30 +33300,27 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreGetSharedNotebookByAuthTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -27321,10 +33386,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -27682,6 +33747,95 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() +{ + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::emailNoteRequest, + &helper, + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &server, + &NoteStoreServer::onEmailNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::emailNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->emailNote( + parameters, + ctx); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteShareNote() @@ -28037,24 +34191,194 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() QVERIFY(e == systemException); } - QVERIFY(caughtException); -} + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequest, + &helper, + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &server, + &NoteStoreServer::onShareNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->shareNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteStopSharingNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::stopSharingNoteRequest, + &helper, + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &server, + &NoteStoreServer::onStopSharingNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::stopSharingNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); -//////////////////////////////////////////////////////////////////////////////// + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->stopSharingNote( + guid, + ctx); +} -void NoteStoreTester::shouldExecuteStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + userException.parameter = generateRandomString(); + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return; + throw userException; }); NoteStoreServer server; @@ -28113,20 +34437,31 @@ void NoteStoreTester::shouldExecuteStopSharingNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->stopSharingNote( - guid, - ctx); + bool caughtException = false; + try + { + noteStore->stopSharingNote( + guid, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -28134,7 +34469,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + throw notFoundException; }); NoteStoreServer server; @@ -28200,24 +34535,25 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() guid, ctx); } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -28225,7 +34561,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; @@ -28291,25 +34627,22 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() guid, ctx); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, @@ -28317,7 +34650,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + throw thriftException; }); NoteStoreServer server; @@ -28383,10 +34716,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() guid, ctx); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -28766,6 +35099,100 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() +{ + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNoteRequest, + &helper, + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &server, + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::authenticateToSharedNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteFindRelated() @@ -29134,7 +35561,101 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() +{ + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findRelatedRequest, + &helper, + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &server, + &NoteStoreServer::onFindRelatedRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findRelatedRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + RelatedResult res = noteStore->findRelated( + query, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -29498,6 +36019,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &helper, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &server, + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteManageNotebookShares() @@ -29856,6 +36467,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() +{ + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::manageNotebookSharesRequest, + &helper, + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &server, + &NoteStoreServer::onManageNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::manageNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void NoteStoreTester::shouldExecuteGetNotebookShares() @@ -30214,6 +36915,96 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() QVERIFY(caughtException); } +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() +{ + QString notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequest, + &helper, + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, + &server, + &NoteStoreServer::onGetNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + } // namespace qevercloud #include diff --git a/QEverCloud/src/tests/generated/TestNoteStore.h b/QEverCloud/src/tests/generated/TestNoteStore.h index 45390c54..8dcbb0c3 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.h +++ b/QEverCloud/src/tests/generated/TestNoteStore.h @@ -29,291 +29,365 @@ private Q_SLOTS: void shouldExecuteGetSyncState(); void shouldDeliverEDAMUserExceptionInGetSyncState(); void shouldDeliverEDAMSystemExceptionInGetSyncState(); + void shouldDeliverThriftExceptionInGetSyncState(); void shouldExecuteGetFilteredSyncChunk(); void shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk(); void shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk(); + void shouldDeliverThriftExceptionInGetFilteredSyncChunk(); void shouldExecuteGetLinkedNotebookSyncState(); void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState(); void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState(); void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState(); + void shouldDeliverThriftExceptionInGetLinkedNotebookSyncState(); void shouldExecuteGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk(); + void shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk(); void shouldExecuteListNotebooks(); void shouldDeliverEDAMUserExceptionInListNotebooks(); void shouldDeliverEDAMSystemExceptionInListNotebooks(); + void shouldDeliverThriftExceptionInListNotebooks(); void shouldExecuteListAccessibleBusinessNotebooks(); void shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks(); void shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks(); + void shouldDeliverThriftExceptionInListAccessibleBusinessNotebooks(); void shouldExecuteGetNotebook(); void shouldDeliverEDAMUserExceptionInGetNotebook(); void shouldDeliverEDAMSystemExceptionInGetNotebook(); void shouldDeliverEDAMNotFoundExceptionInGetNotebook(); + void shouldDeliverThriftExceptionInGetNotebook(); void shouldExecuteGetDefaultNotebook(); void shouldDeliverEDAMUserExceptionInGetDefaultNotebook(); void shouldDeliverEDAMSystemExceptionInGetDefaultNotebook(); + void shouldDeliverThriftExceptionInGetDefaultNotebook(); void shouldExecuteCreateNotebook(); void shouldDeliverEDAMUserExceptionInCreateNotebook(); void shouldDeliverEDAMSystemExceptionInCreateNotebook(); void shouldDeliverEDAMNotFoundExceptionInCreateNotebook(); + void shouldDeliverThriftExceptionInCreateNotebook(); void shouldExecuteUpdateNotebook(); void shouldDeliverEDAMUserExceptionInUpdateNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateNotebook(); + void shouldDeliverThriftExceptionInUpdateNotebook(); void shouldExecuteExpungeNotebook(); void shouldDeliverEDAMUserExceptionInExpungeNotebook(); void shouldDeliverEDAMSystemExceptionInExpungeNotebook(); void shouldDeliverEDAMNotFoundExceptionInExpungeNotebook(); + void shouldDeliverThriftExceptionInExpungeNotebook(); void shouldExecuteListTags(); void shouldDeliverEDAMUserExceptionInListTags(); void shouldDeliverEDAMSystemExceptionInListTags(); + void shouldDeliverThriftExceptionInListTags(); void shouldExecuteListTagsByNotebook(); void shouldDeliverEDAMUserExceptionInListTagsByNotebook(); void shouldDeliverEDAMSystemExceptionInListTagsByNotebook(); void shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook(); + void shouldDeliverThriftExceptionInListTagsByNotebook(); void shouldExecuteGetTag(); void shouldDeliverEDAMUserExceptionInGetTag(); void shouldDeliverEDAMSystemExceptionInGetTag(); void shouldDeliverEDAMNotFoundExceptionInGetTag(); + void shouldDeliverThriftExceptionInGetTag(); void shouldExecuteCreateTag(); void shouldDeliverEDAMUserExceptionInCreateTag(); void shouldDeliverEDAMSystemExceptionInCreateTag(); void shouldDeliverEDAMNotFoundExceptionInCreateTag(); + void shouldDeliverThriftExceptionInCreateTag(); void shouldExecuteUpdateTag(); void shouldDeliverEDAMUserExceptionInUpdateTag(); void shouldDeliverEDAMSystemExceptionInUpdateTag(); void shouldDeliverEDAMNotFoundExceptionInUpdateTag(); + void shouldDeliverThriftExceptionInUpdateTag(); void shouldExecuteUntagAll(); void shouldDeliverEDAMUserExceptionInUntagAll(); void shouldDeliverEDAMSystemExceptionInUntagAll(); void shouldDeliverEDAMNotFoundExceptionInUntagAll(); + void shouldDeliverThriftExceptionInUntagAll(); void shouldExecuteExpungeTag(); void shouldDeliverEDAMUserExceptionInExpungeTag(); void shouldDeliverEDAMSystemExceptionInExpungeTag(); void shouldDeliverEDAMNotFoundExceptionInExpungeTag(); + void shouldDeliverThriftExceptionInExpungeTag(); void shouldExecuteListSearches(); void shouldDeliverEDAMUserExceptionInListSearches(); void shouldDeliverEDAMSystemExceptionInListSearches(); + void shouldDeliverThriftExceptionInListSearches(); void shouldExecuteGetSearch(); void shouldDeliverEDAMUserExceptionInGetSearch(); void shouldDeliverEDAMSystemExceptionInGetSearch(); void shouldDeliverEDAMNotFoundExceptionInGetSearch(); + void shouldDeliverThriftExceptionInGetSearch(); void shouldExecuteCreateSearch(); void shouldDeliverEDAMUserExceptionInCreateSearch(); void shouldDeliverEDAMSystemExceptionInCreateSearch(); + void shouldDeliverThriftExceptionInCreateSearch(); void shouldExecuteUpdateSearch(); void shouldDeliverEDAMUserExceptionInUpdateSearch(); void shouldDeliverEDAMSystemExceptionInUpdateSearch(); void shouldDeliverEDAMNotFoundExceptionInUpdateSearch(); + void shouldDeliverThriftExceptionInUpdateSearch(); void shouldExecuteExpungeSearch(); void shouldDeliverEDAMUserExceptionInExpungeSearch(); void shouldDeliverEDAMSystemExceptionInExpungeSearch(); void shouldDeliverEDAMNotFoundExceptionInExpungeSearch(); + void shouldDeliverThriftExceptionInExpungeSearch(); void shouldExecuteFindNoteOffset(); void shouldDeliverEDAMUserExceptionInFindNoteOffset(); void shouldDeliverEDAMSystemExceptionInFindNoteOffset(); void shouldDeliverEDAMNotFoundExceptionInFindNoteOffset(); + void shouldDeliverThriftExceptionInFindNoteOffset(); void shouldExecuteFindNotesMetadata(); void shouldDeliverEDAMUserExceptionInFindNotesMetadata(); void shouldDeliverEDAMSystemExceptionInFindNotesMetadata(); void shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata(); + void shouldDeliverThriftExceptionInFindNotesMetadata(); void shouldExecuteFindNoteCounts(); void shouldDeliverEDAMUserExceptionInFindNoteCounts(); void shouldDeliverEDAMSystemExceptionInFindNoteCounts(); void shouldDeliverEDAMNotFoundExceptionInFindNoteCounts(); + void shouldDeliverThriftExceptionInFindNoteCounts(); void shouldExecuteGetNoteWithResultSpec(); void shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec(); void shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec(); void shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec(); + void shouldDeliverThriftExceptionInGetNoteWithResultSpec(); void shouldExecuteGetNote(); void shouldDeliverEDAMUserExceptionInGetNote(); void shouldDeliverEDAMSystemExceptionInGetNote(); void shouldDeliverEDAMNotFoundExceptionInGetNote(); + void shouldDeliverThriftExceptionInGetNote(); void shouldExecuteGetNoteApplicationData(); void shouldDeliverEDAMUserExceptionInGetNoteApplicationData(); void shouldDeliverEDAMSystemExceptionInGetNoteApplicationData(); void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData(); + void shouldDeliverThriftExceptionInGetNoteApplicationData(); void shouldExecuteGetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry(); + void shouldDeliverThriftExceptionInGetNoteApplicationDataEntry(); void shouldExecuteSetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry(); + void shouldDeliverThriftExceptionInSetNoteApplicationDataEntry(); void shouldExecuteUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry(); + void shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntry(); void shouldExecuteGetNoteContent(); void shouldDeliverEDAMUserExceptionInGetNoteContent(); void shouldDeliverEDAMSystemExceptionInGetNoteContent(); void shouldDeliverEDAMNotFoundExceptionInGetNoteContent(); + void shouldDeliverThriftExceptionInGetNoteContent(); void shouldExecuteGetNoteSearchText(); void shouldDeliverEDAMUserExceptionInGetNoteSearchText(); void shouldDeliverEDAMSystemExceptionInGetNoteSearchText(); void shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText(); + void shouldDeliverThriftExceptionInGetNoteSearchText(); void shouldExecuteGetResourceSearchText(); void shouldDeliverEDAMUserExceptionInGetResourceSearchText(); void shouldDeliverEDAMSystemExceptionInGetResourceSearchText(); void shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText(); + void shouldDeliverThriftExceptionInGetResourceSearchText(); void shouldExecuteGetNoteTagNames(); void shouldDeliverEDAMUserExceptionInGetNoteTagNames(); void shouldDeliverEDAMSystemExceptionInGetNoteTagNames(); void shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames(); + void shouldDeliverThriftExceptionInGetNoteTagNames(); void shouldExecuteCreateNote(); void shouldDeliverEDAMUserExceptionInCreateNote(); void shouldDeliverEDAMSystemExceptionInCreateNote(); void shouldDeliverEDAMNotFoundExceptionInCreateNote(); + void shouldDeliverThriftExceptionInCreateNote(); void shouldExecuteUpdateNote(); void shouldDeliverEDAMUserExceptionInUpdateNote(); void shouldDeliverEDAMSystemExceptionInUpdateNote(); void shouldDeliverEDAMNotFoundExceptionInUpdateNote(); + void shouldDeliverThriftExceptionInUpdateNote(); void shouldExecuteDeleteNote(); void shouldDeliverEDAMUserExceptionInDeleteNote(); void shouldDeliverEDAMSystemExceptionInDeleteNote(); void shouldDeliverEDAMNotFoundExceptionInDeleteNote(); + void shouldDeliverThriftExceptionInDeleteNote(); void shouldExecuteExpungeNote(); void shouldDeliverEDAMUserExceptionInExpungeNote(); void shouldDeliverEDAMSystemExceptionInExpungeNote(); void shouldDeliverEDAMNotFoundExceptionInExpungeNote(); + void shouldDeliverThriftExceptionInExpungeNote(); void shouldExecuteCopyNote(); void shouldDeliverEDAMUserExceptionInCopyNote(); void shouldDeliverEDAMSystemExceptionInCopyNote(); void shouldDeliverEDAMNotFoundExceptionInCopyNote(); + void shouldDeliverThriftExceptionInCopyNote(); void shouldExecuteListNoteVersions(); void shouldDeliverEDAMUserExceptionInListNoteVersions(); void shouldDeliverEDAMSystemExceptionInListNoteVersions(); void shouldDeliverEDAMNotFoundExceptionInListNoteVersions(); + void shouldDeliverThriftExceptionInListNoteVersions(); void shouldExecuteGetNoteVersion(); void shouldDeliverEDAMUserExceptionInGetNoteVersion(); void shouldDeliverEDAMSystemExceptionInGetNoteVersion(); void shouldDeliverEDAMNotFoundExceptionInGetNoteVersion(); + void shouldDeliverThriftExceptionInGetNoteVersion(); void shouldExecuteGetResource(); void shouldDeliverEDAMUserExceptionInGetResource(); void shouldDeliverEDAMSystemExceptionInGetResource(); void shouldDeliverEDAMNotFoundExceptionInGetResource(); + void shouldDeliverThriftExceptionInGetResource(); void shouldExecuteGetResourceApplicationData(); void shouldDeliverEDAMUserExceptionInGetResourceApplicationData(); void shouldDeliverEDAMSystemExceptionInGetResourceApplicationData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData(); + void shouldDeliverThriftExceptionInGetResourceApplicationData(); void shouldExecuteGetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry(); + void shouldDeliverThriftExceptionInGetResourceApplicationDataEntry(); void shouldExecuteSetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry(); + void shouldDeliverThriftExceptionInSetResourceApplicationDataEntry(); void shouldExecuteUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry(); + void shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntry(); void shouldExecuteUpdateResource(); void shouldDeliverEDAMUserExceptionInUpdateResource(); void shouldDeliverEDAMSystemExceptionInUpdateResource(); void shouldDeliverEDAMNotFoundExceptionInUpdateResource(); + void shouldDeliverThriftExceptionInUpdateResource(); void shouldExecuteGetResourceData(); void shouldDeliverEDAMUserExceptionInGetResourceData(); void shouldDeliverEDAMSystemExceptionInGetResourceData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceData(); + void shouldDeliverThriftExceptionInGetResourceData(); void shouldExecuteGetResourceByHash(); void shouldDeliverEDAMUserExceptionInGetResourceByHash(); void shouldDeliverEDAMSystemExceptionInGetResourceByHash(); void shouldDeliverEDAMNotFoundExceptionInGetResourceByHash(); + void shouldDeliverThriftExceptionInGetResourceByHash(); void shouldExecuteGetResourceRecognition(); void shouldDeliverEDAMUserExceptionInGetResourceRecognition(); void shouldDeliverEDAMSystemExceptionInGetResourceRecognition(); void shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition(); + void shouldDeliverThriftExceptionInGetResourceRecognition(); void shouldExecuteGetResourceAlternateData(); void shouldDeliverEDAMUserExceptionInGetResourceAlternateData(); void shouldDeliverEDAMSystemExceptionInGetResourceAlternateData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData(); + void shouldDeliverThriftExceptionInGetResourceAlternateData(); void shouldExecuteGetResourceAttributes(); void shouldDeliverEDAMUserExceptionInGetResourceAttributes(); void shouldDeliverEDAMSystemExceptionInGetResourceAttributes(); void shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes(); + void shouldDeliverThriftExceptionInGetResourceAttributes(); void shouldExecuteGetPublicNotebook(); void shouldDeliverEDAMSystemExceptionInGetPublicNotebook(); void shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook(); + void shouldDeliverThriftExceptionInGetPublicNotebook(); void shouldExecuteShareNotebook(); void shouldDeliverEDAMUserExceptionInShareNotebook(); void shouldDeliverEDAMNotFoundExceptionInShareNotebook(); void shouldDeliverEDAMSystemExceptionInShareNotebook(); + void shouldDeliverThriftExceptionInShareNotebook(); void shouldExecuteCreateOrUpdateNotebookShares(); void shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares(); + void shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares(); void shouldExecuteUpdateSharedNotebook(); void shouldDeliverEDAMUserExceptionInUpdateSharedNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook(); + void shouldDeliverThriftExceptionInUpdateSharedNotebook(); void shouldExecuteSetNotebookRecipientSettings(); void shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings(); void shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings(); void shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings(); + void shouldDeliverThriftExceptionInSetNotebookRecipientSettings(); void shouldExecuteListSharedNotebooks(); void shouldDeliverEDAMUserExceptionInListSharedNotebooks(); void shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks(); void shouldDeliverEDAMSystemExceptionInListSharedNotebooks(); + void shouldDeliverThriftExceptionInListSharedNotebooks(); void shouldExecuteCreateLinkedNotebook(); void shouldDeliverEDAMUserExceptionInCreateLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook(); + void shouldDeliverThriftExceptionInCreateLinkedNotebook(); void shouldExecuteUpdateLinkedNotebook(); void shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook(); + void shouldDeliverThriftExceptionInUpdateLinkedNotebook(); void shouldExecuteListLinkedNotebooks(); void shouldDeliverEDAMUserExceptionInListLinkedNotebooks(); void shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks(); void shouldDeliverEDAMSystemExceptionInListLinkedNotebooks(); + void shouldDeliverThriftExceptionInListLinkedNotebooks(); void shouldExecuteExpungeLinkedNotebook(); void shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook(); + void shouldDeliverThriftExceptionInExpungeLinkedNotebook(); void shouldExecuteAuthenticateToSharedNotebook(); void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook(); void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook(); void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook(); + void shouldDeliverThriftExceptionInAuthenticateToSharedNotebook(); void shouldExecuteGetSharedNotebookByAuth(); void shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth(); void shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth(); void shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth(); + void shouldDeliverThriftExceptionInGetSharedNotebookByAuth(); void shouldExecuteEmailNote(); void shouldDeliverEDAMUserExceptionInEmailNote(); void shouldDeliverEDAMNotFoundExceptionInEmailNote(); void shouldDeliverEDAMSystemExceptionInEmailNote(); + void shouldDeliverThriftExceptionInEmailNote(); void shouldExecuteShareNote(); void shouldDeliverEDAMUserExceptionInShareNote(); void shouldDeliverEDAMNotFoundExceptionInShareNote(); void shouldDeliverEDAMSystemExceptionInShareNote(); + void shouldDeliverThriftExceptionInShareNote(); void shouldExecuteStopSharingNote(); void shouldDeliverEDAMUserExceptionInStopSharingNote(); void shouldDeliverEDAMNotFoundExceptionInStopSharingNote(); void shouldDeliverEDAMSystemExceptionInStopSharingNote(); + void shouldDeliverThriftExceptionInStopSharingNote(); void shouldExecuteAuthenticateToSharedNote(); void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote(); void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote(); void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote(); + void shouldDeliverThriftExceptionInAuthenticateToSharedNote(); void shouldExecuteFindRelated(); void shouldDeliverEDAMUserExceptionInFindRelated(); void shouldDeliverEDAMSystemExceptionInFindRelated(); void shouldDeliverEDAMNotFoundExceptionInFindRelated(); + void shouldDeliverThriftExceptionInFindRelated(); void shouldExecuteUpdateNoteIfUsnMatches(); void shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches(); void shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches(); void shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches(); + void shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches(); void shouldExecuteManageNotebookShares(); void shouldDeliverEDAMUserExceptionInManageNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInManageNotebookShares(); void shouldDeliverEDAMSystemExceptionInManageNotebookShares(); + void shouldDeliverThriftExceptionInManageNotebookShares(); void shouldExecuteGetNotebookShares(); void shouldDeliverEDAMUserExceptionInGetNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInGetNotebookShares(); void shouldDeliverEDAMSystemExceptionInGetNotebookShares(); + void shouldDeliverThriftExceptionInGetNotebookShares(); }; } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 69152f77..b04eaf54 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -886,6 +886,104 @@ void UserStoreTester::shouldExecuteCheckVersion() QVERIFY(res == response); } +void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() +{ + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) -> bool + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + bool res = userStore->checkVersion( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetBootstrapInfo() @@ -967,6 +1065,96 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QVERIFY(res == response); } +void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() +{ + QString locale = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) -> BootstrapInfo + { + Q_ASSERT(locale == localeParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + BootstrapInfo res = userStore->getBootstrapInfo( + locale, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteAuthenticateLongSession() @@ -1305,42 +1493,50 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() { - QString oneTimeCode = generateRandomString(); + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); QString deviceIdentifier = generateRandomString(); QString deviceDescription = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); - AuthenticationResult response = generateRandomAuthenticationResult(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( - [&] (const QString & oneTimeCodeParam, + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, const QString & deviceIdentifierParam, const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); Q_ASSERT(deviceIdentifier == deviceIdentifierParam); Q_ASSERT(deviceDescription == deviceDescriptionParam); - return response; + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequest, + &UserStoreServer::authenticateLongSessionRequest, &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); QObject::connect( &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, &server, - &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + &UserStoreServer::onAuthenticateLongSessionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1368,7 +1564,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &UserStoreServer::authenticateLongSessionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1388,15 +1584,32 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() { QString oneTimeCode = generateRandomString(); QString deviceIdentifier = generateRandomString(); @@ -1404,9 +1617,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - userException.parameter = generateRandomString(); + AuthenticationResult response = generateRandomAuthenticationResult(); UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( [&] (const QString & oneTimeCodeParam, @@ -1418,7 +1629,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic Q_ASSERT(oneTimeCode == oneTimeCodeParam); Q_ASSERT(deviceIdentifier == deviceIdentifierParam); Q_ASSERT(deviceDescription == deviceDescriptionParam); - throw userException; + return response; }); UserStoreServer server; @@ -1479,26 +1690,15 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } - - QVERIFY(caughtException); + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication() +void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication() { QString oneTimeCode = generateRandomString(); QString deviceIdentifier = generateRandomString(); @@ -1506,10 +1706,9 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( [&] (const QString & oneTimeCodeParam, @@ -1521,7 +1720,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent Q_ASSERT(oneTimeCode == oneTimeCodeParam); Q_ASSERT(deviceIdentifier == deviceIdentifierParam); Q_ASSERT(deviceDescription == deviceDescriptionParam); - throw systemException; + throw userException; }); UserStoreServer server; @@ -1592,40 +1791,52 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteRevokeLongSession() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication() { + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return; + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::completeTwoFactorAuthenticationRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1653,7 +1864,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1673,37 +1884,59 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->revokeLongSession( - ctx); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() +void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthentication() { + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::completeTwoFactorAuthenticationRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1731,7 +1964,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1754,33 +1987,34 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() bool caughtException = false; try { - userStore->revokeLongSession( + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, ctx); + Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteRevokeLongSession() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - UserStoreRevokeLongSessionTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + return; }); UserStoreServer server; @@ -1841,48 +2075,37 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - userStore->revokeLongSession( - ctx); - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + userStore->revokeLongSession( + ctx); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteAuthenticateToBusiness() +void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::revokeLongSessionRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRevokeLongSessionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1910,7 +2133,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::revokeLongSessionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1930,38 +2153,49 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->authenticateToBusiness( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::revokeLongSessionRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRevokeLongSessionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1989,7 +2223,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::revokeLongSessionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2012,47 +2246,43 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateToBusiness( + userStore->revokeLongSession( ctx); - Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() +void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::revokeLongSessionRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRevokeLongSessionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2080,7 +2310,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::revokeLongSessionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2103,14 +2333,13 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateToBusiness( + userStore->revokeLongSession( ctx); - Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -2118,31 +2347,728 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteGetUser() +void UserStoreTester::shouldExecuteAuthenticateToBusiness() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - User response = generateRandomUser(); + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + User response = generateRandomUser(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + User res = userStore->getUser( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + PublicUserInfo response = generateRandomPublicUserInfo(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(username == usernameParam); return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::getPublicUserInfoRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onGetPublicUserInfoRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2170,7 +3096,7 @@ void UserStoreTester::shouldExecuteGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::getPublicUserInfoRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2190,38 +3116,40 @@ void UserStoreTester::shouldExecuteGetUser() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - User res = userStore->getUser( + PublicUserInfo res = userStore->getPublicUserInfo( + username, ctx); QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() { - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(username == usernameParam); + throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::getPublicUserInfoRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onGetPublicUserInfoRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2249,7 +3177,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::getPublicUserInfoRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2272,47 +3200,49 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() bool caughtException = false; try { - User res = userStore->getUser( + PublicUserInfo res = userStore->getPublicUserInfo( + username, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() { - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(username == usernameParam); throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::getPublicUserInfoRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onGetPublicUserInfoRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2340,7 +3270,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::getPublicUserInfoRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2363,7 +3293,8 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() bool caughtException = false; try { - User res = userStore->getUser( + PublicUserInfo res = userStore->getPublicUserInfo( + username, ctx); Q_UNUSED(res) } @@ -2376,21 +3307,21 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetPublicUserInfo() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() { QString username = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - PublicUserInfo response = generateRandomPublicUserInfo(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.parameter = generateRandomString(); UserStoreGetPublicUserInfoTesterHelper helper( [&] (const QString & usernameParam, IRequestContextPtr ctxParam) -> PublicUserInfo { Q_ASSERT(username == usernameParam); - return response; + throw userException; }); UserStoreServer server; @@ -2451,27 +3382,36 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - PublicUserInfo res = userStore->getPublicUserInfo( - username, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() +void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() { QString username = generateRandomString(); IRequestContextPtr ctx = newRequestContext(); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); UserStoreGetPublicUserInfoTesterHelper helper( [&] (const QString & usernameParam, IRequestContextPtr ctxParam) -> PublicUserInfo { Q_ASSERT(username == usernameParam); - throw notFoundException; + throw thriftException; }); UserStoreServer server; @@ -2540,44 +3480,42 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUserUrls() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + UserUrls response = generateRandomUserUrls(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); - throw systemException; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2605,7 +3543,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2625,51 +3563,38 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - PublicUserInfo res = userStore->getPublicUserInfo( - username, - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + UserUrls res = userStore->getUserUrls( + ctx); + QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; userException.parameter = generateRandomString(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2697,7 +3622,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2720,8 +3645,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() bool caughtException = false; try { - PublicUserInfo res = userStore->getPublicUserInfo( - username, + UserUrls res = userStore->getUserUrls( ctx); Q_UNUSED(res) } @@ -2734,20 +3658,21 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetUserUrls() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserUrls response = generateRandomUserUrls(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); UserStoreGetUserUrlsTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> UserUrls { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + throw systemException; }); UserStoreServer server; @@ -2808,25 +3733,34 @@ void UserStoreTester::shouldExecuteGetUserUrls() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - UserUrls res = userStore->getUserUrls( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + UserUrls res = userStore->getUserUrls( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() +void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); UserStoreGetUserUrlsTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> UserUrls { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + throw thriftException; }); UserStoreServer server; @@ -2894,43 +3828,43 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteInviteToBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> UserUrls + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(emailAddress == emailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2958,7 +3892,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2978,37 +3912,28 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - UserUrls res = userStore->getUserUrls( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + userStore->inviteToBusiness( + emailAddress, + ctx); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteInviteToBusiness() +void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() { QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + UserStoreInviteToBusinessTesterHelper helper( [&] (const QString & emailAddressParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(emailAddress == emailAddressParam); - return; + throw userException; }); UserStoreServer server; @@ -3069,20 +3994,32 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->inviteToBusiness( - emailAddress, - ctx); + bool caughtException = false; + try + { + userStore->inviteToBusiness( + emailAddress, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() { QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); UserStoreInviteToBusinessTesterHelper helper( [&] (const QString & emailAddressParam, @@ -3090,7 +4027,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(emailAddress == emailAddressParam); - throw userException; + throw systemException; }); UserStoreServer server; @@ -3158,25 +4095,22 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() emailAddress, ctx); } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() +void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() { QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); UserStoreInviteToBusinessTesterHelper helper( [&] (const QString & emailAddressParam, @@ -3184,7 +4118,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(emailAddress == emailAddressParam); - throw systemException; + throw thriftException; }); UserStoreServer server; @@ -3252,10 +4186,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() emailAddress, ctx); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -3621,6 +4555,97 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() QVERIFY(caughtException); } +void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() +{ + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequest, + &helper, + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &server, + &UserStoreServer::onRemoveFromBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::removeFromBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->removeFromBusiness( + emailAddress, + ctx); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() @@ -3988,10 +5013,105 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden newEmailAddress, ctx); } - catch(const EDAMNotFoundException & e) + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier() +{ + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequest, + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + QObject::connect( + &helper, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &server, + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); @@ -4260,6 +5380,94 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() QVERIFY(caughtException); } +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequest, + &helper, + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + QObject::connect( + &helper, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &server, + &UserStoreServer::onListBusinessUsersRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + QList res = userStore->listBusinessUsers( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteListBusinessInvitations() @@ -4535,6 +5743,98 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( QVERIFY(caughtException); } +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() +{ + bool includeRequestedInvitations = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::listBusinessInvitationsRequest, + &helper, + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + QObject::connect( + &helper, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &server, + &UserStoreServer::onListBusinessInvitationsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::listBusinessInvitationsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + //////////////////////////////////////////////////////////////////////////////// void UserStoreTester::shouldExecuteGetAccountLimits() @@ -4708,6 +6008,96 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() QVERIFY(caughtException); } +void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() +{ + ServiceLevel serviceLevel = ServiceLevel::PLUS; + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) -> AccountLimits + { + Q_ASSERT(serviceLevel == serviceLevelParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getAccountLimitsRequest, + &helper, + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); + QObject::connect( + &helper, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, + &server, + &UserStoreServer::onGetAccountLimitsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getAccountLimitsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AccountLimits res = userStore->getAccountLimits( + serviceLevel, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + } // namespace qevercloud #include diff --git a/QEverCloud/src/tests/generated/TestUserStore.h b/QEverCloud/src/tests/generated/TestUserStore.h index cd01a7f8..ea7b4de4 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.h +++ b/QEverCloud/src/tests/generated/TestUserStore.h @@ -27,48 +27,63 @@ class UserStoreTester: public QObject private Q_SLOTS: void shouldExecuteCheckVersion(); + void shouldDeliverThriftExceptionInCheckVersion(); void shouldExecuteGetBootstrapInfo(); + void shouldDeliverThriftExceptionInGetBootstrapInfo(); void shouldExecuteAuthenticateLongSession(); void shouldDeliverEDAMUserExceptionInAuthenticateLongSession(); void shouldDeliverEDAMSystemExceptionInAuthenticateLongSession(); + void shouldDeliverThriftExceptionInAuthenticateLongSession(); void shouldExecuteCompleteTwoFactorAuthentication(); void shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication(); void shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication(); + void shouldDeliverThriftExceptionInCompleteTwoFactorAuthentication(); void shouldExecuteRevokeLongSession(); void shouldDeliverEDAMUserExceptionInRevokeLongSession(); void shouldDeliverEDAMSystemExceptionInRevokeLongSession(); + void shouldDeliverThriftExceptionInRevokeLongSession(); void shouldExecuteAuthenticateToBusiness(); void shouldDeliverEDAMUserExceptionInAuthenticateToBusiness(); void shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness(); + void shouldDeliverThriftExceptionInAuthenticateToBusiness(); void shouldExecuteGetUser(); void shouldDeliverEDAMUserExceptionInGetUser(); void shouldDeliverEDAMSystemExceptionInGetUser(); + void shouldDeliverThriftExceptionInGetUser(); void shouldExecuteGetPublicUserInfo(); void shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo(); void shouldDeliverEDAMSystemExceptionInGetPublicUserInfo(); void shouldDeliverEDAMUserExceptionInGetPublicUserInfo(); + void shouldDeliverThriftExceptionInGetPublicUserInfo(); void shouldExecuteGetUserUrls(); void shouldDeliverEDAMUserExceptionInGetUserUrls(); void shouldDeliverEDAMSystemExceptionInGetUserUrls(); + void shouldDeliverThriftExceptionInGetUserUrls(); void shouldExecuteInviteToBusiness(); void shouldDeliverEDAMUserExceptionInInviteToBusiness(); void shouldDeliverEDAMSystemExceptionInInviteToBusiness(); + void shouldDeliverThriftExceptionInInviteToBusiness(); void shouldExecuteRemoveFromBusiness(); void shouldDeliverEDAMUserExceptionInRemoveFromBusiness(); void shouldDeliverEDAMSystemExceptionInRemoveFromBusiness(); void shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness(); + void shouldDeliverThriftExceptionInRemoveFromBusiness(); void shouldExecuteUpdateBusinessUserIdentifier(); void shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier(); void shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier(); void shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier(); + void shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier(); void shouldExecuteListBusinessUsers(); void shouldDeliverEDAMUserExceptionInListBusinessUsers(); void shouldDeliverEDAMSystemExceptionInListBusinessUsers(); + void shouldDeliverThriftExceptionInListBusinessUsers(); void shouldExecuteListBusinessInvitations(); void shouldDeliverEDAMUserExceptionInListBusinessInvitations(); void shouldDeliverEDAMSystemExceptionInListBusinessInvitations(); + void shouldDeliverThriftExceptionInListBusinessInvitations(); void shouldExecuteGetAccountLimits(); void shouldDeliverEDAMUserExceptionInGetAccountLimits(); + void shouldDeliverThriftExceptionInGetAccountLimits(); }; } // namespace qevercloud From 83af47bed6e3902d7686e1f01ae1afc36f19f49f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 1 Dec 2019 15:54:15 +0300 Subject: [PATCH 094/188] Update generated code --- .../tests/generated/RandomDataGenerators.cpp | 42 +- .../src/tests/generated/TestNoteStore.cpp | 55552 ++++++++++++++-- .../src/tests/generated/TestNoteStore.h | 362 + .../src/tests/generated/TestUserStore.cpp | 9156 ++- .../src/tests/generated/TestUserStore.h | 58 + 5 files changed, 56989 insertions(+), 8181 deletions(-) diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp index 81b09ac6..2e170d08 100644 --- a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -419,9 +419,9 @@ RelatedResultSpec generateRandomRelatedResultSpec() result.maxExperts = generateRandomInt32(); result.maxRelatedContent = generateRandomInt32(); result.relatedContentTypes = QSet(); - result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); - result.relatedContentTypes->insert(RelatedContentType::PROFILE_ORGANIZATION); result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE); + result.relatedContentTypes->insert(RelatedContentType::NEWS_ARTICLE); + result.relatedContentTypes->insert(RelatedContentType::PROFILE_PERSON); return result; } @@ -448,7 +448,7 @@ InvitationShareRelationship generateRandomInvitationShareRelationship() InvitationShareRelationship result; result.displayName = generateRandomString(); result.recipientUserIdentity = generateRandomUserIdentity(); - result.privilege = ShareRelationshipPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; result.sharerUserId = generateRandomInt32(); return result; } @@ -459,7 +459,7 @@ MemberShareRelationship generateRandomMemberShareRelationship() result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); result.bestPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; - result.individualPrivilege = ShareRelationshipPrivilegeLevel::FULL_ACCESS; + result.individualPrivilege = ShareRelationshipPrivilegeLevel::READ_NOTEBOOK; result.restrictions = generateRandomShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -505,7 +505,7 @@ ManageNotebookSharesError generateRandomManageNotebookSharesError() ManageNotebookSharesError result; result.userIdentity = generateRandomUserIdentity(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::TOO_FEW; + result.userException->errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -532,7 +532,7 @@ SharedNoteTemplate generateRandomSharedNoteTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotePrivilegeLevel::MODIFY_NOTE; + result.privilege = SharedNotePrivilegeLevel::READ_NOTE; return result; } @@ -545,7 +545,7 @@ NotebookShareTemplate generateRandomNotebookShareTemplate() result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); result.recipientContacts.ref() << generateRandomContact(); - result.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotebookPrivilegeLevel::MODIFY_NOTEBOOK_PLUS_ACTIVITY; return result; } @@ -574,7 +574,7 @@ NoteMemberShareRelationship generateRandomNoteMemberShareRelationship() NoteMemberShareRelationship result; result.displayName = generateRandomString(); result.recipientUserId = generateRandomInt32(); - result.privilege = SharedNotePrivilegeLevel::READ_NOTE; + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; result.restrictions = generateRandomNoteShareRelationshipRestrictions(); result.sharerUserId = generateRandomInt32(); return result; @@ -634,7 +634,7 @@ ManageNoteSharesError generateRandomManageNoteSharesError() result.identityID = generateRandomInt64(); result.userID = generateRandomInt32(); result.userException = EDAMUserException(); - result.userException->errorCode = EDAMErrorCode::UNKNOWN; + result.userException->errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; result.userException->parameter = generateRandomString(); result.notFoundException = EDAMNotFoundException(); result.notFoundException->identifier = generateRandomString(); @@ -699,7 +699,7 @@ UserAttributes generateRandomUserAttributes() result.businessAddress = generateRandomString(); result.hideSponsorBilling = generateRandomBool(); result.useEmailAutoFiling = generateRandomBool(); - result.reminderEmailConfig = ReminderEmailConfig::SEND_DAILY_EMAIL; + result.reminderEmailConfig = ReminderEmailConfig::DO_NOT_SEND; result.emailAddressLastConfirmed = generateRandomInt64(); result.passwordUpdated = generateRandomInt64(); result.salesforcePushEnabled = generateRandomBool(); @@ -787,7 +787,7 @@ User generateRandomUser() result.name = generateRandomString(); result.timezone = generateRandomString(); result.privilege = PrivilegeLevel::MANAGER; - result.serviceLevel = ServiceLevel::BASIC; + result.serviceLevel = ServiceLevel::PLUS; result.created = generateRandomInt64(); result.updated = generateRandomInt64(); result.deleted = generateRandomInt64(); @@ -925,7 +925,7 @@ SharedNote generateRandomSharedNote() SharedNote result; result.sharerUserID = generateRandomInt32(); result.recipientIdentity = generateRandomIdentity(); - result.privilege = SharedNotePrivilegeLevel::READ_NOTE; + result.privilege = SharedNotePrivilegeLevel::FULL_ACCESS; result.serviceCreated = generateRandomInt64(); result.serviceUpdated = generateRandomInt64(); result.serviceAssigned = generateRandomInt64(); @@ -994,7 +994,7 @@ Publishing generateRandomPublishing() { Publishing result; result.uri = generateRandomString(); - result.order = NoteSortOrder::CREATED; + result.order = NoteSortOrder::UPDATED; result.ascending = generateRandomBool(); result.publicDescription = generateRandomString(); return result; @@ -1004,7 +1004,7 @@ BusinessNotebook generateRandomBusinessNotebook() { BusinessNotebook result; result.notebookDescription = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::FULL_ACCESS; + result.privilege = SharedNotebookPrivilegeLevel::GROUP; result.recommended = generateRandomBool(); return result; } @@ -1062,7 +1062,7 @@ SharedNotebook generateRandomSharedNotebook() result.serviceUpdated = generateRandomInt64(); result.globalId = generateRandomString(); result.username = generateRandomString(); - result.privilege = SharedNotebookPrivilegeLevel::READ_NOTEBOOK_PLUS_ACTIVITY; + result.privilege = SharedNotebookPrivilegeLevel::GROUP; result.recipientSettings = generateRandomSharedNotebookRecipientSettings(); result.sharerUserId = generateRandomInt32(); result.recipientUsername = generateRandomString(); @@ -1100,7 +1100,7 @@ NotebookRestrictions generateRandomNotebookRestrictions() result.noSetParentTag = generateRandomBool(); result.noCreateSharedNotebooks = generateRandomBool(); result.updateWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; - result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::ASSIGNED; + result.expungeWhichSharedNotebookRestrictions = SharedNotebookInstanceRestrictions::NO_SHARED_NOTEBOOKS; result.noShareNotesWithBusiness = generateRandomBool(); result.noRenameNotebook = generateRandomBool(); result.noSetInMyList = generateRandomBool(); @@ -1179,7 +1179,7 @@ UserProfile generateRandomUserProfile() result.joined = generateRandomInt64(); result.photoLastUpdated = generateRandomInt64(); result.photoUrl = generateRandomString(); - result.role = BusinessUserRole::ADMIN; + result.role = BusinessUserRole::NORMAL; result.status = BusinessUserStatus::ACTIVE; return result; } @@ -1211,8 +1211,8 @@ RelatedContent generateRandomRelatedContent() result.thumbnails.ref() << generateRandomRelatedContentImage(); result.thumbnails.ref() << generateRandomRelatedContentImage(); result.thumbnails.ref() << generateRandomRelatedContentImage(); - result.contentType = RelatedContentType::PROFILE_ORGANIZATION; - result.accessType = RelatedContentAccess::DIRECT_LINK_ACCESS_OK; + result.contentType = RelatedContentType::NEWS_ARTICLE; + result.accessType = RelatedContentAccess::DIRECT_LINK_EMBEDDED_VIEW; result.visibleUrl = generateRandomString(); result.clipUrl = generateRandomString(); result.contact = generateRandomContact(); @@ -1229,7 +1229,7 @@ BusinessInvitation generateRandomBusinessInvitation() result.businessId = generateRandomInt32(); result.email = generateRandomString(); result.role = BusinessUserRole::ADMIN; - result.status = BusinessInvitationStatus::REQUESTED; + result.status = BusinessInvitationStatus::APPROVED; result.requesterId = generateRandomInt32(); result.fromWorkChat = generateRandomBool(); result.created = generateRandomInt64(); @@ -1240,7 +1240,7 @@ BusinessInvitation generateRandomBusinessInvitation() UserIdentity generateRandomUserIdentity() { UserIdentity result; - result.type = UserIdentityType::EMAIL; + result.type = UserIdentityType::IDENTITYID; result.stringIdentifier = generateRandomString(); result.longIdentifier = generateRandomInt64(); return result; diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 58ac96ff..84107c69 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -3895,31 +3895,38464 @@ public Q_SLOTS: //////////////////////////////////////////////////////////////////////////////// +class NoteStoreGetSyncStateAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetSyncStateAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SyncState m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetFilteredSyncChunkAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetFilteredSyncChunkAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SyncChunk m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SyncState m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SyncChunk m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListNotebooksAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListNotebooksAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Notebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetDefaultNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetDefaultNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Notebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Notebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreExpungeNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListTagsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListTagsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListTagsByNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListTagsByNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetTagAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetTagAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Tag m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateTagAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateTagAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Tag m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateTagAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateTagAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUntagAllAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUntagAllAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeTagAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreExpungeTagAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListSearchesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListSearchesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetSearchAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetSearchAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SavedSearch m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateSearchAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateSearchAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SavedSearch m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateSearchAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateSearchAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeSearchAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreExpungeSearchAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNoteOffsetAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreFindNoteOffsetAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNotesMetadataAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreFindNotesMetadataAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + NotesMetadataList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindNoteCountsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreFindNoteCountsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + NoteCollectionCounts m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteWithResultSpecAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteWithResultSpecAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteApplicationDataAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteApplicationDataAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + LazyMap m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteContentAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteContentAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteSearchTextAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteSearchTextAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceSearchTextAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceSearchTextAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteTagNamesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteTagNamesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QStringList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreDeleteNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreDeleteNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreExpungeNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCopyNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCopyNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListNoteVersionsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListNoteVersionsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNoteVersionAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNoteVersionAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Note m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Resource m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceApplicationDataAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceApplicationDataAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + LazyMap m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateResourceAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateResourceAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceDataAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceDataAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QByteArray m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceByHashAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceByHashAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Resource m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceRecognitionAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceRecognitionAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QByteArray m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceAlternateDataAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceAlternateDataAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QByteArray m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetResourceAttributesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetResourceAttributesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + ResourceAttributes m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetPublicNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetPublicNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Notebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreShareNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreShareNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SharedNotebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + CreateOrUpdateNotebookSharesResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateSharedNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateSharedNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + Notebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListSharedNotebooksAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListSharedNotebooksAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreCreateLinkedNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreCreateLinkedNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + LinkedNotebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateLinkedNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateLinkedNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreListLinkedNotebooksAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreListLinkedNotebooksAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreExpungeLinkedNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreExpungeLinkedNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + qint32 m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AuthenticationResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetSharedNotebookByAuthAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetSharedNotebookByAuthAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + SharedNotebook m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreEmailNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreEmailNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreShareNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreShareNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QString m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreStopSharingNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreStopSharingNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreAuthenticateToSharedNoteAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreAuthenticateToSharedNoteAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AuthenticationResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreFindRelatedAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreFindRelatedAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + RelatedResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + UpdateNoteIfUsnMatchesResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreManageNotebookSharesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreManageNotebookSharesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + ManageNotebookSharesResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class NoteStoreGetNotebookSharesAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit NoteStoreGetNotebookSharesAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + ShareRelationships m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + void NoteStoreTester::shouldExecuteGetSyncState() { IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncState response = generateRandomSyncState(); + SyncState response = generateRandomSyncState(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncState res = noteStore->getSyncState( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getSyncState( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetSyncStateAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncState response = generateRandomSyncState(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getSyncStateAsync( + ctx); + + NoteStoreGetSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSyncStateAsync( + ctx); + + NoteStoreGetSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncStateAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSyncStateAsync( + ctx); + + NoteStoreGetSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncStateAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetSyncStateTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequest, + &helper, + &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &server, + &NoteStoreServer::onGetSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSyncStateAsync( + ctx); + + NoteStoreGetSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = generateRandomSyncChunk(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getFilteredSyncChunk( + afterUSN, + maxEntries, + filter, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetFilteredSyncChunkAsync() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = generateRandomSyncChunk(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); + + NoteStoreGetFilteredSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); + + NoteStoreGetFilteredSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsync() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); + + NoteStoreGetFilteredSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync() +{ + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + SyncChunkFilter filter = generateRandomSyncChunkFilter(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetFilteredSyncChunkTesterHelper helper( + [&] (qint32 afterUSNParam, + qint32 maxEntriesParam, + const SyncChunkFilter & filterParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(filter == filterParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequest, + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getFilteredSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getFilteredSyncChunkAsync( + afterUSN, + maxEntries, + filter, + ctx); + + NoteStoreGetFilteredSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetFilteredSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncState response = generateRandomSyncState(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncState res = noteStore->getLinkedNotebookSyncState( + linkedNotebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncStateAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncState response = generateRandomSyncState(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + + NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncStateAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + + NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncStateAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + + NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncStateAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + + NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> SyncState + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( + linkedNotebook, + ctx); + + NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = generateRandomSyncChunk(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SyncChunk res = noteStore->getLinkedNotebookSyncChunk( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunkAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SyncChunk response = generateRandomSyncChunk(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunkAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunkAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunkAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAsync() +{ + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + qint32 afterUSN = generateRandomInt32(); + qint32 maxEntries = generateRandomInt32(); + bool fullSyncOnly = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + qint32 afterUSNParam, + qint32 maxEntriesParam, + bool fullSyncOnlyParam, + IRequestContextPtr ctxParam) -> SyncChunk + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(afterUSN == afterUSNParam); + Q_ASSERT(maxEntries == maxEntriesParam); + Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &server, + &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( + linkedNotebook, + afterUSN, + maxEntries, + fullSyncOnly, + ctx); + + NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listNotebooks( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->listNotebooksAsync( + ctx); + + NoteStoreListNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listNotebooksAsync( + ctx); + + NoteStoreListNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listNotebooksAsync( + ctx); + + NoteStoreListNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listNotebooksAsync( + ctx); + + NoteStoreListNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listAccessibleBusinessNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->listAccessibleBusinessNotebooksAsync( + ctx); + + NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listAccessibleBusinessNotebooksAsync( + ctx); + + NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listAccessibleBusinessNotebooksAsync( + ctx); + + NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &server, + &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listAccessibleBusinessNotebooksAsync( + ctx); + + NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getNotebook( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNotebookAsync( + guid, + ctx); + + NoteStoreGetNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNotebookAsync( + guid, + ctx); + + NoteStoreGetNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNotebookAsync( + guid, + ctx); + + NoteStoreGetNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNotebookAsync( + guid, + ctx); + + NoteStoreGetNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequest, + &helper, + &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &server, + &NoteStoreServer::onGetNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNotebookAsync( + guid, + ctx); + + NoteStoreGetNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->getDefaultNotebook( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->getDefaultNotebook( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetDefaultNotebookAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getDefaultNotebookAsync( + ctx); + + NoteStoreGetDefaultNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getDefaultNotebookAsync( + ctx); + + NoteStoreGetDefaultNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getDefaultNotebookAsync( + ctx); + + NoteStoreGetDefaultNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebookAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetDefaultNotebookTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequest, + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &server, + &NoteStoreServer::onGetDefaultNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getDefaultNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getDefaultNotebookAsync( + ctx); + + NoteStoreGetDefaultNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetDefaultNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Notebook res = noteStore->createNotebook( + notebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Notebook res = noteStore->createNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteCreateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Notebook response = generateRandomNotebook(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->createNotebookAsync( + notebook, + ctx); + + NoteStoreCreateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNotebookAsync( + notebook, + ctx); + + NoteStoreCreateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNotebookAsync( + notebook, + ctx); + + NoteStoreCreateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNotebookAsync( + notebook, + ctx); + + NoteStoreCreateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> Notebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequest, + &helper, + &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &server, + &NoteStoreServer::onCreateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNotebookAsync( + notebook, + ctx); + + NoteStoreCreateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateNotebook( + notebook, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUpdateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->updateNotebookAsync( + notebook, + ctx); + + NoteStoreUpdateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TAKEN_DOWN; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNotebookAsync( + notebook, + ctx); + + NoteStoreUpdateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNotebookAsync( + notebook, + ctx); + + NoteStoreUpdateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNotebookAsync( + notebook, + ctx); + + NoteStoreUpdateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebookAsync() +{ + Notebook notebook = generateRandomNotebook(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateNotebookTesterHelper helper( + [&] (const Notebook & notebookParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebook == notebookParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequest, + &helper, + &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &server, + &NoteStoreServer::onUpdateNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNotebookAsync( + notebook, + ctx); + + NoteStoreUpdateNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNotebook( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteExpungeNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->expungeNotebookAsync( + guid, + ctx); + + NoteStoreExpungeNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeNotebookAsync( + guid, + ctx); + + NoteStoreExpungeNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeNotebookAsync( + guid, + ctx); + + NoteStoreExpungeNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeNotebookAsync( + guid, + ctx); + + NoteStoreExpungeNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequest, + &helper, + &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeNotebookAsync( + guid, + ctx); + + NoteStoreExpungeNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTags( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTags() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTags( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListTagsAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->listTagsAsync( + ctx); + + NoteStoreListTagsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsAsync( + ctx); + + NoteStoreListTagsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsAsync( + ctx); + + NoteStoreListTagsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTagsAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListTagsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsRequest, + &helper, + &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &server, + &NoteStoreServer::onListTagsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsAsync( + ctx); + + NoteStoreListTagsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listTagsByNotebook( + notebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListTagsByNotebookAsync() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomTag(); + response << generateRandomTag(); + response << generateRandomTag(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->listTagsByNotebookAsync( + notebookGuid, + ctx); + + NoteStoreListTagsByNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsByNotebookAsync( + notebookGuid, + ctx); + + NoteStoreListTagsByNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsByNotebookAsync( + notebookGuid, + ctx); + + NoteStoreListTagsByNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsync() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsByNotebookAsync( + notebookGuid, + ctx); + + NoteStoreListTagsByNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebookAsync() +{ + Guid notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListTagsByNotebookTesterHelper helper( + [&] (const Guid & notebookGuidParam, + IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequest, + &helper, + &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &server, + &NoteStoreServer::onListTagsByNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listTagsByNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listTagsByNotebookAsync( + notebookGuid, + ctx); + + NoteStoreListTagsByNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListTagsByNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->getTag( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->getTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getTagAsync( + guid, + ctx); + + NoteStoreGetTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getTagAsync( + guid, + ctx); + + NoteStoreGetTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getTagAsync( + guid, + ctx); + + NoteStoreGetTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getTagAsync( + guid, + ctx); + + NoteStoreGetTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getTagRequest, + &helper, + &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetTagTesterHelper::getTagRequestReady, + &server, + &NoteStoreServer::onGetTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getTagAsync( + guid, + ctx); + + NoteStoreGetTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Tag res = noteStore->createTag( + tag, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Tag res = noteStore->createTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteCreateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Tag response = generateRandomTag(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->createTagAsync( + tag, + ctx); + + NoteStoreCreateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createTagAsync( + tag, + ctx); + + NoteStoreCreateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createTagAsync( + tag, + ctx); + + NoteStoreCreateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createTagAsync( + tag, + ctx); + + NoteStoreCreateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> Tag + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createTagRequest, + &helper, + &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &server, + &NoteStoreServer::onCreateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createTagAsync( + tag, + ctx); + + NoteStoreCreateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateTag( + tag, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateTag( + tag, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUpdateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->updateTagAsync( + tag, + ctx); + + NoteStoreUpdateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateTagAsync( + tag, + ctx); + + NoteStoreUpdateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateTagAsync( + tag, + ctx); + + NoteStoreUpdateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateTagAsync( + tag, + ctx); + + NoteStoreUpdateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTagAsync() +{ + Tag tag = generateRandomTag(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateTagTesterHelper helper( + [&] (const Tag & tagParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(tag == tagParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateTagRequest, + &helper, + &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &server, + &NoteStoreServer::onUpdateTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateTagAsync( + tag, + ctx); + + NoteStoreUpdateTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + noteStore->untagAll( + guid, + ctx); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_FEW; + userException.parameter = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + noteStore->untagAll( + guid, + ctx); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUntagAllAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->untagAllAsync( + guid, + ctx); + + NoteStoreUntagAllAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->untagAllAsync( + guid, + ctx); + + NoteStoreUntagAllAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAllAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->untagAllAsync( + guid, + ctx); + + NoteStoreUntagAllAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAllAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->untagAllAsync( + guid, + ctx); + + NoteStoreUntagAllAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUntagAllAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUntagAllTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::untagAllRequest, + &helper, + &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + QObject::connect( + &helper, + &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &server, + &NoteStoreServer::onUntagAllRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::untagAllRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->untagAllAsync( + guid, + ctx); + + NoteStoreUntagAllAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUntagAllAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeTag( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeTag( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteExpungeTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->expungeTagAsync( + guid, + ctx); + + NoteStoreExpungeTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeTagAsync( + guid, + ctx); + + NoteStoreExpungeTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeTagAsync( + guid, + ctx); + + NoteStoreExpungeTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeTagAsync( + guid, + ctx); + + NoteStoreExpungeTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTagAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeTagTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequest, + &helper, + &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &server, + &NoteStoreServer::onExpungeTagRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeTagRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeTagAsync( + guid, + ctx); + + NoteStoreExpungeTagAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeTagAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QList res = noteStore->listSearches( + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QList res = noteStore->listSearches( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListSearchesAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + response << generateRandomSavedSearch(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->listSearchesAsync( + ctx); + + NoteStoreListSearchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listSearchesAsync( + ctx); + + NoteStoreListSearchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearchesAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listSearchesAsync( + ctx); + + NoteStoreListSearchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListSearchesAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListSearchesTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequest, + &helper, + &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + QObject::connect( + &helper, + &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &server, + &NoteStoreServer::onListSearchesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listSearchesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->listSearchesAsync( + ctx); + + NoteStoreListSearchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSearchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->getSearch( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->getSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getSearchAsync( + guid, + ctx); + + NoteStoreGetSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.parameter = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSearchAsync( + guid, + ctx); + + NoteStoreGetSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSearchAsync( + guid, + ctx); + + NoteStoreGetSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSearchAsync( + guid, + ctx); + + NoteStoreGetSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSearchRequest, + &helper, + &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &server, + &NoteStoreServer::onGetSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSearchAsync( + guid, + ctx); + + NoteStoreGetSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + SavedSearch res = noteStore->createSearch( + search, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + SavedSearch res = noteStore->createSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteCreateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SavedSearch response = generateRandomSavedSearch(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->createSearchAsync( + search, + ctx); + + NoteStoreCreateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createSearchAsync( + search, + ctx); + + NoteStoreCreateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createSearchAsync( + search, + ctx); + + NoteStoreCreateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> SavedSearch + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createSearchRequest, + &helper, + &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &server, + &NoteStoreServer::onCreateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createSearchAsync( + search, + ctx); + + NoteStoreCreateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->updateSearch( + search, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->updateSearch( + search, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUpdateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->updateSearchAsync( + search, + ctx); + + NoteStoreUpdateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateSearchAsync( + search, + ctx); + + NoteStoreUpdateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateSearchAsync( + search, + ctx); + + NoteStoreUpdateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateSearchAsync( + search, + ctx); + + NoteStoreUpdateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearchAsync() +{ + SavedSearch search = generateRandomSavedSearch(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateSearchTesterHelper helper( + [&] (const SavedSearch & searchParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(search == searchParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequest, + &helper, + &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &server, + &NoteStoreServer::onUpdateSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateSearchAsync( + search, + ctx); + + NoteStoreUpdateSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->expungeSearch( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeSearch( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteExpungeSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->expungeSearchAsync( + guid, + ctx); + + NoteStoreExpungeSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.parameter = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeSearchAsync( + guid, + ctx); + + NoteStoreExpungeSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeSearchAsync( + guid, + ctx); + + NoteStoreExpungeSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeSearchAsync( + guid, + ctx); + + NoteStoreExpungeSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearchAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreExpungeSearchTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequest, + &helper, + &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &server, + &NoteStoreServer::onExpungeSearchRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeSearchRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeSearchAsync( + guid, + ctx); + + NoteStoreExpungeSearchAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeSearchAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->findNoteOffset( + filter, + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteFindNoteOffsetAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->findNoteOffsetAsync( + filter, + guid, + ctx); + + NoteStoreFindNoteOffsetAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteOffsetAsync( + filter, + guid, + ctx); + + NoteStoreFindNoteOffsetAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteOffsetAsync( + filter, + guid, + ctx); + + NoteStoreFindNoteOffsetAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteOffsetAsync( + filter, + guid, + ctx); + + NoteStoreFindNoteOffsetAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffsetAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNoteOffsetTesterHelper helper( + [&] (const NoteFilter & filterParam, + const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequest, + &helper, + &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &server, + &NoteStoreServer::onFindNoteOffsetRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteOffsetRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteOffsetAsync( + filter, + guid, + ctx); + + NoteStoreFindNoteOffsetAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteOffsetAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NotesMetadataList response = generateRandomNotesMetadataList(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.parameter = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NotesMetadataList res = noteStore->findNotesMetadata( + filter, + offset, + maxNotes, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteFindNotesMetadataAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NotesMetadataList response = generateRandomNotesMetadataList(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + + NoteStoreFindNotesMetadataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + + NoteStoreFindNotesMetadataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + + NoteStoreFindNotesMetadataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + + NoteStoreFindNotesMetadataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadataAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + qint32 offset = generateRandomInt32(); + qint32 maxNotes = generateRandomInt32(); + NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNotesMetadataTesterHelper helper( + [&] (const NoteFilter & filterParam, + qint32 offsetParam, + qint32 maxNotesParam, + const NotesMetadataResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> NotesMetadataList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(offset == offsetParam); + Q_ASSERT(maxNotes == maxNotesParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequest, + &helper, + &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &server, + &NoteStoreServer::onFindNotesMetadataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNotesMetadataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNotesMetadataAsync( + filter, + offset, + maxNotes, + resultSpec, + ctx); + + NoteStoreFindNotesMetadataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNotesMetadataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + NoteCollectionCounts res = noteStore->findNoteCounts( + filter, + withTrash, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteFindNoteCountsAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->findNoteCountsAsync( + filter, + withTrash, + ctx); + + NoteStoreFindNoteCountsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteCountsAsync( + filter, + withTrash, + ctx); + + NoteStoreFindNoteCountsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteCountsAsync( + filter, + withTrash, + ctx); + + NoteStoreFindNoteCountsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteCountsAsync( + filter, + withTrash, + ctx); + + NoteStoreFindNoteCountsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCountsAsync() +{ + NoteFilter filter = generateRandomNoteFilter(); + bool withTrash = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreFindNoteCountsTesterHelper helper( + [&] (const NoteFilter & filterParam, + bool withTrashParam, + IRequestContextPtr ctxParam) -> NoteCollectionCounts + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(filter == filterParam); + Q_ASSERT(withTrash == withTrashParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequest, + &helper, + &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + QObject::connect( + &helper, + &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &server, + &NoteStoreServer::onFindNoteCountsRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::findNoteCountsRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->findNoteCountsAsync( + filter, + withTrash, + ctx); + + NoteStoreFindNoteCountsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindNoteCountsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNoteWithResultSpec( + guid, + resultSpec, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteWithResultSpecAsync() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + + NoteStoreGetNoteWithResultSpecAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + + NoteStoreGetNoteWithResultSpecAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsync() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + + NoteStoreGetNoteWithResultSpecAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecAsync() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + + NoteStoreGetNoteWithResultSpecAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync() +{ + Guid guid = generateRandomString(); + NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteWithResultSpecTesterHelper helper( + [&] (const Guid & guidParam, + const NoteResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequest, + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &server, + &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteWithResultSpecRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteWithResultSpecAsync( + guid, + resultSpec, + ctx); + + NoteStoreGetNoteWithResultSpecAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteWithResultSpecAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->getNote( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteAsync() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteAsync() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteAsync() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteAsync() +{ + Guid guid = generateRandomString(); + bool withContent = generateRandomBool(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteTesterHelper helper( + [&] (const Guid & guidParam, + bool withContentParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withContent == withContentParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteRequest, + &helper, + &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &server, + &NoteStoreServer::onGetNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteAsync( + guid, + withContent, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = generateRandomLazyMap(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + LazyMap res = noteStore->getNoteApplicationData( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteApplicationDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + LazyMap response = generateRandomLazyMap(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteApplicationDataAsync( + guid, + ctx); + + NoteStoreGetNoteApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataAsync( + guid, + ctx); + + NoteStoreGetNoteApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataAsync( + guid, + ctx); + + NoteStoreGetNoteApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataAsync( + guid, + ctx); + + NoteStoreGetNoteApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequest, + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataAsync( + guid, + ctx); + + NoteStoreGetNoteApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequest, + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->setNoteApplicationDataEntry( + guid, + key, + value, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + + NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + + NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + + NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + + NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequest, + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( + guid, + key, + value, + ctx); + + NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntry() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetNoteApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntryAsync() +{ + Guid guid = generateRandomString(); + QString key = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + QObject::connect( + &helper, + &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &server, + &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteContent( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteContent( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteContentAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteContentAsync( + guid, + ctx); + + NoteStoreGetNoteContentAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteContentAsync( + guid, + ctx); + + NoteStoreGetNoteContentAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContentAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteContentAsync( + guid, + ctx); + + NoteStoreGetNoteContentAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteContentAsync( + guid, + ctx); + + NoteStoreGetNoteContentAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContentAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteContentTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequest, + &helper, + &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &server, + &NoteStoreServer::onGetNoteContentRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteContentRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteContentAsync( + guid, + ctx); + + NoteStoreGetNoteContentAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteContentAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getNoteSearchText( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteSearchTextAsync() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + NoteStoreGetNoteSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + NoteStoreGetNoteSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + NoteStoreGetNoteSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + NoteStoreGetNoteSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchTextAsync() +{ + Guid guid = generateRandomString(); + bool noteOnly = generateRandomBool(); + bool tokenizeForIndexing = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + bool noteOnlyParam, + bool tokenizeForIndexingParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteOnly == noteOnlyParam); + Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequest, + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &server, + &NoteStoreServer::onGetNoteSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteSearchTextAsync( + guid, + noteOnly, + tokenizeForIndexing, + ctx); + + NoteStoreGetNoteSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QString res = noteStore->getResourceSearchText( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetResourceSearchTextAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QString response = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getResourceSearchTextAsync( + guid, + ctx); + + NoteStoreGetResourceSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + userException.parameter = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getResourceSearchTextAsync( + guid, + ctx); + + NoteStoreGetResourceSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getResourceSearchTextAsync( + guid, + ctx); + + NoteStoreGetResourceSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getResourceSearchTextAsync( + guid, + ctx); + + NoteStoreGetResourceSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchTextAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getResourceSearchTextAsync( + guid, + ctx); + + NoteStoreGetResourceSearchTextAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceSearchTextAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QStringList response; + response << generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + QStringList res = noteStore->getNoteTagNames( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetNoteTagNamesAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QStringList response; + response << generateRandomString(); + response << generateRandomString(); + response << generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->getNoteTagNamesAsync( + guid, + ctx); + + NoteStoreGetNoteTagNamesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteTagNamesAsync( + guid, + ctx); + + NoteStoreGetNoteTagNamesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteTagNamesAsync( + guid, + ctx); + + NoteStoreGetNoteTagNamesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteTagNamesAsync( + guid, + ctx); + + NoteStoreGetNoteTagNamesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNamesAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetNoteTagNamesTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QStringList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequest, + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &server, + &NoteStoreServer::onGetNoteTagNamesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteTagNamesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteTagNamesAsync( + guid, + ctx); + + NoteStoreGetNoteTagNamesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteTagNamesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->createNote( + note, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->createNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteCreateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->createNoteAsync( + note, + ctx); + + NoteStoreCreateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.parameter = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNoteAsync( + note, + ctx); + + NoteStoreCreateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNoteAsync( + note, + ctx); + + NoteStoreCreateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNoteAsync( + note, + ctx); + + NoteStoreCreateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInCreateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreCreateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::createNoteRequest, + &helper, + &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &server, + &NoteStoreServer::onCreateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::createNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createNoteAsync( + note, + ctx); + + NoteStoreCreateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + Note res = noteStore->updateNote( + note, + ctx); + QVERIFY(res == response); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + Note res = noteStore->updateNote( + note, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteUpdateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + Note response = generateRandomNote(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + AsyncResult * result = noteStore->updateNoteAsync( + note, + ctx); + + NoteStoreUpdateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw userException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNoteAsync( + note, + ctx); + + NoteStoreUpdateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw systemException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNoteAsync( + note, + ctx); + + NoteStoreUpdateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetSyncStateTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SyncState + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNoteAsync( + note, + ctx); + + NoteStoreUpdateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteAsync() +{ + Note note = generateRandomNote(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreUpdateNoteTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequest, + &helper, + &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &server, + &NoteStoreServer::onUpdateNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::updateNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->updateNoteAsync( + note, + ctx); + + NoteStoreUpdateNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteDeleteNote() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + qint32 response = generateRandomInt32(); + + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3947,7 +42380,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() QObject::connect( &server, - &NoteStoreServer::getSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3965,38 +42398,42 @@ void NoteStoreTester::shouldExecuteGetSyncState() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncState res = noteStore->getSyncState( + qint32 res = noteStore->deleteNote( + guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; userException.parameter = generateRandomString(); - NoteStoreGetSyncStateTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SyncState + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4024,7 +42461,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() QObject::connect( &server, - &NoteStoreServer::getSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4045,7 +42482,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() bool caughtException = false; try { - SyncState res = noteStore->getSyncState( + qint32 res = noteStore->deleteNote( + guid, ctx); Q_UNUSED(res) } @@ -4058,34 +42496,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetSyncStateTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SyncState + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4113,7 +42554,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() QObject::connect( &server, - &NoteStoreServer::getSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4134,7 +42575,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() bool caughtException = false; try { - SyncState res = noteStore->getSyncState( + qint32 res = noteStore->deleteNote( + guid, ctx); Q_UNUSED(res) } @@ -4147,31 +42589,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetSyncStateTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SyncState + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetSyncStateTesterHelper::onGetSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSyncStateTesterHelper::getSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4199,7 +42646,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() QObject::connect( &server, - &NoteStoreServer::getSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4220,55 +42667,50 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() bool caughtException = false; try { - SyncState res = noteStore->getSyncState( + qint32 res = noteStore->deleteNote( + guid, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() +void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() { - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - SyncChunkFilter filter = generateRandomSyncChunkFilter(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = generateRandomSyncChunk(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetFilteredSyncChunkTesterHelper helper( - [&] (qint32 afterUSNParam, - qint32 maxEntriesParam, - const SyncChunkFilter & filterParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(filter == filterParam); - return response; + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4296,7 +42738,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4314,50 +42756,51 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncChunk res = noteStore->getFilteredSyncChunk( - afterUSN, - maxEntries, - filter, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->deleteNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() +void NoteStoreTester::shouldExecuteDeleteNoteAsync() { - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - SyncChunkFilter filter = generateRandomSyncChunkFilter(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + qint32 response = generateRandomInt32(); - NoteStoreGetFilteredSyncChunkTesterHelper helper( - [&] (qint32 afterUSNParam, - qint32 maxEntriesParam, - const SyncChunkFilter & filterParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(filter == filterParam); - throw userException; + Q_ASSERT(guid == guidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4385,7 +42828,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4403,62 +42846,60 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SyncChunk res = noteStore->getFilteredSyncChunk( - afterUSN, - maxEntries, - filter, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } + AsyncResult * result = noteStore->deleteNoteAsync( + guid, + ctx); - QVERIFY(caughtException); + NoteStoreDeleteNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() { - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - SyncChunkFilter filter = generateRandomSyncChunkFilter(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreGetFilteredSyncChunkTesterHelper helper( - [&] (qint32 afterUSNParam, - qint32 maxEntriesParam, - const SyncChunkFilter & filterParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(filter == filterParam); - throw systemException; + Q_ASSERT(guid == guidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4486,7 +42927,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4507,56 +42948,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() bool caughtException = false; try { - SyncChunk res = noteStore->getFilteredSyncChunk( - afterUSN, - maxEntries, - filter, + AsyncResult * result = noteStore->deleteNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreDeleteNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNoteAsync() { - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - SyncChunkFilter filter = generateRandomSyncChunkFilter(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetFilteredSyncChunkTesterHelper helper( - [&] (qint32 afterUSNParam, - qint32 maxEntriesParam, - const SyncChunkFilter & filterParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(filter == filterParam); - throw thriftException; + Q_ASSERT(guid == guidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::onGetFilteredSyncChunkRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetFilteredSyncChunkTesterHelper::getFilteredSyncChunkRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetFilteredSyncChunkRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4584,7 +43038,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() QObject::connect( &server, - &NoteStoreServer::getFilteredSyncChunkRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4605,52 +43059,68 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() bool caughtException = false; try { - SyncChunk res = noteStore->getFilteredSyncChunk( - afterUSN, - maxEntries, - filter, + AsyncResult * result = noteStore->deleteNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreDeleteNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncState response = generateRandomSyncState(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> SyncState + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - return response; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4678,7 +43148,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4696,42 +43166,71 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->deleteNoteAsync( + guid, + ctx); + + NoteStoreDeleteNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState() +void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> SyncState + NoteStoreDeleteNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - throw userException; + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::deleteNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onDeleteNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4759,7 +43258,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::deleteNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4780,51 +43279,68 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState bool caughtException = false; try { - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, + AsyncResult * result = noteStore->deleteNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreDeleteNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreDeleteNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteExpungeNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + qint32 response = generateRandomInt32(); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> SyncState + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - throw systemException; + Q_ASSERT(guid == guidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4852,7 +43368,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4870,53 +43386,42 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + qint32 res = noteStore->expungeNote( + guid, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> SyncState + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - throw notFoundException; + Q_ASSERT(guid == guidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4944,7 +43449,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4965,48 +43470,51 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS bool caughtException = false; try { - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, + qint32 res = noteStore->expungeNote( + guid, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetLinkedNotebookSyncStateTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> SyncState + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - throw thriftException; + Q_ASSERT(guid == guidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::onGetLinkedNotebookSyncStateRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncStateTesterHelper::getLinkedNotebookSyncStateRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5034,7 +43542,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5055,59 +43563,50 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() bool caughtException = false; try { - SyncState res = noteStore->getLinkedNotebookSyncState( - linkedNotebook, + qint32 res = noteStore->expungeNote( + guid, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SyncChunk response = generateRandomSyncChunk(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - return response; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5135,7 +43634,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5153,54 +43652,53 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->expungeNote( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw userException; + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5228,7 +43726,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5249,63 +43747,48 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk bool caughtException = false; try { - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, + qint32 res = noteStore->expungeNote( + guid, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldExecuteExpungeNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + qint32 response = generateRandomInt32(); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw systemException; + Q_ASSERT(guid == guidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5333,7 +43816,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5351,65 +43834,60 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } + AsyncResult * result = noteStore->expungeNoteAsync( + guid, + ctx); - QVERIFY(caughtException); + NoteStoreExpungeNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw notFoundException; + Q_ASSERT(guid == guidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5437,7 +43915,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5458,60 +43936,69 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC bool caughtException = false; try { - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, + AsyncResult * result = noteStore->expungeNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - qint32 afterUSN = generateRandomInt32(); - qint32 maxEntries = generateRandomInt32(); - bool fullSyncOnly = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetLinkedNotebookSyncChunkTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - qint32 afterUSNParam, - qint32 maxEntriesParam, - bool fullSyncOnlyParam, - IRequestContextPtr ctxParam) -> SyncChunk + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - Q_ASSERT(afterUSN == afterUSNParam); - Q_ASSERT(maxEntries == maxEntriesParam); - Q_ASSERT(fullSyncOnly == fullSyncOnlyParam); - throw thriftException; + Q_ASSERT(guid == guidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::onGetLinkedNotebookSyncChunkRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetLinkedNotebookSyncChunkTesterHelper::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5539,7 +44026,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() QObject::connect( &server, - &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5560,53 +44047,68 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() bool caughtException = false; try { - SyncChunk res = noteStore->getLinkedNotebookSyncChunk( - linkedNotebook, - afterUSN, - maxEntries, - fullSyncOnly, + AsyncResult * result = noteStore->expungeNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListNotebooks() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(guid == guidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5634,7 +44136,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5652,38 +44154,71 @@ void NoteStoreTester::shouldExecuteListNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listNotebooks( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeNoteAsync( + guid, + ctx); + + NoteStoreExpungeNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNoteAsync() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreExpungeNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(guid == guidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::expungeNoteRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onExpungeNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5711,7 +44246,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::expungeNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5732,47 +44267,71 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() bool caughtException = false; try { - QList res = noteStore->listNotebooks( + AsyncResult * result = noteStore->expungeNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCopyNote() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + Note response = generateRandomNote(); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5800,7 +44359,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5818,47 +44377,46 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QList res = noteStore->listNotebooks( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.parameter = generateRandomString(); - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5886,7 +44444,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5907,49 +44465,55 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() bool caughtException = false; try { - QList res = noteStore->listNotebooks( + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5977,7 +44541,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5995,38 +44559,57 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listAccessibleBusinessNotebooks( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6054,7 +44637,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6075,47 +44658,54 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote bool caughtException = false; try { - QList res = noteStore->listAccessibleBusinessNotebooks( + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6143,7 +44733,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6164,44 +44754,52 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo bool caughtException = false; try { - QList res = noteStore->listAccessibleBusinessNotebooks( + Note res = noteStore->copyNote( + noteGuid, + toNotebookGuid, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebooks() +void NoteStoreTester::shouldExecuteCopyNoteAsync() { + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + Note response = generateRandomNote(); - NoteStoreListAccessibleBusinessNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::onListAccessibleBusinessNotebooksRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListAccessibleBusinessNotebooksTesterHelper::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6229,7 +44827,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo QObject::connect( &server, - &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6247,52 +44845,64 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QList res = noteStore->listAccessibleBusinessNotebooks( - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } + AsyncResult * result = noteStore->copyNoteAsync( + noteGuid, + toNotebookGuid, + ctx); - QVERIFY(caughtException); -} + NoteStoreCopyNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::onFinished); -//////////////////////////////////////////////////////////////////////////////// + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); -void NoteStoreTester::shouldExecuteGetNotebook() + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + userException.parameter = generateRandomString(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6320,7 +44930,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6338,42 +44948,76 @@ void NoteStoreTester::shouldExecuteGetNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getNotebook( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->copyNoteAsync( + noteGuid, + toNotebookGuid, + ctx); + + NoteStoreCopyNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNoteAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6401,7 +45045,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6422,51 +45066,72 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + AsyncResult * result = noteStore->copyNoteAsync( + noteGuid, + toNotebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreCopyNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6494,7 +45159,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6515,50 +45180,72 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + AsyncResult * result = noteStore->copyNoteAsync( + noteGuid, + toNotebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreCopyNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInCopyNoteAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + Guid toNotebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreCopyNoteTesterHelper helper( + [&] (const Guid & noteGuidParam, + const Guid & toNotebookGuidParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::copyNoteRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onCopyNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6586,7 +45273,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::copyNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6607,48 +45294,72 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() bool caughtException = false; try { - Notebook res = noteStore->getNotebook( - guid, + AsyncResult * result = noteStore->copyNoteAsync( + noteGuid, + toNotebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreCopyNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCopyNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteListNoteVersions() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + QList response; + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); - NoteStoreGetNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(noteGuid == noteGuidParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreGetNotebookTesterHelper::onGetNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNotebookTesterHelper::getNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onGetNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6676,7 +45387,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() QObject::connect( &server, - &NoteStoreServer::getNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6694,50 +45405,42 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - Notebook res = noteStore->getNotebook( - guid, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() { + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.parameter = generateRandomString(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(noteGuid == noteGuidParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6765,7 +45468,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6783,38 +45486,54 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getDefaultNotebook( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = noteStore->listNoteVersions( + noteGuid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() { + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(noteGuid == noteGuidParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6842,7 +45561,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6863,47 +45582,50 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() bool caughtException = false; try { - Notebook res = noteStore->getDefaultNotebook( + QList res = noteStore->listNoteVersions( + noteGuid, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() { + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(noteGuid == noteGuidParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -6931,7 +45653,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -6952,44 +45674,50 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() bool caughtException = false; try { - Notebook res = noteStore->getDefaultNotebook( + QList res = noteStore->listNoteVersions( + noteGuid, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() { + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetDefaultNotebookTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreGetDefaultNotebookTesterHelper::onGetDefaultNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreGetDefaultNotebookTesterHelper::getDefaultNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onGetDefaultNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7017,7 +45745,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() QObject::connect( &server, - &NoteStoreServer::getDefaultNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7038,7 +45766,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() bool caughtException = false; try { - Notebook res = noteStore->getDefaultNotebook( + QList res = noteStore->listNoteVersions( + noteGuid, ctx); Q_UNUSED(res) } @@ -7051,36 +45780,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteCreateNotebook() +void NoteStoreTester::shouldExecuteListNoteVersionsAsync() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + QList response; + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); + response << generateRandomNoteVersionId(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7108,7 +45838,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7126,42 +45856,60 @@ void NoteStoreTester::shouldExecuteCreateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->createNotebook( - notebook, + AsyncResult * result = noteStore->listNoteVersionsAsync( + noteGuid, ctx); - QVERIFY(res == response); + + NoteStoreListNoteVersionsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; userException.parameter = generateRandomString(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7189,7 +45937,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7210,10 +45958,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + AsyncResult * result = noteStore->listNoteVersionsAsync( + noteGuid, ctx); - Q_UNUSED(res) + + NoteStoreListNoteVersionsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -7224,37 +45990,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7282,7 +46048,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7303,10 +46069,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + AsyncResult * result = noteStore->listNoteVersionsAsync( + noteGuid, ctx); - Q_UNUSED(res) + + NoteStoreListNoteVersionsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -7317,9 +46101,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -7327,26 +46111,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7374,7 +46158,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7395,10 +46179,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + AsyncResult * result = noteStore->listNoteVersionsAsync( + noteGuid, ctx); - Q_UNUSED(res) + + NoteStoreListNoteVersionsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -7409,34 +46211,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersionsAsync() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreListNoteVersionsTesterHelper helper( + [&] (const Guid & noteGuidParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNotebookRequest, + &NoteStoreServer::listNoteVersionsRequest, &helper, - &NoteStoreCreateNotebookTesterHelper::onCreateNotebookRequestReceived); + &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNotebookTesterHelper::createNotebookRequestReady, + &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, &server, - &NoteStoreServer::onCreateNotebookRequestReady); + &NoteStoreServer::onListNoteVersionsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7464,7 +46268,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() QObject::connect( &server, - &NoteStoreServer::createNotebookRequestReady, + &NoteStoreServer::listNoteVersionsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7485,10 +46289,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() bool caughtException = false; try { - Notebook res = noteStore->createNotebook( - notebook, + AsyncResult * result = noteStore->listNoteVersionsAsync( + noteGuid, ctx); - Q_UNUSED(res) + + NoteStoreListNoteVersionsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListNoteVersionsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -7501,34 +46323,46 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteUpdateNotebook() +void NoteStoreTester::shouldExecuteGetNoteVersion() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + Note response = generateRandomNote(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7556,7 +46390,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7574,42 +46408,58 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateNotebook( - notebook, + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7637,7 +46487,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7658,8 +46508,12 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( - notebook, + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); Q_UNUSED(res) } @@ -7672,37 +46526,49 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7730,7 +46596,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7751,8 +46617,12 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( - notebook, + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); Q_UNUSED(res) } @@ -7765,9 +46635,13 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -7775,26 +46649,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7822,7 +46704,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7843,8 +46725,12 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( - notebook, + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); Q_UNUSED(res) } @@ -7857,34 +46743,48 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() { - Notebook notebook = generateRandomNotebook(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateNotebookTesterHelper helper( - [&] (const Notebook & notebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebook == notebookParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreUpdateNotebookTesterHelper::onUpdateNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNotebookTesterHelper::updateNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onUpdateNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -7912,7 +46812,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() QObject::connect( &server, - &NoteStoreServer::updateNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -7933,8 +46833,12 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateNotebook( - notebook, + Note res = noteStore->getNoteVersion( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); Q_UNUSED(res) } @@ -7947,36 +46851,46 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeNotebook() +void NoteStoreTester::shouldExecuteGetNoteVersionAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + Note response = generateRandomNote(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8004,7 +46918,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8022,42 +46936,76 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeNotebook( - guid, + AsyncResult * result = noteStore->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); - QVERIFY(res == response); + + NoteStoreGetNoteVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; userException.parameter = generateRandomString(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8085,7 +47033,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8106,10 +47054,32 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeNotebook( - guid, + AsyncResult * result = noteStore->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetNoteVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -8120,37 +47090,175 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, + ctx); + + NoteStoreGetNoteVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync() +{ + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNoteVersionRequest, + &helper, + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &server, + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8178,7 +47286,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8199,50 +47307,84 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeNotebook( - guid, + AsyncResult * result = noteStore->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetNoteVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersionAsync() { - Guid guid = generateRandomString(); + Guid noteGuid = generateRandomString(); + qint32 updateSequenceNum = generateRandomInt32(); + bool withResourcesData = generateRandomBool(); + bool withResourcesRecognition = generateRandomBool(); + bool withResourcesAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreExpungeNotebookTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetNoteVersionTesterHelper helper( + [&] (const Guid & noteGuidParam, + qint32 updateSequenceNumParam, + bool withResourcesDataParam, + bool withResourcesRecognitionParam, + bool withResourcesAlternateDataParam, + IRequestContextPtr ctxParam) -> Note { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(updateSequenceNum == updateSequenceNumParam); + Q_ASSERT(withResourcesData == withResourcesDataParam); + Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); + Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::getNoteVersionRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onGetNoteVersionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8270,7 +47412,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::getNoteVersionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8291,48 +47433,84 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeNotebook( - guid, + AsyncResult * result = noteStore->getNoteVersionAsync( + noteGuid, + updateSequenceNum, + withResourcesData, + withResourcesRecognition, + withResourcesAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetNoteVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNoteVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetResource() { Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + Resource response = generateRandomResource(); - NoteStoreExpungeNotebookTesterHelper helper( + NoteStoreGetResourceTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreExpungeNotebookTesterHelper::onExpungeNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNotebookTesterHelper::expungeNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onExpungeNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8360,7 +47538,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() QObject::connect( &server, - &NoteStoreServer::expungeNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8378,53 +47556,58 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->expungeNotebook( - guid, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListTags() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() { + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8452,7 +47635,7 @@ void NoteStoreTester::shouldExecuteListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8470,38 +47653,70 @@ void NoteStoreTester::shouldExecuteListTags() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTags( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() { + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8529,7 +47744,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8550,47 +47765,66 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() bool caughtException = false; try { - QList res = noteStore->listTags( + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() { + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8618,7 +47852,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8639,44 +47873,66 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() bool caughtException = false; try { - QList res = noteStore->listTags( + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListTags() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() { + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListTagsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsTesterHelper::onListTagsRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsTesterHelper::listTagsRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8704,7 +47960,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() QObject::connect( &server, - &NoteStoreServer::listTagsRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8725,7 +47981,12 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() bool caughtException = false; try { - QList res = noteStore->listTags( + Resource res = noteStore->getResource( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); Q_UNUSED(res) } @@ -8738,39 +47999,46 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListTagsByNotebook() +void NoteStoreTester::shouldExecuteGetResourceAsync() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomTag(); - response << generateRandomTag(); - response << generateRandomTag(); + Resource response = generateRandomResource(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8798,7 +48066,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8816,42 +48084,76 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listTagsByNotebook( - notebookGuid, + AsyncResult * result = noteStore->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; userException.parameter = generateRandomString(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8879,7 +48181,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8900,10 +48202,32 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + AsyncResult * result = noteStore->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -8914,37 +48238,49 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAsync() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -8972,7 +48308,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -8993,10 +48329,32 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + AsyncResult * result = noteStore->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -9007,9 +48365,13 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAsync() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -9017,26 +48379,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9064,7 +48434,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9085,10 +48455,32 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + AsyncResult * result = noteStore->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -9099,34 +48491,48 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAsync() { - Guid notebookGuid = generateRandomString(); + Guid guid = generateRandomString(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAttributes = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListTagsByNotebookTesterHelper helper( - [&] (const Guid & notebookGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreGetResourceTesterHelper helper( + [&] (const Guid & guidParam, + bool withDataParam, + bool withRecognitionParam, + bool withAttributesParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAttributes == withAttributesParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequest, + &NoteStoreServer::getResourceRequest, &helper, - &NoteStoreListTagsByNotebookTesterHelper::onListTagsByNotebookRequestReceived); + &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); QObject::connect( &helper, - &NoteStoreListTagsByNotebookTesterHelper::listTagsByNotebookRequestReady, + &NoteStoreGetResourceTesterHelper::getResourceRequestReady, &server, - &NoteStoreServer::onListTagsByNotebookRequestReady); + &NoteStoreServer::onGetResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9154,7 +48560,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() QObject::connect( &server, - &NoteStoreServer::listTagsByNotebookRequestReady, + &NoteStoreServer::getResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9175,10 +48581,32 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() bool caughtException = false; try { - QList res = noteStore->listTagsByNotebook( - notebookGuid, + AsyncResult * result = noteStore->getResourceAsync( + guid, + withData, + withRecognition, + withAttributes, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -9191,17 +48619,17 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetTag() +void NoteStoreTester::shouldExecuteGetResourceApplicationData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + LazyMap response = generateRandomLazyMap(); - NoteStoreGetTagTesterHelper helper( + NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -9211,14 +48639,14 @@ void NoteStoreTester::shouldExecuteGetTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9246,7 +48674,7 @@ void NoteStoreTester::shouldExecuteGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9264,25 +48692,25 @@ void NoteStoreTester::shouldExecuteGetTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->getTag( + LazyMap res = noteStore->getResourceApplicationData( guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; userException.parameter = generateRandomString(); - NoteStoreGetTagTesterHelper helper( + NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -9292,14 +48720,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9327,7 +48755,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9348,7 +48776,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( + LazyMap res = noteStore->getResourceApplicationData( guid, ctx); Q_UNUSED(res) @@ -9362,20 +48790,20 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetTagTesterHelper helper( + NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -9385,14 +48813,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9420,7 +48848,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9441,7 +48869,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( + LazyMap res = noteStore->getResourceApplicationData( guid, ctx); Q_UNUSED(res) @@ -9455,7 +48883,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -9465,9 +48893,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetTagTesterHelper helper( + NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -9477,14 +48905,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9512,7 +48940,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9533,7 +48961,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( + LazyMap res = noteStore->getResourceApplicationData( guid, ctx); Q_UNUSED(res) @@ -9547,17 +48975,19 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetTagTesterHelper helper( + NoteStoreGetResourceApplicationDataTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> Tag + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -9567,14 +48997,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreGetTagTesterHelper::onGetTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreGetTagTesterHelper::getTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onGetTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9602,7 +49032,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() QObject::connect( &server, - &NoteStoreServer::getTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9623,7 +49053,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() bool caughtException = false; try { - Tag res = noteStore->getTag( + LazyMap res = noteStore->getResourceApplicationData( guid, ctx); Q_UNUSED(res) @@ -9637,36 +49067,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteCreateTag() +void NoteStoreTester::shouldExecuteGetResourceApplicationDataAsync() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Tag response = generateRandomTag(); + LazyMap response = generateRandomLazyMap(); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9694,7 +49122,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9712,42 +49140,60 @@ void NoteStoreTester::shouldExecuteCreateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Tag res = noteStore->createTag( - tag, + AsyncResult * result = noteStore->getResourceApplicationDataAsync( + guid, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataAsync() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9775,7 +49221,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9796,10 +49242,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( - tag, + AsyncResult * result = noteStore->getResourceApplicationDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -9810,37 +49274,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataAsync() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::TOO_FEW; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9868,7 +49332,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9889,10 +49353,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( - tag, + AsyncResult * result = noteStore->getResourceApplicationDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -9903,9 +49385,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataAsync() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -9913,26 +49395,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -9960,7 +49442,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -9981,10 +49463,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( - tag, + AsyncResult * result = noteStore->getResourceApplicationDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -9995,34 +49495,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataAsync() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> Tag + NoteStoreGetResourceApplicationDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> LazyMap { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createTagRequest, + &NoteStoreServer::getResourceApplicationDataRequest, &helper, - &NoteStoreCreateTagTesterHelper::onCreateTagRequestReceived); + &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); QObject::connect( &helper, - &NoteStoreCreateTagTesterHelper::createTagRequestReady, + &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, &server, - &NoteStoreServer::onCreateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10050,7 +49552,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() QObject::connect( &server, - &NoteStoreServer::createTagRequestReady, + &NoteStoreServer::getResourceApplicationDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10071,10 +49573,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() bool caughtException = false; try { - Tag res = noteStore->createTag( - tag, + AsyncResult * result = noteStore->getResourceApplicationDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceApplicationDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -10087,34 +49607,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteUpdateTag() +void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + QString response = generateRandomString(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10142,7 +49665,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10160,42 +49683,46 @@ void NoteStoreTester::shouldExecuteUpdateTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateTag( - tag, + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; userException.parameter = generateRandomString(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10223,7 +49750,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10244,8 +49771,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } @@ -10258,37 +49786,40 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10316,7 +49847,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10337,8 +49868,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } @@ -10351,9 +49883,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -10361,26 +49894,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10408,7 +49943,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10429,8 +49964,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } @@ -10443,34 +49979,39 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEntry() { - Tag tag = generateRandomTag(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateTagTesterHelper helper( - [&] (const Tag & tagParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(tag == tagParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateTagRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateTagTesterHelper::onUpdateTagRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateTagTesterHelper::updateTagRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateTagRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10498,7 +50039,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() QObject::connect( &server, - &NoteStoreServer::updateTagRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10519,8 +50060,9 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() bool caughtException = false; try { - qint32 res = noteStore->updateTag( - tag, + QString res = noteStore->getResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } @@ -10533,34 +50075,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUntagAll() +void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreUntagAllTesterHelper helper( + QString response = generateRandomString(); + + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return; + Q_ASSERT(key == keyParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10588,7 +50133,7 @@ void NoteStoreTester::shouldExecuteUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10606,41 +50151,64 @@ void NoteStoreTester::shouldExecuteUntagAll() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->untagAll( + AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, + key, ctx); + + NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; userException.parameter = generateRandomString(); - NoteStoreUntagAllTesterHelper helper( + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10668,7 +50236,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10689,9 +50257,29 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() bool caughtException = false; try { - noteStore->untagAll( + AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, + key, ctx); + + NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -10702,37 +50290,40 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUntagAllTesterHelper helper( + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10760,7 +50351,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10781,9 +50372,29 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() bool caughtException = false; try { - noteStore->untagAll( + AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, + key, ctx); + + NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -10794,9 +50405,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -10804,26 +50416,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUntagAllTesterHelper helper( + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10851,7 +50465,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10872,9 +50486,29 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() bool caughtException = false; try { - noteStore->untagAll( + AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, + key, ctx); + + NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -10885,34 +50519,39 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUntagAllTesterHelper helper( + NoteStoreGetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + const QString & keyParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::untagAllRequest, + &NoteStoreServer::getResourceApplicationDataEntryRequest, &helper, - &NoteStoreUntagAllTesterHelper::onUntagAllRequestReceived); + &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUntagAllTesterHelper::untagAllRequestReady, + &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUntagAllRequestReady); + &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -10940,7 +50579,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() QObject::connect( &server, - &NoteStoreServer::untagAllRequestReady, + &NoteStoreServer::getResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -10961,9 +50600,29 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() bool caughtException = false; try { - noteStore->untagAll( + AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, + key, ctx); + + NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -10976,34 +50635,40 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteExpungeTag() +void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreExpungeTagTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11031,7 +50696,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11049,42 +50714,50 @@ void NoteStoreTester::shouldExecuteExpungeTag() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeTag( + qint32 res = noteStore->setResourceApplicationDataEntry( guid, + key, + value, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreExpungeTagTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11112,7 +50785,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11133,8 +50806,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() bool caughtException = false; try { - qint32 res = noteStore->expungeTag( + qint32 res = noteStore->setResourceApplicationDataEntry( guid, + key, + value, ctx); Q_UNUSED(res) } @@ -11147,37 +50822,43 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeTagTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11205,7 +50886,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11226,8 +50907,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() bool caughtException = false; try { - qint32 res = noteStore->expungeTag( + qint32 res = noteStore->setResourceApplicationDataEntry( guid, + key, + value, ctx); Q_UNUSED(res) } @@ -11240,9 +50923,11 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -11250,26 +50935,30 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreExpungeTagTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11297,7 +50986,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11318,8 +51007,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() bool caughtException = false; try { - qint32 res = noteStore->expungeTag( + qint32 res = noteStore->setResourceApplicationDataEntry( guid, + key, + value, ctx); Q_UNUSED(res) } @@ -11332,34 +51023,42 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() +void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreExpungeTagTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeTagRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreExpungeTagTesterHelper::onExpungeTagRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeTagTesterHelper::expungeTagRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onExpungeTagRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11387,7 +51086,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() QObject::connect( &server, - &NoteStoreServer::expungeTagRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11408,8 +51107,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() bool caughtException = false; try { - qint32 res = noteStore->expungeTag( + qint32 res = noteStore->setResourceApplicationDataEntry( guid, + key, + value, ctx); Q_UNUSED(res) } @@ -11422,36 +51123,40 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListSearches() +void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntryAsync() { + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); - response << generateRandomSavedSearch(); + qint32 response = generateRandomInt32(); - NoteStoreListSearchesTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSearchesRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onListSearchesRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11479,7 +51184,7 @@ void NoteStoreTester::shouldExecuteListSearches() QObject::connect( &server, - &NoteStoreServer::listSearchesRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11497,38 +51202,68 @@ void NoteStoreTester::shouldExecuteListSearches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listSearches( + AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( + guid, + key, + value, ctx); - QVERIFY(res == response); + + NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntryAsync() { + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; userException.parameter = generateRandomString(); - NoteStoreListSearchesTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSearchesRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onListSearchesRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11556,7 +51291,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() QObject::connect( &server, - &NoteStoreServer::listSearchesRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11577,9 +51312,30 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() bool caughtException = false; try { - QList res = noteStore->listSearches( + AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( + guid, + key, + value, ctx); - Q_UNUSED(res) + + NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -11590,34 +51346,43 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntryAsync() { + Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListSearchesTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSearchesRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onListSearchesRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11645,7 +51410,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() QObject::connect( &server, - &NoteStoreServer::listSearchesRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11666,216 +51431,76 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() bool caughtException = false; try { - QList res = noteStore->listSearches( + AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( + guid, + key, + value, ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - - NoteStoreListSearchesTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::listSearchesRequest, - &helper, - &NoteStoreListSearchesTesterHelper::onListSearchesRequestReceived); - QObject::connect( - &helper, - &NoteStoreListSearchesTesterHelper::listSearchesRequestReady, - &server, - &NoteStoreServer::onListSearchesRequestReady); - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); + NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::onFinished); - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::listSearchesRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); + loop.exec(); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QList res = noteStore->listSearches( - ctx); - Q_UNUSED(res) + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetSearch() -{ - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - SavedSearch response = generateRandomSavedSearch(); - - NoteStoreGetSearchTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> SavedSearch - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::getSearchRequest, - &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); - QObject::connect( - &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, - &server, - &NoteStoreServer::onGetSearchRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::getSearchRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SavedSearch res = noteStore->getSearch( - guid, - ctx); - QVERIFY(res == response); -} - -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TAKEN_DOWN; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetSearchTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> SavedSearch + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSearchRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onGetSearchRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11903,7 +51528,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() QObject::connect( &server, - &NoteStoreServer::getSearchRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -11924,51 +51549,76 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() bool caughtException = false; try { - SavedSearch res = noteStore->getSearch( + AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( guid, + key, + value, ctx); - Q_UNUSED(res) + + NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() +void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEntryAsync() { Guid guid = generateRandomString(); + QString key = generateRandomString(); + QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetSearchTesterHelper helper( + NoteStoreSetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> SavedSearch + const QString & keyParam, + const QString & valueParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(key == keyParam); + Q_ASSERT(value == valueParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSearchRequest, + &NoteStoreServer::setResourceApplicationDataEntryRequest, &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onGetSearchRequestReady); + &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -11996,7 +51646,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() QObject::connect( &server, - &NoteStoreServer::getSearchRequestReady, + &NoteStoreServer::setResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12017,50 +51667,73 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() bool caughtException = false; try { - SavedSearch res = noteStore->getSearch( + AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( guid, + key, + value, ctx); - Q_UNUSED(res) + + NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + qint32 response = generateRandomInt32(); - NoteStoreGetSearchTesterHelper helper( + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> SavedSearch + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(key == keyParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onGetSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12088,7 +51761,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() QObject::connect( &server, - &NoteStoreServer::getSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12106,51 +51779,46 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SavedSearch res = noteStore->getSearch( - guid, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry() { Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreGetSearchTesterHelper helper( + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> SavedSearch + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(key == keyParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreGetSearchTesterHelper::onGetSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreGetSearchTesterHelper::getSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onGetSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12178,7 +51846,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() QObject::connect( &server, - &NoteStoreServer::getSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12199,50 +51867,55 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() bool caughtException = false; try { - SavedSearch res = noteStore->getSearch( + qint32 res = noteStore->unsetResourceApplicationDataEntry( guid, + key, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteCreateSearch() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SavedSearch response = generateRandomSavedSearch(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) -> SavedSearch + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - return response; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onCreateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12270,7 +51943,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() QObject::connect( &server, - &NoteStoreServer::createSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12288,42 +51961,57 @@ void NoteStoreTester::shouldExecuteCreateSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SavedSearch res = noteStore->createSearch( - search, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) -> SavedSearch + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw userException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onCreateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12351,7 +52039,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() QObject::connect( &server, - &NoteStoreServer::createSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12372,51 +52060,54 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() bool caughtException = false; try { - SavedSearch res = noteStore->createSearch( - search, + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntry() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) -> SavedSearch + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw systemException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onCreateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12444,7 +52135,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() QObject::connect( &server, - &NoteStoreServer::createSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12465,48 +52156,52 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() bool caughtException = false; try { - SavedSearch res = noteStore->createSearch( - search, + qint32 res = noteStore->unsetResourceApplicationDataEntry( + guid, + key, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() +void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntryAsync() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + qint32 response = generateRandomInt32(); - NoteStoreCreateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) -> SavedSearch + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw thriftException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreCreateSearchTesterHelper::onCreateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreCreateSearchTesterHelper::createSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onCreateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12534,7 +52229,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() QObject::connect( &server, - &NoteStoreServer::createSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12552,53 +52247,64 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - SavedSearch res = noteStore->createSearch( - search, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } + AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( + guid, + key, + ctx); - QVERIFY(caughtException); -} + NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::onFinished); -//////////////////////////////////////////////////////////////////////////////// + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); -void NoteStoreTester::shouldExecuteUpdateSearch() + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntryAsync() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.parameter = generateRandomString(); - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - return response; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12626,7 +52332,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() QObject::connect( &server, - &NoteStoreServer::updateSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12644,42 +52350,76 @@ void NoteStoreTester::shouldExecuteUpdateSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateSearch( - search, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( + guid, + key, + ctx); + + NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntryAsync() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw userException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12707,7 +52447,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() QObject::connect( &server, - &NoteStoreServer::updateSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12728,51 +52468,72 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() bool caughtException = false; try { - qint32 res = noteStore->updateSearch( - search, + AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( + guid, + key, ctx); - Q_UNUSED(res) + + NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntryAsync() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw systemException; + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12800,7 +52561,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() QObject::connect( &server, - &NoteStoreServer::updateSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -12821,102 +52582,29 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() bool caughtException = false; try { - qint32 res = noteStore->updateSearch( - search, + AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( + guid, + key, ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() -{ - SavedSearch search = generateRandomSavedSearch(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); - - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, - IRequestContextPtr ctxParam) -> qint32 - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); - throw notFoundException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::updateSearchRequest, - &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); - QObject::connect( - &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, - &server, - &NoteStoreServer::onUpdateSearchRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); + NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::onFinished); - QObject::connect( - &server, - &NoteStoreServer::updateSearchRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); + loop.exec(); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->updateSearch( - search, - ctx); - Q_UNUSED(res) + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -12927,34 +52615,39 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() +void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntryAsync() { - SavedSearch search = generateRandomSavedSearch(); + Guid guid = generateRandomString(); + QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateSearchTesterHelper helper( - [&] (const SavedSearch & searchParam, + NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( + [&] (const Guid & guidParam, + const QString & keyParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(search == searchParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSearchRequest, + &NoteStoreServer::unsetResourceApplicationDataEntryRequest, &helper, - &NoteStoreUpdateSearchTesterHelper::onUpdateSearchRequestReceived); + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSearchTesterHelper::updateSearchRequestReady, + &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, &server, - &NoteStoreServer::onUpdateSearchRequestReady); + &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -12982,7 +52675,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() QObject::connect( &server, - &NoteStoreServer::updateSearchRequestReady, + &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13003,10 +52696,29 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() bool caughtException = false; try { - qint32 res = noteStore->updateSearch( - search, + AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( + guid, + key, ctx); - Q_UNUSED(res) + + NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -13019,34 +52731,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteExpungeSearch() +void NoteStoreTester::shouldExecuteUpdateResource() { - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13074,7 +52786,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13092,42 +52804,42 @@ void NoteStoreTester::shouldExecuteExpungeSearch() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateResource( + resource, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() { - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13155,7 +52867,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13176,8 +52888,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() bool caughtException = false; try { - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateResource( + resource, ctx); Q_UNUSED(res) } @@ -13190,37 +52902,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() { - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13248,7 +52960,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13269,8 +52981,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() bool caughtException = false; try { - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateResource( + resource, ctx); Q_UNUSED(res) } @@ -13283,9 +52995,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() { - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -13293,26 +53005,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13340,7 +53052,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13361,8 +53073,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() bool caughtException = false; try { - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateResource( + resource, ctx); Q_UNUSED(res) } @@ -13375,34 +53087,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() { - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreExpungeSearchTesterHelper helper( - [&] (const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeSearchRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreExpungeSearchTesterHelper::onExpungeSearchRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeSearchTesterHelper::expungeSearchRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onExpungeSearchRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13430,7 +53144,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() QObject::connect( &server, - &NoteStoreServer::expungeSearchRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13451,8 +53165,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() bool caughtException = false; try { - qint32 res = noteStore->expungeSearch( - guid, + qint32 res = noteStore->updateResource( + resource, ctx); Q_UNUSED(res) } @@ -13465,39 +53179,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteFindNoteOffset() +void NoteStoreTester::shouldExecuteUpdateResourceAsync() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13525,7 +53234,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13543,46 +53252,60 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->findNoteOffset( - filter, - guid, + AsyncResult * result = noteStore->updateResourceAsync( + resource, ctx); - QVERIFY(res == response); + + NoteStoreUpdateResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13610,7 +53333,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13631,11 +53354,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() bool caughtException = false; try { - qint32 res = noteStore->findNoteOffset( - filter, - guid, + AsyncResult * result = noteStore->updateResourceAsync( + resource, ctx); - Q_UNUSED(res) + + NoteStoreUpdateResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -13646,40 +53386,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResourceAsync() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13707,7 +53444,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13728,11 +53465,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() bool caughtException = false; try { - qint32 res = noteStore->findNoteOffset( - filter, - guid, + AsyncResult * result = noteStore->updateResourceAsync( + resource, ctx); - Q_UNUSED(res) + + NoteStoreUpdateResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -13743,10 +53497,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -13754,28 +53507,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13803,7 +53554,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13824,11 +53575,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() bool caughtException = false; try { - qint32 res = noteStore->findNoteOffset( - filter, - guid, + AsyncResult * result = noteStore->updateResourceAsync( + resource, ctx); - Q_UNUSED(res) + + NoteStoreUpdateResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -13839,37 +53607,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResourceAsync() { - NoteFilter filter = generateRandomNoteFilter(); - Guid guid = generateRandomString(); + Resource resource = generateRandomResource(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreFindNoteOffsetTesterHelper helper( - [&] (const NoteFilter & filterParam, - const Guid & guidParam, + NoteStoreUpdateResourceTesterHelper helper( + [&] (const Resource & resourceParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(guid == guidParam); + Q_ASSERT(resource == resourceParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequest, + &NoteStoreServer::updateResourceRequest, &helper, - &NoteStoreFindNoteOffsetTesterHelper::onFindNoteOffsetRequestReceived); + &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteOffsetTesterHelper::findNoteOffsetRequestReady, + &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, &server, - &NoteStoreServer::onFindNoteOffsetRequestReady); + &NoteStoreServer::onUpdateResourceRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13897,7 +53664,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() QObject::connect( &server, - &NoteStoreServer::findNoteOffsetRequestReady, + &NoteStoreServer::updateResourceRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -13918,11 +53685,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() bool caughtException = false; try { - qint32 res = noteStore->findNoteOffset( - filter, - guid, + AsyncResult * result = noteStore->updateResourceAsync( + resource, ctx); - Q_UNUSED(res) + + NoteStoreUpdateResourceAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateResourceAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -13935,43 +53719,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteFindNotesMetadata() +void NoteStoreTester::shouldExecuteGetResourceData() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NotesMetadataList response = generateRandomNotesMetadataList(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> NotesMetadataList + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -13999,7 +53774,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14017,54 +53792,42 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, + QByteArray res = noteStore->getResourceData( + guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> NotesMetadataList + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14092,7 +53855,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14113,11 +53876,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() bool caughtException = false; try { - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, + QByteArray res = noteStore->getResourceData( + guid, ctx); Q_UNUSED(res) } @@ -14130,46 +53890,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> NotesMetadataList + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14197,7 +53948,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14218,11 +53969,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() bool caughtException = false; try { - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, + QByteArray res = noteStore->getResourceData( + guid, ctx); Q_UNUSED(res) } @@ -14235,12 +53983,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -14248,32 +53993,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> NotesMetadataList + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14301,7 +54040,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14322,11 +54061,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() bool caughtException = false; try { - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, + QByteArray res = noteStore->getResourceData( + guid, ctx); Q_UNUSED(res) } @@ -14339,43 +54075,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() { - NoteFilter filter = generateRandomNoteFilter(); - qint32 offset = generateRandomInt32(); - qint32 maxNotes = generateRandomInt32(); - NotesMetadataResultSpec resultSpec = generateRandomNotesMetadataResultSpec(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreFindNotesMetadataTesterHelper helper( - [&] (const NoteFilter & filterParam, - qint32 offsetParam, - qint32 maxNotesParam, - const NotesMetadataResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> NotesMetadataList + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(offset == offsetParam); - Q_ASSERT(maxNotes == maxNotesParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNotesMetadataTesterHelper::onFindNotesMetadataRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNotesMetadataTesterHelper::findNotesMetadataRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNotesMetadataRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14403,7 +54132,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() QObject::connect( &server, - &NoteStoreServer::findNotesMetadataRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14424,11 +54153,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() bool caughtException = false; try { - NotesMetadataList res = noteStore->findNotesMetadata( - filter, - offset, - maxNotes, - resultSpec, + QByteArray res = noteStore->getResourceData( + guid, ctx); Q_UNUSED(res) } @@ -14441,39 +54167,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteFindNoteCounts() +void NoteStoreTester::shouldExecuteGetResourceDataAsync() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteCollectionCounts response = generateRandomNoteCollectionCounts(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) -> NoteCollectionCounts + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14501,7 +54222,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14519,46 +54240,60 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, + AsyncResult * result = noteStore->getResourceDataAsync( + guid, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; userException.parameter = generateRandomString(); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) -> NoteCollectionCounts + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14586,7 +54321,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14607,11 +54342,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() bool caughtException = false; try { - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, + AsyncResult * result = noteStore->getResourceDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -14622,40 +54374,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceDataAsync() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) -> NoteCollectionCounts + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14683,7 +54432,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14704,11 +54453,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() bool caughtException = false; try { - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, + AsyncResult * result = noteStore->getResourceDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -14719,10 +54485,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -14730,28 +54495,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) -> NoteCollectionCounts + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14779,7 +54542,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14800,11 +54563,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() bool caughtException = false; try { - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, + AsyncResult * result = noteStore->getResourceDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -14815,37 +54595,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceDataAsync() { - NoteFilter filter = generateRandomNoteFilter(); - bool withTrash = generateRandomBool(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreFindNoteCountsTesterHelper helper( - [&] (const NoteFilter & filterParam, - bool withTrashParam, - IRequestContextPtr ctxParam) -> NoteCollectionCounts + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(filter == filterParam); - Q_ASSERT(withTrash == withTrashParam); + Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequest, + &NoteStoreServer::getResourceDataRequest, &helper, - &NoteStoreFindNoteCountsTesterHelper::onFindNoteCountsRequestReceived); + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); QObject::connect( &helper, - &NoteStoreFindNoteCountsTesterHelper::findNoteCountsRequestReady, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, &server, - &NoteStoreServer::onFindNoteCountsRequestReady); + &NoteStoreServer::onGetResourceDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14873,7 +54652,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() QObject::connect( &server, - &NoteStoreServer::findNoteCountsRequestReady, + &NoteStoreServer::getResourceDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14894,11 +54673,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() bool caughtException = false; try { - NoteCollectionCounts res = noteStore->findNoteCounts( - filter, - withTrash, + AsyncResult * result = noteStore->getResourceDataAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -14911,37 +54707,46 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() +void NoteStoreTester::shouldExecuteGetResourceByHash() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + Resource response = generateRandomResource(); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -14969,7 +54774,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -14987,46 +54792,58 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; userException.parameter = generateRandomString(); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15054,7 +54871,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15075,9 +54892,12 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() bool caughtException = false; try { - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); Q_UNUSED(res) } @@ -15090,10 +54910,13 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -15102,28 +54925,34 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15151,7 +54980,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15172,9 +55001,12 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() bool caughtException = false; try { - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); Q_UNUSED(res) } @@ -15187,10 +55019,13 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -15198,28 +55033,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15247,7 +55088,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15268,9 +55109,12 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( bool caughtException = false; try { - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); Q_UNUSED(res) } @@ -15283,37 +55127,48 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() { - Guid guid = generateRandomString(); - NoteResultSpec resultSpec = generateRandomNoteResultSpec(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteWithResultSpecTesterHelper helper( - [&] (const Guid & guidParam, - const NoteResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::onGetNoteWithResultSpecRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteWithResultSpecTesterHelper::getNoteWithResultSpecRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteWithResultSpecRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15341,7 +55196,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() QObject::connect( &server, - &NoteStoreServer::getNoteWithResultSpecRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15362,9 +55217,12 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() bool caughtException = false; try { - Note res = noteStore->getNoteWithResultSpec( - guid, - resultSpec, + Resource res = noteStore->getResourceByHash( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); Q_UNUSED(res) } @@ -15377,48 +55235,46 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNote() +void NoteStoreTester::shouldExecuteGetResourceByHashAsync() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + Resource response = generateRandomResource(); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15446,7 +55302,7 @@ void NoteStoreTester::shouldExecuteGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15464,58 +55320,76 @@ void NoteStoreTester::shouldExecuteGetNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + AsyncResult * result = noteStore->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceByHashAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.errorCode = EDAMErrorCode::UNKNOWN; userException.parameter = generateRandomString(); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15543,7 +55417,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15564,14 +55438,32 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() bool caughtException = false; try { - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + AsyncResult * result = noteStore->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceByHashAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -15582,49 +55474,49 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15652,7 +55544,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15673,14 +55565,32 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() bool caughtException = false; try { - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + AsyncResult * result = noteStore->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceByHashAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -15691,13 +55601,13 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -15705,34 +55615,34 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15760,7 +55670,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15781,14 +55691,32 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() bool caughtException = false; try { - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + AsyncResult * result = noteStore->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceByHashAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -15799,46 +55727,48 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHashAsync() { - Guid guid = generateRandomString(); - bool withContent = generateRandomBool(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + Guid noteGuid = generateRandomString(); + QByteArray contentHash = generateRandomString().toUtf8(); + bool withData = generateRandomBool(); + bool withRecognition = generateRandomBool(); + bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteTesterHelper helper( - [&] (const Guid & guidParam, - bool withContentParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreGetResourceByHashTesterHelper helper( + [&] (const Guid & noteGuidParam, + QByteArray contentHashParam, + bool withDataParam, + bool withRecognitionParam, + bool withAlternateDataParam, + IRequestContextPtr ctxParam) -> Resource { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withContent == withContentParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(contentHash == contentHashParam); + Q_ASSERT(withData == withDataParam); + Q_ASSERT(withRecognition == withRecognitionParam); + Q_ASSERT(withAlternateData == withAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteRequest, + &NoteStoreServer::getResourceByHashRequest, &helper, - &NoteStoreGetNoteTesterHelper::onGetNoteRequestReceived); + &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTesterHelper::getNoteRequestReady, + &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, &server, - &NoteStoreServer::onGetNoteRequestReady); + &NoteStoreServer::onGetResourceByHashRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15866,7 +55796,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() QObject::connect( &server, - &NoteStoreServer::getNoteRequestReady, + &NoteStoreServer::getResourceByHashRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15887,14 +55817,32 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() bool caughtException = false; try { - Note res = noteStore->getNote( - guid, - withContent, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + AsyncResult * result = noteStore->getResourceByHashAsync( + noteGuid, + contentHash, + withData, + withRecognition, + withAlternateData, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceByHashAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceByHashAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -15907,17 +55855,17 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteApplicationData() +void NoteStoreTester::shouldExecuteGetResourceRecognition() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = generateRandomLazyMap(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreGetNoteApplicationDataTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -15927,14 +55875,14 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -15962,7 +55910,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -15980,25 +55928,25 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LazyMap res = noteStore->getNoteApplicationData( + QByteArray res = noteStore->getResourceRecognition( guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; userException.parameter = generateRandomString(); - NoteStoreGetNoteApplicationDataTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -16008,14 +55956,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16043,7 +55991,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16064,7 +56012,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() bool caughtException = false; try { - LazyMap res = noteStore->getNoteApplicationData( + QByteArray res = noteStore->getResourceRecognition( guid, ctx); Q_UNUSED(res) @@ -16078,20 +56026,20 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteApplicationDataTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -16101,14 +56049,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16136,7 +56084,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16157,7 +56105,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() bool caughtException = false; try { - LazyMap res = noteStore->getNoteApplicationData( + QByteArray res = noteStore->getResourceRecognition( guid, ctx); Q_UNUSED(res) @@ -16171,7 +56119,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -16181,9 +56129,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteApplicationDataTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -16193,14 +56141,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16228,7 +56176,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16249,7 +56197,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData bool caughtException = false; try { - LazyMap res = noteStore->getNoteApplicationData( + QByteArray res = noteStore->getResourceRecognition( guid, ctx); Q_UNUSED(res) @@ -16263,17 +56211,19 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteApplicationDataTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -16283,14 +56233,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::onGetNoteApplicationDataRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataTesterHelper::getNoteApplicationDataRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16318,7 +56268,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16339,7 +56289,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() bool caughtException = false; try { - LazyMap res = noteStore->getNoteApplicationData( + QByteArray res = noteStore->getResourceRecognition( guid, ctx); Q_UNUSED(res) @@ -16353,39 +56303,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() +void NoteStoreTester::shouldExecuteGetResourceRecognitionAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16413,7 +56358,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16431,46 +56376,60 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, - key, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceRecognitionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; userException.parameter = generateRandomString(); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16498,7 +56457,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16519,11 +56478,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr bool caughtException = false; try { - QString res = noteStore->getNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceRecognitionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -16534,40 +56510,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16595,7 +56568,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16616,11 +56589,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn bool caughtException = false; try { - QString res = noteStore->getNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceRecognitionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -16631,10 +56621,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognitionAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -16642,28 +56631,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16691,7 +56678,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16712,11 +56699,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData bool caughtException = false; try { - QString res = noteStore->getNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceRecognitionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -16727,37 +56731,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognitionAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceRecognitionTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceRecognitionRequest, &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::onGetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteApplicationDataEntryTesterHelper::getNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, &server, - &NoteStoreServer::onGetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceRecognitionRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16785,7 +56788,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( QObject::connect( &server, - &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceRecognitionRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16806,11 +56809,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( bool caughtException = false; try { - QString res = noteStore->getNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceRecognitionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceRecognitionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -16823,40 +56843,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() +void NoteStoreTester::shouldExecuteGetResourceAlternateData() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16884,7 +56898,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16902,50 +56916,42 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->setNoteApplicationDataEntry( + QByteArray res = noteStore->getResourceAlternateData( guid, - key, - value, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; userException.parameter = generateRandomString(); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -16973,7 +56979,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -16994,10 +57000,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr bool caughtException = false; try { - qint32 res = noteStore->setNoteApplicationDataEntry( + QByteArray res = noteStore->getResourceAlternateData( guid, - key, - value, ctx); Q_UNUSED(res) } @@ -17010,43 +57014,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17074,7 +57072,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17095,10 +57093,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn bool caughtException = false; try { - qint32 res = noteStore->setNoteApplicationDataEntry( + QByteArray res = noteStore->getResourceAlternateData( guid, - key, - value, ctx); Q_UNUSED(res) } @@ -17111,11 +57107,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -17123,30 +57117,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17174,7 +57164,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17195,10 +57185,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData bool caughtException = false; try { - qint32 res = noteStore->setNoteApplicationDataEntry( + QByteArray res = noteStore->getResourceAlternateData( guid, - key, - value, ctx); Q_UNUSED(res) } @@ -17211,40 +57199,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() { Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreSetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::onSetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreSetNoteApplicationDataEntryTesterHelper::setNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onSetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17272,7 +57256,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( QObject::connect( &server, - &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17293,10 +57277,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( bool caughtException = false; try { - qint32 res = noteStore->setNoteApplicationDataEntry( + QByteArray res = noteStore->getResourceAlternateData( guid, - key, - value, ctx); Q_UNUSED(res) } @@ -17309,39 +57291,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldExecuteGetResourceAlternateDataAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + QByteArray response = generateRandomString().toUtf8(); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17369,7 +57346,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17387,46 +57364,60 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->unsetNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, - key, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceAlternateDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; userException.parameter = generateRandomString(); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17454,7 +57445,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17475,11 +57466,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn bool caughtException = false; try { - qint32 res = noteStore->unsetNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAlternateDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -17490,40 +57498,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateDataAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17551,7 +57556,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17572,11 +57577,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData bool caughtException = false; try { - qint32 res = noteStore->unsetNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAlternateDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -17587,10 +57609,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDataAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -17598,28 +57619,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17647,7 +57666,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17668,11 +57687,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa bool caughtException = false; try { - qint32 res = noteStore->unsetNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAlternateDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -17683,37 +57719,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateDataAsync() { Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUnsetNoteApplicationDataEntryTesterHelper helper( + NoteStoreGetResourceAlternateDataTesterHelper helper( [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> QByteArray { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequest, + &NoteStoreServer::getResourceAlternateDataRequest, &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::onUnsetNoteApplicationDataEntryRequestReceived); + &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetNoteApplicationDataEntryTesterHelper::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, &server, - &NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady); + &NoteStoreServer::onGetResourceAlternateDataRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17741,7 +57776,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr QObject::connect( &server, - &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &NoteStoreServer::getResourceAlternateDataRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17762,11 +57797,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr bool caughtException = false; try { - qint32 res = noteStore->unsetNoteApplicationDataEntry( + AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, - key, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAlternateDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAlternateDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -17779,17 +57831,17 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteContent() +void NoteStoreTester::shouldExecuteGetResourceAttributes() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + ResourceAttributes response = generateRandomResourceAttributes(); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -17799,14 +57851,14 @@ void NoteStoreTester::shouldExecuteGetNoteContent() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17834,7 +57886,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17852,25 +57904,25 @@ void NoteStoreTester::shouldExecuteGetNoteContent() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteContent( + ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_FEW; + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; userException.parameter = generateRandomString(); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -17880,14 +57932,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -17915,7 +57967,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -17936,7 +57988,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() bool caughtException = false; try { - QString res = noteStore->getNoteContent( + ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); Q_UNUSED(res) @@ -17950,20 +58002,20 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -17973,14 +58025,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18008,7 +58060,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18029,7 +58081,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() bool caughtException = false; try { - QString res = noteStore->getNoteContent( + ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); Q_UNUSED(res) @@ -18043,7 +58095,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -18053,9 +58105,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -18065,14 +58117,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18100,7 +58152,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18121,7 +58173,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() bool caughtException = false; try { - QString res = noteStore->getNoteContent( + ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); Q_UNUSED(res) @@ -18135,17 +58187,19 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteContentTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -18155,14 +58209,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteContentRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteContentTesterHelper::onGetNoteContentRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteContentTesterHelper::getNoteContentRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteContentRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18190,7 +58244,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() QObject::connect( &server, - &NoteStoreServer::getNoteContentRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18211,7 +58265,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() bool caughtException = false; try { - QString res = noteStore->getNoteContent( + ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); Q_UNUSED(res) @@ -18225,42 +58279,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNoteSearchText() +void NoteStoreTester::shouldExecuteGetResourceAttributesAsync() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + ResourceAttributes response = generateRandomResourceAttributes(); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18288,7 +58334,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18306,50 +58352,60 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getNoteSearchText( + AsyncResult * result = noteStore->getResourceAttributesAsync( guid, - noteOnly, - tokenizeForIndexing, ctx); - QVERIFY(res == response); + + NoteStoreGetResourceAttributesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.errorCode = EDAMErrorCode::DATA_CONFLICT; userException.parameter = generateRandomString(); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18377,7 +58433,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18398,12 +58454,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() bool caughtException = false; try { - QString res = noteStore->getNoteSearchText( + AsyncResult * result = noteStore->getResourceAttributesAsync( guid, - noteOnly, - tokenizeForIndexing, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAttributesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -18414,43 +58486,37 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsync() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18478,7 +58544,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18499,12 +58565,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() bool caughtException = false; try { - QString res = noteStore->getNoteSearchText( + AsyncResult * result = noteStore->getResourceAttributesAsync( guid, - noteOnly, - tokenizeForIndexing, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAttributesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -18515,11 +58597,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesAsync() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -18527,30 +58607,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18578,7 +58654,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18599,12 +58675,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() bool caughtException = false; try { - QString res = noteStore->getNoteSearchText( + AsyncResult * result = noteStore->getResourceAttributesAsync( guid, - noteOnly, - tokenizeForIndexing, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAttributesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -18615,40 +58707,36 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributesAsync() { Guid guid = generateRandomString(); - bool noteOnly = generateRandomBool(); - bool tokenizeForIndexing = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteSearchTextTesterHelper helper( + NoteStoreGetResourceAttributesTesterHelper helper( [&] (const Guid & guidParam, - bool noteOnlyParam, - bool tokenizeForIndexingParam, - IRequestContextPtr ctxParam) -> QString + IRequestContextPtr ctxParam) -> ResourceAttributes { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - Q_ASSERT(noteOnly == noteOnlyParam); - Q_ASSERT(tokenizeForIndexing == tokenizeForIndexingParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequest, + &NoteStoreServer::getResourceAttributesRequest, &helper, - &NoteStoreGetNoteSearchTextTesterHelper::onGetNoteSearchTextRequestReceived); + &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteSearchTextTesterHelper::getNoteSearchTextRequestReady, + &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, &server, - &NoteStoreServer::onGetNoteSearchTextRequestReady); + &NoteStoreServer::onGetResourceAttributesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18676,7 +58764,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() QObject::connect( &server, - &NoteStoreServer::getNoteSearchTextRequestReady, + &NoteStoreServer::getResourceAttributesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18697,12 +58785,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() bool caughtException = false; try { - QString res = noteStore->getNoteSearchText( + AsyncResult * result = noteStore->getResourceAttributesAsync( guid, - noteOnly, - tokenizeForIndexing, ctx); - Q_UNUSED(res) + + NoteStoreGetResourceAttributesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceAttributesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -18715,34 +58819,35 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceSearchText() +void NoteStoreTester::shouldExecuteGetPublicNotebook() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - QString response = generateRandomString(); + Notebook response = generateRandomNotebook(); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18770,7 +58875,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18788,42 +58893,45 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getResourceSearchText( - guid, + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ENML_VALIDATION; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18851,7 +58959,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18872,51 +58980,52 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() bool caughtException = false; try { - QString res = noteStore->getResourceSearchText( - guid, + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -18944,7 +59053,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -18965,50 +59074,52 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() bool caughtException = false; try { - QString res = noteStore->getResourceSearchText( - guid, + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText() +void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19036,7 +59147,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText( QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19057,48 +59168,50 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText( bool caughtException = false; try { - QString res = noteStore->getResourceSearchText( - guid, + Notebook res = noteStore->getPublicNotebook( + userId, + publicUri, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() +void NoteStoreTester::shouldExecuteGetPublicNotebookAsync() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + Notebook response = generateRandomNotebook(); - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19126,7 +59239,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() QObject::connect( &server, - &NoteStoreServer::getResourceSearchTextRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19144,56 +59257,63 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QString res = noteStore->getResourceSearchText( - guid, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } + AsyncResult * result = noteStore->getPublicNotebookAsync( + userId, + publicUri, + ctx); - QVERIFY(caughtException); -} + NoteStoreGetPublicNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::onFinished); -//////////////////////////////////////////////////////////////////////////////// + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); -void NoteStoreTester::shouldExecuteGetNoteTagNames() + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - QStringList response; - response << generateRandomString(); - response << generateRandomString(); - response << generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QStringList + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19221,7 +59341,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19239,42 +59359,73 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QStringList res = noteStore->getNoteTagNames( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getPublicNotebookAsync( + userId, + publicUri, + ctx); + + NoteStoreGetPublicNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QStringList + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19302,7 +59453,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19323,51 +59474,70 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() bool caughtException = false; try { - QStringList res = noteStore->getNoteTagNames( - guid, + AsyncResult * result = noteStore->getPublicNotebookAsync( + userId, + publicUri, ctx); - Q_UNUSED(res) + + NoteStoreGetPublicNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebookAsync() { - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + UserID userId = generateRandomInt32(); + QString publicUri = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QStringList + NoteStoreGetPublicNotebookTesterHelper helper( + [&] (const UserID & userIdParam, + const QString & publicUriParam, + IRequestContextPtr ctxParam) -> Notebook { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(userId == userIdParam); + Q_ASSERT(publicUri == publicUriParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::getPublicNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onGetPublicNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19395,7 +59565,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::getPublicNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19416,50 +59586,72 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() bool caughtException = false; try { - QStringList res = noteStore->getNoteTagNames( - guid, + AsyncResult * result = noteStore->getPublicNotebookAsync( + userId, + publicUri, ctx); - Q_UNUSED(res) + + NoteStoreGetPublicNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetPublicNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteShareNotebook() { - Guid guid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + SharedNotebook response = generateRandomSharedNotebook(); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QStringList + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19487,7 +59679,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19505,51 +59697,46 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - QStringList res = noteStore->getNoteTagNames( - guid, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() { - Guid guid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); - NoteStoreGetNoteTagNamesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QStringList + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreGetNoteTagNamesTesterHelper::onGetNoteTagNamesRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteTagNamesTesterHelper::getNoteTagNamesRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onGetNoteTagNamesRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19577,7 +59764,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() QObject::connect( &server, - &NoteStoreServer::getNoteTagNamesRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19598,50 +59785,54 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() bool caughtException = false; try { - QStringList res = noteStore->getNoteTagNames( - guid, + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteCreateNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19669,7 +59860,7 @@ void NoteStoreTester::shouldExecuteCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19687,42 +59878,58 @@ void NoteStoreTester::shouldExecuteCreateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->createNote( - note, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw userException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19750,7 +59957,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19771,51 +59978,54 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() bool caughtException = false; try { - Note res = noteStore->createNote( - note, + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() +void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw systemException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19843,7 +60053,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19864,50 +60074,52 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() bool caughtException = false; try { - Note res = noteStore->createNote( - note, + SharedNotebook res = noteStore->shareNotebook( + sharedNotebook, + message, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() +void NoteStoreTester::shouldExecuteShareNotebookAsync() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + SharedNotebook response = generateRandomSharedNotebook(); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw notFoundException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -19935,7 +60147,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -19953,51 +60165,64 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - Note res = noteStore->createNote( - note, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } + AsyncResult * result = noteStore->shareNotebookAsync( + sharedNotebook, + message, + ctx); - QVERIFY(caughtException); + NoteStoreShareNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; + userException.parameter = generateRandomString(); - NoteStoreCreateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw thriftException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreCreateNoteTesterHelper::onCreateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCreateNoteTesterHelper::createNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onCreateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20025,7 +60250,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() QObject::connect( &server, - &NoteStoreServer::createNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20046,50 +60271,72 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() bool caughtException = false; try { - Note res = noteStore->createNote( - note, + AsyncResult * result = noteStore->shareNotebookAsync( + sharedNotebook, + message, ctx); - Q_UNUSED(res) + + NoteStoreShareNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20117,7 +60364,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20135,42 +60382,76 @@ void NoteStoreTester::shouldExecuteUpdateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->updateNote( - note, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->shareNotebookAsync( + sharedNotebook, + message, + ctx); + + NoteStoreShareNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebookAsync() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw userException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20198,7 +60479,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20219,51 +60500,72 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() bool caughtException = false; try { - Note res = noteStore->updateNote( - note, + AsyncResult * result = noteStore->shareNotebookAsync( + sharedNotebook, + message, ctx); - Q_UNUSED(res) + + NoteStoreShareNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() +void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebookAsync() { - Note note = generateRandomNote(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + QString message = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreShareNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + const QString & messageParam, + IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw systemException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + Q_ASSERT(message == messageParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::shareNotebookRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onShareNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20291,7 +60593,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::shareNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20312,50 +60614,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() bool caughtException = false; try { - Note res = noteStore->updateNote( - note, + AsyncResult * result = noteStore->shareNotebookAsync( + sharedNotebook, + message, ctx); - Q_UNUSED(res) + + NoteStoreShareNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() { - Note note = generateRandomNote(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw notFoundException; + Q_ASSERT(shareTemplate == shareTemplateParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20383,7 +60704,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20401,51 +60722,42 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - Note res = noteStore->updateNote( - note, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares() { - Note note = generateRandomNote(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreUpdateNoteTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw thriftException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteTesterHelper::onUpdateNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteTesterHelper::updateNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20473,7 +60785,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() QObject::connect( &server, - &NoteStoreServer::updateNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20494,50 +60806,50 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() bool caughtException = false; try { - Note res = noteStore->updateNote( - note, + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteDeleteNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20565,7 +60877,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20583,42 +60895,54 @@ void NoteStoreTester::shouldExecuteDeleteNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->deleteNote( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20646,7 +60970,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20667,51 +60991,56 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() bool caughtException = false; try { - qint32 res = noteStore->deleteNote( - guid, + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, ctx); Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() +void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto invalidContactsException = EDAMInvalidContactsException(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.parameter = generateRandomString(); + invalidContactsException.reasons = QList(); + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::DUPLICATE_CONTACT; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw invalidContactsException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20739,7 +61068,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20760,50 +61089,50 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() bool caughtException = false; try { - qint32 res = noteStore->deleteNote( - guid, + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMInvalidContactsException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == invalidContactsException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20831,7 +61160,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20852,48 +61181,48 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() bool caughtException = false; try { - qint32 res = noteStore->deleteNote( - guid, + CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( + shareTemplate, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() +void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); - NoteStoreDeleteNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; + Q_ASSERT(shareTemplate == shareTemplateParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::deleteNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreDeleteNoteTesterHelper::onDeleteNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreDeleteNoteTesterHelper::deleteNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onDeleteNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -20921,7 +61250,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() QObject::connect( &server, - &NoteStoreServer::deleteNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -20939,53 +61268,60 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->deleteNote( - guid, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, + ctx); - QVERIFY(caughtException); -} + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); -//////////////////////////////////////////////////////////////////////////////// + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); -void NoteStoreTester::shouldExecuteExpungeNote() + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_CONFLICT; + userException.parameter = generateRandomString(); - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return response; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21013,7 +61349,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21031,42 +61367,71 @@ void NoteStoreTester::shouldExecuteExpungeNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeNote( - guid, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, + ctx); + + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw userException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21094,7 +61459,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21115,51 +61480,69 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() bool caughtException = false; try { - qint32 res = noteStore->expungeNote( - guid, + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, ctx); - Q_UNUSED(res) + + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(shareTemplate == shareTemplateParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21187,7 +61570,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21208,10 +61591,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() bool caughtException = false; try { - qint32 res = noteStore->expungeNote( - guid, + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, ctx); - Q_UNUSED(res) + + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -21222,36 +61623,42 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() +void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto invalidContactsException = EDAMInvalidContactsException(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.contacts << generateRandomContact(); + invalidContactsException.parameter = generateRandomString(); + invalidContactsException.reasons = QList(); + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::DUPLICATE_CONTACT; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::BAD_ADDRESS; + invalidContactsException.reasons.ref() << EDAMInvalidContactReason::DUPLICATE_CONTACT; - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(shareTemplate == shareTemplateParam); + throw invalidContactsException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21279,7 +61686,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21300,48 +61707,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() bool caughtException = false; try { - qint32 res = noteStore->expungeNote( - guid, + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, ctx); - Q_UNUSED(res) + + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMInvalidContactsException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == invalidContactsException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookSharesAsync() { - Guid guid = generateRandomString(); + NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreExpungeNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( + [&] (const NotebookShareTemplate & shareTemplateParam, + IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(shareTemplate == shareTemplateParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeNoteRequest, + &NoteStoreServer::createOrUpdateNotebookSharesRequest, &helper, - &NoteStoreExpungeNoteTesterHelper::onExpungeNoteRequestReceived); + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeNoteTesterHelper::expungeNoteRequestReady, + &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, &server, - &NoteStoreServer::onExpungeNoteRequestReady); + &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21369,7 +61796,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() QObject::connect( &server, - &NoteStoreServer::expungeNoteRequestReady, + &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21390,10 +61817,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() bool caughtException = false; try { - qint32 res = noteStore->expungeNote( - guid, + AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( + shareTemplate, ctx); - Q_UNUSED(res) + + NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -21406,37 +61851,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteCopyNote() +void NoteStoreTester::shouldExecuteUpdateSharedNotebook() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + qint32 response = generateRandomInt32(); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21464,7 +61906,7 @@ void NoteStoreTester::shouldExecuteCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21482,46 +61924,42 @@ void NoteStoreTester::shouldExecuteCopyNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; userException.parameter = generateRandomString(); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21549,7 +61987,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21570,9 +62008,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() bool caughtException = false; try { - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, ctx); Q_UNUSED(res) } @@ -21585,40 +62022,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - throw systemException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21646,7 +62079,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21667,54 +62100,51 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() bool caughtException = false; try { - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); - throw notFoundException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21742,7 +62172,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21763,52 +62193,50 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() bool caughtException = false; try { - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() { - Guid noteGuid = generateRandomString(); - Guid toNotebookGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCopyNoteTesterHelper helper( - [&] (const Guid & noteGuidParam, - const Guid & toNotebookGuidParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(toNotebookGuid == toNotebookGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::copyNoteRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreCopyNoteTesterHelper::onCopyNoteRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreCopyNoteTesterHelper::copyNoteRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onCopyNoteRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21836,7 +62264,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() QObject::connect( &server, - &NoteStoreServer::copyNoteRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21857,9 +62285,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() bool caughtException = false; try { - Note res = noteStore->copyNote( - noteGuid, - toNotebookGuid, + qint32 res = noteStore->updateSharedNotebook( + sharedNotebook, ctx); Q_UNUSED(res) } @@ -21872,39 +62299,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListNoteVersions() +void NoteStoreTester::shouldExecuteUpdateSharedNotebookAsync() { - Guid noteGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomNoteVersionId(); - response << generateRandomNoteVersionId(); - response << generateRandomNoteVersionId(); + qint32 response = generateRandomInt32(); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -21932,7 +62354,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -21950,42 +62372,60 @@ void NoteStoreTester::shouldExecuteListNoteVersions() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listNoteVersions( - noteGuid, + AsyncResult * result = noteStore->updateSharedNotebookAsync( + sharedNotebook, ctx); - QVERIFY(res == response); + + NoteStoreUpdateSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync() { - Guid noteGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; userException.parameter = generateRandomString(); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22013,7 +62453,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22034,10 +62474,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() bool caughtException = false; try { - QList res = noteStore->listNoteVersions( - noteGuid, + AsyncResult * result = noteStore->updateSharedNotebookAsync( + sharedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -22048,37 +62506,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAsync() { - Guid noteGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - throw systemException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22106,7 +62563,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22127,50 +62584,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() bool caughtException = false; try { - QList res = noteStore->listNoteVersions( - noteGuid, + AsyncResult * result = noteStore->updateSharedNotebookAsync( + sharedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsync() { - Guid noteGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - throw notFoundException; + Q_ASSERT(sharedNotebook == sharedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22198,7 +62674,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22219,48 +62695,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() bool caughtException = false; try { - QList res = noteStore->listNoteVersions( - noteGuid, + AsyncResult * result = noteStore->updateSharedNotebookAsync( + sharedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebookAsync() { - Guid noteGuid = generateRandomString(); + SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListNoteVersionsTesterHelper helper( - [&] (const Guid & noteGuidParam, - IRequestContextPtr ctxParam) -> QList + NoteStoreUpdateSharedNotebookTesterHelper helper( + [&] (const SharedNotebook & sharedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); + Q_ASSERT(sharedNotebook == sharedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequest, + &NoteStoreServer::updateSharedNotebookRequest, &helper, - &NoteStoreListNoteVersionsTesterHelper::onListNoteVersionsRequestReceived); + &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreListNoteVersionsTesterHelper::listNoteVersionsRequestReady, + &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, &server, - &NoteStoreServer::onListNoteVersionsRequestReady); + &NoteStoreServer::onUpdateSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22288,7 +62784,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() QObject::connect( &server, - &NoteStoreServer::listNoteVersionsRequestReady, + &NoteStoreServer::updateSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22309,10 +62805,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() bool caughtException = false; try { - QList res = noteStore->listNoteVersions( - noteGuid, + AsyncResult * result = noteStore->updateSharedNotebookAsync( + sharedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -22325,46 +62839,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetNoteVersion() +void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Note response = generateRandomNote(); + Notebook response = generateRandomNotebook(); - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22392,7 +62897,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22410,58 +62915,46 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22489,7 +62982,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22510,12 +63003,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() bool caughtException = false; try { - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); Q_UNUSED(res) } @@ -22528,49 +63018,39 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - throw systemException; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22598,7 +63078,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22619,66 +63099,55 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() bool caughtException = false; try { - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); - throw notFoundException; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22706,7 +63175,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22727,64 +63196,54 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() bool caughtException = false; try { - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() +void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings() { - Guid noteGuid = generateRandomString(); - qint32 updateSequenceNum = generateRandomInt32(); - bool withResourcesData = generateRandomBool(); - bool withResourcesRecognition = generateRandomBool(); - bool withResourcesAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetNoteVersionTesterHelper helper( - [&] (const Guid & noteGuidParam, - qint32 updateSequenceNumParam, - bool withResourcesDataParam, - bool withResourcesRecognitionParam, - bool withResourcesAlternateDataParam, - IRequestContextPtr ctxParam) -> Note + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(updateSequenceNum == updateSequenceNumParam); - Q_ASSERT(withResourcesData == withResourcesDataParam); - Q_ASSERT(withResourcesRecognition == withResourcesRecognitionParam); - Q_ASSERT(withResourcesAlternateData == withResourcesAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetNoteVersionTesterHelper::onGetNoteVersionRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetNoteVersionTesterHelper::getNoteVersionRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetNoteVersionRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22812,7 +63271,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() QObject::connect( &server, - &NoteStoreServer::getNoteVersionRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22833,12 +63292,9 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() bool caughtException = false; try { - Note res = noteStore->getNoteVersion( - noteGuid, - updateSequenceNum, - withResourcesData, - withResourcesRecognition, - withResourcesAlternateData, + Notebook res = noteStore->setNotebookRecipientSettings( + notebookGuid, + recipientSettings, ctx); Q_UNUSED(res) } @@ -22851,48 +63307,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResource() +void NoteStoreTester::shouldExecuteSetNotebookRecipientSettingsAsync() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = generateRandomResource(); + Notebook response = generateRandomNotebook(); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -22920,7 +63365,7 @@ void NoteStoreTester::shouldExecuteGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -22938,58 +63383,64 @@ void NoteStoreTester::shouldExecuteGetResource() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, + AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, ctx); - QVERIFY(res == response); + + NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettingsAsync() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.errorCode = EDAMErrorCode::UNKNOWN; userException.parameter = generateRandomString(); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23017,7 +63468,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23038,14 +63489,29 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() bool caughtException = false; try { - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, + AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, ctx); - Q_UNUSED(res) + + NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -23056,49 +63522,39 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettingsAsync() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - throw systemException; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23126,7 +63582,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23147,66 +63603,73 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() bool caughtException = false; try { - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, + AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, ctx); - Q_UNUSED(res) + + NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettingsAsync() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - throw notFoundException; + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23234,7 +63697,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23255,64 +63718,72 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() bool caughtException = false; try { - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, + AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, ctx); - Q_UNUSED(res) + + NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() +void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettingsAsync() { - Guid guid = generateRandomString(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAttributes = generateRandomBool(); - bool withAlternateData = generateRandomBool(); + QString notebookGuid = generateRandomString(); + NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceTesterHelper helper( - [&] (const Guid & guidParam, - bool withDataParam, - bool withRecognitionParam, - bool withAttributesParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreSetNotebookRecipientSettingsTesterHelper helper( + [&] (const QString & notebookGuidParam, + const NotebookRecipientSettings & recipientSettingsParam, + IRequestContextPtr ctxParam) -> Notebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAttributes == withAttributesParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); + Q_ASSERT(notebookGuid == notebookGuidParam); + Q_ASSERT(recipientSettings == recipientSettingsParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRequest, + &NoteStoreServer::setNotebookRecipientSettingsRequest, &helper, - &NoteStoreGetResourceTesterHelper::onGetResourceRequestReceived); + &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceTesterHelper::getResourceRequestReady, + &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, &server, - &NoteStoreServer::onGetResourceRequestReady); + &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23340,7 +63811,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() QObject::connect( &server, - &NoteStoreServer::getResourceRequestReady, + &NoteStoreServer::setNotebookRecipientSettingsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23361,14 +63832,29 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() bool caughtException = false; try { - Resource res = noteStore->getResource( - guid, - withData, - withRecognition, - withAttributes, - withAlternateData, + AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( + notebookGuid, + recipientSettings, ctx); - Q_UNUSED(res) + + NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -23381,34 +63867,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceApplicationData() +void NoteStoreTester::shouldExecuteListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LazyMap response = generateRandomLazyMap(); + QList response; + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23436,7 +63922,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23454,42 +63940,38 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LazyMap res = noteStore->getResourceApplicationData( - guid, + QList res = noteStore->listSharedNotebooks( ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; userException.parameter = generateRandomString(); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23517,7 +63999,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23538,8 +64020,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData bool caughtException = false; try { - LazyMap res = noteStore->getResourceApplicationData( - guid, + QList res = noteStore->listSharedNotebooks( ctx); Q_UNUSED(res) } @@ -23552,37 +64033,33 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23610,7 +64087,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23631,50 +64108,47 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa bool caughtException = false; try { - LazyMap res = noteStore->getResourceApplicationData( - guid, + QList res = noteStore->listSharedNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23702,7 +64176,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23723,48 +64197,46 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication bool caughtException = false; try { - LazyMap res = noteStore->getResourceApplicationData( - guid, + QList res = noteStore->listSharedNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() +void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceApplicationDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> LazyMap + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::onGetResourceApplicationDataRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataTesterHelper::getResourceApplicationDataRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23792,7 +64264,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23813,8 +64285,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() bool caughtException = false; try { - LazyMap res = noteStore->getResourceApplicationData( - guid, + QList res = noteStore->listSharedNotebooks( ctx); Q_UNUSED(res) } @@ -23827,39 +64298,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() +void NoteStoreTester::shouldExecuteListSharedNotebooksAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + QList response; + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); + response << generateRandomSharedNotebook(); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23887,7 +64353,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23905,46 +64371,56 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); - QVERIFY(res == response); + + NoteStoreListSharedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; userException.parameter = generateRandomString(); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -23972,7 +64448,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -23993,11 +64469,27 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData bool caughtException = false; try { - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListSharedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -24008,40 +64500,33 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24069,7 +64554,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24090,54 +64575,65 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa bool caughtException = false; try { - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListSharedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24165,7 +64661,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24186,52 +64682,64 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication bool caughtException = false; try { - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListSharedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooksAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreListSharedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequest, + &NoteStoreServer::listSharedNotebooksRequest, &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::onGetResourceApplicationDataEntryRequestReceived); + &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceApplicationDataEntryTesterHelper::getResourceApplicationDataEntryRequestReady, + &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onListSharedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24259,7 +64767,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn QObject::connect( &server, - &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &NoteStoreServer::listSharedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24280,11 +64788,27 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn bool caughtException = false; try { - QString res = noteStore->getResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListSharedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListSharedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -24297,40 +64821,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() +void NoteStoreTester::shouldExecuteCreateLinkedNotebook() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + LinkedNotebook response = generateRandomLinkedNotebook(); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24358,7 +64876,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24376,50 +64894,42 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->setResourceApplicationDataEntry( - guid, - key, - value, + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; userException.parameter = generateRandomString(); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24447,7 +64957,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24468,10 +64978,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData bool caughtException = false; try { - qint32 res = noteStore->setResourceApplicationDataEntry( - guid, - key, - value, + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } @@ -24484,43 +64992,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); - throw systemException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24548,7 +65049,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24569,58 +65070,51 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa bool caughtException = false; try { - qint32 res = noteStore->setResourceApplicationDataEntry( - guid, - key, - value, + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); - throw notFoundException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24648,7 +65142,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24669,56 +65163,50 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication bool caughtException = false; try { - qint32 res = noteStore->setResourceApplicationDataEntry( - guid, - key, - value, + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); - QString value = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreSetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - const QString & valueParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - Q_ASSERT(value == valueParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::onSetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreSetResourceApplicationDataEntryTesterHelper::setResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onSetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24746,7 +65234,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QObject::connect( &server, - &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24767,10 +65255,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn bool caughtException = false; try { - qint32 res = noteStore->setResourceApplicationDataEntry( - guid, - key, - value, + LinkedNotebook res = noteStore->createLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } @@ -24783,39 +65269,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldExecuteCreateLinkedNotebookAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + LinkedNotebook response = generateRandomLinkedNotebook(); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24843,7 +65324,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24861,46 +65342,60 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->createLinkedNotebookAsync( + linkedNotebook, ctx); - QVERIFY(res == response); + + NoteStoreCreateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; userException.parameter = generateRandomString(); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -24928,7 +65423,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -24949,11 +65444,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa bool caughtException = false; try { - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->createLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreCreateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -24964,40 +65476,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_FEW; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - throw systemException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25025,7 +65533,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25046,54 +65554,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication bool caughtException = false; try { - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->createLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreCreateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); - throw notFoundException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25121,7 +65644,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25142,52 +65665,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati bool caughtException = false; try { - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->createLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreCreateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntry() +void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebookAsync() { - Guid guid = generateRandomString(); - QString key = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUnsetResourceApplicationDataEntryTesterHelper helper( - [&] (const Guid & guidParam, - const QString & keyParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreCreateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> LinkedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - Q_ASSERT(key == keyParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequest, + &NoteStoreServer::createLinkedNotebookRequest, &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::onUnsetResourceApplicationDataEntryRequestReceived); + &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUnsetResourceApplicationDataEntryTesterHelper::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady); + &NoteStoreServer::onCreateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25215,7 +65754,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData QObject::connect( &server, - &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &NoteStoreServer::createLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25236,11 +65775,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData bool caughtException = false; try { - qint32 res = noteStore->unsetResourceApplicationDataEntry( - guid, - key, + AsyncResult * result = noteStore->createLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreCreateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreCreateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -25253,34 +65809,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteUpdateResource() +void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() { - Resource resource = generateRandomResource(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); qint32 response = generateRandomInt32(); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25308,7 +65864,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25326,42 +65882,42 @@ void NoteStoreTester::shouldExecuteUpdateResource() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateResource( - resource, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() { - Resource resource = generateRandomResource(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; userException.parameter = generateRandomString(); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25389,7 +65945,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25410,8 +65966,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() bool caughtException = false; try { - qint32 res = noteStore->updateResource( - resource, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } @@ -25424,37 +65980,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() { - Resource resource = generateRandomResource(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); - throw systemException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25482,7 +66037,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25503,50 +66058,51 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() bool caughtException = false; try { - qint32 res = noteStore->updateResource( - resource, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() { - Resource resource = generateRandomResource(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); - throw notFoundException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25574,7 +66130,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25595,48 +66151,50 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() bool caughtException = false; try { - qint32 res = noteStore->updateResource( - resource, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() { - Resource resource = generateRandomResource(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateResourceTesterHelper helper( - [&] (const Resource & resourceParam, + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(resource == resourceParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateResourceRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreUpdateResourceTesterHelper::onUpdateResourceRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateResourceTesterHelper::updateResourceRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onUpdateResourceRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25664,7 +66222,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() QObject::connect( &server, - &NoteStoreServer::updateResourceRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25685,8 +66243,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() bool caughtException = false; try { - qint32 res = noteStore->updateResource( - resource, + qint32 res = noteStore->updateLinkedNotebook( + linkedNotebook, ctx); Q_UNUSED(res) } @@ -25699,36 +66257,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResourceData() +void NoteStoreTester::shouldExecuteUpdateLinkedNotebookAsync() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + qint32 response = generateRandomInt32(); - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25756,7 +66312,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25774,42 +66330,60 @@ void NoteStoreTester::shouldExecuteGetResourceData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceData( - guid, + AsyncResult * result = noteStore->updateLinkedNotebookAsync( + linkedNotebook, ctx); - QVERIFY(res == response); + + NoteStoreUpdateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; userException.parameter = generateRandomString(); - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25837,7 +66411,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25858,10 +66432,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceData( - guid, + AsyncResult * result = noteStore->updateLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -25872,37 +66464,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAsync() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -25930,7 +66521,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -25951,50 +66542,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceData( - guid, + AsyncResult * result = noteStore->updateLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsync() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(linkedNotebook == linkedNotebookParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26022,7 +66632,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26043,48 +66653,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceData( - guid, + AsyncResult * result = noteStore->updateLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync() { - Guid guid = generateRandomString(); + LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreUpdateLinkedNotebookTesterHelper helper( + [&] (const LinkedNotebook & linkedNotebookParam, + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(linkedNotebook == linkedNotebookParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceDataRequest, + &NoteStoreServer::updateLinkedNotebookRequest, &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceDataRequestReady); + &NoteStoreServer::onUpdateLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26112,7 +66742,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() QObject::connect( &server, - &NoteStoreServer::getResourceDataRequestReady, + &NoteStoreServer::updateLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26133,10 +66763,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceData( - guid, + AsyncResult * result = noteStore->updateLinkedNotebookAsync( + linkedNotebook, ctx); - Q_UNUSED(res) + + NoteStoreUpdateLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -26149,46 +66797,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceByHash() +void NoteStoreTester::shouldExecuteListLinkedNotebooks() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Resource response = generateRandomResource(); + QList response; + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26216,7 +66852,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26234,58 +66870,38 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + QList res = noteStore->listLinkedNotebooks( ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26313,7 +66929,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26334,12 +66950,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() bool caughtException = false; try { - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + QList res = noteStore->listLinkedNotebooks( ctx); Q_UNUSED(res) } @@ -26352,49 +66963,33 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26422,7 +67017,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26443,66 +67038,47 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() bool caughtException = false; try { - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + QList res = noteStore->listLinkedNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26530,7 +67106,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26551,64 +67127,46 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() bool caughtException = false; try { - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + QList res = noteStore->listLinkedNotebooks( ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() +void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() { - Guid noteGuid = generateRandomString(); - QByteArray contentHash = generateRandomString().toUtf8(); - bool withData = generateRandomBool(); - bool withRecognition = generateRandomBool(); - bool withAlternateData = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceByHashTesterHelper helper( - [&] (const Guid & noteGuidParam, - QByteArray contentHashParam, - bool withDataParam, - bool withRecognitionParam, - bool withAlternateDataParam, - IRequestContextPtr ctxParam) -> Resource + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(noteGuid == noteGuidParam); - Q_ASSERT(contentHash == contentHashParam); - Q_ASSERT(withData == withDataParam); - Q_ASSERT(withRecognition == withRecognitionParam); - Q_ASSERT(withAlternateData == withAlternateDataParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceByHashTesterHelper::onGetResourceByHashRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceByHashTesterHelper::getResourceByHashRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceByHashRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26636,7 +67194,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() QObject::connect( &server, - &NoteStoreServer::getResourceByHashRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26657,12 +67215,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() bool caughtException = false; try { - Resource res = noteStore->getResourceByHash( - noteGuid, - contentHash, - withData, - withRecognition, - withAlternateData, + QList res = noteStore->listLinkedNotebooks( ctx); Q_UNUSED(res) } @@ -26675,36 +67228,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResourceRecognition() +void NoteStoreTester::shouldExecuteListLinkedNotebooksAsync() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + QList response; + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); + response << generateRandomLinkedNotebook(); - NoteStoreGetResourceRecognitionTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26732,7 +67283,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26750,42 +67301,56 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceRecognition( - guid, + AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); - QVERIFY(res == response); + + NoteStoreListLinkedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; userException.parameter = generateRandomString(); - NoteStoreGetResourceRecognitionTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26813,7 +67378,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26834,10 +67399,27 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() bool caughtException = false; try { - QByteArray res = noteStore->getResourceRecognition( - guid, + AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListLinkedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -26848,37 +67430,33 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsync() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceRecognitionTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26906,7 +67484,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -26927,50 +67505,65 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() bool caughtException = false; try { - QByteArray res = noteStore->getResourceRecognition( - guid, + AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListLinkedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceRecognitionTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -26998,7 +67591,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27019,48 +67612,64 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition bool caughtException = false; try { - QByteArray res = noteStore->getResourceRecognition( - guid, + AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListLinkedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() +void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooksAsync() { - Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceRecognitionTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + NoteStoreListLinkedNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequest, + &NoteStoreServer::listLinkedNotebooksRequest, &helper, - &NoteStoreGetResourceRecognitionTesterHelper::onGetResourceRecognitionRequestReceived); + &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceRecognitionTesterHelper::getResourceRecognitionRequestReady, + &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, &server, - &NoteStoreServer::onGetResourceRecognitionRequestReady); + &NoteStoreServer::onListLinkedNotebooksRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27088,7 +67697,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() QObject::connect( &server, - &NoteStoreServer::getResourceRecognitionRequestReady, + &NoteStoreServer::listLinkedNotebooksRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27109,10 +67718,27 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() bool caughtException = false; try { - QByteArray res = noteStore->getResourceRecognition( - guid, + AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); - Q_UNUSED(res) + + NoteStoreListLinkedNotebooksAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreListLinkedNotebooksAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -27125,17 +67751,17 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteGetResourceAlternateData() +void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QByteArray response = generateRandomString().toUtf8(); + qint32 response = generateRandomInt32(); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27145,14 +67771,14 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27180,7 +67806,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27198,25 +67824,25 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QByteArray res = noteStore->getResourceAlternateData( + qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; userException.parameter = generateRandomString(); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27226,14 +67852,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27261,7 +67887,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27282,7 +67908,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceAlternateData( + qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); Q_UNUSED(res) @@ -27296,37 +67922,36 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw systemException; + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27354,7 +67979,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27375,50 +68000,51 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData bool caughtException = false; try { - QByteArray res = noteStore->getResourceAlternateData( + qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27446,7 +68072,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27467,31 +68093,33 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa bool caughtException = false; try { - QByteArray res = noteStore->getResourceAlternateData( + qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceAlternateDataTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27501,14 +68129,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::onGetResourceAlternateDataRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAlternateDataTesterHelper::getResourceAlternateDataRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAlternateDataRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27536,7 +68164,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() QObject::connect( &server, - &NoteStoreServer::getResourceAlternateDataRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27557,7 +68185,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() bool caughtException = false; try { - QByteArray res = noteStore->getResourceAlternateData( + qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); Q_UNUSED(res) @@ -27571,19 +68199,17 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetResourceAttributes() +void NoteStoreTester::shouldExecuteExpungeLinkedNotebookAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ResourceAttributes response = generateRandomResourceAttributes(); + qint32 response = generateRandomInt32(); - NoteStoreGetResourceAttributesTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> ResourceAttributes + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27593,14 +68219,14 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27628,7 +68254,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27646,25 +68272,43 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ResourceAttributes res = noteStore->getResourceAttributes( + AsyncResult * result = noteStore->expungeLinkedNotebookAsync( guid, ctx); - QVERIFY(res == response); + + NoteStoreExpungeLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreGetResourceAttributesTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> ResourceAttributes + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27674,14 +68318,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27709,7 +68353,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27730,10 +68374,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() bool caughtException = false; try { - ResourceAttributes res = noteStore->getResourceAttributes( + AsyncResult * result = noteStore->expungeLinkedNotebookAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -27744,20 +68406,130 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreExpungeLinkedNotebookTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> qint32 + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequest, + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + QObject::connect( + &helper, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &server, + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::expungeLinkedNotebookRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->expungeLinkedNotebookAsync( + guid, + ctx); + + NoteStoreExpungeLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetResourceAttributesTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> ResourceAttributes + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -27767,14 +68539,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27802,7 +68574,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27823,10 +68595,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() bool caughtException = false; try { - ResourceAttributes res = noteStore->getResourceAttributes( + AsyncResult * result = noteStore->expungeLinkedNotebookAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -27837,36 +68627,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes() +void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetResourceAttributesTesterHelper helper( + NoteStoreExpungeLinkedNotebookTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> ResourceAttributes + IRequestContextPtr ctxParam) -> qint32 { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - throw notFoundException; + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::expungeLinkedNotebookRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onExpungeLinkedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27894,7 +68684,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::expungeLinkedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -27915,48 +68705,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( bool caughtException = false; try { - ResourceAttributes res = noteStore->getResourceAttributes( + AsyncResult * result = noteStore->expungeLinkedNotebookAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreExpungeLinkedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreExpungeLinkedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() { - Guid guid = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreGetResourceAttributesTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> ResourceAttributes + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetResourceAttributesTesterHelper::onGetResourceAttributesRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetResourceAttributesTesterHelper::getResourceAttributesRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetResourceAttributesRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -27984,7 +68794,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() QObject::connect( &server, - &NoteStoreServer::getResourceAttributesRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28002,54 +68812,42 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - ResourceAttributes res = noteStore->getResourceAttributes( - guid, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + QVERIFY(res == response); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetPublicNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook() { - UserID userId = generateRandomInt32(); - QString publicUri = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString shareKeyOrGlobalId = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.parameter = generateRandomString(); - NoteStoreGetPublicNotebookTesterHelper helper( - [&] (const UserID & userIdParam, - const QString & publicUriParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(userId == userIdParam); - Q_ASSERT(publicUri == publicUriParam); - return response; + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetPublicNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28077,7 +68875,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28095,45 +68893,53 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->getPublicNotebook( - userId, - publicUri, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook() { - UserID userId = generateRandomInt32(); - QString publicUri = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString shareKeyOrGlobalId = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreGetPublicNotebookTesterHelper helper( - [&] (const UserID & userIdParam, - const QString & publicUriParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(userId == userIdParam); - Q_ASSERT(publicUri == publicUriParam); - throw systemException; + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetPublicNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28161,7 +68967,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28182,52 +68988,51 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() bool caughtException = false; try { - Notebook res = noteStore->getPublicNotebook( - userId, - publicUri, + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook() { - UserID userId = generateRandomInt32(); - QString publicUri = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString shareKeyOrGlobalId = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetPublicNotebookTesterHelper helper( - [&] (const UserID & userIdParam, - const QString & publicUriParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(userId == userIdParam); - Q_ASSERT(publicUri == publicUriParam); - throw notFoundException; + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetPublicNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28255,7 +69060,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28276,50 +69081,50 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() bool caughtException = false; try { - Notebook res = noteStore->getPublicNotebook( - userId, - publicUri, + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, ctx); Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook() { - UserID userId = generateRandomInt32(); - QString publicUri = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString shareKeyOrGlobalId = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetPublicNotebookTesterHelper helper( - [&] (const UserID & userIdParam, - const QString & publicUriParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(userId == userIdParam); - Q_ASSERT(publicUri == publicUriParam); + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreGetPublicNotebookTesterHelper::onGetPublicNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreGetPublicNotebookTesterHelper::getPublicNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onGetPublicNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28347,7 +69152,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() QObject::connect( &server, - &NoteStoreServer::getPublicNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28368,9 +69173,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() bool caughtException = false; try { - Notebook res = noteStore->getPublicNotebook( - userId, - publicUri, + AuthenticationResult res = noteStore->authenticateToSharedNotebook( + shareKeyOrGlobalId, ctx); Q_UNUSED(res) } @@ -28383,39 +69187,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteShareNotebook() +void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebookAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = generateRandomSharedNotebook(); + AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28443,7 +69242,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28461,17 +69260,33 @@ void NoteStoreTester::shouldExecuteShareNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, + AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, ctx); - QVERIFY(res == response); + + NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebookAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -28479,28 +69294,26 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; userException.parameter = generateRandomString(); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28528,7 +69341,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28549,11 +69362,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() bool caughtException = false; try { - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, + AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -28564,10 +69394,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebookAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -28575,28 +69404,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28624,7 +69451,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28645,11 +69472,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() bool caughtException = false; try { - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, + AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -28660,40 +69504,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebookAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28721,7 +69562,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28742,11 +69583,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() bool caughtException = false; try { - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, + AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -28757,37 +69615,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebookAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); - QString message = generateRandomString(); + QString shareKeyOrGlobalId = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreShareNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - const QString & messageParam, - IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNotebookTesterHelper helper( + [&] (const QString & shareKeyOrGlobalIdParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - Q_ASSERT(message == messageParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNotebookRequest, + &NoteStoreServer::authenticateToSharedNotebookRequest, &helper, - &NoteStoreShareNotebookTesterHelper::onShareNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); QObject::connect( &helper, - &NoteStoreShareNotebookTesterHelper::shareNotebookRequestReady, + &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, &server, - &NoteStoreServer::onShareNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28815,7 +69672,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() QObject::connect( &server, - &NoteStoreServer::shareNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNotebookRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28836,11 +69693,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() bool caughtException = false; try { - SharedNotebook res = noteStore->shareNotebook( - sharedNotebook, - message, + AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( + shareKeyOrGlobalId, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -28853,34 +69727,31 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - CreateOrUpdateNotebookSharesResult response = generateRandomCreateOrUpdateNotebookSharesResult(); + SharedNotebook response = generateRandomSharedNotebook(); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28908,7 +69779,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -28926,42 +69797,38 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; userException.parameter = generateRandomString(); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -28989,7 +69856,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29010,8 +69877,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar bool caughtException = false; try { - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); Q_UNUSED(res) } @@ -29024,9 +69890,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -29034,119 +69899,24 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, - &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); - QObject::connect( - &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, - &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares() -{ - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); - throw systemException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29174,7 +69944,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29195,56 +69965,47 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh bool caughtException = false; try { - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto invalidContactsException = EDAMInvalidContactsException(); - invalidContactsException.contacts << generateRandomContact(); - invalidContactsException.contacts << generateRandomContact(); - invalidContactsException.contacts << generateRandomContact(); - invalidContactsException.parameter = generateRandomString(); - invalidContactsException.reasons = QList(); - invalidContactsException.reasons.ref() << EDAMInvalidContactReason::BAD_ADDRESS; - invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; - invalidContactsException.reasons.ref() << EDAMInvalidContactReason::NO_CONNECTION; + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); - throw invalidContactsException; + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29272,7 +70033,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29293,48 +70054,46 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN bool caughtException = false; try { - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); Q_UNUSED(res) } - catch(const EDAMInvalidContactsException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == invalidContactsException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares() +void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() { - NotebookShareTemplate shareTemplate = generateRandomNotebookShareTemplate(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateOrUpdateNotebookSharesTesterHelper helper( - [&] (const NotebookShareTemplate & shareTemplateParam, - IRequestContextPtr ctxParam) -> CreateOrUpdateNotebookSharesResult + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(shareTemplate == shareTemplateParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::onCreateOrUpdateNotebookSharesRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreCreateOrUpdateNotebookSharesTesterHelper::createOrUpdateNotebookSharesRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29362,7 +70121,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QObject::connect( &server, - &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29383,8 +70142,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares bool caughtException = false; try { - CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( - shareTemplate, + SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); Q_UNUSED(res) } @@ -29397,36 +70155,31 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateSharedNotebook() +void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + SharedNotebook response = generateRandomSharedNotebook(); - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29454,7 +70207,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29472,42 +70225,56 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, + AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( ctx); - QVERIFY(res == response); + + NoteStoreGetSharedNotebookByAuthAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; userException.parameter = generateRandomString(); - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29535,7 +70302,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29556,10 +70323,27 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, + AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( ctx); - Q_UNUSED(res) + + NoteStoreGetSharedNotebookByAuthAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -29570,9 +70354,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuthAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -29580,26 +70363,24 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29627,7 +70408,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29648,10 +70429,27 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, + AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( ctx); - Q_UNUSED(res) + + NoteStoreGetSharedNotebookByAuthAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -29662,37 +70460,140 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthAsync() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.errorCode = EDAMErrorCode::UNKNOWN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::getSharedNotebookByAuthRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( + ctx); + + NoteStoreGetSharedNotebookByAuthAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequest, + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &server, + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29720,7 +70621,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29741,48 +70642,65 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, + AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( ctx); - Q_UNUSED(res) + + NoteStoreGetSharedNotebookByAuthAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetSharedNotebookByAuthAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteEmailNote() { - SharedNotebook sharedNotebook = generateRandomSharedNotebook(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - - NoteStoreUpdateSharedNotebookTesterHelper helper( - [&] (const SharedNotebook & sharedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(sharedNotebook == sharedNotebookParam); - throw thriftException; + Q_ASSERT(parameters == parametersParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::onUpdateSharedNotebookRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateSharedNotebookTesterHelper::updateSharedNotebookRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onUpdateSharedNotebookRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29810,7 +70728,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() QObject::connect( &server, - &NoteStoreServer::updateSharedNotebookRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29828,56 +70746,41 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->updateSharedNotebook( - sharedNotebook, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); + noteStore->emailNote( + parameters, + ctx); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - Notebook response = generateRandomNotebook(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29905,7 +70808,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -29923,46 +70826,52 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + noteStore->emailNote( + parameters, + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); - throw userException; + Q_ASSERT(parameters == parametersParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -29990,7 +70899,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30011,54 +70920,50 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin bool caughtException = false; try { - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, + noteStore->emailNote( + parameters, ctx); - Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); - throw notFoundException; + Q_ASSERT(parameters == parametersParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30086,7 +70991,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30107,55 +71012,49 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe bool caughtException = false; try { - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, + noteStore->emailNote( + parameters, ctx); - Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings() +void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); - throw systemException; + Q_ASSERT(parameters == parametersParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30183,7 +71082,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30204,52 +71103,45 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett bool caughtException = false; try { - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, + noteStore->emailNote( + parameters, ctx); - Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings() +void NoteStoreTester::shouldExecuteEmailNoteAsync() { - QString notebookGuid = generateRandomString(); - NotebookRecipientSettings recipientSettings = generateRandomNotebookRecipientSettings(); + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - - NoteStoreSetNotebookRecipientSettingsTesterHelper helper( - [&] (const QString & notebookGuidParam, - const NotebookRecipientSettings & recipientSettingsParam, - IRequestContextPtr ctxParam) -> Notebook + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(notebookGuid == notebookGuidParam); - Q_ASSERT(recipientSettings == recipientSettingsParam); - throw thriftException; + Q_ASSERT(parameters == parametersParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::onSetNotebookRecipientSettingsRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreSetNotebookRecipientSettingsTesterHelper::setNotebookRecipientSettingsRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onSetNotebookRecipientSettingsRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30277,7 +71169,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings QObject::connect( &server, - &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30295,131 +71187,59 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - Notebook res = noteStore->setNotebookRecipientSettings( - notebookGuid, - recipientSettings, - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); -} - -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteListSharedNotebooks() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - QList response; - response << generateRandomSharedNotebook(); - response << generateRandomSharedNotebook(); - response << generateRandomSharedNotebook(); - - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; - }); + AsyncResult * result = noteStore->emailNoteAsync( + parameters, + ctx); - NoteStoreServer server; + NoteStoreEmailNoteAsyncValueFetcher valueFetcher; QObject::connect( - &server, - &NoteStoreServer::listSharedNotebooksRequest, - &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); - QObject::connect( - &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, - &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::onFinished); - QTcpSocket * pSocket = nullptr; + QEventLoop loop; QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::listSharedNotebooksRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); + loop.exec(); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listSharedNotebooks( - ctx); - QVERIFY(res == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() { + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; userException.parameter = generateRandomString(); - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30447,7 +71267,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30468,9 +71288,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() bool caughtException = false; try { - QList res = noteStore->listSharedNotebooks( + AsyncResult * result = noteStore->emailNoteAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreEmailNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -30481,8 +71320,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync() { + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -30490,24 +71330,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30535,7 +71377,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30556,9 +71398,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() bool caughtException = false; try { - QList res = noteStore->listSharedNotebooks( + AsyncResult * result = noteStore->emailNoteAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreEmailNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -30569,34 +71430,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNoteAsync() { + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30624,7 +71488,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30645,9 +71509,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() bool caughtException = false; try { - QList res = noteStore->listSharedNotebooks( + AsyncResult * result = noteStore->emailNoteAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreEmailNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -30658,31 +71541,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInEmailNoteAsync() { + NoteEmailParameters parameters = generateRandomNoteEmailParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListSharedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreEmailNoteTesterHelper helper( + [&] (const NoteEmailParameters & parametersParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(parameters == parametersParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequest, + &NoteStoreServer::emailNoteRequest, &helper, - &NoteStoreListSharedNotebooksTesterHelper::onListSharedNotebooksRequestReceived); + &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListSharedNotebooksTesterHelper::listSharedNotebooksRequestReady, + &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, &server, - &NoteStoreServer::onListSharedNotebooksRequestReady); + &NoteStoreServer::onEmailNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30710,7 +71598,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() QObject::connect( &server, - &NoteStoreServer::listSharedNotebooksRequestReady, + &NoteStoreServer::emailNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30731,9 +71619,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() bool caughtException = false; try { - QList res = noteStore->listSharedNotebooks( + AsyncResult * result = noteStore->emailNoteAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreEmailNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreEmailNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -30746,34 +71653,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteCreateLinkedNotebook() +void NoteStoreTester::shouldExecuteShareNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - LinkedNotebook response = generateRandomLinkedNotebook(); + QString response = generateRandomString(); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> LinkedNotebook + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30801,7 +71708,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30819,42 +71726,42 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, + QString res = noteStore->shareNote( + guid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> LinkedNotebook + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30882,7 +71789,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30903,8 +71810,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() bool caughtException = false; try { - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, + QString res = noteStore->shareNote( + guid, ctx); Q_UNUSED(res) } @@ -30917,9 +71824,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -30927,26 +71834,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> LinkedNotebook + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -30974,7 +71881,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -30995,8 +71902,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() bool caughtException = false; try { - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, + QString res = noteStore->shareNote( + guid, ctx); Q_UNUSED(res) } @@ -31009,37 +71916,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.errorCode = EDAMErrorCode::TOO_MANY; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> LinkedNotebook + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31067,7 +71974,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31088,8 +71995,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() bool caughtException = false; try { - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, + QString res = noteStore->shareNote( + guid, ctx); Q_UNUSED(res) } @@ -31102,34 +72009,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreCreateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> LinkedNotebook + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::onCreateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreCreateLinkedNotebookTesterHelper::createLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onCreateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31157,7 +72066,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::createLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31178,8 +72087,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() bool caughtException = false; try { - LinkedNotebook res = noteStore->createLinkedNotebook( - linkedNotebook, + QString res = noteStore->shareNote( + guid, ctx); Q_UNUSED(res) } @@ -31192,36 +72101,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() +void NoteStoreTester::shouldExecuteShareNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); + QString response = generateRandomString(); - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31249,7 +72156,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31267,42 +72174,60 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, + AsyncResult * result = noteStore->shareNoteAsync( + guid, ctx); - QVERIFY(res == response); + + NoteStoreShareNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31330,7 +72255,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31351,10 +72276,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, + AsyncResult * result = noteStore->shareNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreShareNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -31365,9 +72308,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -31375,26 +72318,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31422,7 +72365,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31443,10 +72386,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, + AsyncResult * result = noteStore->shareNoteAsync( + guid, ctx); - Q_UNUSED(res) + + NoteStoreShareNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -31457,37 +72418,147 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNoteAsync() { - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequest, + &NoteStoreServer::shareNoteRequest, &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); + &NoteStoreServer::onShareNoteRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->shareNoteAsync( + guid, + ctx); + + NoteStoreShareNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInShareNoteAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreShareNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::shareNoteRequest, + &helper, + &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + QObject::connect( + &helper, + &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &server, + &NoteStoreServer::onShareNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31515,7 +72586,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, + &NoteStoreServer::shareNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31536,100 +72607,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, + AsyncResult * result = noteStore->shareNoteAsync( + guid, ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() -{ - LinkedNotebook linkedNotebook = generateRandomLinkedNotebook(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - - NoteStoreUpdateLinkedNotebookTesterHelper helper( - [&] (const LinkedNotebook & linkedNotebookParam, - IRequestContextPtr ctxParam) -> qint32 - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(linkedNotebook == linkedNotebookParam); - throw thriftException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::updateLinkedNotebookRequest, - &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::onUpdateLinkedNotebookRequestReceived); - QObject::connect( - &helper, - &NoteStoreUpdateLinkedNotebookTesterHelper::updateLinkedNotebookRequestReady, - &server, - &NoteStoreServer::onUpdateLinkedNotebookRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); + NoteStoreShareNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::onFinished); - QObject::connect( - &server, - &NoteStoreServer::updateLinkedNotebookRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreShareNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); + loop.exec(); - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - qint32 res = noteStore->updateLinkedNotebook( - linkedNotebook, - ctx); - Q_UNUSED(res) + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -31642,34 +72641,32 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteListLinkedNotebooks() +void NoteStoreTester::shouldExecuteStopSharingNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomLinkedNotebook(); - response << generateRandomLinkedNotebook(); - response << generateRandomLinkedNotebook(); - - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(guid == guidParam); + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31697,7 +72694,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31715,38 +72712,41 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QList res = noteStore->listLinkedNotebooks( + noteStore->stopSharingNote( + guid, ctx); - QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; userException.parameter = generateRandomString(); - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31774,7 +72774,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31795,9 +72795,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() bool caughtException = false; try { - QList res = noteStore->listLinkedNotebooks( + noteStore->stopSharingNote( + guid, ctx); - Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -31808,8 +72808,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -31817,24 +72818,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31862,7 +72865,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31883,9 +72886,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() bool caughtException = false; try { - QList res = noteStore->listLinkedNotebooks( + noteStore->stopSharingNote( + guid, ctx); - Q_UNUSED(res) } catch(const EDAMNotFoundException & e) { @@ -31896,34 +72899,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -31951,7 +72957,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -31972,9 +72978,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() bool caughtException = false; try { - QList res = noteStore->listLinkedNotebooks( + noteStore->stopSharingNote( + guid, ctx); - Q_UNUSED(res) } catch(const EDAMSystemException & e) { @@ -31985,31 +72991,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() +void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() { + Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreListLinkedNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + NoteStoreStopSharingNoteTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreListLinkedNotebooksTesterHelper::onListLinkedNotebooksRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreListLinkedNotebooksTesterHelper::listLinkedNotebooksRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onListLinkedNotebooksRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32037,7 +73048,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() QObject::connect( &server, - &NoteStoreServer::listLinkedNotebooksRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32058,9 +73069,9 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() bool caughtException = false; try { - QList res = noteStore->listLinkedNotebooks( + noteStore->stopSharingNote( + guid, ctx); - Q_UNUSED(res) } catch(const ThriftException & e) { @@ -32071,36 +73082,32 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() +void NoteStoreTester::shouldExecuteStopSharingNoteAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - qint32 response = generateRandomInt32(); - - NoteStoreExpungeLinkedNotebookTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); - return response; + return; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32128,7 +73135,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32146,25 +73153,42 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - qint32 res = noteStore->expungeLinkedNotebook( + AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); - QVERIFY(res == response); + + NoteStoreStopSharingNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreExpungeLinkedNotebookTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -32174,14 +73198,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32209,7 +73233,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32230,10 +73254,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeLinkedNotebook( + AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreStopSharingNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -32244,7 +73286,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -32254,9 +73296,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreExpungeLinkedNotebookTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -32266,14 +73308,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32301,7 +73343,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32322,10 +73364,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( bool caughtException = false; try { - qint32 res = noteStore->expungeLinkedNotebook( + AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreStopSharingNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -32336,20 +73396,20 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreExpungeLinkedNotebookTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -32359,14 +73419,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32394,7 +73454,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32415,10 +73475,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeLinkedNotebook( + AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreStopSharingNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -32429,17 +73507,19 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNoteAsync() { Guid guid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreExpungeLinkedNotebookTesterHelper helper( + NoteStoreStopSharingNoteTesterHelper helper( [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> qint32 + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(guid == guidParam); @@ -32449,14 +73529,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequest, + &NoteStoreServer::stopSharingNoteRequest, &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::onExpungeLinkedNotebookRequestReceived); + &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); QObject::connect( &helper, - &NoteStoreExpungeLinkedNotebookTesterHelper::expungeLinkedNotebookRequestReady, + &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, &server, - &NoteStoreServer::onExpungeLinkedNotebookRequestReady); + &NoteStoreServer::onStopSharingNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32484,7 +73564,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() QObject::connect( &server, - &NoteStoreServer::expungeLinkedNotebookRequestReady, + &NoteStoreServer::stopSharingNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32505,10 +73585,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() bool caughtException = false; try { - qint32 res = noteStore->expungeLinkedNotebook( + AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); - Q_UNUSED(res) + + NoteStoreStopSharingNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreStopSharingNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -32521,19 +73619,22 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() +void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() { - QString shareKeyOrGlobalId = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); @@ -32541,14 +73642,14 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32576,7 +73677,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32594,27 +73695,31 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() { - QString shareKeyOrGlobalId = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw userException; }); @@ -32622,14 +73727,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32657,7 +73762,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32678,8 +73783,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); Q_UNUSED(res) } @@ -32692,9 +73798,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote() { - QString shareKeyOrGlobalId = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -32702,11 +73809,13 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw notFoundException; }); @@ -32714,14 +73823,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32749,7 +73858,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32770,8 +73879,9 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); Q_UNUSED(res) } @@ -32784,22 +73894,25 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote() { - QString shareKeyOrGlobalId = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TOO_FEW; + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw systemException; }); @@ -32807,14 +73920,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32842,7 +73955,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32863,8 +73976,9 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); Q_UNUSED(res) } @@ -32877,19 +73991,24 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook() +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() { - QString shareKeyOrGlobalId = generateRandomString(); + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreAuthenticateToSharedNotebookTesterHelper helper( - [&] (const QString & shareKeyOrGlobalIdParam, + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, IRequestContextPtr ctxParam) -> AuthenticationResult { - Q_ASSERT(shareKeyOrGlobalId == shareKeyOrGlobalIdParam); + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw thriftException; }); @@ -32897,14 +74016,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::onAuthenticateToSharedNotebookRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNotebookTesterHelper::authenticateToSharedNotebookRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNotebookRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -32932,7 +74051,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -32953,8 +74072,9 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNotebook( - shareKeyOrGlobalId, + AuthenticationResult res = noteStore->authenticateToSharedNote( + guid, + noteKey, ctx); Q_UNUSED(res) } @@ -32967,18 +74087,22 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() +void NoteStoreTester::shouldExecuteAuthenticateToSharedNoteAsync() { + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - SharedNotebook response = generateRandomSharedNotebook(); + AuthenticationResult response = generateRandomAuthenticationResult(); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); @@ -32986,14 +74110,14 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33021,7 +74145,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33039,23 +74163,49 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - SharedNotebook res = noteStore->getSharedNotebookByAuth( + AsyncResult * result = noteStore->authenticateToSharedNoteAsync( + guid, + noteKey, ctx); - QVERIFY(res == response); + + NoteStoreAuthenticateToSharedNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAsync() { + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.errorCode = EDAMErrorCode::QUOTA_REACHED; userException.parameter = generateRandomString(); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw userException; }); @@ -33063,14 +74213,14 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33098,7 +74248,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33119,9 +74269,29 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() bool caughtException = false; try { - SharedNotebook res = noteStore->getSharedNotebookByAuth( + AsyncResult * result = noteStore->authenticateToSharedNoteAsync( + guid, + noteKey, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -33132,8 +74302,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNoteAsync() { + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -33141,9 +74313,13 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw notFoundException; }); @@ -33151,14 +74327,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33186,7 +74362,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33207,9 +74383,29 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut bool caughtException = false; try { - SharedNotebook res = noteStore->getSharedNotebookByAuth( + AsyncResult * result = noteStore->authenticateToSharedNoteAsync( + guid, + noteKey, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -33220,19 +74416,25 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNoteAsync() { + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.errorCode = EDAMErrorCode::UNKNOWN; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw systemException; }); @@ -33240,14 +74442,14 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33275,7 +74477,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33296,9 +74498,29 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( bool caughtException = false; try { - SharedNotebook res = noteStore->getSharedNotebookByAuth( + AsyncResult * result = noteStore->authenticateToSharedNoteAsync( + guid, + noteKey, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -33309,16 +74531,24 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() +void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsync() { + QString guid = generateRandomString(); + QString noteKey = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook + NoteStoreAuthenticateToSharedNoteTesterHelper helper( + [&] (const QString & guidParam, + const QString & noteKeyParam, + IRequestContextPtr ctxParam) -> AuthenticationResult { + Q_ASSERT(guid == guidParam); + Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw thriftException; }); @@ -33326,14 +74556,14 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, + &NoteStoreServer::authenticateToSharedNoteRequest, &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); QObject::connect( &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33361,7 +74591,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() QObject::connect( &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &NoteStoreServer::authenticateToSharedNoteRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33382,9 +74612,29 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() bool caughtException = false; try { - SharedNotebook res = noteStore->getSharedNotebookByAuth( + AsyncResult * result = noteStore->authenticateToSharedNoteAsync( + guid, + noteKey, ctx); - Q_UNUSED(res) + + NoteStoreAuthenticateToSharedNoteAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreAuthenticateToSharedNoteAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -33397,32 +74647,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteEmailNote() +void NoteStoreTester::shouldExecuteFindRelated() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) -> void + RelatedResult response = generateRandomRelatedResult(); + + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); - return; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33450,7 +74705,7 @@ void NoteStoreTester::shouldExecuteEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33468,41 +74723,46 @@ void NoteStoreTester::shouldExecuteEmailNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->emailNote( - parameters, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::INVALID_AUTH; + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; userException.parameter = generateRandomString(); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) -> void + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33530,7 +74790,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33551,9 +74811,11 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() bool caughtException = false; try { - noteStore->emailNote( - parameters, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); + Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -33564,36 +74826,40 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) -> void + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); - throw notFoundException; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33621,7 +74887,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33642,50 +74908,54 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() bool caughtException = false; try { - noteStore->emailNote( - parameters, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); + Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) -> void + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); - throw systemException; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33713,7 +74983,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33734,47 +75004,54 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() bool caughtException = false; try { - noteStore->emailNote( - parameters, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); + Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() +void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() { - NoteEmailParameters parameters = generateRandomNoteEmailParameters(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreEmailNoteTesterHelper helper( - [&] (const NoteEmailParameters & parametersParam, - IRequestContextPtr ctxParam) -> void + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::emailNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreEmailNoteTesterHelper::onEmailNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreEmailNoteTesterHelper::emailNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onEmailNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33802,7 +75079,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() QObject::connect( &server, - &NoteStoreServer::emailNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33823,9 +75100,11 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() bool caughtException = false; try { - noteStore->emailNote( - parameters, + RelatedResult res = noteStore->findRelated( + query, + resultSpec, ctx); + Q_UNUSED(res) } catch(const ThriftException & e) { @@ -33836,36 +75115,37 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteShareNote() +void NoteStoreTester::shouldExecuteFindRelatedAsync() { - Guid guid = generateRandomString(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QString response = generateRandomString(); + RelatedResult response = generateRandomRelatedResult(); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33893,7 +75173,7 @@ void NoteStoreTester::shouldExecuteShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33911,42 +75191,64 @@ void NoteStoreTester::shouldExecuteShareNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - QString res = noteStore->shareNote( - guid, + AsyncResult * result = noteStore->findRelatedAsync( + query, + resultSpec, ctx); - QVERIFY(res == response); + + NoteStoreFindRelatedAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() { - Guid guid = generateRandomString(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + userException.errorCode = EDAMErrorCode::DATA_CONFLICT; userException.parameter = generateRandomString(); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -33974,7 +75276,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -33995,10 +75297,29 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() bool caughtException = false; try { - QString res = noteStore->shareNote( - guid, + AsyncResult * result = noteStore->findRelatedAsync( + query, + resultSpec, ctx); - Q_UNUSED(res) + + NoteStoreFindRelatedAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -34009,36 +75330,40 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelatedAsync() { - Guid guid = generateRandomString(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34066,7 +75391,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34087,51 +75412,72 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() bool caughtException = false; try { - QString res = noteStore->shareNote( - guid, + AsyncResult * result = noteStore->findRelatedAsync( + query, + resultSpec, ctx); - Q_UNUSED(res) + + NoteStoreFindRelatedAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync() { - Guid guid = generateRandomString(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::QUOTA_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw systemException; + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34159,7 +75505,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34180,48 +75526,72 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() bool caughtException = false; try { - QString res = noteStore->shareNote( - guid, + AsyncResult * result = noteStore->findRelatedAsync( + query, + resultSpec, ctx); - Q_UNUSED(res) + + NoteStoreFindRelatedAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() +void NoteStoreTester::shouldDeliverThriftExceptionInFindRelatedAsync() { - Guid guid = generateRandomString(); + RelatedQuery query = generateRandomRelatedQuery(); + RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreShareNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString + NoteStoreFindRelatedTesterHelper helper( + [&] (const RelatedQuery & queryParam, + const RelatedResultSpec & resultSpecParam, + IRequestContextPtr ctxParam) -> RelatedResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(query == queryParam); + Q_ASSERT(resultSpec == resultSpecParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::shareNoteRequest, + &NoteStoreServer::findRelatedRequest, &helper, - &NoteStoreShareNoteTesterHelper::onShareNoteRequestReceived); + &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); QObject::connect( &helper, - &NoteStoreShareNoteTesterHelper::shareNoteRequestReady, + &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, &server, - &NoteStoreServer::onShareNoteRequestReady); + &NoteStoreServer::onFindRelatedRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34249,7 +75619,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() QObject::connect( &server, - &NoteStoreServer::shareNoteRequestReady, + &NoteStoreServer::findRelatedRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34270,10 +75640,29 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() bool caughtException = false; try { - QString res = noteStore->shareNote( - guid, + AsyncResult * result = noteStore->findRelatedAsync( + query, + resultSpec, ctx); - Q_UNUSED(res) + + NoteStoreFindRelatedAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreFindRelatedAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -34286,32 +75675,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteStopSharingNote() +void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); + + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - return; + Q_ASSERT(note == noteParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34339,7 +75730,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34357,41 +75748,42 @@ void NoteStoreTester::shouldExecuteStopSharingNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - noteStore->stopSharingNote( - guid, + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); + QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::AUTH_EXPIRED; + userException.errorCode = EDAMErrorCode::INVALID_AUTH; userException.parameter = generateRandomString(); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(note == noteParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34419,7 +75811,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34440,9 +75832,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() bool caughtException = false; try { - noteStore->stopSharingNote( - guid, + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); + Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -34453,9 +75846,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -34463,26 +75856,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(note == noteParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34510,7 +75903,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34531,9 +75924,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() bool caughtException = false; try { - noteStore->stopSharingNote( - guid, + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); + Q_UNUSED(res) } catch(const EDAMNotFoundException & e) { @@ -34544,37 +75938,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(note == noteParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34602,7 +75996,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34623,9 +76017,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() bool caughtException = false; try { - noteStore->stopSharingNote( - guid, + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); + Q_UNUSED(res) } catch(const EDAMSystemException & e) { @@ -34636,34 +76031,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() { - Guid guid = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreStopSharingNoteTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> void + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); + Q_ASSERT(note == noteParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreStopSharingNoteTesterHelper::onStopSharingNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreStopSharingNoteTesterHelper::stopSharingNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onStopSharingNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34691,7 +76088,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() QObject::connect( &server, - &NoteStoreServer::stopSharingNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34712,9 +76109,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() bool caughtException = false; try { - noteStore->stopSharingNote( - guid, + UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( + note, ctx); + Q_UNUSED(res) } catch(const ThriftException & e) { @@ -34725,39 +76123,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() +void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatchesAsync() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34785,7 +76178,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34803,46 +76196,60 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, + AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( + note, ctx); - QVERIFY(res == response); + + NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsync() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; userException.parameter = generateRandomString(); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34870,7 +76277,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34891,11 +76298,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, + AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( + note, ctx); - Q_UNUSED(res) + + NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -34906,10 +76330,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatchesAsync() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -34917,28 +76340,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -34966,7 +76387,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -34987,11 +76408,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, + AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( + note, ctx); - Q_UNUSED(res) + + NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -35002,40 +76440,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAsync() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35063,7 +76498,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35084,11 +76519,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, + AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( + note, ctx); - Q_UNUSED(res) + + NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -35099,37 +76551,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() +void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync() { - QString guid = generateRandomString(); - QString noteKey = generateRandomString(); + Note note = generateRandomNote(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreAuthenticateToSharedNoteTesterHelper helper( - [&] (const QString & guidParam, - const QString & noteKeyParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( + [&] (const Note & noteParam, + IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult { - Q_ASSERT(guid == guidParam); - Q_ASSERT(noteKey == noteKeyParam); Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(note == noteParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequest, + &NoteStoreServer::updateNoteIfUsnMatchesRequest, &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::onAuthenticateToSharedNoteRequestReceived); + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); QObject::connect( &helper, - &NoteStoreAuthenticateToSharedNoteTesterHelper::authenticateToSharedNoteRequestReady, + &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, &server, - &NoteStoreServer::onAuthenticateToSharedNoteRequestReady); + &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35157,7 +76608,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() QObject::connect( &server, - &NoteStoreServer::authenticateToSharedNoteRequestReady, + &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35178,11 +76629,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() bool caughtException = false; try { - AuthenticationResult res = noteStore->authenticateToSharedNote( - guid, - noteKey, + AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( + note, ctx); - Q_UNUSED(res) + + NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -35195,37 +76663,34 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() //////////////////////////////////////////////////////////////////////////////// -void NoteStoreTester::shouldExecuteFindRelated() +void NoteStoreTester::shouldExecuteManageNotebookShares() { - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - RelatedResult response = generateRandomRelatedResult(); + ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> RelatedResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(parameters == parametersParam); return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findRelatedRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onFindRelatedRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35253,7 +76718,7 @@ void NoteStoreTester::shouldExecuteFindRelated() QObject::connect( &server, - &NoteStoreServer::findRelatedRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35271,143 +76736,42 @@ void NoteStoreTester::shouldExecuteFindRelated() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - RelatedResult res = noteStore->findRelated( - query, - resultSpec, + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() { - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.errorCode = EDAMErrorCode::INVALID_AUTH; userException.parameter = generateRandomString(); - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> RelatedResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(parameters == parametersParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findRelatedRequest, - &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); - QObject::connect( - &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, - &server, - &NoteStoreServer::onFindRelatedRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::findRelatedRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - RelatedResult res = noteStore->findRelated( - query, - resultSpec, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() -{ - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> RelatedResult - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); - throw systemException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::findRelatedRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onFindRelatedRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35435,7 +76799,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() QObject::connect( &server, - &NoteStoreServer::findRelatedRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35456,25 +76820,23 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() bool caughtException = false; try { - RelatedResult res = noteStore->findRelated( - query, - resultSpec, + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() { - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -35482,28 +76844,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> RelatedResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); + Q_ASSERT(parameters == parametersParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findRelatedRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onFindRelatedRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35531,7 +76891,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() QObject::connect( &server, - &NoteStoreServer::findRelatedRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35552,9 +76912,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() bool caughtException = false; try { - RelatedResult res = noteStore->findRelated( - query, - resultSpec, + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, ctx); Q_UNUSED(res) } @@ -35567,37 +76926,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() { - RelatedQuery query = generateRandomRelatedQuery(); - RelatedResultSpec resultSpec = generateRandomRelatedResultSpec(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreFindRelatedTesterHelper helper( - [&] (const RelatedQuery & queryParam, - const RelatedResultSpec & resultSpecParam, - IRequestContextPtr ctxParam) -> RelatedResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(query == queryParam); - Q_ASSERT(resultSpec == resultSpecParam); - throw thriftException; + Q_ASSERT(parameters == parametersParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::findRelatedRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreFindRelatedTesterHelper::onFindRelatedRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreFindRelatedTesterHelper::findRelatedRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onFindRelatedRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35625,7 +76984,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() QObject::connect( &server, - &NoteStoreServer::findRelatedRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35646,51 +77005,50 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() bool caughtException = false; try { - RelatedResult res = noteStore->findRelated( - query, - resultSpec, + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() { - Note note = generateRandomNote(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UpdateNoteIfUsnMatchesResult response = generateRandomUpdateNoteIfUsnMatchesResult(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - return response; + Q_ASSERT(parameters == parametersParam); + throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35718,7 +77076,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35736,42 +77094,51 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + ManageNotebookSharesResult res = noteStore->manageNotebookShares( + parameters, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldExecuteManageNotebookSharesAsync() { - Note note = generateRandomNote(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::QUOTA_REACHED; - userException.parameter = generateRandomString(); + ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw userException; + Q_ASSERT(parameters == parametersParam); + return response; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35799,7 +77166,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35817,53 +77184,60 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - bool caughtException = false; - try - { - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } + AsyncResult * result = noteStore->manageNotebookSharesAsync( + parameters, + ctx); - QVERIFY(caughtException); + NoteStoreManageNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync() { - Note note = generateRandomNote(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.parameter = generateRandomString(); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw notFoundException; + Q_ASSERT(parameters == parametersParam); + throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35891,7 +77265,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -35912,51 +77286,68 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches bool caughtException = false; try { - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, + AsyncResult * result = noteStore->manageNotebookSharesAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreManageNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAsync() { - Note note = generateRandomNote(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::USER_NOT_REGISTERED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw systemException; + Q_ASSERT(parameters == parametersParam); + throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -35984,7 +77375,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36005,48 +77396,69 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() bool caughtException = false; try { - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, + AsyncResult * result = noteStore->manageNotebookSharesAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreManageNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsync() { - Note note = generateRandomNote(); + ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreUpdateNoteIfUsnMatchesTesterHelper helper( - [&] (const Note & noteParam, - IRequestContextPtr ctxParam) -> UpdateNoteIfUsnMatchesResult + NoteStoreManageNotebookSharesTesterHelper helper( + [&] (const ManageNotebookSharesParameters & parametersParam, + IRequestContextPtr ctxParam) -> ManageNotebookSharesResult { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(note == noteParam); - throw thriftException; + Q_ASSERT(parameters == parametersParam); + throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequest, + &NoteStoreServer::manageNotebookSharesRequest, &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::onUpdateNoteIfUsnMatchesRequestReceived); + &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreUpdateNoteIfUsnMatchesTesterHelper::updateNoteIfUsnMatchesRequestReady, + &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, &server, - &NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady); + &NoteStoreServer::onManageNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -36074,7 +77486,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, - &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &NoteStoreServer::manageNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36095,29 +77507,47 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() bool caughtException = false; try { - UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( - note, + AsyncResult * result = noteStore->manageNotebookSharesAsync( + parameters, ctx); - Q_UNUSED(res) + + NoteStoreManageNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteManageNotebookShares() +void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookSharesAsync() { ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - ManageNotebookSharesResult response = generateRandomManageNotebookSharesResult(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); NoteStoreManageNotebookSharesTesterHelper helper( [&] (const ManageNotebookSharesParameters & parametersParam, @@ -36125,7 +77555,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(parameters == parametersParam); - return response; + throw thriftException; }); NoteStoreServer server; @@ -36184,42 +77614,152 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, + bool caughtException = false; + try + { + AsyncResult * result = noteStore->manageNotebookSharesAsync( + parameters, + ctx); + + NoteStoreManageNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreManageNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void NoteStoreTester::shouldExecuteGetNotebookShares() +{ + QString notebookGuid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + ShareRelationships response = generateRandomShareRelationships(); + + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(notebookGuid == notebookGuidParam); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequest, + &helper, + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, + &server, + &NoteStoreServer::onGetNotebookSharesRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getNotebookSharesRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port)); + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); QVERIFY(res == response); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() { - ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; userException.parameter = generateRandomString(); - NoteStoreManageNotebookSharesTesterHelper helper( - [&] (const ManageNotebookSharesParameters & parametersParam, - IRequestContextPtr ctxParam) -> ManageNotebookSharesResult + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(notebookGuid == notebookGuidParam); throw userException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onManageNotebookSharesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -36247,7 +77787,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36268,8 +77808,8 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() bool caughtException = false; try { - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); Q_UNUSED(res) } @@ -36282,9 +77822,9 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() { - ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -36292,26 +77832,26 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - NoteStoreManageNotebookSharesTesterHelper helper( - [&] (const ManageNotebookSharesParameters & parametersParam, - IRequestContextPtr ctxParam) -> ManageNotebookSharesResult + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(notebookGuid == notebookGuidParam); throw notFoundException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onManageNotebookSharesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -36339,7 +77879,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36360,8 +77900,8 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() bool caughtException = false; try { - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); Q_UNUSED(res) } @@ -36374,37 +77914,37 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() { - ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - NoteStoreManageNotebookSharesTesterHelper helper( - [&] (const ManageNotebookSharesParameters & parametersParam, - IRequestContextPtr ctxParam) -> ManageNotebookSharesResult + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(notebookGuid == notebookGuidParam); throw systemException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onManageNotebookSharesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -36432,7 +77972,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36453,8 +77993,8 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() bool caughtException = false; try { - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); Q_UNUSED(res) } @@ -36467,34 +78007,36 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() { - ManageNotebookSharesParameters parameters = generateRandomManageNotebookSharesParameters(); + QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - NoteStoreManageNotebookSharesTesterHelper helper( - [&] (const ManageNotebookSharesParameters & parametersParam, - IRequestContextPtr ctxParam) -> ManageNotebookSharesResult + NoteStoreGetNotebookSharesTesterHelper helper( + [&] (const QString & notebookGuidParam, + IRequestContextPtr ctxParam) -> ShareRelationships { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(parameters == parametersParam); + Q_ASSERT(notebookGuid == notebookGuidParam); throw thriftException; }); NoteStoreServer server; QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequest, + &NoteStoreServer::getNotebookSharesRequest, &helper, - &NoteStoreManageNotebookSharesTesterHelper::onManageNotebookSharesRequestReceived); + &NoteStoreGetNotebookSharesTesterHelper::onGetNotebookSharesRequestReceived); QObject::connect( &helper, - &NoteStoreManageNotebookSharesTesterHelper::manageNotebookSharesRequestReady, + &NoteStoreGetNotebookSharesTesterHelper::getNotebookSharesRequestReady, &server, - &NoteStoreServer::onManageNotebookSharesRequestReady); + &NoteStoreServer::onGetNotebookSharesRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -36522,7 +78064,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() QObject::connect( &server, - &NoteStoreServer::manageNotebookSharesRequestReady, + &NoteStoreServer::getNotebookSharesRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -36543,8 +78085,8 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() bool caughtException = false; try { - ManageNotebookSharesResult res = noteStore->manageNotebookShares( - parameters, + ShareRelationships res = noteStore->getNotebookShares( + notebookGuid, ctx); Q_UNUSED(res) } @@ -36557,9 +78099,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void NoteStoreTester::shouldExecuteGetNotebookShares() +void NoteStoreTester::shouldExecuteGetNotebookSharesAsync() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -36632,20 +78172,38 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port)); - ShareRelationships res = noteStore->getNotebookShares( + AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); - QVERIFY(res == response); + + NoteStoreGetNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() +void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; userException.parameter = generateRandomString(); NoteStoreGetNotebookSharesTesterHelper helper( @@ -36716,10 +78274,28 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() bool caughtException = false; try { - ShareRelationships res = noteStore->getNotebookShares( + AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreGetNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -36730,7 +78306,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( @@ -36808,10 +78384,28 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() bool caughtException = false; try { - ShareRelationships res = noteStore->getNotebookShares( + AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreGetNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -36822,14 +78416,14 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() +void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); @@ -36901,10 +78495,28 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() bool caughtException = false; try { - ShareRelationships res = noteStore->getNotebookShares( + AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreGetNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -36915,13 +78527,15 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() QVERIFY(caughtException); } -void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() +void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookSharesAsync() { QString notebookGuid = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); NoteStoreGetNotebookSharesTesterHelper helper( [&] (const QString & notebookGuidParam, @@ -36991,10 +78605,28 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() bool caughtException = false; try { - ShareRelationships res = noteStore->getNotebookShares( + AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); - Q_UNUSED(res) + + NoteStoreGetNotebookSharesAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetNotebookSharesAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { diff --git a/QEverCloud/src/tests/generated/TestNoteStore.h b/QEverCloud/src/tests/generated/TestNoteStore.h index 8dcbb0c3..b6ac40fa 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.h +++ b/QEverCloud/src/tests/generated/TestNoteStore.h @@ -30,364 +30,726 @@ private Q_SLOTS: void shouldDeliverEDAMUserExceptionInGetSyncState(); void shouldDeliverEDAMSystemExceptionInGetSyncState(); void shouldDeliverThriftExceptionInGetSyncState(); + void shouldExecuteGetSyncStateAsync(); + void shouldDeliverEDAMUserExceptionInGetSyncStateAsync(); + void shouldDeliverEDAMSystemExceptionInGetSyncStateAsync(); + void shouldDeliverThriftExceptionInGetSyncStateAsync(); void shouldExecuteGetFilteredSyncChunk(); void shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk(); void shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk(); void shouldDeliverThriftExceptionInGetFilteredSyncChunk(); + void shouldExecuteGetFilteredSyncChunkAsync(); + void shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync(); + void shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsync(); + void shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync(); void shouldExecuteGetLinkedNotebookSyncState(); void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState(); void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncState(); void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncState(); void shouldDeliverThriftExceptionInGetLinkedNotebookSyncState(); + void shouldExecuteGetLinkedNotebookSyncStateAsync(); + void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncStateAsync(); + void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncStateAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncStateAsync(); + void shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAsync(); void shouldExecuteGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunk(); void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunk(); void shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk(); + void shouldExecuteGetLinkedNotebookSyncChunkAsync(); + void shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunkAsync(); + void shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChunkAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncChunkAsync(); + void shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAsync(); void shouldExecuteListNotebooks(); void shouldDeliverEDAMUserExceptionInListNotebooks(); void shouldDeliverEDAMSystemExceptionInListNotebooks(); void shouldDeliverThriftExceptionInListNotebooks(); + void shouldExecuteListNotebooksAsync(); + void shouldDeliverEDAMUserExceptionInListNotebooksAsync(); + void shouldDeliverEDAMSystemExceptionInListNotebooksAsync(); + void shouldDeliverThriftExceptionInListNotebooksAsync(); void shouldExecuteListAccessibleBusinessNotebooks(); void shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooks(); void shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooks(); void shouldDeliverThriftExceptionInListAccessibleBusinessNotebooks(); + void shouldExecuteListAccessibleBusinessNotebooksAsync(); + void shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooksAsync(); + void shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNotebooksAsync(); + void shouldDeliverThriftExceptionInListAccessibleBusinessNotebooksAsync(); void shouldExecuteGetNotebook(); void shouldDeliverEDAMUserExceptionInGetNotebook(); void shouldDeliverEDAMSystemExceptionInGetNotebook(); void shouldDeliverEDAMNotFoundExceptionInGetNotebook(); void shouldDeliverThriftExceptionInGetNotebook(); + void shouldExecuteGetNotebookAsync(); + void shouldDeliverEDAMUserExceptionInGetNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInGetNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync(); + void shouldDeliverThriftExceptionInGetNotebookAsync(); void shouldExecuteGetDefaultNotebook(); void shouldDeliverEDAMUserExceptionInGetDefaultNotebook(); void shouldDeliverEDAMSystemExceptionInGetDefaultNotebook(); void shouldDeliverThriftExceptionInGetDefaultNotebook(); + void shouldExecuteGetDefaultNotebookAsync(); + void shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync(); + void shouldDeliverThriftExceptionInGetDefaultNotebookAsync(); void shouldExecuteCreateNotebook(); void shouldDeliverEDAMUserExceptionInCreateNotebook(); void shouldDeliverEDAMSystemExceptionInCreateNotebook(); void shouldDeliverEDAMNotFoundExceptionInCreateNotebook(); void shouldDeliverThriftExceptionInCreateNotebook(); + void shouldExecuteCreateNotebookAsync(); + void shouldDeliverEDAMUserExceptionInCreateNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInCreateNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync(); + void shouldDeliverThriftExceptionInCreateNotebookAsync(); void shouldExecuteUpdateNotebook(); void shouldDeliverEDAMUserExceptionInUpdateNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateNotebook(); void shouldDeliverThriftExceptionInUpdateNotebook(); + void shouldExecuteUpdateNotebookAsync(); + void shouldDeliverEDAMUserExceptionInUpdateNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync(); + void shouldDeliverThriftExceptionInUpdateNotebookAsync(); void shouldExecuteExpungeNotebook(); void shouldDeliverEDAMUserExceptionInExpungeNotebook(); void shouldDeliverEDAMSystemExceptionInExpungeNotebook(); void shouldDeliverEDAMNotFoundExceptionInExpungeNotebook(); void shouldDeliverThriftExceptionInExpungeNotebook(); + void shouldExecuteExpungeNotebookAsync(); + void shouldDeliverEDAMUserExceptionInExpungeNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync(); + void shouldDeliverThriftExceptionInExpungeNotebookAsync(); void shouldExecuteListTags(); void shouldDeliverEDAMUserExceptionInListTags(); void shouldDeliverEDAMSystemExceptionInListTags(); void shouldDeliverThriftExceptionInListTags(); + void shouldExecuteListTagsAsync(); + void shouldDeliverEDAMUserExceptionInListTagsAsync(); + void shouldDeliverEDAMSystemExceptionInListTagsAsync(); + void shouldDeliverThriftExceptionInListTagsAsync(); void shouldExecuteListTagsByNotebook(); void shouldDeliverEDAMUserExceptionInListTagsByNotebook(); void shouldDeliverEDAMSystemExceptionInListTagsByNotebook(); void shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook(); void shouldDeliverThriftExceptionInListTagsByNotebook(); + void shouldExecuteListTagsByNotebookAsync(); + void shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsync(); + void shouldDeliverThriftExceptionInListTagsByNotebookAsync(); void shouldExecuteGetTag(); void shouldDeliverEDAMUserExceptionInGetTag(); void shouldDeliverEDAMSystemExceptionInGetTag(); void shouldDeliverEDAMNotFoundExceptionInGetTag(); void shouldDeliverThriftExceptionInGetTag(); + void shouldExecuteGetTagAsync(); + void shouldDeliverEDAMUserExceptionInGetTagAsync(); + void shouldDeliverEDAMSystemExceptionInGetTagAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetTagAsync(); + void shouldDeliverThriftExceptionInGetTagAsync(); void shouldExecuteCreateTag(); void shouldDeliverEDAMUserExceptionInCreateTag(); void shouldDeliverEDAMSystemExceptionInCreateTag(); void shouldDeliverEDAMNotFoundExceptionInCreateTag(); void shouldDeliverThriftExceptionInCreateTag(); + void shouldExecuteCreateTagAsync(); + void shouldDeliverEDAMUserExceptionInCreateTagAsync(); + void shouldDeliverEDAMSystemExceptionInCreateTagAsync(); + void shouldDeliverEDAMNotFoundExceptionInCreateTagAsync(); + void shouldDeliverThriftExceptionInCreateTagAsync(); void shouldExecuteUpdateTag(); void shouldDeliverEDAMUserExceptionInUpdateTag(); void shouldDeliverEDAMSystemExceptionInUpdateTag(); void shouldDeliverEDAMNotFoundExceptionInUpdateTag(); void shouldDeliverThriftExceptionInUpdateTag(); + void shouldExecuteUpdateTagAsync(); + void shouldDeliverEDAMUserExceptionInUpdateTagAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateTagAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync(); + void shouldDeliverThriftExceptionInUpdateTagAsync(); void shouldExecuteUntagAll(); void shouldDeliverEDAMUserExceptionInUntagAll(); void shouldDeliverEDAMSystemExceptionInUntagAll(); void shouldDeliverEDAMNotFoundExceptionInUntagAll(); void shouldDeliverThriftExceptionInUntagAll(); + void shouldExecuteUntagAllAsync(); + void shouldDeliverEDAMUserExceptionInUntagAllAsync(); + void shouldDeliverEDAMSystemExceptionInUntagAllAsync(); + void shouldDeliverEDAMNotFoundExceptionInUntagAllAsync(); + void shouldDeliverThriftExceptionInUntagAllAsync(); void shouldExecuteExpungeTag(); void shouldDeliverEDAMUserExceptionInExpungeTag(); void shouldDeliverEDAMSystemExceptionInExpungeTag(); void shouldDeliverEDAMNotFoundExceptionInExpungeTag(); void shouldDeliverThriftExceptionInExpungeTag(); + void shouldExecuteExpungeTagAsync(); + void shouldDeliverEDAMUserExceptionInExpungeTagAsync(); + void shouldDeliverEDAMSystemExceptionInExpungeTagAsync(); + void shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync(); + void shouldDeliverThriftExceptionInExpungeTagAsync(); void shouldExecuteListSearches(); void shouldDeliverEDAMUserExceptionInListSearches(); void shouldDeliverEDAMSystemExceptionInListSearches(); void shouldDeliverThriftExceptionInListSearches(); + void shouldExecuteListSearchesAsync(); + void shouldDeliverEDAMUserExceptionInListSearchesAsync(); + void shouldDeliverEDAMSystemExceptionInListSearchesAsync(); + void shouldDeliverThriftExceptionInListSearchesAsync(); void shouldExecuteGetSearch(); void shouldDeliverEDAMUserExceptionInGetSearch(); void shouldDeliverEDAMSystemExceptionInGetSearch(); void shouldDeliverEDAMNotFoundExceptionInGetSearch(); void shouldDeliverThriftExceptionInGetSearch(); + void shouldExecuteGetSearchAsync(); + void shouldDeliverEDAMUserExceptionInGetSearchAsync(); + void shouldDeliverEDAMSystemExceptionInGetSearchAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetSearchAsync(); + void shouldDeliverThriftExceptionInGetSearchAsync(); void shouldExecuteCreateSearch(); void shouldDeliverEDAMUserExceptionInCreateSearch(); void shouldDeliverEDAMSystemExceptionInCreateSearch(); void shouldDeliverThriftExceptionInCreateSearch(); + void shouldExecuteCreateSearchAsync(); + void shouldDeliverEDAMUserExceptionInCreateSearchAsync(); + void shouldDeliverEDAMSystemExceptionInCreateSearchAsync(); + void shouldDeliverThriftExceptionInCreateSearchAsync(); void shouldExecuteUpdateSearch(); void shouldDeliverEDAMUserExceptionInUpdateSearch(); void shouldDeliverEDAMSystemExceptionInUpdateSearch(); void shouldDeliverEDAMNotFoundExceptionInUpdateSearch(); void shouldDeliverThriftExceptionInUpdateSearch(); + void shouldExecuteUpdateSearchAsync(); + void shouldDeliverEDAMUserExceptionInUpdateSearchAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateSearchAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync(); + void shouldDeliverThriftExceptionInUpdateSearchAsync(); void shouldExecuteExpungeSearch(); void shouldDeliverEDAMUserExceptionInExpungeSearch(); void shouldDeliverEDAMSystemExceptionInExpungeSearch(); void shouldDeliverEDAMNotFoundExceptionInExpungeSearch(); void shouldDeliverThriftExceptionInExpungeSearch(); + void shouldExecuteExpungeSearchAsync(); + void shouldDeliverEDAMUserExceptionInExpungeSearchAsync(); + void shouldDeliverEDAMSystemExceptionInExpungeSearchAsync(); + void shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync(); + void shouldDeliverThriftExceptionInExpungeSearchAsync(); void shouldExecuteFindNoteOffset(); void shouldDeliverEDAMUserExceptionInFindNoteOffset(); void shouldDeliverEDAMSystemExceptionInFindNoteOffset(); void shouldDeliverEDAMNotFoundExceptionInFindNoteOffset(); void shouldDeliverThriftExceptionInFindNoteOffset(); + void shouldExecuteFindNoteOffsetAsync(); + void shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync(); + void shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync(); + void shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync(); + void shouldDeliverThriftExceptionInFindNoteOffsetAsync(); void shouldExecuteFindNotesMetadata(); void shouldDeliverEDAMUserExceptionInFindNotesMetadata(); void shouldDeliverEDAMSystemExceptionInFindNotesMetadata(); void shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata(); void shouldDeliverThriftExceptionInFindNotesMetadata(); + void shouldExecuteFindNotesMetadataAsync(); + void shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync(); + void shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync(); + void shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync(); + void shouldDeliverThriftExceptionInFindNotesMetadataAsync(); void shouldExecuteFindNoteCounts(); void shouldDeliverEDAMUserExceptionInFindNoteCounts(); void shouldDeliverEDAMSystemExceptionInFindNoteCounts(); void shouldDeliverEDAMNotFoundExceptionInFindNoteCounts(); void shouldDeliverThriftExceptionInFindNoteCounts(); + void shouldExecuteFindNoteCountsAsync(); + void shouldDeliverEDAMUserExceptionInFindNoteCountsAsync(); + void shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync(); + void shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync(); + void shouldDeliverThriftExceptionInFindNoteCountsAsync(); void shouldExecuteGetNoteWithResultSpec(); void shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec(); void shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec(); void shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec(); void shouldDeliverThriftExceptionInGetNoteWithResultSpec(); + void shouldExecuteGetNoteWithResultSpecAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecAsync(); + void shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync(); void shouldExecuteGetNote(); void shouldDeliverEDAMUserExceptionInGetNote(); void shouldDeliverEDAMSystemExceptionInGetNote(); void shouldDeliverEDAMNotFoundExceptionInGetNote(); void shouldDeliverThriftExceptionInGetNote(); + void shouldExecuteGetNoteAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteAsync(); + void shouldDeliverThriftExceptionInGetNoteAsync(); void shouldExecuteGetNoteApplicationData(); void shouldDeliverEDAMUserExceptionInGetNoteApplicationData(); void shouldDeliverEDAMSystemExceptionInGetNoteApplicationData(); void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData(); void shouldDeliverThriftExceptionInGetNoteApplicationData(); + void shouldExecuteGetNoteApplicationDataAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataAsync(); + void shouldDeliverThriftExceptionInGetNoteApplicationDataAsync(); void shouldExecuteGetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntry(); void shouldDeliverThriftExceptionInGetNoteApplicationDataEntry(); + void shouldExecuteGetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInGetNoteApplicationDataEntryAsync(); void shouldExecuteSetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntry(); void shouldDeliverThriftExceptionInSetNoteApplicationDataEntry(); + void shouldExecuteSetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInSetNoteApplicationDataEntryAsync(); void shouldExecuteUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntry(); void shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntry(); + void shouldExecuteUnsetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntryAsync(); void shouldExecuteGetNoteContent(); void shouldDeliverEDAMUserExceptionInGetNoteContent(); void shouldDeliverEDAMSystemExceptionInGetNoteContent(); void shouldDeliverEDAMNotFoundExceptionInGetNoteContent(); void shouldDeliverThriftExceptionInGetNoteContent(); + void shouldExecuteGetNoteContentAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteContentAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteContentAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync(); + void shouldDeliverThriftExceptionInGetNoteContentAsync(); void shouldExecuteGetNoteSearchText(); void shouldDeliverEDAMUserExceptionInGetNoteSearchText(); void shouldDeliverEDAMSystemExceptionInGetNoteSearchText(); void shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText(); void shouldDeliverThriftExceptionInGetNoteSearchText(); + void shouldExecuteGetNoteSearchTextAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync(); + void shouldDeliverThriftExceptionInGetNoteSearchTextAsync(); void shouldExecuteGetResourceSearchText(); void shouldDeliverEDAMUserExceptionInGetResourceSearchText(); void shouldDeliverEDAMSystemExceptionInGetResourceSearchText(); void shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText(); void shouldDeliverThriftExceptionInGetResourceSearchText(); + void shouldExecuteGetResourceSearchTextAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextAsync(); + void shouldDeliverThriftExceptionInGetResourceSearchTextAsync(); void shouldExecuteGetNoteTagNames(); void shouldDeliverEDAMUserExceptionInGetNoteTagNames(); void shouldDeliverEDAMSystemExceptionInGetNoteTagNames(); void shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames(); void shouldDeliverThriftExceptionInGetNoteTagNames(); + void shouldExecuteGetNoteTagNamesAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync(); + void shouldDeliverThriftExceptionInGetNoteTagNamesAsync(); void shouldExecuteCreateNote(); void shouldDeliverEDAMUserExceptionInCreateNote(); void shouldDeliverEDAMSystemExceptionInCreateNote(); void shouldDeliverEDAMNotFoundExceptionInCreateNote(); void shouldDeliverThriftExceptionInCreateNote(); + void shouldExecuteCreateNoteAsync(); + void shouldDeliverEDAMUserExceptionInCreateNoteAsync(); + void shouldDeliverEDAMSystemExceptionInCreateNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync(); + void shouldDeliverThriftExceptionInCreateNoteAsync(); void shouldExecuteUpdateNote(); void shouldDeliverEDAMUserExceptionInUpdateNote(); void shouldDeliverEDAMSystemExceptionInUpdateNote(); void shouldDeliverEDAMNotFoundExceptionInUpdateNote(); void shouldDeliverThriftExceptionInUpdateNote(); + void shouldExecuteUpdateNoteAsync(); + void shouldDeliverEDAMUserExceptionInUpdateNoteAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync(); + void shouldDeliverThriftExceptionInUpdateNoteAsync(); void shouldExecuteDeleteNote(); void shouldDeliverEDAMUserExceptionInDeleteNote(); void shouldDeliverEDAMSystemExceptionInDeleteNote(); void shouldDeliverEDAMNotFoundExceptionInDeleteNote(); void shouldDeliverThriftExceptionInDeleteNote(); + void shouldExecuteDeleteNoteAsync(); + void shouldDeliverEDAMUserExceptionInDeleteNoteAsync(); + void shouldDeliverEDAMSystemExceptionInDeleteNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync(); + void shouldDeliverThriftExceptionInDeleteNoteAsync(); void shouldExecuteExpungeNote(); void shouldDeliverEDAMUserExceptionInExpungeNote(); void shouldDeliverEDAMSystemExceptionInExpungeNote(); void shouldDeliverEDAMNotFoundExceptionInExpungeNote(); void shouldDeliverThriftExceptionInExpungeNote(); + void shouldExecuteExpungeNoteAsync(); + void shouldDeliverEDAMUserExceptionInExpungeNoteAsync(); + void shouldDeliverEDAMSystemExceptionInExpungeNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync(); + void shouldDeliverThriftExceptionInExpungeNoteAsync(); void shouldExecuteCopyNote(); void shouldDeliverEDAMUserExceptionInCopyNote(); void shouldDeliverEDAMSystemExceptionInCopyNote(); void shouldDeliverEDAMNotFoundExceptionInCopyNote(); void shouldDeliverThriftExceptionInCopyNote(); + void shouldExecuteCopyNoteAsync(); + void shouldDeliverEDAMUserExceptionInCopyNoteAsync(); + void shouldDeliverEDAMSystemExceptionInCopyNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync(); + void shouldDeliverThriftExceptionInCopyNoteAsync(); void shouldExecuteListNoteVersions(); void shouldDeliverEDAMUserExceptionInListNoteVersions(); void shouldDeliverEDAMSystemExceptionInListNoteVersions(); void shouldDeliverEDAMNotFoundExceptionInListNoteVersions(); void shouldDeliverThriftExceptionInListNoteVersions(); + void shouldExecuteListNoteVersionsAsync(); + void shouldDeliverEDAMUserExceptionInListNoteVersionsAsync(); + void shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync(); + void shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync(); + void shouldDeliverThriftExceptionInListNoteVersionsAsync(); void shouldExecuteGetNoteVersion(); void shouldDeliverEDAMUserExceptionInGetNoteVersion(); void shouldDeliverEDAMSystemExceptionInGetNoteVersion(); void shouldDeliverEDAMNotFoundExceptionInGetNoteVersion(); void shouldDeliverThriftExceptionInGetNoteVersion(); + void shouldExecuteGetNoteVersionAsync(); + void shouldDeliverEDAMUserExceptionInGetNoteVersionAsync(); + void shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync(); + void shouldDeliverThriftExceptionInGetNoteVersionAsync(); void shouldExecuteGetResource(); void shouldDeliverEDAMUserExceptionInGetResource(); void shouldDeliverEDAMSystemExceptionInGetResource(); void shouldDeliverEDAMNotFoundExceptionInGetResource(); void shouldDeliverThriftExceptionInGetResource(); + void shouldExecuteGetResourceAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceAsync(); + void shouldDeliverThriftExceptionInGetResourceAsync(); void shouldExecuteGetResourceApplicationData(); void shouldDeliverEDAMUserExceptionInGetResourceApplicationData(); void shouldDeliverEDAMSystemExceptionInGetResourceApplicationData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationData(); void shouldDeliverThriftExceptionInGetResourceApplicationData(); + void shouldExecuteGetResourceApplicationDataAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceApplicationDataAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataAsync(); + void shouldDeliverThriftExceptionInGetResourceApplicationDataAsync(); void shouldExecuteGetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntry(); void shouldDeliverThriftExceptionInGetResourceApplicationDataEntry(); + void shouldExecuteGetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInGetResourceApplicationDataEntryAsync(); void shouldExecuteSetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntry(); void shouldDeliverThriftExceptionInSetResourceApplicationDataEntry(); + void shouldExecuteSetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInSetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInSetResourceApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInSetResourceApplicationDataEntryAsync(); void shouldExecuteUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntry(); void shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntry(); void shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntry(); + void shouldExecuteUnsetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMSystemExceptionInUnsetResourceApplicationDataEntryAsync(); + void shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicationDataEntryAsync(); + void shouldDeliverThriftExceptionInUnsetResourceApplicationDataEntryAsync(); void shouldExecuteUpdateResource(); void shouldDeliverEDAMUserExceptionInUpdateResource(); void shouldDeliverEDAMSystemExceptionInUpdateResource(); void shouldDeliverEDAMNotFoundExceptionInUpdateResource(); void shouldDeliverThriftExceptionInUpdateResource(); + void shouldExecuteUpdateResourceAsync(); + void shouldDeliverEDAMUserExceptionInUpdateResourceAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateResourceAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync(); + void shouldDeliverThriftExceptionInUpdateResourceAsync(); void shouldExecuteGetResourceData(); void shouldDeliverEDAMUserExceptionInGetResourceData(); void shouldDeliverEDAMSystemExceptionInGetResourceData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceData(); void shouldDeliverThriftExceptionInGetResourceData(); + void shouldExecuteGetResourceDataAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceDataAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceDataAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync(); + void shouldDeliverThriftExceptionInGetResourceDataAsync(); void shouldExecuteGetResourceByHash(); void shouldDeliverEDAMUserExceptionInGetResourceByHash(); void shouldDeliverEDAMSystemExceptionInGetResourceByHash(); void shouldDeliverEDAMNotFoundExceptionInGetResourceByHash(); void shouldDeliverThriftExceptionInGetResourceByHash(); + void shouldExecuteGetResourceByHashAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceByHashAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync(); + void shouldDeliverThriftExceptionInGetResourceByHashAsync(); void shouldExecuteGetResourceRecognition(); void shouldDeliverEDAMUserExceptionInGetResourceRecognition(); void shouldDeliverEDAMSystemExceptionInGetResourceRecognition(); void shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition(); void shouldDeliverThriftExceptionInGetResourceRecognition(); + void shouldExecuteGetResourceRecognitionAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceRecognitionAsync(); + void shouldDeliverThriftExceptionInGetResourceRecognitionAsync(); void shouldExecuteGetResourceAlternateData(); void shouldDeliverEDAMUserExceptionInGetResourceAlternateData(); void shouldDeliverEDAMSystemExceptionInGetResourceAlternateData(); void shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateData(); void shouldDeliverThriftExceptionInGetResourceAlternateData(); + void shouldExecuteGetResourceAlternateDataAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceAlternateDataAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDataAsync(); + void shouldDeliverThriftExceptionInGetResourceAlternateDataAsync(); void shouldExecuteGetResourceAttributes(); void shouldDeliverEDAMUserExceptionInGetResourceAttributes(); void shouldDeliverEDAMSystemExceptionInGetResourceAttributes(); void shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes(); void shouldDeliverThriftExceptionInGetResourceAttributes(); + void shouldExecuteGetResourceAttributesAsync(); + void shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync(); + void shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesAsync(); + void shouldDeliverThriftExceptionInGetResourceAttributesAsync(); void shouldExecuteGetPublicNotebook(); void shouldDeliverEDAMSystemExceptionInGetPublicNotebook(); void shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook(); void shouldDeliverThriftExceptionInGetPublicNotebook(); + void shouldExecuteGetPublicNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync(); + void shouldDeliverThriftExceptionInGetPublicNotebookAsync(); void shouldExecuteShareNotebook(); void shouldDeliverEDAMUserExceptionInShareNotebook(); void shouldDeliverEDAMNotFoundExceptionInShareNotebook(); void shouldDeliverEDAMSystemExceptionInShareNotebook(); void shouldDeliverThriftExceptionInShareNotebook(); + void shouldExecuteShareNotebookAsync(); + void shouldDeliverEDAMUserExceptionInShareNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInShareNotebookAsync(); + void shouldDeliverThriftExceptionInShareNotebookAsync(); void shouldExecuteCreateOrUpdateNotebookShares(); void shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookShares(); void shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares(); + void shouldExecuteCreateOrUpdateNotebookSharesAsync(); + void shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookSharesAsync(); + void shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebookSharesAsync(); + void shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSharesAsync(); + void shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateNotebookSharesAsync(); + void shouldDeliverThriftExceptionInCreateOrUpdateNotebookSharesAsync(); void shouldExecuteUpdateSharedNotebook(); void shouldDeliverEDAMUserExceptionInUpdateSharedNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook(); void shouldDeliverThriftExceptionInUpdateSharedNotebook(); + void shouldExecuteUpdateSharedNotebookAsync(); + void shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsync(); + void shouldDeliverThriftExceptionInUpdateSharedNotebookAsync(); void shouldExecuteSetNotebookRecipientSettings(); void shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettings(); void shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettings(); void shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettings(); void shouldDeliverThriftExceptionInSetNotebookRecipientSettings(); + void shouldExecuteSetNotebookRecipientSettingsAsync(); + void shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettingsAsync(); + void shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSettingsAsync(); + void shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSettingsAsync(); + void shouldDeliverThriftExceptionInSetNotebookRecipientSettingsAsync(); void shouldExecuteListSharedNotebooks(); void shouldDeliverEDAMUserExceptionInListSharedNotebooks(); void shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks(); void shouldDeliverEDAMSystemExceptionInListSharedNotebooks(); void shouldDeliverThriftExceptionInListSharedNotebooks(); + void shouldExecuteListSharedNotebooksAsync(); + void shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync(); + void shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsync(); + void shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync(); + void shouldDeliverThriftExceptionInListSharedNotebooksAsync(); void shouldExecuteCreateLinkedNotebook(); void shouldDeliverEDAMUserExceptionInCreateLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook(); void shouldDeliverThriftExceptionInCreateLinkedNotebook(); + void shouldExecuteCreateLinkedNotebookAsync(); + void shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsync(); + void shouldDeliverThriftExceptionInCreateLinkedNotebookAsync(); void shouldExecuteUpdateLinkedNotebook(); void shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook(); void shouldDeliverThriftExceptionInUpdateLinkedNotebook(); + void shouldExecuteUpdateLinkedNotebookAsync(); + void shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsync(); + void shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync(); void shouldExecuteListLinkedNotebooks(); void shouldDeliverEDAMUserExceptionInListLinkedNotebooks(); void shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks(); void shouldDeliverEDAMSystemExceptionInListLinkedNotebooks(); void shouldDeliverThriftExceptionInListLinkedNotebooks(); + void shouldExecuteListLinkedNotebooksAsync(); + void shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync(); + void shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsync(); + void shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync(); + void shouldDeliverThriftExceptionInListLinkedNotebooksAsync(); void shouldExecuteExpungeLinkedNotebook(); void shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook(); void shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook(); void shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook(); void shouldDeliverThriftExceptionInExpungeLinkedNotebook(); + void shouldExecuteExpungeLinkedNotebookAsync(); + void shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsync(); + void shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync(); void shouldExecuteAuthenticateToSharedNotebook(); void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebook(); void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebook(); void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebook(); void shouldDeliverThriftExceptionInAuthenticateToSharedNotebook(); + void shouldExecuteAuthenticateToSharedNotebookAsync(); + void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebookAsync(); + void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNotebookAsync(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNotebookAsync(); + void shouldDeliverThriftExceptionInAuthenticateToSharedNotebookAsync(); void shouldExecuteGetSharedNotebookByAuth(); void shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth(); void shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuth(); void shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth(); void shouldDeliverThriftExceptionInGetSharedNotebookByAuth(); + void shouldExecuteGetSharedNotebookByAuthAsync(); + void shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAuthAsync(); + void shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthAsync(); + void shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync(); void shouldExecuteEmailNote(); void shouldDeliverEDAMUserExceptionInEmailNote(); void shouldDeliverEDAMNotFoundExceptionInEmailNote(); void shouldDeliverEDAMSystemExceptionInEmailNote(); void shouldDeliverThriftExceptionInEmailNote(); + void shouldExecuteEmailNoteAsync(); + void shouldDeliverEDAMUserExceptionInEmailNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync(); + void shouldDeliverEDAMSystemExceptionInEmailNoteAsync(); + void shouldDeliverThriftExceptionInEmailNoteAsync(); void shouldExecuteShareNote(); void shouldDeliverEDAMUserExceptionInShareNote(); void shouldDeliverEDAMNotFoundExceptionInShareNote(); void shouldDeliverEDAMSystemExceptionInShareNote(); void shouldDeliverThriftExceptionInShareNote(); + void shouldExecuteShareNoteAsync(); + void shouldDeliverEDAMUserExceptionInShareNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInShareNoteAsync(); + void shouldDeliverEDAMSystemExceptionInShareNoteAsync(); + void shouldDeliverThriftExceptionInShareNoteAsync(); void shouldExecuteStopSharingNote(); void shouldDeliverEDAMUserExceptionInStopSharingNote(); void shouldDeliverEDAMNotFoundExceptionInStopSharingNote(); void shouldDeliverEDAMSystemExceptionInStopSharingNote(); void shouldDeliverThriftExceptionInStopSharingNote(); + void shouldExecuteStopSharingNoteAsync(); + void shouldDeliverEDAMUserExceptionInStopSharingNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync(); + void shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync(); + void shouldDeliverThriftExceptionInStopSharingNoteAsync(); void shouldExecuteAuthenticateToSharedNote(); void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote(); void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNote(); void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote(); void shouldDeliverThriftExceptionInAuthenticateToSharedNote(); + void shouldExecuteAuthenticateToSharedNoteAsync(); + void shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAsync(); + void shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNoteAsync(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNoteAsync(); + void shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsync(); void shouldExecuteFindRelated(); void shouldDeliverEDAMUserExceptionInFindRelated(); void shouldDeliverEDAMSystemExceptionInFindRelated(); void shouldDeliverEDAMNotFoundExceptionInFindRelated(); void shouldDeliverThriftExceptionInFindRelated(); + void shouldExecuteFindRelatedAsync(); + void shouldDeliverEDAMUserExceptionInFindRelatedAsync(); + void shouldDeliverEDAMSystemExceptionInFindRelatedAsync(); + void shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync(); + void shouldDeliverThriftExceptionInFindRelatedAsync(); void shouldExecuteUpdateNoteIfUsnMatches(); void shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches(); void shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches(); void shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches(); void shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches(); + void shouldExecuteUpdateNoteIfUsnMatchesAsync(); + void shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatchesAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAsync(); + void shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync(); void shouldExecuteManageNotebookShares(); void shouldDeliverEDAMUserExceptionInManageNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInManageNotebookShares(); void shouldDeliverEDAMSystemExceptionInManageNotebookShares(); void shouldDeliverThriftExceptionInManageNotebookShares(); + void shouldExecuteManageNotebookSharesAsync(); + void shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync(); + void shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAsync(); + void shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsync(); + void shouldDeliverThriftExceptionInManageNotebookSharesAsync(); void shouldExecuteGetNotebookShares(); void shouldDeliverEDAMUserExceptionInGetNotebookShares(); void shouldDeliverEDAMNotFoundExceptionInGetNotebookShares(); void shouldDeliverEDAMSystemExceptionInGetNotebookShares(); void shouldDeliverThriftExceptionInGetNotebookShares(); + void shouldExecuteGetNotebookSharesAsync(); + void shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync(); + void shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync(); + void shouldDeliverThriftExceptionInGetNotebookSharesAsync(); }; } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index b04eaf54..b855b52b 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -799,38 +799,6323 @@ public Q_SLOTS: //////////////////////////////////////////////////////////////////////////////// +class UserStoreCheckVersionAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreCheckVersionAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + bool m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetBootstrapInfoAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreGetBootstrapInfoAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + BootstrapInfo m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreAuthenticateLongSessionAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreAuthenticateLongSessionAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AuthenticationResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AuthenticationResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreRevokeLongSessionAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreRevokeLongSessionAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreAuthenticateToBusinessAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreAuthenticateToBusinessAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AuthenticationResult m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetUserAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreGetUserAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + User m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetPublicUserInfoAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreGetPublicUserInfoAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + PublicUserInfo m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetUserUrlsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreGetUserUrlsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + UserUrls m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreInviteToBusinessAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreInviteToBusinessAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreRemoveFromBusinessAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreRemoveFromBusinessAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreListBusinessUsersAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreListBusinessUsersAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreListBusinessInvitationsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreListBusinessInvitationsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + QList m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast>(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + +class UserStoreGetAccountLimitsAsyncValueFetcher: public QObject +{ + Q_OBJECT +public: + explicit UserStoreGetAccountLimitsAsyncValueFetcher(QObject * parent = nullptr) : + QObject(parent) + {} + + AccountLimits m_value; + QSharedPointer m_exceptionData; + +Q_SIGNALS: + void finished(); + +public Q_SLOTS: + void onFinished(QVariant value, QSharedPointer data) + { + m_value = qvariant_cast(value); + m_exceptionData = data; + Q_EMIT finished(); + } +}; + +//////////////////////////////////////////////////////////////////////////////// + void UserStoreTester::shouldExecuteCheckVersion() { - QString clientName = generateRandomString(); - qint16 edamVersionMajor = generateRandomInt16(); - qint16 edamVersionMinor = generateRandomInt16(); - IRequestContextPtr ctx = newRequestContext(); + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + bool response = generateRandomBool(); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) -> bool + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool res = userStore->checkVersion( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() +{ + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) -> bool + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + bool res = userStore->checkVersion( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteCheckVersionAsync() +{ + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + bool response = generateRandomBool(); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) -> bool + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->checkVersionAsync( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + + UserStoreCheckVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCheckVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCheckVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() +{ + QString clientName = generateRandomString(); + qint16 edamVersionMajor = generateRandomInt16(); + qint16 edamVersionMinor = generateRandomInt16(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreCheckVersionTesterHelper helper( + [&] (const QString & clientNameParam, + qint16 edamVersionMajorParam, + qint16 edamVersionMinorParam, + IRequestContextPtr ctxParam) -> bool + { + Q_ASSERT(clientName == clientNameParam); + Q_ASSERT(edamVersionMajor == edamVersionMajorParam); + Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::checkVersionRequest, + &helper, + &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + QObject::connect( + &helper, + &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &server, + &UserStoreServer::onCheckVersionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::checkVersionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->checkVersionAsync( + clientName, + edamVersionMajor, + edamVersionMinor, + ctx); + + UserStoreCheckVersionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCheckVersionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCheckVersionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetBootstrapInfo() +{ + QString locale = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + BootstrapInfo response = generateRandomBootstrapInfo(); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) -> BootstrapInfo + { + Q_ASSERT(locale == localeParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + BootstrapInfo res = userStore->getBootstrapInfo( + locale, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() +{ + QString locale = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) -> BootstrapInfo + { + Q_ASSERT(locale == localeParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + BootstrapInfo res = userStore->getBootstrapInfo( + locale, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() +{ + QString locale = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + BootstrapInfo response = generateRandomBootstrapInfo(); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) -> BootstrapInfo + { + Q_ASSERT(locale == localeParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->getBootstrapInfoAsync( + locale, + ctx); + + UserStoreGetBootstrapInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetBootstrapInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetBootstrapInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() +{ + QString locale = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetBootstrapInfoTesterHelper helper( + [&] (const QString & localeParam, + IRequestContextPtr ctxParam) -> BootstrapInfo + { + Q_ASSERT(locale == localeParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequest, + &helper, + &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &server, + &UserStoreServer::onGetBootstrapInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getBootstrapInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getBootstrapInfoAsync( + locale, + ctx); + + UserStoreGetBootstrapInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetBootstrapInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetBootstrapInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateLongSession( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + + UserStoreAuthenticateLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsync() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + + UserStoreAuthenticateLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionAsync() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + + UserStoreAuthenticateLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync() +{ + QString username = generateRandomString(); + QString password = generateRandomString(); + QString consumerKey = generateRandomString(); + QString consumerSecret = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + bool supportsTwoFactor = generateRandomBool(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreAuthenticateLongSessionTesterHelper helper( + [&] (const QString & usernameParam, + const QString & passwordParam, + const QString & consumerKeyParam, + const QString & consumerSecretParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + bool supportsTwoFactorParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(username == usernameParam); + Q_ASSERT(password == passwordParam); + Q_ASSERT(consumerKey == consumerKeyParam); + Q_ASSERT(consumerSecret == consumerSecretParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequest, + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &server, + &UserStoreServer::onAuthenticateLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateLongSessionAsync( + username, + password, + consumerKey, + consumerSecret, + deviceIdentifier, + deviceDescription, + supportsTwoFactor, + ctx); + + UserStoreAuthenticateLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthentication() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->completeTwoFactorAuthentication( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + + UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthenticationAsync() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.parameter = generateRandomString(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + + UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthenticationAsync() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + + UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticationAsync() +{ + QString oneTimeCode = generateRandomString(); + QString deviceIdentifier = generateRandomString(); + QString deviceDescription = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( + [&] (const QString & oneTimeCodeParam, + const QString & deviceIdentifierParam, + const QString & deviceDescriptionParam, + IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oneTimeCode == oneTimeCodeParam); + Q_ASSERT(deviceIdentifier == deviceIdentifierParam); + Q_ASSERT(deviceDescription == deviceDescriptionParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequest, + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + QObject::connect( + &helper, + &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &server, + &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( + oneTimeCode, + deviceIdentifier, + deviceDescription, + ctx); + + UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + userStore->revokeLongSession( + ctx); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DATA_REQUIRED; + userException.parameter = generateRandomString(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::TOO_MANY; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + userStore->revokeLongSession( + ctx); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteRevokeLongSessionAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->revokeLongSessionAsync( + ctx); + + UserStoreRevokeLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->revokeLongSessionAsync( + ctx); + + UserStoreRevokeLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->revokeLongSessionAsync( + ctx); + + UserStoreRevokeLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreRevokeLongSessionTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> void + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequest, + &helper, + &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + QObject::connect( + &helper, + &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &server, + &UserStoreServer::onRevokeLongSessionRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::revokeLongSessionRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->revokeLongSessionAsync( + ctx); + + UserStoreRevokeLongSessionAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRevokeLongSessionAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AuthenticationResult res = userStore->authenticateToBusiness( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + AuthenticationResult response = generateRandomAuthenticationResult(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->authenticateToBusinessAsync( + ctx); + + UserStoreAuthenticateToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_MANY; + userException.parameter = generateRandomString(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateToBusinessAsync( + ctx); + + UserStoreAuthenticateToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateToBusinessAsync( + ctx); + + UserStoreAuthenticateToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreAuthenticateToBusinessTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequest, + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + QObject::connect( + &helper, + &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &server, + &UserStoreServer::onAuthenticateToBusinessRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::authenticateToBusinessRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->authenticateToBusinessAsync( + ctx); + + UserStoreAuthenticateToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreAuthenticateToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + User response = generateRandomUser(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + User res = userStore->getUser( + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + userException.parameter = generateRandomString(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_CONFLICT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetUser() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + User res = userStore->getUser( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteGetUserAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + User response = generateRandomUser(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->getUserAsync( + ctx); + + UserStoreGetUserAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getUserAsync( + ctx); + + UserStoreGetUserAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getUserAsync( + ctx); + + UserStoreGetUserAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetUserTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> User + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getUserRequest, + &helper, + &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + QObject::connect( + &helper, + &UserStoreGetUserTesterHelper::getUserRequestReady, + &server, + &UserStoreServer::onGetUserRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getUserRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getUserAsync( + ctx); + + UserStoreGetUserAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + PublicUserInfo response = generateRandomPublicUserInfo(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + QVERIFY(res == response); +} + +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw notFoundException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + PublicUserInfo res = userStore->getPublicUserInfo( + username, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + PublicUserInfo response = generateRandomPublicUserInfo(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + return response; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->getPublicUserInfoAsync( + username, + ctx); + + UserStoreGetPublicUserInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw notFoundException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getPublicUserInfoAsync( + username, + ctx); + + UserStoreGetPublicUserInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::RATE_LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw systemException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getPublicUserInfoAsync( + username, + ctx); + + UserStoreGetPublicUserInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::SHARD_UNAVAILABLE; + userException.parameter = generateRandomString(); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getPublicUserInfoAsync( + username, + ctx); + + UserStoreGetPublicUserInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); +} + +void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() +{ + QString username = generateRandomString(); + IRequestContextPtr ctx = newRequestContext(); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + UserStoreGetPublicUserInfoTesterHelper helper( + [&] (const QString & usernameParam, + IRequestContextPtr ctxParam) -> PublicUserInfo + { + Q_ASSERT(username == usernameParam); + throw thriftException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequest, + &helper, + &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + QObject::connect( + &helper, + &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &server, + &UserStoreServer::onGetPublicUserInfoRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::getPublicUserInfoRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + bool caughtException = false; + try + { + AsyncResult * result = userStore->getPublicUserInfoAsync( + username, + ctx); + + UserStoreGetPublicUserInfoAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetPublicUserInfoAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetUserUrls() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - bool response = generateRandomBool(); + UserUrls response = generateRandomUserUrls(); - UserStoreCheckVersionTesterHelper helper( - [&] (const QString & clientNameParam, - qint16 edamVersionMajorParam, - qint16 edamVersionMinorParam, - IRequestContextPtr ctxParam) -> bool + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(clientName == clientNameParam); - Q_ASSERT(edamVersionMajor == edamVersionMajorParam); - Q_ASSERT(edamVersionMinor == edamVersionMinorParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::checkVersionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onCheckVersionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -858,7 +7143,7 @@ void UserStoreTester::shouldExecuteCheckVersion() QObject::connect( &server, - &UserStoreServer::checkVersionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -878,46 +7163,38 @@ void UserStoreTester::shouldExecuteCheckVersion() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool res = userStore->checkVersion( - clientName, - edamVersionMajor, - edamVersionMinor, + UserUrls res = userStore->getUserUrls( ctx); QVERIFY(res == response); } -void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() { - QString clientName = generateRandomString(); - qint16 edamVersionMajor = generateRandomInt16(); - qint16 edamVersionMinor = generateRandomInt16(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); - UserStoreCheckVersionTesterHelper helper( - [&] (const QString & clientNameParam, - qint16 edamVersionMajorParam, - qint16 edamVersionMinorParam, - IRequestContextPtr ctxParam) -> bool + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(clientName == clientNameParam); - Q_ASSERT(edamVersionMajor == edamVersionMajorParam); - Q_ASSERT(edamVersionMinor == edamVersionMinorParam); - throw thriftException; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::checkVersionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreCheckVersionTesterHelper::onCheckVersionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreCheckVersionTesterHelper::checkVersionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onCheckVersionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -945,7 +7222,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() QObject::connect( &server, - &UserStoreServer::checkVersionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -968,50 +7245,47 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() bool caughtException = false; try { - bool res = userStore->checkVersion( - clientName, - edamVersionMajor, - edamVersionMinor, + UserUrls res = userStore->getUserUrls( ctx); Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetBootstrapInfo() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() { - QString locale = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - BootstrapInfo response = generateRandomBootstrapInfo(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreGetBootstrapInfoTesterHelper helper( - [&] (const QString & localeParam, - IRequestContextPtr ctxParam) -> BootstrapInfo + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(locale == localeParam); - return response; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getBootstrapInfoRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onGetBootstrapInfoRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1039,7 +7313,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QObject::connect( &server, - &UserStoreServer::getBootstrapInfoRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1059,38 +7333,49 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - BootstrapInfo res = userStore->getBootstrapInfo( - locale, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + UserUrls res = userStore->getUserUrls( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() +void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() { - QString locale = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreGetBootstrapInfoTesterHelper helper( - [&] (const QString & localeParam, - IRequestContextPtr ctxParam) -> BootstrapInfo + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(locale == localeParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getBootstrapInfoRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreGetBootstrapInfoTesterHelper::onGetBootstrapInfoRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreGetBootstrapInfoTesterHelper::getBootstrapInfoRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onGetBootstrapInfoRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1118,7 +7403,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() QObject::connect( &server, - &UserStoreServer::getBootstrapInfoRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1141,8 +7426,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() bool caughtException = false; try { - BootstrapInfo res = userStore->getBootstrapInfo( - locale, + UserUrls res = userStore->getUserUrls( ctx); Q_UNUSED(res) } @@ -1155,52 +7439,31 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteAuthenticateLongSession() +void UserStoreTester::shouldExecuteGetUserUrlsAsync() { - QString username = generateRandomString(); - QString password = generateRandomString(); - QString consumerKey = generateRandomString(); - QString consumerSecret = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); - bool supportsTwoFactor = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); + UserUrls response = generateRandomUserUrls(); - UserStoreAuthenticateLongSessionTesterHelper helper( - [&] (const QString & usernameParam, - const QString & passwordParam, - const QString & consumerKeyParam, - const QString & consumerSecretParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - bool supportsTwoFactorParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); - Q_ASSERT(password == passwordParam); - Q_ASSERT(consumerKey == consumerKeyParam); - Q_ASSERT(consumerSecret == consumerSecretParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); - Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onAuthenticateLongSessionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1228,7 +7491,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1248,64 +7511,56 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->authenticateLongSession( - username, - password, - consumerKey, - consumerSecret, - deviceIdentifier, - deviceDescription, - supportsTwoFactor, + AsyncResult * result = userStore->getUserUrlsAsync( ctx); - QVERIFY(res == response); + + UserStoreGetUserUrlsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() { - QString username = generateRandomString(); - QString password = generateRandomString(); - QString consumerKey = generateRandomString(); - QString consumerSecret = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); - bool supportsTwoFactor = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LIMIT_REACHED; + userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; userException.parameter = generateRandomString(); - UserStoreAuthenticateLongSessionTesterHelper helper( - [&] (const QString & usernameParam, - const QString & passwordParam, - const QString & consumerKeyParam, - const QString & consumerSecretParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - bool supportsTwoFactorParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); - Q_ASSERT(password == passwordParam); - Q_ASSERT(consumerKey == consumerKeyParam); - Q_ASSERT(consumerSecret == consumerSecretParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); - Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onAuthenticateLongSessionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1333,7 +7588,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1356,16 +7611,27 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateLongSession( - username, - password, - consumerKey, - consumerSecret, - deviceIdentifier, - deviceDescription, - supportsTwoFactor, + AsyncResult * result = userStore->getUserUrlsAsync( ctx); - Q_UNUSED(res) + + UserStoreGetUserUrlsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -1376,53 +7642,34 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() { - QString username = generateRandomString(); - QString password = generateRandomString(); - QString consumerKey = generateRandomString(); - QString consumerSecret = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); - bool supportsTwoFactor = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ENML_VALIDATION; + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - UserStoreAuthenticateLongSessionTesterHelper helper( - [&] (const QString & usernameParam, - const QString & passwordParam, - const QString & consumerKeyParam, - const QString & consumerSecretParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - bool supportsTwoFactorParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); - Q_ASSERT(password == passwordParam); - Q_ASSERT(consumerKey == consumerKeyParam); - Q_ASSERT(consumerSecret == consumerSecretParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); - Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onAuthenticateLongSessionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1450,7 +7697,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1473,16 +7720,27 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateLongSession( - username, - password, - consumerKey, - consumerSecret, - deviceIdentifier, - deviceDescription, - supportsTwoFactor, + AsyncResult * result = userStore->getUserUrlsAsync( ctx); - Q_UNUSED(res) + + UserStoreGetUserUrlsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -1493,50 +7751,33 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() +void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() { - QString username = generateRandomString(); - QString password = generateRandomString(); - QString consumerKey = generateRandomString(); - QString consumerSecret = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); - bool supportsTwoFactor = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreAuthenticateLongSessionTesterHelper helper( - [&] (const QString & usernameParam, - const QString & passwordParam, - const QString & consumerKeyParam, - const QString & consumerSecretParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - bool supportsTwoFactorParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreGetUserUrlsTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> UserUrls { - Q_ASSERT(username == usernameParam); - Q_ASSERT(password == passwordParam); - Q_ASSERT(consumerKey == consumerKeyParam); - Q_ASSERT(consumerSecret == consumerSecretParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); - Q_ASSERT(supportsTwoFactor == supportsTwoFactorParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequest, + &UserStoreServer::getUserUrlsRequest, &helper, - &UserStoreAuthenticateLongSessionTesterHelper::onAuthenticateLongSessionRequestReceived); + &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateLongSessionTesterHelper::authenticateLongSessionRequestReady, + &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, &server, - &UserStoreServer::onAuthenticateLongSessionRequestReady); + &UserStoreServer::onGetUserUrlsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1564,7 +7805,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() QObject::connect( &server, - &UserStoreServer::authenticateLongSessionRequestReady, + &UserStoreServer::getUserUrlsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1587,16 +7828,27 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateLongSession( - username, - password, - consumerKey, - consumerSecret, - deviceIdentifier, - deviceDescription, - supportsTwoFactor, + AsyncResult * result = userStore->getUserUrlsAsync( ctx); - Q_UNUSED(res) + + UserStoreGetUserUrlsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetUserUrlsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -1609,40 +7861,32 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() +void UserStoreTester::shouldExecuteInviteToBusiness() { - QString oneTimeCode = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); - - UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( - [&] (const QString & oneTimeCodeParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oneTimeCode == oneTimeCodeParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); - return response; + Q_ASSERT(emailAddress == emailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1670,7 +7914,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1690,50 +7934,41 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, + userStore->inviteToBusiness( + emailAddress, ctx); - QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication() +void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() { - QString oneTimeCode = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.errorCode = EDAMErrorCode::TAKEN_DOWN; userException.parameter = generateRandomString(); - UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( - [&] (const QString & oneTimeCodeParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oneTimeCode == oneTimeCodeParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(emailAddress == emailAddressParam); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1761,7 +7996,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1784,12 +8019,9 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic bool caughtException = false; try { - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, + userStore->inviteToBusiness( + emailAddress, ctx); - Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -1800,43 +8032,37 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() { - QString oneTimeCode = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( - [&] (const QString & oneTimeCodeParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oneTimeCode == oneTimeCodeParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(emailAddress == emailAddressParam); throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1864,7 +8090,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1887,12 +8113,9 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent bool caughtException = false; try { - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, + userStore->inviteToBusiness( + emailAddress, ctx); - Q_UNUSED(res) } catch(const EDAMSystemException & e) { @@ -1903,40 +8126,36 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthentication() +void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() { - QString oneTimeCode = generateRandomString(); - QString deviceIdentifier = generateRandomString(); - QString deviceDescription = generateRandomString(); + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreCompleteTwoFactorAuthenticationTesterHelper helper( - [&] (const QString & oneTimeCodeParam, - const QString & deviceIdentifierParam, - const QString & deviceDescriptionParam, - IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oneTimeCode == oneTimeCodeParam); - Q_ASSERT(deviceIdentifier == deviceIdentifierParam); - Q_ASSERT(deviceDescription == deviceDescriptionParam); + Q_ASSERT(emailAddress == emailAddressParam); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::onCompleteTwoFactorAuthenticationRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreCompleteTwoFactorAuthenticationTesterHelper::completeTwoFactorAuthenticationRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -1964,7 +8183,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QObject::connect( &server, - &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -1987,12 +8206,9 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat bool caughtException = false; try { - AuthenticationResult res = userStore->completeTwoFactorAuthentication( - oneTimeCode, - deviceIdentifier, - deviceDescription, + userStore->inviteToBusiness( + emailAddress, ctx); - Q_UNUSED(res) } catch(const ThriftException & e) { @@ -2003,31 +8219,32 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteRevokeLongSession() +void UserStoreTester::shouldExecuteInviteToBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2055,7 +8272,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2075,37 +8292,59 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->revokeLongSession( + AsyncResult * result = userStore->inviteToBusinessAsync( + emailAddress, ctx); + + UserStoreInviteToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() +void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::USER_NOT_ASSOCIATED; + userException.errorCode = EDAMErrorCode::TOO_FEW; userException.parameter = generateRandomString(); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2133,7 +8372,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2156,8 +8395,28 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() bool caughtException = false; try { - userStore->revokeLongSession( + AsyncResult * result = userStore->inviteToBusinessAsync( + emailAddress, ctx); + + UserStoreInviteToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -2168,34 +8427,37 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2223,7 +8485,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2246,8 +8508,28 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() bool caughtException = false; try { - userStore->revokeLongSession( + AsyncResult * result = userStore->inviteToBusinessAsync( + emailAddress, ctx); + + UserStoreInviteToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) { @@ -2258,31 +8540,36 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() +void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreRevokeLongSessionTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> void + UserStoreInviteToBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequest, + &UserStoreServer::inviteToBusinessRequest, &helper, - &UserStoreRevokeLongSessionTesterHelper::onRevokeLongSessionRequestReceived); + &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); QObject::connect( &helper, - &UserStoreRevokeLongSessionTesterHelper::revokeLongSessionRequestReady, + &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, &server, - &UserStoreServer::onRevokeLongSessionRequestReady); + &UserStoreServer::onInviteToBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2310,7 +8597,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() QObject::connect( &server, - &UserStoreServer::revokeLongSessionRequestReady, + &UserStoreServer::inviteToBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2333,8 +8620,28 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() bool caughtException = false; try { - userStore->revokeLongSession( + AsyncResult * result = userStore->inviteToBusinessAsync( + emailAddress, ctx); + + UserStoreInviteToBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreInviteToBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -2347,31 +8654,32 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteAuthenticateToBusiness() +void UserStoreTester::shouldExecuteRemoveFromBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - AuthenticationResult response = generateRandomAuthenticationResult(); - - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(emailAddress == emailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2399,7 +8707,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2419,38 +8727,41 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AuthenticationResult res = userStore->authenticateToBusiness( + userStore->removeFromBusiness( + emailAddress, ctx); - QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() +void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.errorCode = EDAMErrorCode::LIMIT_REACHED; userException.parameter = generateRandomString(); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2478,7 +8789,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2501,9 +8812,9 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateToBusiness( + userStore->removeFromBusiness( + emailAddress, ctx); - Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -2514,122 +8825,37 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; - }); - - UserStoreServer server; - QObject::connect( - &server, - &UserStoreServer::authenticateToBusinessRequest, - &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); - QObject::connect( - &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, - &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &UserStoreServer::authenticateToBusinessRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); - bool caughtException = false; - try - { - AuthenticationResult res = userStore->authenticateToBusiness( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} - -void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::USER_ALREADY_ASSOCIATED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreAuthenticateToBusinessTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> AuthenticationResult + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(emailAddress == emailAddressParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreAuthenticateToBusinessTesterHelper::onAuthenticateToBusinessRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreAuthenticateToBusinessTesterHelper::authenticateToBusinessRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onAuthenticateToBusinessRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2657,7 +8883,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() QObject::connect( &server, - &UserStoreServer::authenticateToBusinessRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2680,46 +8906,49 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() bool caughtException = false; try { - AuthenticationResult res = userStore->authenticateToBusiness( + userStore->removeFromBusiness( + emailAddress, ctx); - Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetUser() +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - User response = generateRandomUser(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(emailAddress == emailAddressParam); + throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2747,7 +8976,7 @@ void UserStoreTester::shouldExecuteGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2767,38 +8996,52 @@ void UserStoreTester::shouldExecuteGetUser() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - User res = userStore->getUser( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + userStore->removeFromBusiness( + emailAddress, + ctx); + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() +void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::UNSUPPORTED_OPERATION; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(emailAddress == emailAddressParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2826,7 +9069,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2849,47 +9092,45 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() bool caughtException = false; try { - User res = userStore->getUser( + userStore->removeFromBusiness( + emailAddress, ctx); - Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() +void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); - - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(emailAddress == emailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -2917,7 +9158,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -2937,47 +9178,59 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - User res = userStore->getUser( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } + AsyncResult * result = userStore->removeFromBusinessAsync( + emailAddress, + ctx); - QVERIFY(caughtException); + UserStoreRemoveFromBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); } -void UserStoreTester::shouldDeliverThriftExceptionInGetUser() +void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() { + QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::ENML_VALIDATION; + userException.parameter = generateRandomString(); - UserStoreGetUserTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> User + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(emailAddress == emailAddressParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetUserTesterHelper::onGetUserRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetUserTesterHelper::getUserRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetUserRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3005,7 +9258,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() QObject::connect( &server, - &UserStoreServer::getUserRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3028,47 +9281,69 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() bool caughtException = false; try { - User res = userStore->getUser( + AsyncResult * result = userStore->removeFromBusinessAsync( + emailAddress, ctx); - Q_UNUSED(res) + + UserStoreRemoveFromBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetPublicUserInfo() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - PublicUserInfo response = generateRandomPublicUserInfo(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LIMIT_REACHED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { - Q_ASSERT(username == usernameParam); - return response; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3096,7 +9371,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3116,40 +9391,71 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - PublicUserInfo res = userStore->getPublicUserInfo( - username, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = userStore->removeFromBusinessAsync( + emailAddress, + ctx); + + UserStoreRemoveFromBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsync() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); auto notFoundException = EDAMNotFoundException(); notFoundException.identifier = generateRandomString(); notFoundException.key = generateRandomString(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { - Q_ASSERT(username == usernameParam); + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3177,7 +9483,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3200,10 +9506,28 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() bool caughtException = false; try { - PublicUserInfo res = userStore->getPublicUserInfo( - username, + AsyncResult * result = userStore->removeFromBusinessAsync( + emailAddress, ctx); - Q_UNUSED(res) + + UserStoreRemoveFromBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) { @@ -3214,35 +9538,36 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() +void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString emailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreRemoveFromBusinessTesterHelper helper( + [&] (const QString & emailAddressParam, + IRequestContextPtr ctxParam) -> void { - Q_ASSERT(username == usernameParam); - throw systemException; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(emailAddress == emailAddressParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::removeFromBusinessRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onRemoveFromBusinessRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3270,7 +9595,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::removeFromBusinessRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3293,48 +9618,69 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() bool caughtException = false; try { - PublicUserInfo res = userStore->getPublicUserInfo( - username, + AsyncResult * result = userStore->removeFromBusinessAsync( + emailAddress, ctx); - Q_UNUSED(res) + + UserStoreRemoveFromBusinessAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreRemoveFromBusinessAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() -{ - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); +//////////////////////////////////////////////////////////////////////////////// - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - userException.parameter = generateRandomString(); +void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() +{ + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { - Q_ASSERT(username == usernameParam); - throw userException; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3362,7 +9708,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3382,49 +9728,45 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - PublicUserInfo res = userStore->getPublicUserInfo( - username, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } - - QVERIFY(caughtException); + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); } -void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() +void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier() { - QString username = generateRandomString(); - IRequestContextPtr ctx = newRequestContext(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + userException.parameter = generateRandomString(); - UserStoreGetPublicUserInfoTesterHelper helper( - [&] (const QString & usernameParam, - IRequestContextPtr ctxParam) -> PublicUserInfo + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { - Q_ASSERT(username == usernameParam); - throw thriftException; + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetPublicUserInfoTesterHelper::onGetPublicUserInfoRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetPublicUserInfoTesterHelper::getPublicUserInfoRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetPublicUserInfoRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3452,7 +9794,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() QObject::connect( &server, - &UserStoreServer::getPublicUserInfoRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3475,47 +9817,54 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() bool caughtException = false; try { - PublicUserInfo res = userStore->getPublicUserInfo( - username, + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, ctx); - Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetUserUrls() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier() { + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserUrls response = generateRandomUserUrls(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::INVALID_AUTH; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> UserUrls + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3543,7 +9892,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3563,38 +9912,56 @@ void UserStoreTester::shouldExecuteGetUserUrls() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - UserUrls res = userStore->getUserUrls( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, + ctx); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier() { + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::BAD_DATA_FORMAT; - userException.parameter = generateRandomString(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> UserUrls + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3622,7 +9989,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3645,47 +10012,53 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() bool caughtException = false; try { - UserUrls res = userStore->getUserUrls( + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, ctx); - Q_UNUSED(res) } - catch(const EDAMUserException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() +void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier() { + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> UserUrls + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3713,7 +10086,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3736,44 +10109,49 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() bool caughtException = false; try { - UserUrls res = userStore->getUserUrls( + userStore->updateBusinessUserIdentifier( + oldEmailAddress, + newEmailAddress, ctx); - Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() +void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() { + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); - - UserStoreGetUserUrlsTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> UserUrls + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, + IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + return; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::getUserUrlsRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreGetUserUrlsTesterHelper::onGetUserUrlsRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreGetUserUrlsTesterHelper::getUserUrlsRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onGetUserUrlsRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3801,7 +10179,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() QObject::connect( &server, - &UserStoreServer::getUserUrlsRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3821,50 +10199,63 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - UserUrls res = userStore->getUserUrls( - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } + AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, + ctx); - QVERIFY(caughtException); -} + UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::onFinished); -//////////////////////////////////////////////////////////////////////////////// + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); -void UserStoreTester::shouldExecuteInviteToBusiness() + loop.exec(); + + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifierAsync() { - QString emailAddress = generateRandomString(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreInviteToBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; + userException.parameter = generateRandomString(); + + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - return; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onInviteToBusinessRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3892,7 +10283,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3912,41 +10303,76 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->inviteToBusiness( - emailAddress, - ctx); + bool caughtException = false; + try + { + AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, + ctx); + + UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMUserException & e) + { + caughtException = true; + QVERIFY(e == userException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifierAsync() { - QString emailAddress = generateRandomString(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::PERMISSION_DENIED; - userException.parameter = generateRandomString(); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::UNKNOWN; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreInviteToBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - throw userException; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onInviteToBusinessRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -3974,7 +10400,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -3997,50 +10423,72 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() bool caughtException = false; try { - userStore->inviteToBusiness( - emailAddress, + AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, ctx); + + UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() +void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifierAsync() { - QString emailAddress = generateRandomString(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::AUTH_EXPIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); - UserStoreInviteToBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - throw systemException; + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); + throw notFoundException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onInviteToBusinessRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4068,7 +10516,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4091,47 +10539,72 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() bool caughtException = false; try { - userStore->inviteToBusiness( - emailAddress, + AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, ctx); + + UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMNotFoundException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == notFoundException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() +void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifierAsync() { - QString emailAddress = generateRandomString(); + QString oldEmailAddress = generateRandomString(); + QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreInviteToBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, + UserStoreUpdateBusinessUserIdentifierTesterHelper helper( + [&] (const QString & oldEmailAddressParam, + const QString & newEmailAddressParam, IRequestContextPtr ctxParam) -> void { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); + Q_ASSERT(oldEmailAddress == oldEmailAddressParam); + Q_ASSERT(newEmailAddress == newEmailAddressParam); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequest, + &UserStoreServer::updateBusinessUserIdentifierRequest, &helper, - &UserStoreInviteToBusinessTesterHelper::onInviteToBusinessRequestReceived); + &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); QObject::connect( &helper, - &UserStoreInviteToBusinessTesterHelper::inviteToBusinessRequestReady, + &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, &server, - &UserStoreServer::onInviteToBusinessRequestReady); + &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4159,7 +10632,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() QObject::connect( &server, - &UserStoreServer::inviteToBusinessRequestReady, + &UserStoreServer::updateBusinessUserIdentifierRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4182,9 +10655,29 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() bool caughtException = false; try { - userStore->inviteToBusiness( - emailAddress, + AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( + oldEmailAddress, + newEmailAddress, ctx); + + UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { @@ -4197,32 +10690,34 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() //////////////////////////////////////////////////////////////////////////////// -void UserStoreTester::shouldExecuteRemoveFromBusiness() +void UserStoreTester::shouldExecuteListBusinessUsers() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) -> void + QList response; + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - return; + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4250,7 +10745,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4270,41 +10765,38 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->removeFromBusiness( - emailAddress, + QList res = userStore->listBusinessUsers( ctx); + QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::LEN_TOO_LONG; + userException.errorCode = EDAMErrorCode::INVALID_OPENID_TOKEN; userException.parameter = generateRandomString(); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4332,7 +10824,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4355,9 +10847,9 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() bool caughtException = false; try { - userStore->removeFromBusiness( - emailAddress, + QList res = userStore->listBusinessUsers( ctx); + Q_UNUSED(res) } catch(const EDAMUserException & e) { @@ -4368,37 +10860,34 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::TAKEN_DOWN; + systemException.errorCode = EDAMErrorCode::PERMISSION_DENIED; systemException.message = generateRandomString(); systemException.rateLimitDuration = generateRandomInt32(); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4426,7 +10915,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4449,9 +10938,9 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() bool caughtException = false; try { - userStore->removeFromBusiness( - emailAddress, + QList res = userStore->listBusinessUsers( ctx); + Q_UNUSED(res) } catch(const EDAMSystemException & e) { @@ -4462,36 +10951,33 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - throw notFoundException; + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4519,7 +11005,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4542,47 +11028,47 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() bool caughtException = false; try { - userStore->removeFromBusiness( - emailAddress, + QList res = userStore->listBusinessUsers( ctx); + Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() +void UserStoreTester::shouldExecuteListBusinessUsersAsync() { - QString emailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + QList response; + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); + response << generateRandomUserProfile(); - UserStoreRemoveFromBusinessTesterHelper helper( - [&] (const QString & emailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(emailAddress == emailAddressParam); - throw thriftException; + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreRemoveFromBusinessTesterHelper::onRemoveFromBusinessRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreRemoveFromBusinessTesterHelper::removeFromBusinessRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onRemoveFromBusinessRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4610,7 +11096,104 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() QObject::connect( &server, - &UserStoreServer::removeFromBusinessRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto userStore = newUserStore( + QStringLiteral("127.0.0.1"), + port, + QStringLiteral("http")); + AsyncResult * result = userStore->listBusinessUsersAsync( + ctx); + + UserStoreListBusinessUsersAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); +} + +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::INTERNAL_ERROR; + userException.parameter = generateRandomString(); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw userException; + }); + + UserStoreServer server; + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequest, + &helper, + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + QObject::connect( + &helper, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &server, + &UserStoreServer::onListBusinessUsersRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4633,50 +11216,65 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() bool caughtException = false; try { - userStore->removeFromBusiness( - emailAddress, + AsyncResult * result = userStore->listBusinessUsersAsync( ctx); + + UserStoreListBusinessUsersAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) -> void + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::SSO_AUTHENTICATION_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); + + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - return; + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4704,7 +11302,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4724,45 +11322,67 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, - ctx); + bool caughtException = false; + try + { + AsyncResult * result = userStore->listBusinessUsersAsync( + ctx); + + UserStoreListBusinessUsersAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier() +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::TOO_FEW; - userException.parameter = generateRandomString(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessUsersTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - throw userException; + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessUsersRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessUsersRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4790,7 +11410,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessUsersRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4813,54 +11433,70 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi bool caughtException = false; try { - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, + AsyncResult * result = userStore->listBusinessUsersAsync( ctx); + + UserStoreListBusinessUsersAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessUsersAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMUserException & e) + catch(const ThriftException & e) { caughtException = true; - QVERIFY(e == userException); + QVERIFY(e == thriftException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteListBusinessInvitations() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::OPENID_ALREADY_TAKEN; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + QList response; + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - throw systemException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4888,7 +11524,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -4908,56 +11544,42 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, - ctx); - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier() +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::TOO_FEW; + userException.parameter = generateRandomString(); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - throw notFoundException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -4985,7 +11607,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5008,51 +11630,51 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden bool caughtException = false; try { - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, ctx); + Q_UNUSED(res) } - catch(const EDAMNotFoundException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == notFoundException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations() { - QString oldEmailAddress = generateRandomString(); - QString newEmailAddress = generateRandomString(); + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreUpdateBusinessUserIdentifierTesterHelper helper( - [&] (const QString & oldEmailAddressParam, - const QString & newEmailAddressParam, - IRequestContextPtr ctxParam) -> void + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(oldEmailAddress == oldEmailAddressParam); - Q_ASSERT(newEmailAddress == newEmailAddressParam); - throw thriftException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::onUpdateBusinessUserIdentifierRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreUpdateBusinessUserIdentifierTesterHelper::updateBusinessUserIdentifierRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onUpdateBusinessUserIdentifierRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5080,7 +11702,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier QObject::connect( &server, - &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5103,50 +11725,50 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier bool caughtException = false; try { - userStore->updateBusinessUserIdentifier( - oldEmailAddress, - newEmailAddress, + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, ctx); + Q_UNUSED(res) } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteListBusinessUsers() +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() { + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomUserProfile(); - response << generateRandomUserProfile(); - response << generateRandomUserProfile(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreListBusinessUsersTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onListBusinessUsersRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5174,7 +11796,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5194,38 +11816,54 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - QList res = userStore->listBusinessUsers( - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + QList res = userStore->listBusinessInvitations( + includeRequestedInvitations, + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() +void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() { + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::ACCOUNT_CLEAR; - userException.parameter = generateRandomString(); + QList response; + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); + response << generateRandomBusinessInvitation(); - UserStoreListBusinessUsersTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw userException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onListBusinessUsersRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5253,7 +11891,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5273,50 +11911,60 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - QList res = userStore->listBusinessUsers( - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } + AsyncResult * result = userStore->listBusinessInvitationsAsync( + includeRequestedInvitations, + ctx); + + UserStoreListBusinessInvitationsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::onFinished); - QVERIFY(caughtException); + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() +void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsync() { + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::DATA_REQUIRED; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::BUSINESS_SECURITY_LOGIN_REQUIRED; + userException.parameter = generateRandomString(); - UserStoreListBusinessUsersTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw systemException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onListBusinessUsersRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5344,7 +11992,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5367,44 +12015,69 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() bool caughtException = false; try { - QList res = userStore->listBusinessUsers( + AsyncResult * result = userStore->listBusinessInvitationsAsync( + includeRequestedInvitations, ctx); - Q_UNUSED(res) + + UserStoreListBusinessInvitationsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() +void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsAsync() { + bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto systemException = EDAMSystemException(); + systemException.errorCode = EDAMErrorCode::LEN_TOO_SHORT; + systemException.message = generateRandomString(); + systemException.rateLimitDuration = generateRandomInt32(); - UserStoreListBusinessUsersTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList + UserStoreListBusinessInvitationsTesterHelper helper( + [&] (bool includeRequestedInvitationsParam, + IRequestContextPtr ctxParam) -> QList { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; + Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + throw systemException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequest, + &UserStoreServer::listBusinessInvitationsRequest, &helper, - &UserStoreListBusinessUsersTesterHelper::onListBusinessUsersRequestReceived); + &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessUsersTesterHelper::listBusinessUsersRequestReady, + &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, &server, - &UserStoreServer::onListBusinessUsersRequestReady); + &UserStoreServer::onListBusinessInvitationsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5432,7 +12105,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() QObject::connect( &server, - &UserStoreServer::listBusinessUsersRequestReady, + &UserStoreServer::listBusinessInvitationsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5455,31 +12128,47 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() bool caughtException = false; try { - QList res = userStore->listBusinessUsers( + AsyncResult * result = userStore->listBusinessInvitationsAsync( + includeRequestedInvitations, ctx); - Q_UNUSED(res) + + UserStoreListBusinessInvitationsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } - catch(const ThriftException & e) + catch(const EDAMSystemException & e) { caughtException = true; - QVERIFY(e == thriftException); + QVERIFY(e == systemException); } QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteListBusinessInvitations() +void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync() { bool includeRequestedInvitations = generateRandomBool(); IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); - QList response; - response << generateRandomBusinessInvitation(); - response << generateRandomBusinessInvitation(); - response << generateRandomBusinessInvitation(); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); UserStoreListBusinessInvitationsTesterHelper helper( [&] (bool includeRequestedInvitationsParam, @@ -5487,7 +12176,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() { Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); - return response; + throw thriftException; }); UserStoreServer server; @@ -5548,42 +12237,69 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - QList res = userStore->listBusinessInvitations( - includeRequestedInvitations, - ctx); - QVERIFY(res == response); + bool caughtException = false; + try + { + AsyncResult * result = userStore->listBusinessInvitationsAsync( + includeRequestedInvitations, + ctx); + + UserStoreListBusinessInvitationsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreListBusinessInvitationsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() +//////////////////////////////////////////////////////////////////////////////// + +void UserStoreTester::shouldExecuteGetAccountLimits() { - bool includeRequestedInvitations = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + ServiceLevel serviceLevel = ServiceLevel::BASIC; + IRequestContextPtr ctx = newRequestContext(); - auto userException = EDAMUserException(); - userException.errorCode = EDAMErrorCode::DEVICE_LIMIT_REACHED; - userException.parameter = generateRandomString(); + AccountLimits response = generateRandomAccountLimits(); - UserStoreListBusinessInvitationsTesterHelper helper( - [&] (bool includeRequestedInvitationsParam, - IRequestContextPtr ctxParam) -> QList + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) -> AccountLimits { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); - throw userException; + Q_ASSERT(serviceLevel == serviceLevelParam); + return response; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequest, + &UserStoreServer::getAccountLimitsRequest, &helper, - &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, &server, - &UserStoreServer::onListBusinessInvitationsRequestReady); + &UserStoreServer::onGetAccountLimitsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5611,7 +12327,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequestReady, + &UserStoreServer::getAccountLimitsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5631,54 +12347,40 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - bool caughtException = false; - try - { - QList res = userStore->listBusinessInvitations( - includeRequestedInvitations, - ctx); - Q_UNUSED(res) - } - catch(const EDAMUserException & e) - { - caughtException = true; - QVERIFY(e == userException); - } - - QVERIFY(caughtException); + AccountLimits res = userStore->getAccountLimits( + serviceLevel, + ctx); + QVERIFY(res == response); } -void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() { - bool includeRequestedInvitations = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + ServiceLevel serviceLevel = ServiceLevel::PREMIUM; + IRequestContextPtr ctx = newRequestContext(); - auto systemException = EDAMSystemException(); - systemException.errorCode = EDAMErrorCode::INVALID_AUTH; - systemException.message = generateRandomString(); - systemException.rateLimitDuration = generateRandomInt32(); + auto userException = EDAMUserException(); + userException.errorCode = EDAMErrorCode::UNKNOWN; + userException.parameter = generateRandomString(); - UserStoreListBusinessInvitationsTesterHelper helper( - [&] (bool includeRequestedInvitationsParam, - IRequestContextPtr ctxParam) -> QList + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) -> AccountLimits { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); - throw systemException; + Q_ASSERT(serviceLevel == serviceLevelParam); + throw userException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequest, + &UserStoreServer::getAccountLimitsRequest, &helper, - &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, &server, - &UserStoreServer::onListBusinessInvitationsRequestReady); + &UserStoreServer::onGetAccountLimitsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5706,7 +12408,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequestReady, + &UserStoreServer::getAccountLimitsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5729,48 +12431,48 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( bool caughtException = false; try { - QList res = userStore->listBusinessInvitations( - includeRequestedInvitations, + AccountLimits res = userStore->getAccountLimits( + serviceLevel, ctx); Q_UNUSED(res) } - catch(const EDAMSystemException & e) + catch(const EDAMUserException & e) { caughtException = true; - QVERIFY(e == systemException); + QVERIFY(e == userException); } QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() +void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() { - bool includeRequestedInvitations = generateRandomBool(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); + ServiceLevel serviceLevel = ServiceLevel::BASIC; + IRequestContextPtr ctx = newRequestContext(); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); - UserStoreListBusinessInvitationsTesterHelper helper( - [&] (bool includeRequestedInvitationsParam, - IRequestContextPtr ctxParam) -> QList + UserStoreGetAccountLimitsTesterHelper helper( + [&] (const ServiceLevel & serviceLevelParam, + IRequestContextPtr ctxParam) -> AccountLimits { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(includeRequestedInvitations == includeRequestedInvitationsParam); + Q_ASSERT(serviceLevel == serviceLevelParam); throw thriftException; }); UserStoreServer server; QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequest, + &UserStoreServer::getAccountLimitsRequest, &helper, - &UserStoreListBusinessInvitationsTesterHelper::onListBusinessInvitationsRequestReceived); + &UserStoreGetAccountLimitsTesterHelper::onGetAccountLimitsRequestReceived); QObject::connect( &helper, - &UserStoreListBusinessInvitationsTesterHelper::listBusinessInvitationsRequestReady, + &UserStoreGetAccountLimitsTesterHelper::getAccountLimitsRequestReady, &server, - &UserStoreServer::onListBusinessInvitationsRequestReady); + &UserStoreServer::onGetAccountLimitsRequestReady); QTcpServer tcpServer; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); @@ -5798,7 +12500,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() QObject::connect( &server, - &UserStoreServer::listBusinessInvitationsRequestReady, + &UserStoreServer::getAccountLimitsRequestReady, [&] (QByteArray responseData) { QByteArray buffer; @@ -5821,8 +12523,8 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() bool caughtException = false; try { - QList res = userStore->listBusinessInvitations( - includeRequestedInvitations, + AccountLimits res = userStore->getAccountLimits( + serviceLevel, ctx); Q_UNUSED(res) } @@ -5835,9 +12537,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() QVERIFY(caughtException); } -//////////////////////////////////////////////////////////////////////////////// - -void UserStoreTester::shouldExecuteGetAccountLimits() +void UserStoreTester::shouldExecuteGetAccountLimitsAsync() { ServiceLevel serviceLevel = ServiceLevel::BASIC; IRequestContextPtr ctx = newRequestContext(); @@ -5910,15 +12610,33 @@ void UserStoreTester::shouldExecuteGetAccountLimits() QStringLiteral("127.0.0.1"), port, QStringLiteral("http")); - AccountLimits res = userStore->getAccountLimits( + AsyncResult * result = userStore->getAccountLimitsAsync( serviceLevel, ctx); - QVERIFY(res == response); + + UserStoreGetAccountLimitsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_value == response); + QVERIFY(!valueFetcher.m_exceptionData); } -void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() +void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() { - ServiceLevel serviceLevel = ServiceLevel::BUSINESS; + ServiceLevel serviceLevel = ServiceLevel::PREMIUM; IRequestContextPtr ctx = newRequestContext(); auto userException = EDAMUserException(); @@ -5994,10 +12712,28 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() bool caughtException = false; try { - AccountLimits res = userStore->getAccountLimits( + AsyncResult * result = userStore->getAccountLimitsAsync( serviceLevel, ctx); - Q_UNUSED(res) + + UserStoreGetAccountLimitsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) { @@ -6008,12 +12744,14 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() QVERIFY(caughtException); } -void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() +void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() { - ServiceLevel serviceLevel = ServiceLevel::PLUS; + ServiceLevel serviceLevel = ServiceLevel::BASIC; IRequestContextPtr ctx = newRequestContext(); - auto thriftException = ThriftException(ThriftException::Type::INTERNAL_ERROR, QStringLiteral("Internal error")); + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); UserStoreGetAccountLimitsTesterHelper helper( [&] (const ServiceLevel & serviceLevelParam, @@ -6084,10 +12822,28 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() bool caughtException = false; try { - AccountLimits res = userStore->getAccountLimits( + AsyncResult * result = userStore->getAccountLimitsAsync( serviceLevel, ctx); - Q_UNUSED(res) + + UserStoreGetAccountLimitsAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &UserStoreGetAccountLimitsAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData); + valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) { diff --git a/QEverCloud/src/tests/generated/TestUserStore.h b/QEverCloud/src/tests/generated/TestUserStore.h index ea7b4de4..e0f4f303 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.h +++ b/QEverCloud/src/tests/generated/TestUserStore.h @@ -28,62 +28,120 @@ class UserStoreTester: public QObject private Q_SLOTS: void shouldExecuteCheckVersion(); void shouldDeliverThriftExceptionInCheckVersion(); + void shouldExecuteCheckVersionAsync(); + void shouldDeliverThriftExceptionInCheckVersionAsync(); void shouldExecuteGetBootstrapInfo(); void shouldDeliverThriftExceptionInGetBootstrapInfo(); + void shouldExecuteGetBootstrapInfoAsync(); + void shouldDeliverThriftExceptionInGetBootstrapInfoAsync(); void shouldExecuteAuthenticateLongSession(); void shouldDeliverEDAMUserExceptionInAuthenticateLongSession(); void shouldDeliverEDAMSystemExceptionInAuthenticateLongSession(); void shouldDeliverThriftExceptionInAuthenticateLongSession(); + void shouldExecuteAuthenticateLongSessionAsync(); + void shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsync(); + void shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionAsync(); + void shouldDeliverThriftExceptionInAuthenticateLongSessionAsync(); void shouldExecuteCompleteTwoFactorAuthentication(); void shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentication(); void shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthentication(); void shouldDeliverThriftExceptionInCompleteTwoFactorAuthentication(); + void shouldExecuteCompleteTwoFactorAuthenticationAsync(); + void shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthenticationAsync(); + void shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthenticationAsync(); + void shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticationAsync(); void shouldExecuteRevokeLongSession(); void shouldDeliverEDAMUserExceptionInRevokeLongSession(); void shouldDeliverEDAMSystemExceptionInRevokeLongSession(); void shouldDeliverThriftExceptionInRevokeLongSession(); + void shouldExecuteRevokeLongSessionAsync(); + void shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync(); + void shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync(); + void shouldDeliverThriftExceptionInRevokeLongSessionAsync(); void shouldExecuteAuthenticateToBusiness(); void shouldDeliverEDAMUserExceptionInAuthenticateToBusiness(); void shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness(); void shouldDeliverThriftExceptionInAuthenticateToBusiness(); + void shouldExecuteAuthenticateToBusinessAsync(); + void shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsync(); + void shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAsync(); + void shouldDeliverThriftExceptionInAuthenticateToBusinessAsync(); void shouldExecuteGetUser(); void shouldDeliverEDAMUserExceptionInGetUser(); void shouldDeliverEDAMSystemExceptionInGetUser(); void shouldDeliverThriftExceptionInGetUser(); + void shouldExecuteGetUserAsync(); + void shouldDeliverEDAMUserExceptionInGetUserAsync(); + void shouldDeliverEDAMSystemExceptionInGetUserAsync(); + void shouldDeliverThriftExceptionInGetUserAsync(); void shouldExecuteGetPublicUserInfo(); void shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo(); void shouldDeliverEDAMSystemExceptionInGetPublicUserInfo(); void shouldDeliverEDAMUserExceptionInGetPublicUserInfo(); void shouldDeliverThriftExceptionInGetPublicUserInfo(); + void shouldExecuteGetPublicUserInfoAsync(); + void shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync(); + void shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync(); + void shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync(); + void shouldDeliverThriftExceptionInGetPublicUserInfoAsync(); void shouldExecuteGetUserUrls(); void shouldDeliverEDAMUserExceptionInGetUserUrls(); void shouldDeliverEDAMSystemExceptionInGetUserUrls(); void shouldDeliverThriftExceptionInGetUserUrls(); + void shouldExecuteGetUserUrlsAsync(); + void shouldDeliverEDAMUserExceptionInGetUserUrlsAsync(); + void shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync(); + void shouldDeliverThriftExceptionInGetUserUrlsAsync(); void shouldExecuteInviteToBusiness(); void shouldDeliverEDAMUserExceptionInInviteToBusiness(); void shouldDeliverEDAMSystemExceptionInInviteToBusiness(); void shouldDeliverThriftExceptionInInviteToBusiness(); + void shouldExecuteInviteToBusinessAsync(); + void shouldDeliverEDAMUserExceptionInInviteToBusinessAsync(); + void shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync(); + void shouldDeliverThriftExceptionInInviteToBusinessAsync(); void shouldExecuteRemoveFromBusiness(); void shouldDeliverEDAMUserExceptionInRemoveFromBusiness(); void shouldDeliverEDAMSystemExceptionInRemoveFromBusiness(); void shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness(); void shouldDeliverThriftExceptionInRemoveFromBusiness(); + void shouldExecuteRemoveFromBusinessAsync(); + void shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync(); + void shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync(); + void shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsync(); + void shouldDeliverThriftExceptionInRemoveFromBusinessAsync(); void shouldExecuteUpdateBusinessUserIdentifier(); void shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifier(); void shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifier(); void shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifier(); void shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier(); + void shouldExecuteUpdateBusinessUserIdentifierAsync(); + void shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifierAsync(); + void shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdentifierAsync(); + void shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIdentifierAsync(); + void shouldDeliverThriftExceptionInUpdateBusinessUserIdentifierAsync(); void shouldExecuteListBusinessUsers(); void shouldDeliverEDAMUserExceptionInListBusinessUsers(); void shouldDeliverEDAMSystemExceptionInListBusinessUsers(); void shouldDeliverThriftExceptionInListBusinessUsers(); + void shouldExecuteListBusinessUsersAsync(); + void shouldDeliverEDAMUserExceptionInListBusinessUsersAsync(); + void shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync(); + void shouldDeliverThriftExceptionInListBusinessUsersAsync(); void shouldExecuteListBusinessInvitations(); void shouldDeliverEDAMUserExceptionInListBusinessInvitations(); void shouldDeliverEDAMSystemExceptionInListBusinessInvitations(); void shouldDeliverThriftExceptionInListBusinessInvitations(); + void shouldExecuteListBusinessInvitationsAsync(); + void shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsync(); + void shouldDeliverEDAMSystemExceptionInListBusinessInvitationsAsync(); + void shouldDeliverThriftExceptionInListBusinessInvitationsAsync(); void shouldExecuteGetAccountLimits(); void shouldDeliverEDAMUserExceptionInGetAccountLimits(); void shouldDeliverThriftExceptionInGetAccountLimits(); + void shouldExecuteGetAccountLimitsAsync(); + void shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync(); + void shouldDeliverThriftExceptionInGetAccountLimitsAsync(); }; } // namespace qevercloud From 345d67f33603d49505ed14de95d07140f42bd27e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 1 Dec 2019 18:57:08 +0300 Subject: [PATCH 095/188] Update generated code --- QEverCloud/headers/generated/Services.h | 10 +- QEverCloud/src/generated/Services.cpp | 33 +- .../src/tests/generated/TestUserStore.cpp | 464 +++++------------- 3 files changed, 139 insertions(+), 368 deletions(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index da062700..62da6521 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -3303,15 +3303,13 @@ using IUserStorePtr = QSharedPointer; //////////////////////////////////////////////////////////////////////////////// -INoteStore * newNoteStore( - QString noteStoreUrl = QString(), +QEVERCLOUD_EXPORT INoteStore * newNoteStore( + QString noteStoreUrl = {}, IRequestContextPtr ctx = {}, QObject * parent = nullptr); -IUserStore * newUserStore( - QString host, - quint16 port, - QString urlScheme = QStringLiteral("https"), +QEVERCLOUD_EXPORT IUserStore * newUserStore( + QString userStoreUrl = {}, IRequestContextPtr ctx = {}, QObject * parent = nullptr); diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index af3ceec8..a6d03ca9 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -15989,24 +15989,32 @@ class Q_DECL_HIDDEN UserStore: public IUserStore Q_DISABLE_COPY(UserStore) public: explicit UserStore( - QString host, - quint16 port, - QString urlScheme, + QString userStoreUrl = {}, IRequestContextPtr ctx = {}, QObject * parent = nullptr) : IUserStore(parent), + m_url(std::move(userStoreUrl)), m_ctx(std::move(ctx)) { if (!m_ctx) { m_ctx = newRequestContext(); } + } + + explicit UserStore(QObject * parent) : + IUserStore(parent) + { + m_ctx = newRequestContext(); + } - QUrl url; - url.setScheme(urlScheme); - url.setHost(host); - url.setPort(static_cast(port)); - url.setPath(QStringLiteral("/edam/user")); - m_url = url.toString(QUrl::StripTrailingSlash); + void setUserStoreUrl(QString userStoreUrl) + { + m_url = std::move(userStoreUrl); + } + + QString userStoreUrl() + { + return m_url; } virtual bool checkVersion( @@ -19630,7 +19638,6 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore if (!m_ctx) { m_ctx = newRequestContext(); } - } virtual bool checkVersion( @@ -25752,13 +25759,11 @@ INoteStore * newNoteStore( } IUserStore * newUserStore( - QString host, - quint16 port, - QString urlScheme, + QString userStoreUrl, IRequestContextPtr ctx, QObject * parent) { - return new UserStore(host, port, urlScheme, ctx, parent); + return new UserStore(userStoreUrl, ctx, parent); } } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index b855b52b..24c45557 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -1242,9 +1242,7 @@ void UserStoreTester::shouldExecuteCheckVersion() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool res = userStore->checkVersion( clientName, edamVersionMajor, @@ -1331,9 +1329,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -1429,9 +1425,7 @@ void UserStoreTester::shouldExecuteCheckVersionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->checkVersionAsync( clientName, edamVersionMajor, @@ -1536,9 +1530,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -1648,9 +1640,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); BootstrapInfo res = userStore->getBootstrapInfo( locale, ctx); @@ -1729,9 +1719,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -1819,9 +1807,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->getBootstrapInfoAsync( locale, ctx); @@ -1918,9 +1904,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2046,9 +2030,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AuthenticationResult res = userStore->authenticateLongSession( username, password, @@ -2151,9 +2133,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2268,9 +2248,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2384,9 +2362,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2498,9 +2474,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->authenticateLongSessionAsync( username, password, @@ -2621,9 +2595,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsy }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2756,9 +2728,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionA }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -2890,9 +2860,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3014,9 +2982,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AuthenticationResult res = userStore->completeTwoFactorAuthentication( oneTimeCode, deviceIdentifier, @@ -3105,9 +3071,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3208,9 +3172,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3310,9 +3272,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3410,9 +3370,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( oneTimeCode, deviceIdentifier, @@ -3519,9 +3477,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3640,9 +3596,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3760,9 +3714,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -3869,9 +3821,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); userStore->revokeLongSession( ctx); } @@ -3947,9 +3897,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4037,9 +3985,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4126,9 +4072,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4211,9 +4155,7 @@ void UserStoreTester::shouldExecuteRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->revokeLongSessionAsync( ctx); @@ -4307,9 +4249,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4416,9 +4356,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4524,9 +4462,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4632,9 +4568,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AuthenticationResult res = userStore->authenticateToBusiness( ctx); QVERIFY(res == response); @@ -4711,9 +4645,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4802,9 +4734,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4892,9 +4822,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -4980,9 +4908,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->authenticateToBusinessAsync( ctx); @@ -5077,9 +5003,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsyn }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5186,9 +5110,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAs }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5294,9 +5216,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync( }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5402,9 +5322,7 @@ void UserStoreTester::shouldExecuteGetUser() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); User res = userStore->getUser( ctx); QVERIFY(res == response); @@ -5481,9 +5399,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5572,9 +5488,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5662,9 +5576,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5750,9 +5662,7 @@ void UserStoreTester::shouldExecuteGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->getUserAsync( ctx); @@ -5847,9 +5757,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -5956,9 +5864,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6064,9 +5970,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6173,9 +6077,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); PublicUserInfo res = userStore->getPublicUserInfo( username, ctx); @@ -6254,9 +6156,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6347,9 +6247,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6439,9 +6337,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6531,9 +6427,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6621,9 +6515,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->getPublicUserInfoAsync( username, ctx); @@ -6720,9 +6612,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6831,9 +6721,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -6941,9 +6829,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7051,9 +6937,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7160,9 +7044,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); UserUrls res = userStore->getUserUrls( ctx); QVERIFY(res == response); @@ -7239,9 +7121,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7330,9 +7210,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7420,9 +7298,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7508,9 +7384,7 @@ void UserStoreTester::shouldExecuteGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->getUserUrlsAsync( ctx); @@ -7605,9 +7479,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7714,9 +7586,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7822,9 +7692,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -7931,9 +7799,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); userStore->inviteToBusiness( emailAddress, ctx); @@ -8013,9 +7879,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8107,9 +7971,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8200,9 +8062,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8289,9 +8149,7 @@ void UserStoreTester::shouldExecuteInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->inviteToBusinessAsync( emailAddress, ctx); @@ -8389,9 +8247,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8502,9 +8358,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8614,9 +8468,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8724,9 +8576,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); userStore->removeFromBusiness( emailAddress, ctx); @@ -8806,9 +8656,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8900,9 +8748,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -8993,9 +8839,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9086,9 +8930,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9175,9 +9017,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->removeFromBusinessAsync( emailAddress, ctx); @@ -9275,9 +9115,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9388,9 +9226,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync( }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9500,9 +9336,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsyn }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9612,9 +9446,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9725,9 +9557,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); userStore->updateBusinessUserIdentifier( oldEmailAddress, newEmailAddress, @@ -9811,9 +9641,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -9909,9 +9737,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10006,9 +9832,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10103,9 +9927,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10196,9 +10018,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( oldEmailAddress, newEmailAddress, @@ -10300,9 +10120,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10417,9 +10235,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10533,9 +10349,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10649,9 +10463,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10762,9 +10574,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); QList res = userStore->listBusinessUsers( ctx); QVERIFY(res == response); @@ -10841,9 +10651,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -10932,9 +10740,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11022,9 +10828,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11113,9 +10917,7 @@ void UserStoreTester::shouldExecuteListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->listBusinessUsersAsync( ctx); @@ -11210,9 +11012,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11319,9 +11119,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11427,9 +11225,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11541,9 +11337,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); QList res = userStore->listBusinessInvitations( includeRequestedInvitations, ctx); @@ -11624,9 +11418,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11719,9 +11511,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11813,9 +11603,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -11908,9 +11696,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->listBusinessInvitationsAsync( includeRequestedInvitations, ctx); @@ -12009,9 +11795,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsy }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12122,9 +11906,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsA }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12234,9 +12016,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12344,9 +12124,7 @@ void UserStoreTester::shouldExecuteGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AccountLimits res = userStore->getAccountLimits( serviceLevel, ctx); @@ -12425,9 +12203,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12517,9 +12293,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12607,9 +12381,7 @@ void UserStoreTester::shouldExecuteGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); AsyncResult * result = userStore->getAccountLimitsAsync( serviceLevel, ctx); @@ -12706,9 +12478,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { @@ -12816,9 +12586,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("127.0.0.1"), - port, - QStringLiteral("http")); + QStringLiteral("http://127.0.0.1:") + QString::number(port)); bool caughtException = false; try { From 0379ab18d4572729e17bcdd3e23d5aa55ac3dad0 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 1 Dec 2019 20:39:31 +0300 Subject: [PATCH 096/188] Update generated code --- QEverCloud/headers/generated/Types.h | 442 ++++++++++++++++++++++++++- QEverCloud/src/generated/Types.cpp | 118 ++++++- 2 files changed, 548 insertions(+), 12 deletions(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 10ccb937..0cdf4a98 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -19,12 +19,14 @@ #include "Printable.h" #include #include +#include #include #include #include #include #include #include +#include namespace qevercloud { @@ -89,12 +91,71 @@ using MessageEventID = qint64; using MessageThreadID = qint64; +/** + * @brief The EverCloudLocalData struct contains several + * data elements which are not synchronized with Evernote service + * but which are nevertheless useful in applications using + * QEverCloud to implement feature rich full sync Evernote clients. + * Values of this struct's types are contained within QEverCloud + * types corresponding to actual Evernote API types + */ +struct QEVERCLOUD_EXPORT EverCloudLocalData: public Printable +{ + EverCloudLocalData(); + virtual ~EverCloudLocalData() noexcept override; + + virtual void print(QTextStream & strm) const override; + + /** + * @brief id property can be used as a local unique identifier + * for any data item before it has been synchronized with + * Evernote and thus before it can be identified using its guid. + * + * id property is generated automatically on EverCloudLocalData + * construction for convenience but can be overridden manually + */ + QString id; + + /** + * @brief dirty property can be used to keep track which + * objects have been modified locally and thus need to be synchronized + * with Evernote service + */ + bool dirty = false; + + /** + * @brief local property can be used to keep track which + * data items are meant to be local only and thus never be synchronized + * with Evernote service + */ + bool local = false; + + /** + * @brief favorited property can be used to keep track which + * data items were favorited in the client. Unfortunately, + * Evernote has never provided a way to synchronize such + * property between different clients + */ + bool favorited = false; + + /** + * @brief dict can be used for storage of any other auxiliary + * values associated with objects of QEverCloud types + */ + QHash dict; +}; + /** * This structure encapsulates the information about the state of the * user's account for the purpose of "state based" synchronization. * */ struct QEVERCLOUD_EXPORT SyncState: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The server's current date and time. */ @@ -182,6 +243,11 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable **/ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If true, then the server will include the SyncChunks.notes field */ @@ -319,6 +385,11 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable **/ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The NoteSortOrder value indicating what criterion should be used to sort the results of the filter. @@ -439,6 +510,11 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable */ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Optional includeTitle; /** NOT DOCUMENTED */ @@ -493,6 +569,11 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable **/ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** A mapping from the Notebook GUID to the number of notes (from some selection) that are in the corresponding notebook. @@ -539,6 +620,11 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable * */ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If true, the Note.content field will be populated with the note's ENML contents. */ @@ -604,6 +690,11 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable * */ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** 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 @@ -662,6 +753,11 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable * */ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The GUID of an existing note in your account for which related entities will be found. @@ -732,6 +828,11 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** Return notes that are related to the query, but no more than this many. Any value greater than EDAM_RELATED_MAX_NOTES @@ -815,6 +916,11 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Optional noSetReadOnly; /** NOT DOCUMENTED */ @@ -848,6 +954,11 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The string that clients should show to users to represent this member. @@ -917,6 +1028,11 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** This value is true if the user is not allowed to set the privilege level to SharedNotePrivilegeLevel.READ_NOTE. @@ -956,6 +1072,11 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The string that clients should show to users to represent this member. @@ -1012,6 +1133,11 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The string that clients should show to users to represent this invitation. @@ -1064,6 +1190,11 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** A list of open invitations that can be redeemed into memberships to the note. @@ -1106,6 +1237,11 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The GUID of the note whose shares are being managed. */ @@ -1164,6 +1300,11 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable **/ struct QEVERCLOUD_EXPORT Data: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** This field carries a one-way hash of the contents of the data body, in binary form. The hash function is MD5
    @@ -1206,6 +1347,11 @@ struct QEVERCLOUD_EXPORT Data: public Printable **/ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** the location string that should be associated with the user in order to determine where notes are taken if not otherwise @@ -1459,6 +1605,11 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** Free form text of this user's title in the business */ @@ -1515,6 +1666,11 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable **/ struct QEVERCLOUD_EXPORT Accounting: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The date and time when the current upload limit expires. At this time, the monthly upload count reverts to 0 and a new @@ -1667,6 +1823,11 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The ID of the Evernote Business account that the user is a member of.

    businessName @@ -1717,6 +1878,11 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable **/ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** 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 @@ -1801,6 +1967,11 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable **/ struct QEVERCLOUD_EXPORT User: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique numeric identifier for the account, which will not change for the lifetime of the account. @@ -1954,6 +2125,11 @@ struct QEVERCLOUD_EXPORT User: public Printable * */ struct QEVERCLOUD_EXPORT Contact: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The displayable name of this contact. This field is filled in by the service and is read-only to clients. @@ -2021,6 +2197,11 @@ struct QEVERCLOUD_EXPORT Contact: public Printable * */ struct QEVERCLOUD_EXPORT Identity: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier for this mapping. */ @@ -2100,6 +2281,11 @@ struct QEVERCLOUD_EXPORT Identity: public Printable **/ struct QEVERCLOUD_EXPORT Tag: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of this tag. Will be set by the service, so may be omitted by the client when creating the Tag. @@ -2180,6 +2366,11 @@ struct QEVERCLOUD_EXPORT Tag: public Printable * */ struct QEVERCLOUD_EXPORT LazyMap: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The set of keys for the map. This field is ignored by the server when set. @@ -2210,6 +2401,11 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable * */ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** the original location where the resource was hosted
    @@ -2318,6 +2514,11 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable * */ struct QEVERCLOUD_EXPORT Resource: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of this resource. Will be set whenever a resource is retrieved from the service, but may be null when a client @@ -2425,6 +2626,11 @@ struct QEVERCLOUD_EXPORT Resource: public Printable * */ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** time that the note refers to */ @@ -2675,6 +2881,11 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable * */ struct QEVERCLOUD_EXPORT SharedNote: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The user ID of the user who shared the note with the recipient. */ @@ -2761,6 +2972,11 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable * */ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The client may not update the note's title (Note.title). */ @@ -2809,6 +3025,11 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable */ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Optional noteResourceCountMax; /** NOT DOCUMENTED */ @@ -2844,6 +3065,11 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable * */ struct QEVERCLOUD_EXPORT Note: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of this note. Will be set by the server, but will be omitted by clients calling NoteStore.createNote() @@ -3025,6 +3251,11 @@ struct QEVERCLOUD_EXPORT Note: public Printable * */ struct QEVERCLOUD_EXPORT Publishing: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If this field is present, then the notebook is published for mass consumption on the Internet under the provided URI, which is @@ -3086,6 +3317,11 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable * */ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** A short description of the notebook's content that will be displayed in the business library user interface. The description may not begin @@ -3130,6 +3366,11 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The search should include notes from the account that contains the SavedSearch. */ @@ -3167,6 +3408,11 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of this search. Will be set by the service, so may be omitted by the client when creating. @@ -3254,6 +3500,11 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** Indicates that the user wishes to receive daily e-mail notifications for reminders associated with the notebook. This may be true only for @@ -3296,6 +3547,11 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** Indicates that the user wishes to receive daily e-mail notifications for reminders associated with the notebook. This may be @@ -3354,6 +3610,11 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The primary identifier of the share, which is not globally unique. */ @@ -3489,6 +3750,11 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Optional canMoveToContainer; @@ -3534,6 +3800,11 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The client is not able to read notes from the service and the notebook is write-only. @@ -3711,6 +3982,11 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT Notebook: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of this notebook.
    @@ -3866,6 +4142,11 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable * */ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The display name of the shared notebook. The link owner can change this. */ @@ -3971,6 +4252,11 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable * */ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique identifier of the notebook. */ @@ -4018,6 +4304,11 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable * */ struct QEVERCLOUD_EXPORT UserProfile: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The numeric identifier that uniquely identifies a user. */ @@ -4091,6 +4382,11 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The external URL of the image */ @@ -4137,6 +4433,11 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** An identifier that uniquely identifies the content. */ @@ -4244,6 +4545,11 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable * */ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The ID of the business to which the invitation grants access. */ @@ -4332,6 +4638,11 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable */ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Optional type; /** NOT DOCUMENTED */ @@ -4361,6 +4672,11 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable **/ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique numeric user identifier for the user account. */ @@ -4411,6 +4727,11 @@ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable * */ struct QEVERCLOUD_EXPORT UserUrls: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** 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. @@ -4480,6 +4801,11 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable **/ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The server-side date and time when this result was generated. @@ -4567,6 +4893,11 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The hostname and optional port for composing Evernote web service URLs. This URL can be used to access the UserStore and related services, @@ -4663,6 +4994,11 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The unique name of the profile, which is guaranteed to remain consistent across calls to getBootstrapInfo. @@ -4693,6 +5029,11 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** List of one or more bootstrap profiles, in descending preference order. @@ -4738,10 +5079,10 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin Optional parameter; EDAMUserException(); - virtual ~EDAMUserException() throw() override; + virtual ~EDAMUserException() noexcept override; EDAMUserException(const EDAMUserException & other); - const char * what() const throw() override; + const char * what() const noexcept override; virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4781,10 +5122,10 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr Optional rateLimitDuration; EDAMSystemException(); - virtual ~EDAMSystemException() throw() override; + virtual ~EDAMSystemException() noexcept override; EDAMSystemException(const EDAMSystemException & other); - const char * what() const throw() override; + const char * what() const noexcept override; virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4823,10 +5164,10 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public Optional key; EDAMNotFoundException(); - virtual ~EDAMNotFoundException() throw() override; + virtual ~EDAMNotFoundException() noexcept override; EDAMNotFoundException(const EDAMNotFoundException & other); - const char * what() const throw() override; + const char * what() const noexcept override; virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4874,10 +5215,10 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, Optional> reasons; EDAMInvalidContactsException(); - virtual ~EDAMInvalidContactsException() throw() override; + virtual ~EDAMInvalidContactsException() noexcept override; EDAMInvalidContactsException(const EDAMInvalidContactsException & other); - const char * what() const throw() override; + const char * what() const noexcept override; virtual QSharedPointer exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -4909,6 +5250,11 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, **/ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The server's current date and time. */ @@ -5023,6 +5369,11 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable **/ struct QEVERCLOUD_EXPORT NoteList: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set. @@ -5105,6 +5456,11 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable * */ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** NOT DOCUMENTED */ Guid guid; /** NOT DOCUMENTED */ @@ -5171,6 +5527,11 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable **/ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The starting index within the overall set of notes. This is also the number of notes that are "before" this list in the set. @@ -5250,6 +5611,11 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable * */ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** 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, @@ -5316,6 +5682,11 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If notes have been requested to be included, this will be the list of notes. @@ -5424,6 +5795,11 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable * */ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** 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. @@ -5460,6 +5836,11 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable * */ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The string that clients should show to users to represent this invitation. @@ -5515,6 +5896,11 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** A list of open invitations that can be redeemed into memberships to the notebook. @@ -5559,6 +5945,11 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The GUID of the notebook whose shares are being managed. */ @@ -5636,6 +6027,11 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The identity of the share relationship whose update encountered an error. @@ -5676,6 +6072,11 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If the method completed without throwing exceptions, some errors might still have occurred, and in that case, this field will contain @@ -5703,6 +6104,11 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The GUID of the note. */ @@ -5750,6 +6156,11 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable * */ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The GUID of the notebook. */ @@ -5797,6 +6208,11 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable * */ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The USN of the notebook after the call. */ @@ -5837,6 +6253,11 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** The identity ID of an outstanding invitation that was not updated due to the error. @@ -5884,6 +6305,11 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { + /** + * See the declaration of EverCloudLocalData for details + */ + EverCloudLocalData localData; + /** If the call succeeded without throwing an exception, some errors might still have occurred. In that case, this field will contain the diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index ef132314..f8a5543c 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -14,6 +14,8 @@ #include "../Impl.h" #include "Types_io.h" #include +#include +#include namespace qevercloud { @@ -381,6 +383,40 @@ void readEnumUserIdentityType( } } +EverCloudLocalData::EverCloudLocalData() +{ + id = QUuid::createUuid().toString(); + // Remove curvy braces + id.remove(id.size() - 1, 1); + id.remove(0, 1); +} + +EverCloudLocalData::~EverCloudLocalData() noexcept +{} + +void EverCloudLocalData::print(QTextStream & strm) const +{ + strm << " localData.id = " << id << "\n" + << " localData.dirty = " << (dirty ? "true" : "false") << "\n" + << " localData.local = " << (local ? "true" : "false") << "\n" + << " localData.favorited = " << (favorited ? "true" : "false") << "\n"; + + if (!dict.isEmpty()) + { + strm << " localData.dict:" << "\n"; + QString valueStr; + for(const auto & it: toRange(dict)) { + strm << " [" << it.key() << "] = "; + valueStr.resize(0); + QDebug dbg(&valueStr); + dbg.noquote(); + dbg.nospace(); + dbg << it.value(); + strm << valueStr << "\n"; + } + } +} + void writeSyncState( ThriftBinaryBufferWriter & writer, const SyncState & s) @@ -530,6 +566,7 @@ void readSyncState( void SyncState::print(QTextStream & strm) const { strm << "SyncState: {\n"; + localData.print(strm); strm << " currentTime = " << currentTime << "\n"; strm << " fullSyncBefore = " @@ -1075,6 +1112,7 @@ void readSyncChunk( void SyncChunk::print(QTextStream & strm) const { strm << "SyncChunk: {\n"; + localData.print(strm); strm << " currentTime = " << currentTime << "\n"; @@ -1581,6 +1619,7 @@ void readSyncChunkFilter( void SyncChunkFilter::print(QTextStream & strm) const { strm << "SyncChunkFilter: {\n"; + localData.print(strm); if (includeNotes.isSet()) { strm << " includeNotes = " @@ -2017,6 +2056,7 @@ void readNoteFilter( void NoteFilter::print(QTextStream & strm) const { strm << "NoteFilter: {\n"; + localData.print(strm); if (order.isSet()) { strm << " order = " @@ -2375,6 +2415,7 @@ void readNoteList( void NoteList::print(QTextStream & strm) const { strm << "NoteList: {\n"; + localData.print(strm); strm << " startIndex = " << startIndex << "\n"; strm << " totalNotes = " @@ -2719,6 +2760,7 @@ void readNoteMetadata( void NoteMetadata::print(QTextStream & strm) const { strm << "NoteMetadata: {\n"; + localData.print(strm); strm << " guid = " << guid << "\n"; @@ -3063,6 +3105,7 @@ void readNotesMetadataList( void NotesMetadataList::print(QTextStream & strm) const { strm << "NotesMetadataList: {\n"; + localData.print(strm); strm << " startIndex = " << startIndex << "\n"; strm << " totalNotes = " @@ -3368,6 +3411,7 @@ void readNotesMetadataResultSpec( void NotesMetadataResultSpec::print(QTextStream & strm) const { strm << "NotesMetadataResultSpec: {\n"; + localData.print(strm); if (includeTitle.isSet()) { strm << " includeTitle = " @@ -3589,6 +3633,7 @@ void readNoteCollectionCounts( void NoteCollectionCounts::print(QTextStream & strm) const { strm << "NoteCollectionCounts: {\n"; + localData.print(strm); if (notebookCounts.isSet()) { strm << " notebookCounts = " @@ -3811,6 +3856,7 @@ void readNoteResultSpec( void NoteResultSpec::print(QTextStream & strm) const { strm << "NoteResultSpec: {\n"; + localData.print(strm); if (includeContent.isSet()) { strm << " includeContent = " @@ -4065,6 +4111,7 @@ void readNoteEmailParameters( void NoteEmailParameters::print(QTextStream & strm) const { strm << "NoteEmailParameters: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -4258,6 +4305,7 @@ void readNoteVersionId( void NoteVersionId::print(QTextStream & strm) const { strm << "NoteVersionId: {\n"; + localData.print(strm); strm << " updateSequenceNum = " << updateSequenceNum << "\n"; strm << " updated = " @@ -4426,6 +4474,7 @@ void readRelatedQuery( void RelatedQuery::print(QTextStream & strm) const { strm << "RelatedQuery: {\n"; + localData.print(strm); if (noteGuid.isSet()) { strm << " noteGuid = " @@ -4797,6 +4846,7 @@ void readRelatedResult( void RelatedResult::print(QTextStream & strm) const { strm << "RelatedResult: {\n"; + localData.print(strm); if (notes.isSet()) { strm << " notes = " @@ -5121,6 +5171,7 @@ void readRelatedResultSpec( void RelatedResultSpec::print(QTextStream & strm) const { strm << "RelatedResultSpec: {\n"; + localData.print(strm); if (maxNotes.isSet()) { strm << " maxNotes = " @@ -5273,6 +5324,7 @@ void readUpdateNoteIfUsnMatchesResult( void UpdateNoteIfUsnMatchesResult::print(QTextStream & strm) const { strm << "UpdateNoteIfUsnMatchesResult: {\n"; + localData.print(strm); if (note.isSet()) { strm << " note = " @@ -5403,6 +5455,7 @@ void readShareRelationshipRestrictions( void ShareRelationshipRestrictions::print(QTextStream & strm) const { strm << "ShareRelationshipRestrictions: {\n"; + localData.print(strm); if (noSetReadOnly.isSet()) { strm << " noSetReadOnly = " @@ -5549,6 +5602,7 @@ void readInvitationShareRelationship( void InvitationShareRelationship::print(QTextStream & strm) const { strm << "InvitationShareRelationship: {\n"; + localData.print(strm); if (displayName.isSet()) { strm << " displayName = " @@ -5733,6 +5787,7 @@ void readMemberShareRelationship( void MemberShareRelationship::print(QTextStream & strm) const { strm << "MemberShareRelationship: {\n"; + localData.print(strm); if (displayName.isSet()) { strm << " displayName = " @@ -5914,6 +5969,7 @@ void readShareRelationships( void ShareRelationships::print(QTextStream & strm) const { strm << "ShareRelationships: {\n"; + localData.print(strm); if (invitations.isSet()) { strm << " invitations = " @@ -6136,6 +6192,7 @@ void readManageNotebookSharesParameters( void ManageNotebookSharesParameters::print(QTextStream & strm) const { strm << "ManageNotebookSharesParameters: {\n"; + localData.print(strm); if (notebookGuid.isSet()) { strm << " notebookGuid = " @@ -6283,6 +6340,7 @@ void readManageNotebookSharesError( void ManageNotebookSharesError::print(QTextStream & strm) const { strm << "ManageNotebookSharesError: {\n"; + localData.print(strm); if (userIdentity.isSet()) { strm << " userIdentity = " @@ -6383,6 +6441,7 @@ void readManageNotebookSharesResult( void ManageNotebookSharesResult::print(QTextStream & strm) const { strm << "ManageNotebookSharesResult: {\n"; + localData.print(strm); if (errors.isSet()) { strm << " errors = " @@ -6528,6 +6587,7 @@ void readSharedNoteTemplate( void SharedNoteTemplate::print(QTextStream & strm) const { strm << "SharedNoteTemplate: {\n"; + localData.print(strm); if (noteGuid.isSet()) { strm << " noteGuid = " @@ -6697,6 +6757,7 @@ void readNotebookShareTemplate( void NotebookShareTemplate::print(QTextStream & strm) const { strm << "NotebookShareTemplate: {\n"; + localData.print(strm); if (notebookGuid.isSet()) { strm << " notebookGuid = " @@ -6828,6 +6889,7 @@ void readCreateOrUpdateNotebookSharesResult( void CreateOrUpdateNotebookSharesResult::print(QTextStream & strm) const { strm << "CreateOrUpdateNotebookSharesResult: {\n"; + localData.print(strm); if (updateSequenceNum.isSet()) { strm << " updateSequenceNum = " @@ -6943,6 +7005,7 @@ void readNoteShareRelationshipRestrictions( void NoteShareRelationshipRestrictions::print(QTextStream & strm) const { strm << "NoteShareRelationshipRestrictions: {\n"; + localData.print(strm); if (noSetReadNote.isSet()) { strm << " noSetReadNote = " @@ -7100,6 +7163,7 @@ void readNoteMemberShareRelationship( void NoteMemberShareRelationship::print(QTextStream & strm) const { strm << "NoteMemberShareRelationship: {\n"; + localData.print(strm); if (displayName.isSet()) { strm << " displayName = " @@ -7254,6 +7318,7 @@ void readNoteInvitationShareRelationship( void NoteInvitationShareRelationship::print(QTextStream & strm) const { strm << "NoteInvitationShareRelationship: {\n"; + localData.print(strm); if (displayName.isSet()) { strm << " displayName = " @@ -7419,6 +7484,7 @@ void readNoteShareRelationships( void NoteShareRelationships::print(QTextStream & strm) const { strm << "NoteShareRelationships: {\n"; + localData.print(strm); if (invitations.isSet()) { strm << " invitations = " @@ -7660,6 +7726,7 @@ void readManageNoteSharesParameters( void ManageNoteSharesParameters::print(QTextStream & strm) const { strm << "ManageNoteSharesParameters: {\n"; + localData.print(strm); if (noteGuid.isSet()) { strm << " noteGuid = " @@ -7830,6 +7897,7 @@ void readManageNoteSharesError( void ManageNoteSharesError::print(QTextStream & strm) const { strm << "ManageNoteSharesError: {\n"; + localData.print(strm); if (identityID.isSet()) { strm << " identityID = " @@ -7938,6 +8006,7 @@ void readManageNoteSharesResult( void ManageNoteSharesResult::print(QTextStream & strm) const { strm << "ManageNoteSharesResult: {\n"; + localData.print(strm); if (errors.isSet()) { strm << " errors = " @@ -8045,6 +8114,7 @@ void readData( void Data::print(QTextStream & strm) const { strm << "Data: {\n"; + localData.print(strm); if (bodyHash.isSet()) { strm << " bodyHash = " @@ -8810,6 +8880,7 @@ void readUserAttributes( void UserAttributes::print(QTextStream & strm) const { strm << "UserAttributes: {\n"; + localData.print(strm); if (defaultLocationName.isSet()) { strm << " defaultLocationName = " @@ -9269,6 +9340,7 @@ void readBusinessUserAttributes( void BusinessUserAttributes::print(QTextStream & strm) const { strm << "BusinessUserAttributes: {\n"; + localData.print(strm); if (title.isSet()) { strm << " title = " @@ -9800,6 +9872,7 @@ void readAccounting( void Accounting::print(QTextStream & strm) const { strm << "Accounting: {\n"; + localData.print(strm); if (uploadLimitEnd.isSet()) { strm << " uploadLimitEnd = " @@ -10117,6 +10190,7 @@ void readBusinessUserInfo( void BusinessUserInfo::print(QTextStream & strm) const { strm << "BusinessUserInfo: {\n"; + localData.print(strm); if (businessId.isSet()) { strm << " businessId = " @@ -10404,6 +10478,7 @@ void readAccountLimits( void AccountLimits::print(QTextStream & strm) const { strm << "AccountLimits: {\n"; + localData.print(strm); if (userMailLimitDaily.isSet()) { strm << " userMailLimitDaily = " @@ -10872,6 +10947,7 @@ void readUser( void User::print(QTextStream & strm) const { strm << "User: {\n"; + localData.print(strm); if (id.isSet()) { strm << " id = " @@ -11187,6 +11263,7 @@ void readContact( void Contact::print(QTextStream & strm) const { strm << "Contact: {\n"; + localData.print(strm); if (name.isSet()) { strm << " name = " @@ -11434,6 +11511,7 @@ void readIdentity( void Identity::print(QTextStream & strm) const { strm << "Identity: {\n"; + localData.print(strm); strm << " id = " << id << "\n"; @@ -11606,6 +11684,7 @@ void readTag( void Tag::print(QTextStream & strm) const { strm << "Tag: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -11752,6 +11831,7 @@ void readLazyMap( void LazyMap::print(QTextStream & strm) const { strm << "LazyMap: {\n"; + localData.print(strm); if (keysOnly.isSet()) { strm << " keysOnly = " @@ -12042,6 +12122,7 @@ void readResourceAttributes( void ResourceAttributes::print(QTextStream & strm) const { strm << "ResourceAttributes: {\n"; + localData.print(strm); if (sourceURL.isSet()) { strm << " sourceURL = " @@ -12404,6 +12485,7 @@ void readResource( void Resource::print(QTextStream & strm) const { strm << "Resource: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -12975,6 +13057,7 @@ void readNoteAttributes( void NoteAttributes::print(QTextStream & strm) const { strm << "NoteAttributes: {\n"; + localData.print(strm); if (subjectDate.isSet()) { strm << " subjectDate = " @@ -13307,6 +13390,7 @@ void readSharedNote( void SharedNote::print(QTextStream & strm) const { strm << "SharedNote: {\n"; + localData.print(strm); if (sharerUserID.isSet()) { strm << " sharerUserID = " @@ -13488,6 +13572,7 @@ void readNoteRestrictions( void NoteRestrictions::print(QTextStream & strm) const { strm << "NoteRestrictions: {\n"; + localData.print(strm); if (noUpdateTitle.isSet()) { strm << " noUpdateTitle = " @@ -13661,6 +13746,7 @@ void readNoteLimits( void NoteLimits::print(QTextStream & strm) const { strm << "NoteLimits: {\n"; + localData.print(strm); if (noteResourceCountMax.isSet()) { strm << " noteResourceCountMax = " @@ -14157,6 +14243,7 @@ void readNote( void Note::print(QTextStream & strm) const { strm << "Note: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -14431,6 +14518,7 @@ void readPublishing( void Publishing::print(QTextStream & strm) const { strm << "Publishing: {\n"; + localData.print(strm); if (uri.isSet()) { strm << " uri = " @@ -14558,6 +14646,7 @@ void readBusinessNotebook( void BusinessNotebook::print(QTextStream & strm) const { strm << "BusinessNotebook: {\n"; + localData.print(strm); if (notebookDescription.isSet()) { strm << " notebookDescription = " @@ -14677,6 +14766,7 @@ void readSavedSearchScope( void SavedSearchScope::print(QTextStream & strm) const { strm << "SavedSearchScope: {\n"; + localData.print(strm); if (includeAccount.isSet()) { strm << " includeAccount = " @@ -14853,6 +14943,7 @@ void readSavedSearch( void SavedSearch::print(QTextStream & strm) const { strm << "SavedSearch: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -14977,6 +15068,7 @@ void readSharedNotebookRecipientSettings( void SharedNotebookRecipientSettings::print(QTextStream & strm) const { strm << "SharedNotebookRecipientSettings: {\n"; + localData.print(strm); if (reminderNotifyEmail.isSet()) { strm << " reminderNotifyEmail = " @@ -15126,6 +15218,7 @@ void readNotebookRecipientSettings( void NotebookRecipientSettings::print(QTextStream & strm) const { strm << "NotebookRecipientSettings: {\n"; + localData.print(strm); if (reminderNotifyEmail.isSet()) { strm << " reminderNotifyEmail = " @@ -15508,6 +15601,7 @@ void readSharedNotebook( void SharedNotebook::print(QTextStream & strm) const { strm << "SharedNotebook: {\n"; + localData.print(strm); if (id.isSet()) { strm << " id = " @@ -15693,6 +15787,7 @@ void readCanMoveToContainerRestrictions( void CanMoveToContainerRestrictions::print(QTextStream & strm) const { strm << "CanMoveToContainerRestrictions: {\n"; + localData.print(strm); if (canMoveToContainer.isSet()) { strm << " canMoveToContainer = " @@ -16290,6 +16385,7 @@ void readNotebookRestrictions( void NotebookRestrictions::print(QTextStream & strm) const { strm << "NotebookRestrictions: {\n"; + localData.print(strm); if (noReadNotes.isSet()) { strm << " noReadNotes = " @@ -16883,6 +16979,7 @@ void readNotebook( void Notebook::print(QTextStream & strm) const { strm << "Notebook: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -17258,6 +17355,7 @@ void readLinkedNotebook( void LinkedNotebook::print(QTextStream & strm) const { strm << "LinkedNotebook: {\n"; + localData.print(strm); if (shareName.isSet()) { strm << " shareName = " @@ -17479,6 +17577,7 @@ void readNotebookDescriptor( void NotebookDescriptor::print(QTextStream & strm) const { strm << "NotebookDescriptor: {\n"; + localData.print(strm); if (guid.isSet()) { strm << " guid = " @@ -17747,6 +17846,7 @@ void readUserProfile( void UserProfile::print(QTextStream & strm) const { strm << "UserProfile: {\n"; + localData.print(strm); if (id.isSet()) { strm << " id = " @@ -17960,6 +18060,7 @@ void readRelatedContentImage( void RelatedContentImage::print(QTextStream & strm) const { strm << "RelatedContentImage: {\n"; + localData.print(strm); if (url.isSet()) { strm << " url = " @@ -18380,6 +18481,7 @@ void readRelatedContent( void RelatedContent::print(QTextStream & strm) const { strm << "RelatedContent: {\n"; + localData.print(strm); if (contentId.isSet()) { strm << " contentId = " @@ -18706,6 +18808,7 @@ void readBusinessInvitation( void BusinessInvitation::print(QTextStream & strm) const { strm << "BusinessInvitation: {\n"; + localData.print(strm); if (businessId.isSet()) { strm << " businessId = " @@ -18865,6 +18968,7 @@ void readUserIdentity( void UserIdentity::print(QTextStream & strm) const { strm << "UserIdentity: {\n"; + localData.print(strm); if (type.isSet()) { strm << " type = " @@ -19023,6 +19127,7 @@ void readPublicUserInfo( void PublicUserInfo::print(QTextStream & strm) const { strm << "PublicUserInfo: {\n"; + localData.print(strm); strm << " userId = " << userId << "\n"; @@ -19209,6 +19314,7 @@ void readUserUrls( void UserUrls::print(QTextStream & strm) const { strm << "UserUrls: {\n"; + localData.print(strm); if (noteStoreUrl.isSet()) { strm << " noteStoreUrl = " @@ -19488,6 +19594,7 @@ void readAuthenticationResult( void AuthenticationResult::print(QTextStream & strm) const { strm << "AuthenticationResult: {\n"; + localData.print(strm); strm << " currentTime = " << currentTime << "\n"; strm << " authenticationToken = " @@ -19858,6 +19965,7 @@ void readBootstrapSettings( void BootstrapSettings::print(QTextStream & strm) const { strm << "BootstrapSettings: {\n"; + localData.print(strm); strm << " serviceHost = " << serviceHost << "\n"; strm << " marketingUrl = " @@ -20024,6 +20132,7 @@ void readBootstrapProfile( void BootstrapProfile::print(QTextStream & strm) const { strm << "BootstrapProfile: {\n"; + localData.print(strm); strm << " name = " << name << "\n"; strm << " settings = " @@ -20104,6 +20213,7 @@ void readBootstrapInfo( void BootstrapInfo::print(QTextStream & strm) const { strm << "BootstrapInfo: {\n"; + localData.print(strm); strm << " profiles = " << "QList {"; for(const auto & v: profiles) { @@ -20116,7 +20226,7 @@ void BootstrapInfo::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// EDAMUserException::EDAMUserException() {} -EDAMUserException::~EDAMUserException() throw() {} +EDAMUserException::~EDAMUserException() noexcept {} EDAMUserException::EDAMUserException(const EDAMUserException& other) : EvernoteException(other) { errorCode = other.errorCode; @@ -20210,7 +20320,7 @@ void EDAMUserException::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// EDAMSystemException::EDAMSystemException() {} -EDAMSystemException::~EDAMSystemException() throw() {} +EDAMSystemException::~EDAMSystemException() noexcept {} EDAMSystemException::EDAMSystemException(const EDAMSystemException& other) : EvernoteException(other) { errorCode = other.errorCode; @@ -20332,7 +20442,7 @@ void EDAMSystemException::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// EDAMNotFoundException::EDAMNotFoundException() {} -EDAMNotFoundException::~EDAMNotFoundException() throw() {} +EDAMNotFoundException::~EDAMNotFoundException() noexcept {} EDAMNotFoundException::EDAMNotFoundException(const EDAMNotFoundException& other) : EvernoteException(other) { identifier = other.identifier; @@ -20431,7 +20541,7 @@ void EDAMNotFoundException::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// EDAMInvalidContactsException::EDAMInvalidContactsException() {} -EDAMInvalidContactsException::~EDAMInvalidContactsException() throw() {} +EDAMInvalidContactsException::~EDAMInvalidContactsException() noexcept {} EDAMInvalidContactsException::EDAMInvalidContactsException(const EDAMInvalidContactsException& other) : EvernoteException(other) { contacts = other.contacts; From 2f30392272b0298db0b1c21d21aa820c31ec8352 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 2 Dec 2019 07:51:33 +0300 Subject: [PATCH 097/188] d1vanov/QEverCloud#23: Add equality operators to Optional Unfortunately, it can break existing code although it should not break very much of it. The change is required for the introduction of Qt meta-object system based reflection --- QEverCloud/headers/Optional.h | 35 +++++++++++++++++++++------ QEverCloud/src/tests/TestOptional.cpp | 10 ++++---- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/QEverCloud/headers/Optional.h b/QEverCloud/headers/Optional.h index 8d6f0223..f0ca4976 100644 --- a/QEverCloud/headers/Optional.h +++ b/QEverCloud/headers/Optional.h @@ -341,19 +341,40 @@ class Optional /** * Two optionals are equal if they are both not set or have * equal values. - * - * I do not define `operator==` due to not easily resolvable conflicts with - * `operator T&`. - * - * Note that `optional == other_optional` may throw but - * `optional.isEqual(other_optional)` will not. */ bool isEqual(const Optional & other) const { - if(m_isSet != other.m_isSet) return false; + if (m_isSet != other.m_isSet) { + return false; + } + return !m_isSet || (m_value == other.m_value); } + bool operator==(const Optional & other) const + { + return isEqual(other); + } + + bool operator!=(const Optional & other) const + { + return !operator==(other); + } + + bool operator==(const T & other) const + { + if (!m_isSet) { + return false; + } + + return m_value == other; + } + + bool operator!=(const T & other) const + { + return !operator==(other); + } + template friend class Optional; friend void swap(Optional & first, Optional & second) diff --git a/QEverCloud/src/tests/TestOptional.cpp b/QEverCloud/src/tests/TestOptional.cpp index 8c1c16f4..5e016be6 100644 --- a/QEverCloud/src/tests/TestOptional.cpp +++ b/QEverCloud/src/tests/TestOptional.cpp @@ -77,9 +77,9 @@ void OptionalTester::shouldAssignFromOtherOptionals() QVERIFY(y == 10); Optional d; d = y; - QVERIFY(d == 10); + QVERIFY(d == 10.0); d = ' '; - QVERIFY(d == 32); + QVERIFY(d == 32.0); } void OptionalTester::shouldProcessEqualityChecks() @@ -88,9 +88,9 @@ void OptionalTester::shouldProcessEqualityChecks() Optional d = 32; Optional d2(y), d3(' '), d4(d); - QVERIFY(d2 == 10); - QVERIFY(d3 == 32); - QVERIFY(d4 == d); + QVERIFY(d2 == 10.0); + QVERIFY(d3 == 32.0); + QVERIFY(d4.ref() == d.ref()); Optional oi; Optional od; From 3abe3eb08091105395d020a71cf2b7e3b62e30e8 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 2 Dec 2019 08:04:54 +0300 Subject: [PATCH 098/188] d1vanov/QEverCloud#23: update generated code --- QEverCloud/headers/generated/Types.h | 986 ++++++++++++++++++++++++++- QEverCloud/src/generated/Types.cpp | 14 + 2 files changed, 997 insertions(+), 3 deletions(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 0cdf4a98..ab89d5f1 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -92,20 +92,24 @@ using MessageThreadID = qint64; /** - * @brief The EverCloudLocalData struct contains several + * @brief The EverCloudLocalData class contains several * data elements which are not synchronized with Evernote service * but which are nevertheless useful in applications using * QEverCloud to implement feature rich full sync Evernote clients. - * Values of this struct's types are contained within QEverCloud + * Values of this class' types are contained within QEverCloud * types corresponding to actual Evernote API types */ -struct QEVERCLOUD_EXPORT EverCloudLocalData: public Printable +class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable { + Q_GADGET +public: EverCloudLocalData(); virtual ~EverCloudLocalData() noexcept override; virtual void print(QTextStream & strm) const override; + bool operator==(const EverCloudLocalData & other) const; + bool operator!=(const EverCloudLocalData & other) const; /** * @brief id property can be used as a local unique identifier * for any data item before it has been synchronized with @@ -143,6 +147,13 @@ struct QEVERCLOUD_EXPORT EverCloudLocalData: public Printable * values associated with objects of QEverCloud types */ QHash dict; + + // Properties declaration for meta-object system + Q_PROPERTY(QString id MEMBER id USER true) + Q_PROPERTY(bool dirty MEMBER dirty) + Q_PROPERTY(bool local MEMBER local) + Q_PROPERTY(bool favorited MEMBER favorited) + Q_PROPERTY(QHash dict MEMBER dict) }; /** @@ -151,6 +162,9 @@ struct QEVERCLOUD_EXPORT EverCloudLocalData: public Printable * */ struct QEVERCLOUD_EXPORT SyncState: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -232,6 +246,14 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(Timestamp fullSyncBefore MEMBER fullSyncBefore) + Q_PROPERTY(qint32 updateCount MEMBER updateCount) + Q_PROPERTY(Optional uploaded MEMBER uploaded) + Q_PROPERTY(Optional userLastUpdated MEMBER userLastUpdated) + Q_PROPERTY(Optional userMaxMessageEventId MEMBER userMaxMessageEventId) }; /** @@ -243,6 +265,9 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable **/ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -375,6 +400,24 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeNotes MEMBER includeNotes) + Q_PROPERTY(Optional includeNoteResources MEMBER includeNoteResources) + Q_PROPERTY(Optional includeNoteAttributes MEMBER includeNoteAttributes) + Q_PROPERTY(Optional includeNotebooks MEMBER includeNotebooks) + Q_PROPERTY(Optional includeTags MEMBER includeTags) + Q_PROPERTY(Optional includeSearches MEMBER includeSearches) + Q_PROPERTY(Optional includeResources MEMBER includeResources) + Q_PROPERTY(Optional includeLinkedNotebooks MEMBER includeLinkedNotebooks) + Q_PROPERTY(Optional includeExpunged MEMBER includeExpunged) + Q_PROPERTY(Optional includeNoteApplicationDataFullMap MEMBER includeNoteApplicationDataFullMap) + Q_PROPERTY(Optional includeResourceApplicationDataFullMap MEMBER includeResourceApplicationDataFullMap) + Q_PROPERTY(Optional includeNoteResourceApplicationDataFullMap MEMBER includeNoteResourceApplicationDataFullMap) + Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) + Q_PROPERTY(Optional omitSharedNotebooks MEMBER omitSharedNotebooks) + Q_PROPERTY(Optional requireNoteContentClass MEMBER requireNoteContentClass) + Q_PROPERTY(Optional> notebookGuids MEMBER notebookGuids) }; /** @@ -385,6 +428,9 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable **/ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -493,6 +539,21 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional order MEMBER order) + Q_PROPERTY(Optional ascending MEMBER ascending) + Q_PROPERTY(Optional words MEMBER words) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional timeZone MEMBER timeZone) + Q_PROPERTY(Optional inactive MEMBER inactive) + Q_PROPERTY(Optional emphasized MEMBER emphasized) + Q_PROPERTY(Optional includeAllReadableNotebooks MEMBER includeAllReadableNotebooks) + Q_PROPERTY(Optional includeAllReadableWorkspaces MEMBER includeAllReadableWorkspaces) + Q_PROPERTY(Optional context MEMBER context) + Q_PROPERTY(Optional rawWords MEMBER rawWords) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) }; /** @@ -510,6 +571,9 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable */ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -560,6 +624,19 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeTitle MEMBER includeTitle) + Q_PROPERTY(Optional includeContentLength MEMBER includeContentLength) + Q_PROPERTY(Optional includeCreated MEMBER includeCreated) + Q_PROPERTY(Optional includeUpdated MEMBER includeUpdated) + Q_PROPERTY(Optional includeDeleted MEMBER includeDeleted) + Q_PROPERTY(Optional includeUpdateSequenceNum MEMBER includeUpdateSequenceNum) + Q_PROPERTY(Optional includeNotebookGuid MEMBER includeNotebookGuid) + Q_PROPERTY(Optional includeTagGuids MEMBER includeTagGuids) + Q_PROPERTY(Optional includeAttributes MEMBER includeAttributes) + Q_PROPERTY(Optional includeLargestResourceMime MEMBER includeLargestResourceMime) + Q_PROPERTY(Optional includeLargestResourceSize MEMBER includeLargestResourceSize) }; /** @@ -569,6 +646,9 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable **/ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -606,6 +686,11 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> notebookCounts MEMBER notebookCounts) + Q_PROPERTY(Optional> tagCounts MEMBER tagCounts) + Q_PROPERTY(Optional trashCount MEMBER trashCount) }; /** @@ -620,6 +705,9 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable * */ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -680,6 +768,16 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeContent MEMBER includeContent) + Q_PROPERTY(Optional includeResourcesData MEMBER includeResourcesData) + Q_PROPERTY(Optional includeResourcesRecognition MEMBER includeResourcesRecognition) + Q_PROPERTY(Optional includeResourcesAlternateData MEMBER includeResourcesAlternateData) + Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) + Q_PROPERTY(Optional includeNoteAppDataValues MEMBER includeNoteAppDataValues) + Q_PROPERTY(Optional includeResourceAppDataValues MEMBER includeResourceAppDataValues) + Q_PROPERTY(Optional includeAccountLimits MEMBER includeAccountLimits) }; /** @@ -690,6 +788,9 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable * */ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -741,6 +842,13 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Timestamp updated MEMBER updated) + Q_PROPERTY(Timestamp saved MEMBER saved) + Q_PROPERTY(QString title MEMBER title) + Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) }; /** @@ -753,6 +861,9 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable * */ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -817,6 +928,14 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional plainText MEMBER plainText) + Q_PROPERTY(Optional filter MEMBER filter) + Q_PROPERTY(Optional referenceUri MEMBER referenceUri) + Q_PROPERTY(Optional context MEMBER context) + Q_PROPERTY(Optional cacheKey MEMBER cacheKey) }; /** @@ -828,6 +947,9 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -911,11 +1033,25 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional maxNotes MEMBER maxNotes) + Q_PROPERTY(Optional maxNotebooks MEMBER maxNotebooks) + Q_PROPERTY(Optional maxTags MEMBER maxTags) + Q_PROPERTY(Optional writableNotebooksOnly MEMBER writableNotebooksOnly) + Q_PROPERTY(Optional includeContainingNotebooks MEMBER includeContainingNotebooks) + Q_PROPERTY(Optional includeDebugInfo MEMBER includeDebugInfo) + Q_PROPERTY(Optional maxExperts MEMBER maxExperts) + Q_PROPERTY(Optional maxRelatedContent MEMBER maxRelatedContent) + Q_PROPERTY(Optional> relatedContentTypes MEMBER relatedContentTypes) }; /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -945,6 +1081,12 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noSetReadOnly MEMBER noSetReadOnly) + Q_PROPERTY(Optional noSetReadPlusActivity MEMBER noSetReadPlusActivity) + Q_PROPERTY(Optional noSetModify MEMBER noSetModify) + Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -954,6 +1096,9 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1018,6 +1163,14 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional bestPrivilege MEMBER bestPrivilege) + Q_PROPERTY(Optional individualPrivilege MEMBER individualPrivilege) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1028,6 +1181,9 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1063,6 +1219,11 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noSetReadNote MEMBER noSetReadNote) + Q_PROPERTY(Optional noSetModifyNote MEMBER noSetModifyNote) + Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -1072,6 +1233,9 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1124,6 +1288,13 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1133,6 +1304,9 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1179,6 +1353,12 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1190,6 +1370,9 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1223,6 +1406,11 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> invitations MEMBER invitations) + Q_PROPERTY(Optional> memberships MEMBER memberships) + Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -1237,6 +1425,9 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1287,6 +1478,13 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) + Q_PROPERTY(Optional> invitationsToUpdate MEMBER invitationsToUpdate) + Q_PROPERTY(Optional> membershipsToUnshare MEMBER membershipsToUnshare) + Q_PROPERTY(Optional> invitationsToUnshare MEMBER invitationsToUnshare) }; /** @@ -1300,6 +1498,9 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable **/ struct QEVERCLOUD_EXPORT Data: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1338,6 +1539,11 @@ struct QEVERCLOUD_EXPORT Data: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional bodyHash MEMBER bodyHash) + Q_PROPERTY(Optional size MEMBER size) + Q_PROPERTY(Optional body MEMBER body) }; /** @@ -1347,6 +1553,9 @@ struct QEVERCLOUD_EXPORT Data: public Printable **/ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1596,6 +1805,43 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional defaultLocationName MEMBER defaultLocationName) + Q_PROPERTY(Optional defaultLatitude MEMBER defaultLatitude) + Q_PROPERTY(Optional defaultLongitude MEMBER defaultLongitude) + Q_PROPERTY(Optional preactivation MEMBER preactivation) + Q_PROPERTY(Optional viewedPromotions MEMBER viewedPromotions) + Q_PROPERTY(Optional incomingEmailAddress MEMBER incomingEmailAddress) + Q_PROPERTY(Optional recentMailedAddresses MEMBER recentMailedAddresses) + Q_PROPERTY(Optional comments MEMBER comments) + Q_PROPERTY(Optional dateAgreedToTermsOfService MEMBER dateAgreedToTermsOfService) + Q_PROPERTY(Optional maxReferrals MEMBER maxReferrals) + Q_PROPERTY(Optional referralCount MEMBER referralCount) + Q_PROPERTY(Optional refererCode MEMBER refererCode) + Q_PROPERTY(Optional sentEmailDate MEMBER sentEmailDate) + Q_PROPERTY(Optional sentEmailCount MEMBER sentEmailCount) + Q_PROPERTY(Optional dailyEmailLimit MEMBER dailyEmailLimit) + Q_PROPERTY(Optional emailOptOutDate MEMBER emailOptOutDate) + Q_PROPERTY(Optional partnerEmailOptInDate MEMBER partnerEmailOptInDate) + Q_PROPERTY(Optional preferredLanguage MEMBER preferredLanguage) + Q_PROPERTY(Optional preferredCountry MEMBER preferredCountry) + Q_PROPERTY(Optional clipFullPage MEMBER clipFullPage) + Q_PROPERTY(Optional twitterUserName MEMBER twitterUserName) + Q_PROPERTY(Optional twitterId MEMBER twitterId) + Q_PROPERTY(Optional groupName MEMBER groupName) + Q_PROPERTY(Optional recognitionLanguage MEMBER recognitionLanguage) + Q_PROPERTY(Optional referralProof MEMBER referralProof) + Q_PROPERTY(Optional educationalDiscount MEMBER educationalDiscount) + Q_PROPERTY(Optional businessAddress MEMBER businessAddress) + Q_PROPERTY(Optional hideSponsorBilling MEMBER hideSponsorBilling) + Q_PROPERTY(Optional useEmailAutoFiling MEMBER useEmailAutoFiling) + Q_PROPERTY(Optional reminderEmailConfig MEMBER reminderEmailConfig) + Q_PROPERTY(Optional emailAddressLastConfirmed MEMBER emailAddressLastConfirmed) + Q_PROPERTY(Optional passwordUpdated MEMBER passwordUpdated) + Q_PROPERTY(Optional salesforcePushEnabled MEMBER salesforcePushEnabled) + Q_PROPERTY(Optional shouldLogClientEvent MEMBER shouldLogClientEvent) + Q_PROPERTY(Optional optOutMachineLearning MEMBER optOutMachineLearning) }; /** @@ -1605,6 +1851,9 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1658,6 +1907,15 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional location MEMBER location) + Q_PROPERTY(Optional department MEMBER department) + Q_PROPERTY(Optional mobilePhone MEMBER mobilePhone) + Q_PROPERTY(Optional linkedInProfileUrl MEMBER linkedInProfileUrl) + Q_PROPERTY(Optional workPhone MEMBER workPhone) + Q_PROPERTY(Optional companyStartDate MEMBER companyStartDate) }; /** @@ -1666,6 +1924,9 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable **/ struct QEVERCLOUD_EXPORT Accounting: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1814,6 +2075,31 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional uploadLimitEnd MEMBER uploadLimitEnd) + Q_PROPERTY(Optional uploadLimitNextMonth MEMBER uploadLimitNextMonth) + Q_PROPERTY(Optional premiumServiceStatus MEMBER premiumServiceStatus) + Q_PROPERTY(Optional premiumOrderNumber MEMBER premiumOrderNumber) + Q_PROPERTY(Optional premiumCommerceService MEMBER premiumCommerceService) + Q_PROPERTY(Optional premiumServiceStart MEMBER premiumServiceStart) + Q_PROPERTY(Optional premiumServiceSKU MEMBER premiumServiceSKU) + Q_PROPERTY(Optional lastSuccessfulCharge MEMBER lastSuccessfulCharge) + Q_PROPERTY(Optional lastFailedCharge MEMBER lastFailedCharge) + Q_PROPERTY(Optional lastFailedChargeReason MEMBER lastFailedChargeReason) + Q_PROPERTY(Optional nextPaymentDue MEMBER nextPaymentDue) + Q_PROPERTY(Optional premiumLockUntil MEMBER premiumLockUntil) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional premiumSubscriptionNumber MEMBER premiumSubscriptionNumber) + Q_PROPERTY(Optional lastRequestedCharge MEMBER lastRequestedCharge) + Q_PROPERTY(Optional currency MEMBER currency) + Q_PROPERTY(Optional unitPrice MEMBER unitPrice) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional businessName MEMBER businessName) + Q_PROPERTY(Optional businessRole MEMBER businessRole) + Q_PROPERTY(Optional unitDiscount MEMBER unitDiscount) + Q_PROPERTY(Optional nextChargeDate MEMBER nextChargeDate) + Q_PROPERTY(Optional availablePoints MEMBER availablePoints) }; /** @@ -1823,6 +2109,9 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1871,6 +2160,13 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional businessName MEMBER businessName) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -1878,6 +2174,9 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable **/ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -1960,6 +2259,19 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional userMailLimitDaily MEMBER userMailLimitDaily) + Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) + Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) + Q_PROPERTY(Optional userLinkedNotebookMax MEMBER userLinkedNotebookMax) + Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) + Q_PROPERTY(Optional userNoteCountMax MEMBER userNoteCountMax) + Q_PROPERTY(Optional userNotebookCountMax MEMBER userNotebookCountMax) + Q_PROPERTY(Optional userTagCountMax MEMBER userTagCountMax) + Q_PROPERTY(Optional noteTagCountMax MEMBER noteTagCountMax) + Q_PROPERTY(Optional userSavedSearchesMax MEMBER userSavedSearchesMax) + Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) }; /** @@ -1967,6 +2279,9 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable **/ struct QEVERCLOUD_EXPORT User: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2116,6 +2431,26 @@ struct QEVERCLOUD_EXPORT User: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional timezone MEMBER timezone) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional shardId MEMBER shardId) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional accounting MEMBER accounting) + Q_PROPERTY(Optional businessUserInfo MEMBER businessUserInfo) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional accountLimits MEMBER accountLimits) }; /** @@ -2125,6 +2460,9 @@ struct QEVERCLOUD_EXPORT User: public Printable * */ struct QEVERCLOUD_EXPORT Contact: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2188,6 +2526,15 @@ struct QEVERCLOUD_EXPORT Contact: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional type MEMBER type) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional messagingPermit MEMBER messagingPermit) + Q_PROPERTY(Optional messagingPermitExpires MEMBER messagingPermitExpires) }; /** @@ -2197,6 +2544,9 @@ struct QEVERCLOUD_EXPORT Contact: public Printable * */ struct QEVERCLOUD_EXPORT Identity: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2273,6 +2623,16 @@ struct QEVERCLOUD_EXPORT Identity: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(IdentityID id MEMBER id) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional userId MEMBER userId) + Q_PROPERTY(Optional deactivated MEMBER deactivated) + Q_PROPERTY(Optional sameBusiness MEMBER sameBusiness) + Q_PROPERTY(Optional blocked MEMBER blocked) + Q_PROPERTY(Optional userConnected MEMBER userConnected) + Q_PROPERTY(Optional eventId MEMBER eventId) }; /** @@ -2281,6 +2641,9 @@ struct QEVERCLOUD_EXPORT Identity: public Printable **/ struct QEVERCLOUD_EXPORT Tag: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2343,6 +2706,12 @@ struct QEVERCLOUD_EXPORT Tag: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional parentGuid MEMBER parentGuid) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) }; /** @@ -2366,6 +2735,9 @@ struct QEVERCLOUD_EXPORT Tag: public Printable * */ struct QEVERCLOUD_EXPORT LazyMap: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2394,6 +2766,10 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> keysOnly MEMBER keysOnly) + Q_PROPERTY(Optional> fullMap MEMBER fullMap) }; /** @@ -2401,6 +2777,9 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable * */ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2506,6 +2885,20 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional sourceURL MEMBER sourceURL) + Q_PROPERTY(Optional timestamp MEMBER timestamp) + Q_PROPERTY(Optional latitude MEMBER latitude) + Q_PROPERTY(Optional longitude MEMBER longitude) + Q_PROPERTY(Optional altitude MEMBER altitude) + Q_PROPERTY(Optional cameraMake MEMBER cameraMake) + Q_PROPERTY(Optional cameraModel MEMBER cameraModel) + Q_PROPERTY(Optional clientWillIndex MEMBER clientWillIndex) + Q_PROPERTY(Optional recoType MEMBER recoType) + Q_PROPERTY(Optional fileName MEMBER fileName) + Q_PROPERTY(Optional attachment MEMBER attachment) + Q_PROPERTY(Optional applicationData MEMBER applicationData) }; /** @@ -2514,6 +2907,9 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable * */ struct QEVERCLOUD_EXPORT Resource: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2619,6 +3015,20 @@ struct QEVERCLOUD_EXPORT Resource: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional data MEMBER data) + Q_PROPERTY(Optional mime MEMBER mime) + Q_PROPERTY(Optional width MEMBER width) + Q_PROPERTY(Optional height MEMBER height) + Q_PROPERTY(Optional duration MEMBER duration) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional recognition MEMBER recognition) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional alternateData MEMBER alternateData) }; /** @@ -2626,6 +3036,9 @@ struct QEVERCLOUD_EXPORT Resource: public Printable * */ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2871,6 +3284,30 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional subjectDate MEMBER subjectDate) + Q_PROPERTY(Optional latitude MEMBER latitude) + Q_PROPERTY(Optional longitude MEMBER longitude) + Q_PROPERTY(Optional altitude MEMBER altitude) + Q_PROPERTY(Optional author MEMBER author) + Q_PROPERTY(Optional source MEMBER source) + Q_PROPERTY(Optional sourceURL MEMBER sourceURL) + Q_PROPERTY(Optional sourceApplication MEMBER sourceApplication) + Q_PROPERTY(Optional shareDate MEMBER shareDate) + Q_PROPERTY(Optional reminderOrder MEMBER reminderOrder) + Q_PROPERTY(Optional reminderDoneTime MEMBER reminderDoneTime) + Q_PROPERTY(Optional reminderTime MEMBER reminderTime) + Q_PROPERTY(Optional placeName MEMBER placeName) + Q_PROPERTY(Optional contentClass MEMBER contentClass) + Q_PROPERTY(Optional applicationData MEMBER applicationData) + Q_PROPERTY(Optional lastEditedBy MEMBER lastEditedBy) + Q_PROPERTY(Optional> classifications MEMBER classifications) + Q_PROPERTY(Optional creatorId MEMBER creatorId) + Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) + Q_PROPERTY(Optional sharedWithBusiness MEMBER sharedWithBusiness) + Q_PROPERTY(Optional conflictSourceNoteGuid MEMBER conflictSourceNoteGuid) + Q_PROPERTY(Optional noteTitleQuality MEMBER noteTitleQuality) }; /** @@ -2881,6 +3318,9 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable * */ struct QEVERCLOUD_EXPORT SharedNote: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -2931,6 +3371,14 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional sharerUserID MEMBER sharerUserID) + Q_PROPERTY(Optional recipientIdentity MEMBER recipientIdentity) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -2972,6 +3420,9 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable * */ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3013,6 +3464,13 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noUpdateTitle MEMBER noUpdateTitle) + Q_PROPERTY(Optional noUpdateContent MEMBER noUpdateContent) + Q_PROPERTY(Optional noEmail MEMBER noEmail) + Q_PROPERTY(Optional noShare MEMBER noShare) + Q_PROPERTY(Optional noSharePublicly MEMBER noSharePublicly) }; /** @@ -3025,6 +3483,9 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable */ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3057,6 +3518,13 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) + Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) + Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) + Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) + Q_PROPERTY(Optional uploaded MEMBER uploaded) }; /** @@ -3065,6 +3533,9 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable * */ struct QEVERCLOUD_EXPORT Note: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3242,6 +3713,26 @@ struct QEVERCLOUD_EXPORT Note: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional content MEMBER content) + Q_PROPERTY(Optional contentHash MEMBER contentHash) + Q_PROPERTY(Optional contentLength MEMBER contentLength) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional> resources MEMBER resources) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional tagNames MEMBER tagNames) + Q_PROPERTY(Optional> sharedNotes MEMBER sharedNotes) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional limits MEMBER limits) }; /** @@ -3251,6 +3742,9 @@ struct QEVERCLOUD_EXPORT Note: public Printable * */ struct QEVERCLOUD_EXPORT Publishing: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3306,6 +3800,12 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional uri MEMBER uri) + Q_PROPERTY(Optional order MEMBER order) + Q_PROPERTY(Optional ascending MEMBER ascending) + Q_PROPERTY(Optional publicDescription MEMBER publicDescription) }; /** @@ -3317,6 +3817,9 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable * */ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3358,6 +3861,11 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookDescription MEMBER notebookDescription) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional recommended MEMBER recommended) }; /** @@ -3366,6 +3874,9 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3401,6 +3912,11 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeAccount MEMBER includeAccount) + Q_PROPERTY(Optional includePersonalLinkedNotebooks MEMBER includePersonalLinkedNotebooks) + Q_PROPERTY(Optional includeBusinessLinkedNotebooks MEMBER includeBusinessLinkedNotebooks) }; /** @@ -3408,6 +3924,9 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3482,6 +4001,14 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional query MEMBER query) + Q_PROPERTY(Optional format MEMBER format) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional scope MEMBER scope) }; /** @@ -3500,6 +4027,9 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3533,6 +4063,10 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) + Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) }; /** @@ -3547,6 +4081,9 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3602,6 +4139,13 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) + Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) + Q_PROPERTY(Optional inMyList MEMBER inMyList) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional recipientStatus MEMBER recipientStatus) }; /** @@ -3610,6 +4154,9 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3743,6 +4290,24 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional userId MEMBER userId) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) + Q_PROPERTY(Optional notebookModifiable MEMBER notebookModifiable) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional globalId MEMBER globalId) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) + Q_PROPERTY(Optional recipientUsername MEMBER recipientUsername) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -3750,6 +4315,9 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3770,6 +4338,9 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional canMoveToContainer MEMBER canMoveToContainer) }; /** @@ -3800,6 +4371,9 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -3975,6 +4549,37 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noReadNotes MEMBER noReadNotes) + Q_PROPERTY(Optional noCreateNotes MEMBER noCreateNotes) + Q_PROPERTY(Optional noUpdateNotes MEMBER noUpdateNotes) + Q_PROPERTY(Optional noExpungeNotes MEMBER noExpungeNotes) + Q_PROPERTY(Optional noShareNotes MEMBER noShareNotes) + Q_PROPERTY(Optional noEmailNotes MEMBER noEmailNotes) + Q_PROPERTY(Optional noSendMessageToRecipients MEMBER noSendMessageToRecipients) + Q_PROPERTY(Optional noUpdateNotebook MEMBER noUpdateNotebook) + Q_PROPERTY(Optional noExpungeNotebook MEMBER noExpungeNotebook) + Q_PROPERTY(Optional noSetDefaultNotebook MEMBER noSetDefaultNotebook) + Q_PROPERTY(Optional noSetNotebookStack MEMBER noSetNotebookStack) + Q_PROPERTY(Optional noPublishToPublic MEMBER noPublishToPublic) + Q_PROPERTY(Optional noPublishToBusinessLibrary MEMBER noPublishToBusinessLibrary) + Q_PROPERTY(Optional noCreateTags MEMBER noCreateTags) + Q_PROPERTY(Optional noUpdateTags MEMBER noUpdateTags) + Q_PROPERTY(Optional noExpungeTags MEMBER noExpungeTags) + Q_PROPERTY(Optional noSetParentTag MEMBER noSetParentTag) + Q_PROPERTY(Optional noCreateSharedNotebooks MEMBER noCreateSharedNotebooks) + Q_PROPERTY(Optional updateWhichSharedNotebookRestrictions MEMBER updateWhichSharedNotebookRestrictions) + Q_PROPERTY(Optional expungeWhichSharedNotebookRestrictions MEMBER expungeWhichSharedNotebookRestrictions) + Q_PROPERTY(Optional noShareNotesWithBusiness MEMBER noShareNotesWithBusiness) + Q_PROPERTY(Optional noRenameNotebook MEMBER noRenameNotebook) + Q_PROPERTY(Optional noSetInMyList MEMBER noSetInMyList) + Q_PROPERTY(Optional noChangeContact MEMBER noChangeContact) + Q_PROPERTY(Optional canMoveToContainerRestrictions MEMBER canMoveToContainerRestrictions) + Q_PROPERTY(Optional noSetReminderNotifyEmail MEMBER noSetReminderNotifyEmail) + Q_PROPERTY(Optional noSetReminderNotifyInApp MEMBER noSetReminderNotifyInApp) + Q_PROPERTY(Optional noSetRecipientSettingsStack MEMBER noSetRecipientSettingsStack) + Q_PROPERTY(Optional noCanMoveNote MEMBER noCanMoveNote) }; /** @@ -3982,6 +4587,9 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT Notebook: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4133,6 +4741,23 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional defaultNotebook MEMBER defaultNotebook) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional publishing MEMBER publishing) + Q_PROPERTY(Optional published MEMBER published) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional> sharedNotebookIds MEMBER sharedNotebookIds) + Q_PROPERTY(Optional> sharedNotebooks MEMBER sharedNotebooks) + Q_PROPERTY(Optional businessNotebook MEMBER businessNotebook) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) }; /** @@ -4142,6 +4767,9 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable * */ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4243,6 +4871,19 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional shareName MEMBER shareName) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional shardId MEMBER shardId) + Q_PROPERTY(Optional sharedNotebookGlobalId MEMBER sharedNotebookGlobalId) + Q_PROPERTY(Optional uri MEMBER uri) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional businessId MEMBER businessId) }; /** @@ -4252,6 +4893,9 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable * */ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4296,6 +4940,13 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional notebookDisplayName MEMBER notebookDisplayName) + Q_PROPERTY(Optional contactName MEMBER contactName) + Q_PROPERTY(Optional hasSharedNotebook MEMBER hasSharedNotebook) + Q_PROPERTY(Optional joinedUserCount MEMBER joinedUserCount) }; /** @@ -4304,6 +4955,9 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable * */ struct QEVERCLOUD_EXPORT UserProfile: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4372,6 +5026,18 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional joined MEMBER joined) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional status MEMBER status) }; /** @@ -4382,6 +5048,9 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4424,6 +5093,13 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional url MEMBER url) + Q_PROPERTY(Optional width MEMBER width) + Q_PROPERTY(Optional height MEMBER height) + Q_PROPERTY(Optional pixelRatio MEMBER pixelRatio) + Q_PROPERTY(Optional fileSize MEMBER fileSize) }; /** @@ -4433,6 +5109,9 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4537,6 +5216,24 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional contentId MEMBER contentId) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional url MEMBER url) + Q_PROPERTY(Optional sourceId MEMBER sourceId) + Q_PROPERTY(Optional sourceUrl MEMBER sourceUrl) + Q_PROPERTY(Optional sourceFaviconUrl MEMBER sourceFaviconUrl) + Q_PROPERTY(Optional sourceName MEMBER sourceName) + Q_PROPERTY(Optional date MEMBER date) + Q_PROPERTY(Optional teaser MEMBER teaser) + Q_PROPERTY(Optional> thumbnails MEMBER thumbnails) + Q_PROPERTY(Optional contentType MEMBER contentType) + Q_PROPERTY(Optional accessType MEMBER accessType) + Q_PROPERTY(Optional visibleUrl MEMBER visibleUrl) + Q_PROPERTY(Optional clipUrl MEMBER clipUrl) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional authors MEMBER authors) }; /** @@ -4545,6 +5242,9 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable * */ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4605,6 +5305,16 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional status MEMBER status) + Q_PROPERTY(Optional requesterId MEMBER requesterId) + Q_PROPERTY(Optional fromWorkChat MEMBER fromWorkChat) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional mostRecentReminder MEMBER mostRecentReminder) }; /** @@ -4638,6 +5348,9 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable */ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4664,6 +5377,11 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional type MEMBER type) + Q_PROPERTY(Optional stringIdentifier MEMBER stringIdentifier) + Q_PROPERTY(Optional longIdentifier MEMBER longIdentifier) }; /** @@ -4672,6 +5390,9 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable **/ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4721,12 +5442,22 @@ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(UserID userId MEMBER userId) + Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) }; /** * */ struct QEVERCLOUD_EXPORT UserUrls: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4793,6 +5524,14 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional userStoreUrl MEMBER userStoreUrl) + Q_PROPERTY(Optional utilityUrl MEMBER utilityUrl) + Q_PROPERTY(Optional messageStoreUrl MEMBER messageStoreUrl) + Q_PROPERTY(Optional userWebSocketUrl MEMBER userWebSocketUrl) }; /** @@ -4801,6 +5540,9 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable **/ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4886,6 +5628,18 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(QString authenticationToken MEMBER authenticationToken) + Q_PROPERTY(Timestamp expiration MEMBER expiration) + Q_PROPERTY(Optional user MEMBER user) + Q_PROPERTY(Optional publicUserInfo MEMBER publicUserInfo) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional secondFactorRequired MEMBER secondFactorRequired) + Q_PROPERTY(Optional secondFactorDeliveryHint MEMBER secondFactorDeliveryHint) + Q_PROPERTY(Optional urls MEMBER urls) }; /** @@ -4893,6 +5647,9 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -4987,6 +5744,22 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QString serviceHost MEMBER serviceHost) + Q_PROPERTY(QString marketingUrl MEMBER marketingUrl) + Q_PROPERTY(QString supportUrl MEMBER supportUrl) + Q_PROPERTY(QString accountEmailDomain MEMBER accountEmailDomain) + Q_PROPERTY(Optional enableFacebookSharing MEMBER enableFacebookSharing) + Q_PROPERTY(Optional enableGiftSubscriptions MEMBER enableGiftSubscriptions) + Q_PROPERTY(Optional enableSupportTickets MEMBER enableSupportTickets) + Q_PROPERTY(Optional enableSharedNotebooks MEMBER enableSharedNotebooks) + Q_PROPERTY(Optional enableSingleNoteSharing MEMBER enableSingleNoteSharing) + Q_PROPERTY(Optional enableSponsoredAccounts MEMBER enableSponsoredAccounts) + Q_PROPERTY(Optional enableTwitterSharing MEMBER enableTwitterSharing) + Q_PROPERTY(Optional enableLinkedInSharing MEMBER enableLinkedInSharing) + Q_PROPERTY(Optional enablePublicNotebooks MEMBER enablePublicNotebooks) + Q_PROPERTY(Optional enableGoogle MEMBER enableGoogle) }; /** @@ -4994,6 +5767,9 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5022,6 +5798,10 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QString name MEMBER name) + Q_PROPERTY(BootstrapSettings settings MEMBER settings) }; /** @@ -5029,6 +5809,9 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5052,6 +5835,9 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QList profiles MEMBER profiles) }; /** @@ -5074,6 +5860,7 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable */ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Printable { + Q_GADGET public: EDAMErrorCode errorCode; Optional parameter; @@ -5098,6 +5885,9 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin { return !(*this == other); } + + Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) + Q_PROPERTY(Optional parameter MEMBER parameter) }; /** @@ -5116,6 +5906,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin */ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Printable { + Q_GADGET public: EDAMErrorCode errorCode; Optional message; @@ -5142,6 +5933,10 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr { return !(*this == other); } + + Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) + Q_PROPERTY(Optional message MEMBER message) + Q_PROPERTY(Optional rateLimitDuration MEMBER rateLimitDuration) }; /** @@ -5159,6 +5954,7 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr */ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public Printable { + Q_GADGET public: Optional identifier; Optional key; @@ -5183,6 +5979,9 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public { return !(*this == other); } + + Q_PROPERTY(Optional identifier MEMBER identifier) + Q_PROPERTY(Optional key MEMBER key) }; /** @@ -5209,6 +6008,7 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public */ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, public Printable { + Q_GADGET public: QList contacts; Optional parameter; @@ -5235,6 +6035,10 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, { return !(*this == other); } + + Q_PROPERTY(QList contacts MEMBER contacts) + Q_PROPERTY(Optional parameter MEMBER parameter) + Q_PROPERTY(Optional> reasons MEMBER reasons) }; /** @@ -5250,6 +6054,9 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, **/ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5361,6 +6168,22 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(Optional chunkHighUSN MEMBER chunkHighUSN) + Q_PROPERTY(qint32 updateCount MEMBER updateCount) + Q_PROPERTY(Optional> notes MEMBER notes) + Q_PROPERTY(Optional> notebooks MEMBER notebooks) + Q_PROPERTY(Optional> tags MEMBER tags) + Q_PROPERTY(Optional> searches MEMBER searches) + Q_PROPERTY(Optional> resources MEMBER resources) + Q_PROPERTY(Optional> expungedNotes MEMBER expungedNotes) + Q_PROPERTY(Optional> expungedNotebooks MEMBER expungedNotebooks) + Q_PROPERTY(Optional> expungedTags MEMBER expungedTags) + Q_PROPERTY(Optional> expungedSearches MEMBER expungedSearches) + Q_PROPERTY(Optional> linkedNotebooks MEMBER linkedNotebooks) + Q_PROPERTY(Optional> expungedLinkedNotebooks MEMBER expungedLinkedNotebooks) }; /** @@ -5369,6 +6192,9 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable **/ struct QEVERCLOUD_EXPORT NoteList: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5442,6 +6268,16 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 startIndex MEMBER startIndex) + Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) + Q_PROPERTY(QList notes MEMBER notes) + Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) + Q_PROPERTY(Optional searchedWords MEMBER searchedWords) + Q_PROPERTY(Optional updateCount MEMBER updateCount) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -5456,6 +6292,9 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable * */ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5517,6 +6356,20 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Guid guid MEMBER guid) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional contentLength MEMBER contentLength) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional largestResourceMime MEMBER largestResourceMime) + Q_PROPERTY(Optional largestResourceSize MEMBER largestResourceSize) }; /** @@ -5527,6 +6380,9 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable **/ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5602,6 +6458,16 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 startIndex MEMBER startIndex) + Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) + Q_PROPERTY(QList notes MEMBER notes) + Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) + Q_PROPERTY(Optional searchedWords MEMBER searchedWords) + Q_PROPERTY(Optional updateCount MEMBER updateCount) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -5611,6 +6477,9 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable * */ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5670,6 +6539,14 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional note MEMBER note) + Q_PROPERTY(Optional toAddresses MEMBER toAddresses) + Q_PROPERTY(Optional ccAddresses MEMBER ccAddresses) + Q_PROPERTY(Optional subject MEMBER subject) + Q_PROPERTY(Optional message MEMBER message) }; /** @@ -5682,6 +6559,9 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5786,6 +6666,17 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> notes MEMBER notes) + Q_PROPERTY(Optional> notebooks MEMBER notebooks) + Q_PROPERTY(Optional> tags MEMBER tags) + Q_PROPERTY(Optional> containingNotebooks MEMBER containingNotebooks) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) + Q_PROPERTY(Optional> experts MEMBER experts) + Q_PROPERTY(Optional> relatedContent MEMBER relatedContent) + Q_PROPERTY(Optional cacheKey MEMBER cacheKey) + Q_PROPERTY(Optional cacheExpires MEMBER cacheExpires) }; /** @@ -5795,6 +6686,9 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable * */ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5827,6 +6721,10 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional note MEMBER note) + Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -5836,6 +6734,9 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable * */ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5885,6 +6786,12 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserIdentity MEMBER recipientUserIdentity) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -5896,6 +6803,9 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -5936,6 +6846,11 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> invitations MEMBER invitations) + Q_PROPERTY(Optional> memberships MEMBER memberships) + Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -5945,6 +6860,9 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6012,6 +6930,13 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional inviteMessage MEMBER inviteMessage) + Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) + Q_PROPERTY(Optional> invitationsToCreateOrUpdate MEMBER invitationsToCreateOrUpdate) + Q_PROPERTY(Optional> unshares MEMBER unshares) }; /** @@ -6027,6 +6952,9 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6064,6 +6992,11 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional userIdentity MEMBER userIdentity) + Q_PROPERTY(Optional userException MEMBER userException) + Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -6072,6 +7005,9 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6096,6 +7032,9 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> errors MEMBER errors) }; /** @@ -6104,6 +7043,9 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6148,6 +7090,12 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) + Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) + Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -6156,6 +7104,9 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable * */ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6200,6 +7151,12 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) + Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) + Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -6208,6 +7165,9 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable * */ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6238,6 +7198,10 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional> matchingShares MEMBER matchingShares) }; /** @@ -6253,6 +7217,9 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6297,6 +7264,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional identityID MEMBER identityID) + Q_PROPERTY(Optional userID MEMBER userID) + Q_PROPERTY(Optional userException MEMBER userException) + Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -6305,6 +7278,9 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { +private: + Q_GADGET +public: /** * See the declaration of EverCloudLocalData for details */ @@ -6329,10 +7305,14 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { return !(*this == other); } + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> errors MEMBER errors) }; } // namespace qevercloud +Q_DECLARE_METATYPE(qevercloud::EverCloudLocalData) Q_DECLARE_METATYPE(qevercloud::SyncState) Q_DECLARE_METATYPE(qevercloud::SyncChunkFilter) Q_DECLARE_METATYPE(qevercloud::NoteFilter) diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index f8a5543c..eab273d8 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -417,6 +417,20 @@ void EverCloudLocalData::print(QTextStream & strm) const } } +bool EverCloudLocalData::operator==( + const EverCloudLocalData & other) const +{ + return id == other.id && dirty == other.dirty && + local == other.local && favorited == other.favorited && + dict == other.dict; +} + +bool EverCloudLocalData::operator!=( + const EverCloudLocalData & other) const +{ + return !operator==(other); +} + void writeSyncState( ThriftBinaryBufferWriter & writer, const SyncState & s) From 497578fce8d736c473ee97967941cc34eda0526f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 3 Dec 2019 07:30:11 +0300 Subject: [PATCH 099/188] Make OAuthResult printable + rearrange some code --- QEverCloud/headers/OAuth.h | 5 +- QEverCloud/src/OAuth.cpp | 236 +++++++++++++++++++++---------------- 2 files changed, 140 insertions(+), 101 deletions(-) diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index cec24f7d..934c065f 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -17,6 +17,7 @@ #include "Export.h" #include "Helpers.h" #include "generated/Types.h" +#include "Printable.h" #include #include @@ -95,7 +96,7 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget QString oauthError() const; /** Holds data that is returned by Evernote on a successful authentication */ - struct OAuthResult + struct OAuthResult: public Printable { QString noteStoreUrl; ///< note store url for the user; no need to /// question UserStore::getNoteStoreUrl for it. @@ -104,6 +105,8 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget UserID userId; ///< same as PublicUserInfo::userId QString webApiUrlPrefix; ///< see PublicUserInfo::webApiUrlPrefix QString authenticationToken; ///< This is what this all was for! + + virtual void print(QTextStream & strm) const override; }; /** @returns the result of the last authentication, i.e. authenticate() call.*/ diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index a6dec54e..4e0ecd8c 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -32,36 +32,45 @@ namespace { - quint64 random64() - { - quint64 res = 0; - for(int i = 0; i < 8; i++) { - res += static_cast(qrand() % 256) << i*8; - } - - QByteArray randomData = QUuid::createUuid().toRfc4122(); - quint64 random; - std::memcpy(&random, &randomData.constData()[0], sizeof(random)); - res ^= random; - std::memcpy(&random, &randomData.constData()[sizeof(random)], - sizeof(random)); - res ^= random; +//////////////////////////////////////////////////////////////////////////////// - return res; +quint64 random64() +{ + quint64 res = 0; + for(int i = 0; i < 8; i++) { + res += static_cast(qrand() % 256) << i*8; } - typedef quint64 (*NonceGenerator)(); - NonceGenerator nonceGenerator_ = random64; + QByteArray randomData = QUuid::createUuid().toRfc4122(); + quint64 random; + std::memcpy(&random, &randomData.constData()[0], sizeof(random)); + res ^= random; + std::memcpy(&random, &randomData.constData()[sizeof(random)], + sizeof(random)); + res ^= random; - NonceGenerator nonceGenerator() {return nonceGenerator_;} + return res; } +typedef quint64 (*NonceGenerator)(); +NonceGenerator nonceGenerator_ = random64; + +NonceGenerator nonceGenerator() {return nonceGenerator_;} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + +namespace qevercloud { + +//////////////////////////////////////////////////////////////////////////////// + void setNonceGenerator(quint64 (*nonceGenerator)()) { nonceGenerator_ = nonceGenerator; } -namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE class EvernoteOAuthWebViewPrivate: public QWebEngineView @@ -96,6 +105,8 @@ public Q_SLOTS: EvernoteOAuthWebView::OAuthResult m_oauthResult; }; +//////////////////////////////////////////////////////////////////////////////// + EvernoteOAuthWebViewPrivate::EvernoteOAuthWebViewPrivate(QWidget * parent) #ifdef QEVERCLOUD_USE_QT_WEB_ENGINE : QWebEngineView(parent) @@ -118,87 +129,6 @@ void EvernoteOAuthWebViewPrivate::setError(QString errorText) emit authenticationFailed(); } -EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : - QWidget(parent), - d_ptr(new EvernoteOAuthWebViewPrivate(this)) -{ - QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFinished, - this, &EvernoteOAuthWebView::authenticationFinished); - QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationSuceeded, - this, &EvernoteOAuthWebView::authenticationSuceeded); - QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFailed, - this, &EvernoteOAuthWebView::authenticationFailed); - - QVBoxLayout * pLayout = new QVBoxLayout(this); - pLayout->addWidget(d_ptr); - setLayout(pLayout); -} - -void EvernoteOAuthWebView::authenticate( - QString host, QString consumerKey, QString consumerSecret, - const qint64 timeoutMsec) -{ - QEC_DEBUG("oauth", "Sending request to acquire temporary token"); - - Q_D(EvernoteOAuthWebView); - d->m_host = host; - d->m_isSucceeded = false; - d->m_timeoutMsec = timeoutMsec; - d->setHtml(QLatin1String("")); - d->history()->clear(); - - qint64 timestamp = QDateTime::currentMSecsSinceEpoch()/1000; - quint64 nonce = nonceGenerator()(); - d->m_oauthUrlBase = - QString::fromUtf8("https://%1/oauth?oauth_consumer_key=%2&" - "oauth_signature=%3&" - "oauth_signature_method=PLAINTEXT&" - "oauth_timestamp=%4&oauth_nonce=%5") - .arg(host, consumerKey, consumerSecret).arg(timestamp).arg(nonce); - - // step 1: acquire temporary token - ReplyFetcher * replyFetcher = new ReplyFetcher(); - QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, - d, &EvernoteOAuthWebViewPrivate::temporaryFinished); - QUrl url(d->m_oauthUrlBase + QStringLiteral("&oauth_callback=nnoauth")); -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE - replyFetcher->start(evernoteNetworkAccessManager(), url, timeoutMsec); -#else - replyFetcher->start(d->page()->networkAccessManager(), url, timeoutMsec); -#endif -} - -bool EvernoteOAuthWebView::isSucceeded() const -{ - Q_D(const EvernoteOAuthWebView); - return d->m_isSucceeded; -} - -QString EvernoteOAuthWebView::oauthError() const -{ - Q_D(const EvernoteOAuthWebView); - return d->m_errorText; -} - -EvernoteOAuthWebView::OAuthResult EvernoteOAuthWebView::oauthResult() const -{ - Q_D(const EvernoteOAuthWebView); - return d->m_oauthResult; -} - -void EvernoteOAuthWebView::setSizeHint(QSize sizeHint) -{ - Q_D(EvernoteOAuthWebView); - d->m_sizeHint = sizeHint; - updateGeometry(); -} - -QSize EvernoteOAuthWebView::sizeHint() const -{ - Q_D(const EvernoteOAuthWebView); - return d->m_sizeHint; -} - void EvernoteOAuthWebViewPrivate::temporaryFinished(QObject * rf) { ReplyFetcher * replyFetcher = qobject_cast(rf); @@ -309,6 +239,110 @@ void EvernoteOAuthWebViewPrivate::clearHtml() setHtml(QLatin1String("")); } +//////////////////////////////////////////////////////////////////////////////// + +EvernoteOAuthWebView::EvernoteOAuthWebView(QWidget * parent) : + QWidget(parent), + d_ptr(new EvernoteOAuthWebViewPrivate(this)) +{ + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFinished, + this, &EvernoteOAuthWebView::authenticationFinished); + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationSuceeded, + this, &EvernoteOAuthWebView::authenticationSuceeded); + QObject::connect(d_ptr, &EvernoteOAuthWebViewPrivate::authenticationFailed, + this, &EvernoteOAuthWebView::authenticationFailed); + + QVBoxLayout * pLayout = new QVBoxLayout(this); + pLayout->addWidget(d_ptr); + setLayout(pLayout); +} + +void EvernoteOAuthWebView::authenticate( + QString host, QString consumerKey, QString consumerSecret, + const qint64 timeoutMsec) +{ + QEC_DEBUG("oauth", "Sending request to acquire temporary token"); + + Q_D(EvernoteOAuthWebView); + d->m_host = host; + d->m_isSucceeded = false; + d->m_timeoutMsec = timeoutMsec; + d->setHtml(QLatin1String("")); + d->history()->clear(); + + qint64 timestamp = QDateTime::currentMSecsSinceEpoch()/1000; + quint64 nonce = nonceGenerator()(); + d->m_oauthUrlBase = + QString::fromUtf8("https://%1/oauth?oauth_consumer_key=%2&" + "oauth_signature=%3&" + "oauth_signature_method=PLAINTEXT&" + "oauth_timestamp=%4&oauth_nonce=%5") + .arg(host, consumerKey, consumerSecret).arg(timestamp).arg(nonce); + + // step 1: acquire temporary token + ReplyFetcher * replyFetcher = new ReplyFetcher(); + QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, + d, &EvernoteOAuthWebViewPrivate::temporaryFinished); + QUrl url(d->m_oauthUrlBase + QStringLiteral("&oauth_callback=nnoauth")); +#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE + replyFetcher->start(evernoteNetworkAccessManager(), url, timeoutMsec); +#else + replyFetcher->start(d->page()->networkAccessManager(), url, timeoutMsec); +#endif +} + +bool EvernoteOAuthWebView::isSucceeded() const +{ + Q_D(const EvernoteOAuthWebView); + return d->m_isSucceeded; +} + +QString EvernoteOAuthWebView::oauthError() const +{ + Q_D(const EvernoteOAuthWebView); + return d->m_errorText; +} + +EvernoteOAuthWebView::OAuthResult EvernoteOAuthWebView::oauthResult() const +{ + Q_D(const EvernoteOAuthWebView); + return d->m_oauthResult; +} + +void EvernoteOAuthWebView::setSizeHint(QSize sizeHint) +{ + Q_D(EvernoteOAuthWebView); + d->m_sizeHint = sizeHint; + updateGeometry(); +} + +QSize EvernoteOAuthWebView::sizeHint() const +{ + Q_D(const EvernoteOAuthWebView); + return d->m_sizeHint; +} + +//////////////////////////////////////////////////////////////////////////////// + +void EvernoteOAuthWebView::OAuthResult::print(QTextStream & strm) const +{ + strm << "qevercloud::EvernoteOAuthWebView::OAuthResult {\n"; + + strm << " noteStoreUrl = " << noteStoreUrl << ";\n"; + strm << " expires = " << expires << ";\n"; + strm << " shardId = " << shardId << ";\n"; + strm << " userId = " << QString::number(userId) << ";\n"; + strm << " webApiUrlPrefix = " << webApiUrlPrefix << ";\n"; + strm << " authenticationToken " + << (authenticationToken.isEmpty() + ? "is empty" + : "is not empty") << ";\n"; + + strm << "};\n"; +} + +//////////////////////////////////////////////////////////////////////////////// + class EvernoteOAuthDialogPrivate { public: @@ -326,6 +360,8 @@ class EvernoteOAuthDialogPrivate QString m_consumerSecret; }; +//////////////////////////////////////////////////////////////////////////////// + EvernoteOAuthDialog::EvernoteOAuthDialog(QString consumerKey, QString consumerSecret, QString host, QWidget *parent) : From ecddb9eb4268497facd0c586055006620c54f065 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 3 Dec 2019 07:55:47 +0300 Subject: [PATCH 100/188] Update generated code --- QEverCloud/headers/generated/Types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index ab89d5f1..fbc0ab52 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -15,8 +15,8 @@ #include "../Export.h" #include "../Optional.h" +#include "../Printable.h" #include "EDAMErrorCode.h" -#include "Printable.h" #include #include #include From d161b28d28c1e40211ae82c29b993f52c9e88a2a Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 4 Dec 2019 07:44:09 +0300 Subject: [PATCH 101/188] Update generated code --- QEverCloud/headers/generated/Services.h | 6 ++++++ QEverCloud/src/generated/Services.cpp | 28 +++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 62da6521..7c538c6a 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -61,6 +61,9 @@ class QEVERCLOUD_EXPORT INoteStore: public QObject {} public: + virtual QString noteStoreUrl() const = 0; + virtual void setNoteStoreUrl(QString url) = 0; + /** * Asks the NoteStore to provide information about the status of the user * account corresponding to the provided authentication token. @@ -2762,6 +2765,9 @@ class QEVERCLOUD_EXPORT IUserStore: public QObject {} public: + virtual QString userStoreUrl() const = 0; + virtual void setUserStoreUrl(QString url) = 0; + /** * 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 diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index a6d03ca9..a94d3dd0 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -47,12 +47,12 @@ class Q_DECL_HIDDEN NoteStore: public INoteStore m_ctx = newRequestContext(); } - void setNoteStoreUrl(QString noteStoreUrl) + virtual void setNoteStoreUrl(QString noteStoreUrl) override { m_url = std::move(noteStoreUrl); } - QString noteStoreUrl() + virtual QString noteStoreUrl() const override { return m_url; } @@ -16007,12 +16007,12 @@ class Q_DECL_HIDDEN UserStore: public IUserStore m_ctx = newRequestContext(); } - void setUserStoreUrl(QString userStoreUrl) + virtual void setUserStoreUrl(QString userStoreUrl) override { m_url = std::move(userStoreUrl); } - QString userStoreUrl() + virtual QString userStoreUrl() const override { return m_url; } @@ -18953,6 +18953,16 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore } } + virtual void setNoteStoreUrl(QString noteStoreUrl) override + { + m_service->setNoteStoreUrl(noteStoreUrl); + } + + virtual QString noteStoreUrl() const override + { + return m_service->noteStoreUrl(); + } + virtual SyncState getSyncState( IRequestContextPtr ctx = {}) override; @@ -19640,6 +19650,16 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore } } + virtual void setUserStoreUrl(QString userStoreUrl) override + { + m_service->setUserStoreUrl(userStoreUrl); + } + + virtual QString userStoreUrl() const override + { + return m_service->userStoreUrl(); + } + virtual bool checkVersion( QString clientName, qint16 edamVersionMajor = EDAM_VERSION_MAJOR, From b66b4670f3ca230ffb7088a30722ce1d96fd2416 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 5 Dec 2019 07:44:23 +0300 Subject: [PATCH 102/188] Add printing of ThriftException::Type --- QEverCloud/headers/Exceptions.h | 3 +++ QEverCloud/src/Exceptions.cpp | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index b7f4668c..a1cb1f5f 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -84,6 +84,9 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException INVALID_DATA = 8 }; + friend QEVERCLOUD_EXPORT QTextStream & operator<<( + QTextStream & strm, const Type type); + ThriftException(); ThriftException(Type type); ThriftException(Type type, QString message); diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index de4c45a3..683d6b9c 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -177,6 +177,45 @@ ThriftException::ThriftException(ThriftException::Type type, QString message) : ThriftException::~ThriftException() noexcept {} +QTextStream & operator<<(QTextStream & strm, const ThriftException::Type type) +{ + switch(type) + { + case ThriftException::Type::UNKNOWN: + strm << "Unknown application exception"; + break; + case ThriftException::Type::UNKNOWN_METHOD: + strm << "Unknown method"; + break; + case ThriftException::Type::INVALID_MESSAGE_TYPE: + strm << "Invalid message type"; + break; + case ThriftException::Type::WRONG_METHOD_NAME: + strm << "Wrong method name"; + break; + case ThriftException::Type::BAD_SEQUENCE_ID: + strm << "Bad sequence identifier"; + break; + case ThriftException::Type::MISSING_RESULT: + strm << "Missing result"; + break; + case ThriftException::Type::INTERNAL_ERROR: + strm << "Internal error"; + break; + case ThriftException::Type::PROTOCOL_ERROR: + strm << "Protocol error"; + break; + case ThriftException::Type::INVALID_DATA: + strm << "Invalid data"; + break; + default: + strm << "Invalid exception type: " << static_cast(type); + break; + } + + return strm; +} + bool ThriftException::operator==(const ThriftException & other) const { return m_type == other.m_type && m_error == other.m_error; From a3cc7d65ac1088586fe031f4251540ba8cad7e7b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 6 Dec 2019 08:01:50 +0300 Subject: [PATCH 103/188] Fix infinite recursion in Printable implementation --- QEverCloud/src/Printable.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/Printable.cpp b/QEverCloud/src/Printable.cpp index 964add2c..293ce03b 100644 --- a/QEverCloud/src/Printable.cpp +++ b/QEverCloud/src/Printable.cpp @@ -19,13 +19,17 @@ QString Printable::toString() const QTextStream & operator<<(QTextStream & strm, const Printable & printable) { - strm << printable.toString(); + printable.print(strm); return strm; } QDebug & operator<<(QDebug & dbg, const Printable & printable) { - dbg << printable.toString(); + QString str; + QTextStream strm(&str); + printable.print(strm); + + dbg << str; return dbg; } From c41fb94d97a6e4102b9ee8b32aa8cdc75a882bb5 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 12:09:56 +0300 Subject: [PATCH 104/188] Require Qt >= 5.5 and remove Qt4 leftovers --- .../QEverCloudFindQt4Dependencies.cmake | 9 --- ...erCloudFindQt4DependenciesWithWebKit.cmake | 9 --- .../cmake/modules/QEverCloudSetupQt.cmake | 73 +++++++++++++++---- 3 files changed, 57 insertions(+), 34 deletions(-) delete mode 100644 QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake delete mode 100644 QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake diff --git a/QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake b/QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake deleted file mode 100644 index 4c145084..00000000 --- a/QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake +++ /dev/null @@ -1,9 +0,0 @@ -find_package(Qt4 COMPONENTS QTCORE QTGUI QTNETWORK QUIET REQUIRED) - -include(${QT_USE_FILE}) - -# Workaround what seems to be a CMake 3.x bug with Qt4 libraries -list(FIND QT_LIBRARIES "${QT_QTGUI_LIBRARY}" HasGui) -if(HasGui EQUAL -1) - list(APPEND QT_LIBRARIES ${QT_QTGUI_LIBRARY}) -endif() diff --git a/QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake b/QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake deleted file mode 100644 index c0da4281..00000000 --- a/QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake +++ /dev/null @@ -1,9 +0,0 @@ -find_package(Qt4 COMPONENTS QTCORE QTGUI QTNETWORK QTWEBKIT QUIET REQUIRED) - -include(${QT_USE_FILE}) - -# Workaround what seems to be a CMake 3.x bug with Qt4 libraries -list(FIND QT_LIBRARIES "${QT_QTGUI_LIBRARY}" HasGui) -if(HasGui EQUAL -1) - list(APPEND QT_LIBRARIES ${QT_QTGUI_LIBRARY}) -endif() diff --git a/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake b/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake index 84604dde..6f8a6ea6 100644 --- a/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake +++ b/QEverCloud/cmake/modules/QEverCloudSetupQt.cmake @@ -1,17 +1,28 @@ set(QEVERCLOUD_FIND_PACKAGE_ARG "VERBOSE") -find_package(Qt5Core QUIET REQUIRED) +find_package(Qt5Core 5.5 REQUIRED) message(STATUS "Found Qt5 installation, version ${Qt5Core_VERSION}") include(QEverCloudFindPackageWrapperMacro) include(QEverCloudFindQt5DependenciesCore) -list(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) -list(APPEND QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES}) -list(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) +list(APPEND QT_INCLUDES + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS}) + +list(APPEND QT_LIBRARIES + ${Qt5Core_LIBRARIES} + ${Qt5Network_LIBRARIES} + ${Qt5Widgets_LIBRARIES}) + +list(APPEND QT_DEFINITIONS + ${Qt5Core_DEFINITIONS} + ${Qt5Network_DEFINITIONS} + ${Qt5Widgets_DEFINITIONS}) if(BUILD_WITH_OAUTH_SUPPORT) - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) + if(USE_QT5_WEBKIT) include(QEverCloudFindQt5DependenciesWebKit) elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") include(QEverCloudFindQt5DependenciesWebEngineNoCore) @@ -25,22 +36,52 @@ if(BUILD_WITH_OAUTH_SUPPORT) add_definitions(-DQEVERCLOUD_USE_QT_WEB_ENGINE) endif() - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebKit_INCLUDE_DIRS} ${Qt5WebKitWidgets_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebKit_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebKit_DEFINITIONS} ${Qt5WebKitWidgets_DEFINITIONS}) + if(USE_QT5_WEBKIT) + list(APPEND QT_INCLUDES + ${QT_INCLUDES} + ${Qt5WebKit_INCLUDE_DIRS} + ${Qt5WebKitWidgets_INCLUDE_DIRS}) + + list(APPEND QT_LIBRARIES + ${QT_LIBRARIES} + ${Qt5WebKit_LIBRARIES} + ${Qt5WebKitWidgets_LIBRARIES}) + + list(APPEND QT_DEFINITIONS + ${QT_DEFINITIONS} + ${Qt5WebKit_DEFINITIONS} + ${Qt5WebKitWidgets_DEFINITIONS}) else() if(Qt5WebEngine_VERSION VERSION_LESS "5.6.0") - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngine_INCLUDE_DIRS} ${Qt5WebEngineWidgets_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngine_LIBRARIES} ${Qt5WebEngineWidgets_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngine_DEFINITIONS} ${Qt5WebEngineWidgets_DEFINITIONS}) + list(APPEND QT_INCLUDES + ${QT_INCLUDES} + ${Qt5WebEngine_INCLUDE_DIRS} + ${Qt5WebEngineWidgets_INCLUDE_DIRS}) + + list(APPEND QT_LIBRARIES + ${QT_LIBRARIES} + ${Qt5WebEngine_LIBRARIES} + ${Qt5WebEngineWidgets_LIBRARIES}) + + list(APPEND QT_DEFINITIONS + ${QT_DEFINITIONS} + ${Qt5WebEngine_DEFINITIONS} + ${Qt5WebEngineWidgets_DEFINITIONS}) else() - list(APPEND QT_INCLUDES ${QT_INCLUDES} ${Qt5WebEngineCore_INCLUDE_DIRS}) - list(APPEND QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WebEngineCore_LIBRARIES}) - list(APPEND QT_DEFINITIONS ${QT_DEFINITIONS} ${Qt5WebEngineCore_DEFINITIONS}) + list(APPEND QT_INCLUDES + ${QT_INCLUDES} + ${Qt5WebEngineCore_INCLUDE_DIRS}) + + list(APPEND QT_LIBRARIES + ${QT_LIBRARIES} + ${Qt5WebEngineCore_LIBRARIES}) + + list(APPEND QT_DEFINITIONS + ${QT_DEFINITIONS} + ${Qt5WebEngineCore_DEFINITIONS}) endif() endif() -endif(BUILD_WITH_OAUTH_SUPPORT) +endif() list(REMOVE_DUPLICATES QT_INCLUDES) list(REMOVE_DUPLICATES QT_LIBRARIES) From fec7951ef1730d1eae9f2cf2d373d312e91ff31e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 15:22:36 +0300 Subject: [PATCH 105/188] Bump year in copyright in two source files + add missing license to one source file --- QEverCloud/src/EventLoopFinisher.cpp | 2 +- QEverCloud/src/EverCloudException.cpp | 2 +- QEverCloud/src/RequestContext.cpp | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/EventLoopFinisher.cpp b/QEverCloud/src/EventLoopFinisher.cpp index 316bbda3..4112a102 100644 --- a/QEverCloud/src/EventLoopFinisher.cpp +++ b/QEverCloud/src/EventLoopFinisher.cpp @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms * of MIT license: diff --git a/QEverCloud/src/EverCloudException.cpp b/QEverCloud/src/EverCloudException.cpp index 60330031..c5dbbb82 100644 --- a/QEverCloud/src/EverCloudException.cpp +++ b/QEverCloud/src/EverCloudException.cpp @@ -1,6 +1,6 @@ /** * Original work: Copyright (c) 2014 Sergey Skoblikov - * Modified work: Copyright (c) 2015-2016 Dmitry Ivanov + * Modified work: Copyright (c) 2015-2019 Dmitry Ivanov * * This file is a part of QEverCloud project and is distributed under the terms * of MIT license: diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index 7d752dbb..de075d25 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -1,3 +1,10 @@ +/** + * Copyright (c) 2019 Dmitry Ivanov + * + * This file is a part of QEverCloud project and is distributed under the terms + * of MIT license: https://opensource.org/licenses/MIT + */ + #include namespace qevercloud { From df534e5a5c01411024b11624ec4881565899d828 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 18:26:40 +0300 Subject: [PATCH 106/188] Add clone method to IRequestContext interface --- QEverCloud/headers/RequestContext.h | 6 ++++++ QEverCloud/src/RequestContext.cpp | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index b5d7c249..03cef6f9 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -57,6 +57,12 @@ class QEVERCLOUD_EXPORT IRequestContext /** Max number of attempts to retry a request */ virtual quint32 maxRequestRetryCount() const = 0; + /** + * Create a new instance of IRequestContext with all the same parameters + * as in the source but a distinct id + */ + virtual QSharedPointer clone() const = 0; + friend QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & strm, const IRequestContext & ctx); diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index de075d25..7aebcbf6 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -56,6 +56,16 @@ class Q_DECL_HIDDEN RequestContext final: public IRequestContext return m_maxRequestRetryCount; } + virtual QSharedPointer clone() const override + { + return QSharedPointer::create( + m_authenticationToken, + m_requestTimeout, + m_increaseRequestTimeoutExponentially, + m_maxRequestTimeout, + m_maxRequestRetryCount); + } + private: QUuid m_requestId; QString m_authenticationToken; @@ -68,7 +78,7 @@ class Q_DECL_HIDDEN RequestContext final: public IRequestContext //////////////////////////////////////////////////////////////////////////////// template -void PrintRequestContext(const IRequestContext & ctx, T & strm) +void printRequestContext(const IRequestContext & ctx, T & strm) { strm << "RequestContext:\n" << " authentication token = " << ctx.authenticationToken() << "\n" @@ -82,13 +92,13 @@ void PrintRequestContext(const IRequestContext & ctx, T & strm) QTextStream & operator<<(QTextStream & strm, const IRequestContext & ctx) { - PrintRequestContext(ctx, strm); + printRequestContext(ctx, strm); return strm; } QDebug & operator<<(QDebug & dbg, const IRequestContext & ctx) { - PrintRequestContext(ctx, dbg); + printRequestContext(ctx, dbg); return dbg; } From 85e0b19266fd96a8220ac21fe55891ccd72e5bed Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 18:27:31 +0300 Subject: [PATCH 107/188] Update generated code --- QEverCloud/src/generated/Services.cpp | 712 +++++++++++++------------- 1 file changed, 356 insertions(+), 356 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index a94d3dd0..9c5a9376 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -855,7 +855,7 @@ SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getSyncState: request id = " @@ -880,7 +880,7 @@ AsyncResult * NoteStore::getSyncStateAsync( QEC_DEBUG("note_store", "NoteStore::getSyncStateAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetSyncStatePrepareParams( @@ -1057,7 +1057,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk: request id = " @@ -1096,7 +1096,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( << " filter = " << filter); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( @@ -1267,7 +1267,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState: request id = " @@ -1298,7 +1298,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( @@ -1497,7 +1497,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk: request id = " @@ -1540,7 +1540,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( << " fullSyncOnly = " << fullSyncOnly); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( @@ -1705,7 +1705,7 @@ QList NoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listNotebooks: request id = " @@ -1730,7 +1730,7 @@ AsyncResult * NoteStore::listNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listNotebooksAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListNotebooksPrepareParams( @@ -1891,7 +1891,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks: request id = " @@ -1916,7 +1916,7 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooksAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( @@ -2084,7 +2084,7 @@ Notebook NoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNotebook: request id = " @@ -2115,7 +2115,7 @@ AsyncResult * NoteStore::getNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNotebookPrepareParams( @@ -2263,7 +2263,7 @@ Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook: request id = " @@ -2288,7 +2288,7 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( QEC_DEBUG("note_store", "NoteStore::getDefaultNotebookAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( @@ -2456,7 +2456,7 @@ Notebook NoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createNotebook: request id = " @@ -2487,7 +2487,7 @@ AsyncResult * NoteStore::createNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateNotebookPrepareParams( @@ -2656,7 +2656,7 @@ qint32 NoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateNotebook: request id = " @@ -2687,7 +2687,7 @@ AsyncResult * NoteStore::updateNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateNotebookPrepareParams( @@ -2856,7 +2856,7 @@ qint32 NoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::expungeNotebook: request id = " @@ -2887,7 +2887,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreExpungeNotebookPrepareParams( @@ -3049,7 +3049,7 @@ QList NoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listTags: request id = " @@ -3074,7 +3074,7 @@ AsyncResult * NoteStore::listTagsAsync( QEC_DEBUG("note_store", "NoteStore::listTagsAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListTagsPrepareParams( @@ -3256,7 +3256,7 @@ QList NoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook: request id = " @@ -3287,7 +3287,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListTagsByNotebookPrepareParams( @@ -3456,7 +3456,7 @@ Tag NoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getTag: request id = " @@ -3487,7 +3487,7 @@ AsyncResult * NoteStore::getTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetTagPrepareParams( @@ -3656,7 +3656,7 @@ Tag NoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createTag: request id = " @@ -3687,7 +3687,7 @@ AsyncResult * NoteStore::createTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateTagPrepareParams( @@ -3856,7 +3856,7 @@ qint32 NoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateTag: request id = " @@ -3887,7 +3887,7 @@ AsyncResult * NoteStore::updateTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateTagPrepareParams( @@ -4036,7 +4036,7 @@ void NoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::untagAll: request id = " @@ -4067,7 +4067,7 @@ AsyncResult * NoteStore::untagAllAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUntagAllPrepareParams( @@ -4236,7 +4236,7 @@ qint32 NoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::expungeTag: request id = " @@ -4267,7 +4267,7 @@ AsyncResult * NoteStore::expungeTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreExpungeTagPrepareParams( @@ -4429,7 +4429,7 @@ QList NoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listSearches: request id = " @@ -4454,7 +4454,7 @@ AsyncResult * NoteStore::listSearchesAsync( QEC_DEBUG("note_store", "NoteStore::listSearchesAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListSearchesPrepareParams( @@ -4622,7 +4622,7 @@ SavedSearch NoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getSearch: request id = " @@ -4653,7 +4653,7 @@ AsyncResult * NoteStore::getSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetSearchPrepareParams( @@ -4811,7 +4811,7 @@ SavedSearch NoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createSearch: request id = " @@ -4842,7 +4842,7 @@ AsyncResult * NoteStore::createSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateSearchPrepareParams( @@ -5011,7 +5011,7 @@ qint32 NoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateSearch: request id = " @@ -5042,7 +5042,7 @@ AsyncResult * NoteStore::updateSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateSearchPrepareParams( @@ -5211,7 +5211,7 @@ qint32 NoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::expungeSearch: request id = " @@ -5242,7 +5242,7 @@ AsyncResult * NoteStore::expungeSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreExpungeSearchPrepareParams( @@ -5421,7 +5421,7 @@ qint32 NoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::findNoteOffset: request id = " @@ -5456,7 +5456,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreFindNoteOffsetPrepareParams( @@ -5656,7 +5656,7 @@ NotesMetadataList NoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::findNotesMetadata: request id = " @@ -5699,7 +5699,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreFindNotesMetadataPrepareParams( @@ -5881,7 +5881,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::findNoteCounts: request id = " @@ -5916,7 +5916,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( << " withTrash = " << withTrash); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreFindNoteCountsPrepareParams( @@ -6096,7 +6096,7 @@ Note NoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec: request id = " @@ -6131,7 +6131,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( @@ -6341,7 +6341,7 @@ Note NoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNote: request id = " @@ -6388,7 +6388,7 @@ AsyncResult * NoteStore::getNoteAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNotePrepareParams( @@ -6561,7 +6561,7 @@ LazyMap NoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData: request id = " @@ -6592,7 +6592,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( @@ -6771,7 +6771,7 @@ QString NoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry: request id = " @@ -6806,7 +6806,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( @@ -6996,7 +6996,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry: request id = " @@ -7035,7 +7035,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( @@ -7216,7 +7216,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry: request id = " @@ -7251,7 +7251,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( @@ -7421,7 +7421,7 @@ QString NoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteContent: request id = " @@ -7452,7 +7452,7 @@ AsyncResult * NoteStore::getNoteContentAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteContentPrepareParams( @@ -7641,7 +7641,7 @@ QString NoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteSearchText: request id = " @@ -7680,7 +7680,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( << " tokenizeForIndexing = " << tokenizeForIndexing); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( @@ -7851,7 +7851,7 @@ QString NoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceSearchText: request id = " @@ -7882,7 +7882,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( @@ -8065,7 +8065,7 @@ QStringList NoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteTagNames: request id = " @@ -8096,7 +8096,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( @@ -8265,7 +8265,7 @@ Note NoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createNote: request id = " @@ -8296,7 +8296,7 @@ AsyncResult * NoteStore::createNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateNotePrepareParams( @@ -8465,7 +8465,7 @@ Note NoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateNote: request id = " @@ -8496,7 +8496,7 @@ AsyncResult * NoteStore::updateNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateNotePrepareParams( @@ -8665,7 +8665,7 @@ qint32 NoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::deleteNote: request id = " @@ -8696,7 +8696,7 @@ AsyncResult * NoteStore::deleteNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreDeleteNotePrepareParams( @@ -8865,7 +8865,7 @@ qint32 NoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::expungeNote: request id = " @@ -8896,7 +8896,7 @@ AsyncResult * NoteStore::expungeNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreExpungeNotePrepareParams( @@ -9075,7 +9075,7 @@ Note NoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::copyNote: request id = " @@ -9110,7 +9110,7 @@ AsyncResult * NoteStore::copyNoteAsync( << " toNotebookGuid = " << toNotebookGuid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCopyNotePrepareParams( @@ -9294,7 +9294,7 @@ QList NoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listNoteVersions: request id = " @@ -9325,7 +9325,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( << " noteGuid = " << noteGuid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListNoteVersionsPrepareParams( @@ -9534,7 +9534,7 @@ Note NoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteVersion: request id = " @@ -9581,7 +9581,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNoteVersionPrepareParams( @@ -9794,7 +9794,7 @@ Resource NoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResource: request id = " @@ -9841,7 +9841,7 @@ AsyncResult * NoteStore::getResourceAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourcePrepareParams( @@ -10014,7 +10014,7 @@ LazyMap NoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData: request id = " @@ -10045,7 +10045,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( @@ -10224,7 +10224,7 @@ QString NoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry: request id = " @@ -10259,7 +10259,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( @@ -10449,7 +10449,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry: request id = " @@ -10488,7 +10488,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( @@ -10669,7 +10669,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry: request id = " @@ -10704,7 +10704,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( @@ -10874,7 +10874,7 @@ qint32 NoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateResource: request id = " @@ -10905,7 +10905,7 @@ AsyncResult * NoteStore::updateResourceAsync( << " resource = " << resource); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateResourcePrepareParams( @@ -11074,7 +11074,7 @@ QByteArray NoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceData: request id = " @@ -11105,7 +11105,7 @@ AsyncResult * NoteStore::getResourceDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceDataPrepareParams( @@ -11314,7 +11314,7 @@ Resource NoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceByHash: request id = " @@ -11361,7 +11361,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceByHashPrepareParams( @@ -11534,7 +11534,7 @@ QByteArray NoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceRecognition: request id = " @@ -11565,7 +11565,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( @@ -11734,7 +11734,7 @@ QByteArray NoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData: request id = " @@ -11765,7 +11765,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( @@ -11934,7 +11934,7 @@ ResourceAttributes NoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceAttributes: request id = " @@ -11965,7 +11965,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetResourceAttributesPrepareParams( @@ -12124,7 +12124,7 @@ Notebook NoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getPublicNotebook: request id = " @@ -12158,7 +12158,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( << " publicUri = " << publicUri); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetPublicNotebookPrepareParams( @@ -12337,7 +12337,7 @@ SharedNotebook NoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::shareNotebook: request id = " @@ -12372,7 +12372,7 @@ AsyncResult * NoteStore::shareNotebookAsync( << " message = " << message); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreShareNotebookPrepareParams( @@ -12553,7 +12553,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares: request id = " @@ -12584,7 +12584,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( << " shareTemplate = " << shareTemplate); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( @@ -12753,7 +12753,7 @@ qint32 NoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook: request id = " @@ -12784,7 +12784,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( << " sharedNotebook = " << sharedNotebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( @@ -12963,7 +12963,7 @@ Notebook NoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings: request id = " @@ -12998,7 +12998,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( << " recipientSettings = " << recipientSettings); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( @@ -13172,7 +13172,7 @@ QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks: request id = " @@ -13197,7 +13197,7 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listSharedNotebooksAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListSharedNotebooksPrepareParams( @@ -13365,7 +13365,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook: request id = " @@ -13396,7 +13396,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( @@ -13565,7 +13565,7 @@ qint32 NoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook: request id = " @@ -13596,7 +13596,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( @@ -13769,7 +13769,7 @@ QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks: request id = " @@ -13794,7 +13794,7 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooksAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( @@ -13962,7 +13962,7 @@ qint32 NoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook: request id = " @@ -13993,7 +13993,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( @@ -14162,7 +14162,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook: request id = " @@ -14193,7 +14193,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( @@ -14352,7 +14352,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth: request id = " @@ -14377,7 +14377,7 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuthAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( @@ -14525,7 +14525,7 @@ void NoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::emailNote: request id = " @@ -14556,7 +14556,7 @@ AsyncResult * NoteStore::emailNoteAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreEmailNotePrepareParams( @@ -14725,7 +14725,7 @@ QString NoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::shareNote: request id = " @@ -14756,7 +14756,7 @@ AsyncResult * NoteStore::shareNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreShareNotePrepareParams( @@ -14905,7 +14905,7 @@ void NoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::stopSharingNote: request id = " @@ -14936,7 +14936,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreStopSharingNotePrepareParams( @@ -15115,7 +15115,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote: request id = " @@ -15150,7 +15150,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( << " noteKey = " << noteKey); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( @@ -15330,7 +15330,7 @@ RelatedResult NoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::findRelated: request id = " @@ -15365,7 +15365,7 @@ AsyncResult * NoteStore::findRelatedAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreFindRelatedPrepareParams( @@ -15535,7 +15535,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches: request id = " @@ -15566,7 +15566,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( @@ -15735,7 +15735,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::manageNotebookShares: request id = " @@ -15766,7 +15766,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreManageNotebookSharesPrepareParams( @@ -15935,7 +15935,7 @@ ShareRelationships NoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("note_store", "NoteStore::getNotebookShares: request id = " @@ -15966,7 +15966,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = NoteStoreGetNotebookSharesPrepareParams( @@ -16286,7 +16286,7 @@ bool UserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::checkVersion: request id = " @@ -16324,7 +16324,7 @@ AsyncResult * UserStore::checkVersionAsync( << " edamVersionMinor = " << edamVersionMinor); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreCheckVersionPrepareParams( @@ -16452,7 +16452,7 @@ BootstrapInfo UserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::getBootstrapInfo: request id = " @@ -16482,7 +16482,7 @@ AsyncResult * UserStore::getBootstrapInfoAsync( << " locale = " << locale); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreGetBootstrapInfoPrepareParams( @@ -16690,7 +16690,7 @@ AuthenticationResult UserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::authenticateLongSession: request id = " @@ -16738,7 +16738,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( << " supportsTwoFactor = " << supportsTwoFactor); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( @@ -16921,7 +16921,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication: request id = " @@ -16958,7 +16958,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( << " deviceDescription = " << deviceDescription); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( @@ -17088,7 +17088,7 @@ void UserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::revokeLongSession: request id = " @@ -17113,7 +17113,7 @@ AsyncResult * UserStore::revokeLongSessionAsync( QEC_DEBUG("user_store", "UserStore::revokeLongSessionAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreRevokeLongSessionPrepareParams( @@ -17260,7 +17260,7 @@ AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::authenticateToBusiness: request id = " @@ -17285,7 +17285,7 @@ AsyncResult * UserStore::authenticateToBusinessAsync( QEC_DEBUG("user_store", "UserStore::authenticateToBusinessAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( @@ -17432,7 +17432,7 @@ User UserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::getUser: request id = " @@ -17457,7 +17457,7 @@ AsyncResult * UserStore::getUserAsync( QEC_DEBUG("user_store", "UserStore::getUserAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreGetUserPrepareParams( @@ -17616,7 +17616,7 @@ PublicUserInfo UserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::getPublicUserInfo: request id = " @@ -17646,7 +17646,7 @@ AsyncResult * UserStore::getPublicUserInfoAsync( << " username = " << username); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreGetPublicUserInfoPrepareParams( @@ -17793,7 +17793,7 @@ UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::getUserUrls: request id = " @@ -17818,7 +17818,7 @@ AsyncResult * UserStore::getUserUrlsAsync( QEC_DEBUG("user_store", "UserStore::getUserUrlsAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreGetUserUrlsPrepareParams( @@ -17955,7 +17955,7 @@ void UserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::inviteToBusiness: request id = " @@ -17986,7 +17986,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreInviteToBusinessPrepareParams( @@ -18135,7 +18135,7 @@ void UserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::removeFromBusiness: request id = " @@ -18166,7 +18166,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreRemoveFromBusinessPrepareParams( @@ -18325,7 +18325,7 @@ void UserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier: request id = " @@ -18360,7 +18360,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( << " newEmailAddress = " << newEmailAddress); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( @@ -18523,7 +18523,7 @@ QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::listBusinessUsers: request id = " @@ -18548,7 +18548,7 @@ AsyncResult * UserStore::listBusinessUsersAsync( QEC_DEBUG("user_store", "UserStore::listBusinessUsersAsync"); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreListBusinessUsersPrepareParams( @@ -18719,7 +18719,7 @@ QList UserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::listBusinessInvitations: request id = " @@ -18750,7 +18750,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( << " includeRequestedInvitations = " << includeRequestedInvitations); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreListBusinessInvitationsPrepareParams( @@ -18888,7 +18888,7 @@ AccountLimits UserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QEC_DEBUG("user_store", "UserStore::getAccountLimits: request id = " @@ -18918,7 +18918,7 @@ AsyncResult * UserStore::getAccountLimitsAsync( << " serviceLevel = " << serviceLevel); if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } QByteArray params = UserStoreGetAccountLimitsPrepareParams( @@ -19804,7 +19804,7 @@ SyncState DurableNoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -19830,7 +19830,7 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -19857,7 +19857,7 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -19897,7 +19897,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -19933,7 +19933,7 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -19967,7 +19967,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20002,7 +20002,7 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20045,7 +20045,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20082,7 +20082,7 @@ QList DurableNoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20108,7 +20108,7 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20132,7 +20132,7 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20158,7 +20158,7 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20183,7 +20183,7 @@ Notebook DurableNoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20217,7 +20217,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20248,7 +20248,7 @@ Notebook DurableNoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20274,7 +20274,7 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20299,7 +20299,7 @@ Notebook DurableNoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20333,7 +20333,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20365,7 +20365,7 @@ qint32 DurableNoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20399,7 +20399,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20431,7 +20431,7 @@ qint32 DurableNoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20465,7 +20465,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20496,7 +20496,7 @@ QList DurableNoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20522,7 +20522,7 @@ AsyncResult * DurableNoteStore::listTagsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20547,7 +20547,7 @@ QList DurableNoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20581,7 +20581,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20613,7 +20613,7 @@ Tag DurableNoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20647,7 +20647,7 @@ AsyncResult * DurableNoteStore::getTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20679,7 +20679,7 @@ Tag DurableNoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20713,7 +20713,7 @@ AsyncResult * DurableNoteStore::createTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20745,7 +20745,7 @@ qint32 DurableNoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20779,7 +20779,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20811,7 +20811,7 @@ void DurableNoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20845,7 +20845,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20877,7 +20877,7 @@ qint32 DurableNoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20911,7 +20911,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20942,7 +20942,7 @@ QList DurableNoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -20968,7 +20968,7 @@ AsyncResult * DurableNoteStore::listSearchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20993,7 +20993,7 @@ SavedSearch DurableNoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21027,7 +21027,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21059,7 +21059,7 @@ SavedSearch DurableNoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21093,7 +21093,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21125,7 +21125,7 @@ qint32 DurableNoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21159,7 +21159,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21191,7 +21191,7 @@ qint32 DurableNoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21225,7 +21225,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21258,7 +21258,7 @@ qint32 DurableNoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21295,7 +21295,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21332,7 +21332,7 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21375,7 +21375,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21414,7 +21414,7 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21451,7 +21451,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21486,7 +21486,7 @@ Note DurableNoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21523,7 +21523,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21561,7 +21561,7 @@ Note DurableNoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21607,7 +21607,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21647,7 +21647,7 @@ LazyMap DurableNoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21681,7 +21681,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21714,7 +21714,7 @@ QString DurableNoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21751,7 +21751,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21787,7 +21787,7 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21827,7 +21827,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21864,7 +21864,7 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21901,7 +21901,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21935,7 +21935,7 @@ QString DurableNoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -21969,7 +21969,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22003,7 +22003,7 @@ QString DurableNoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22043,7 +22043,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22079,7 +22079,7 @@ QString DurableNoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22113,7 +22113,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22145,7 +22145,7 @@ QStringList DurableNoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22179,7 +22179,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22211,7 +22211,7 @@ Note DurableNoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22245,7 +22245,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22277,7 +22277,7 @@ Note DurableNoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22311,7 +22311,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22343,7 +22343,7 @@ qint32 DurableNoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22377,7 +22377,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22409,7 +22409,7 @@ qint32 DurableNoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22443,7 +22443,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22476,7 +22476,7 @@ Note DurableNoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22513,7 +22513,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22547,7 +22547,7 @@ QList DurableNoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22581,7 +22581,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22617,7 +22617,7 @@ Note DurableNoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22663,7 +22663,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22707,7 +22707,7 @@ Resource DurableNoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22753,7 +22753,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22793,7 +22793,7 @@ LazyMap DurableNoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22827,7 +22827,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22860,7 +22860,7 @@ QString DurableNoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22897,7 +22897,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22933,7 +22933,7 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -22973,7 +22973,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23010,7 +23010,7 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23047,7 +23047,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23081,7 +23081,7 @@ qint32 DurableNoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23115,7 +23115,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23147,7 +23147,7 @@ QByteArray DurableNoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23181,7 +23181,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23217,7 +23217,7 @@ Resource DurableNoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23263,7 +23263,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23303,7 +23303,7 @@ QByteArray DurableNoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23337,7 +23337,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23369,7 +23369,7 @@ QByteArray DurableNoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23403,7 +23403,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23435,7 +23435,7 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23469,7 +23469,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23502,7 +23502,7 @@ Notebook DurableNoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23539,7 +23539,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23574,7 +23574,7 @@ SharedNotebook DurableNoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23611,7 +23611,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23645,7 +23645,7 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23679,7 +23679,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23711,7 +23711,7 @@ qint32 DurableNoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23745,7 +23745,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23778,7 +23778,7 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23815,7 +23815,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23848,7 +23848,7 @@ QList DurableNoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23874,7 +23874,7 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23899,7 +23899,7 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23933,7 +23933,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23965,7 +23965,7 @@ qint32 DurableNoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -23999,7 +23999,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24030,7 +24030,7 @@ QList DurableNoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24056,7 +24056,7 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24081,7 +24081,7 @@ qint32 DurableNoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24115,7 +24115,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24147,7 +24147,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24181,7 +24181,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24212,7 +24212,7 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24238,7 +24238,7 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24263,7 +24263,7 @@ void DurableNoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24297,7 +24297,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24329,7 +24329,7 @@ QString DurableNoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24363,7 +24363,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24395,7 +24395,7 @@ void DurableNoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24429,7 +24429,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24462,7 +24462,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24499,7 +24499,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24534,7 +24534,7 @@ RelatedResult DurableNoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24571,7 +24571,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24605,7 +24605,7 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24639,7 +24639,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24671,7 +24671,7 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24705,7 +24705,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24737,7 +24737,7 @@ ShareRelationships DurableNoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24771,7 +24771,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24807,7 +24807,7 @@ bool DurableUserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24847,7 +24847,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24883,7 +24883,7 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -24917,7 +24917,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24955,7 +24955,7 @@ AuthenticationResult DurableUserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25004,7 +25004,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25047,7 +25047,7 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25086,7 +25086,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25120,7 +25120,7 @@ void DurableUserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25146,7 +25146,7 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25170,7 +25170,7 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25196,7 +25196,7 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25220,7 +25220,7 @@ User DurableUserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25246,7 +25246,7 @@ AsyncResult * DurableUserStore::getUserAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25271,7 +25271,7 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25305,7 +25305,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25336,7 +25336,7 @@ UserUrls DurableUserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25362,7 +25362,7 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25387,7 +25387,7 @@ void DurableUserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25421,7 +25421,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25453,7 +25453,7 @@ void DurableUserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25487,7 +25487,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25520,7 +25520,7 @@ void DurableUserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25557,7 +25557,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25590,7 +25590,7 @@ QList DurableUserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25616,7 +25616,7 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25641,7 +25641,7 @@ QList DurableUserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25675,7 +25675,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25707,7 +25707,7 @@ AccountLimits DurableUserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::SyncServiceCall( @@ -25741,7 +25741,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx.clone(); } auto call = IDurableService::AsyncServiceCall( From 9c82193da15e6e877e01d04ed6bc55b4a688db36 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 18:53:11 +0300 Subject: [PATCH 108/188] Update generated code --- QEverCloud/src/generated/Services.cpp | 712 +++++++++++++------------- 1 file changed, 356 insertions(+), 356 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 9c5a9376..ef204707 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -855,7 +855,7 @@ SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getSyncState: request id = " @@ -880,7 +880,7 @@ AsyncResult * NoteStore::getSyncStateAsync( QEC_DEBUG("note_store", "NoteStore::getSyncStateAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetSyncStatePrepareParams( @@ -1057,7 +1057,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk: request id = " @@ -1096,7 +1096,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( << " filter = " << filter); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( @@ -1267,7 +1267,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState: request id = " @@ -1298,7 +1298,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( @@ -1497,7 +1497,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk: request id = " @@ -1540,7 +1540,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( << " fullSyncOnly = " << fullSyncOnly); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( @@ -1705,7 +1705,7 @@ QList NoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listNotebooks: request id = " @@ -1730,7 +1730,7 @@ AsyncResult * NoteStore::listNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listNotebooksAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListNotebooksPrepareParams( @@ -1891,7 +1891,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks: request id = " @@ -1916,7 +1916,7 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooksAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( @@ -2084,7 +2084,7 @@ Notebook NoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNotebook: request id = " @@ -2115,7 +2115,7 @@ AsyncResult * NoteStore::getNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNotebookPrepareParams( @@ -2263,7 +2263,7 @@ Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook: request id = " @@ -2288,7 +2288,7 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( QEC_DEBUG("note_store", "NoteStore::getDefaultNotebookAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( @@ -2456,7 +2456,7 @@ Notebook NoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createNotebook: request id = " @@ -2487,7 +2487,7 @@ AsyncResult * NoteStore::createNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateNotebookPrepareParams( @@ -2656,7 +2656,7 @@ qint32 NoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateNotebook: request id = " @@ -2687,7 +2687,7 @@ AsyncResult * NoteStore::updateNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateNotebookPrepareParams( @@ -2856,7 +2856,7 @@ qint32 NoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::expungeNotebook: request id = " @@ -2887,7 +2887,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreExpungeNotebookPrepareParams( @@ -3049,7 +3049,7 @@ QList NoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listTags: request id = " @@ -3074,7 +3074,7 @@ AsyncResult * NoteStore::listTagsAsync( QEC_DEBUG("note_store", "NoteStore::listTagsAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListTagsPrepareParams( @@ -3256,7 +3256,7 @@ QList NoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook: request id = " @@ -3287,7 +3287,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListTagsByNotebookPrepareParams( @@ -3456,7 +3456,7 @@ Tag NoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getTag: request id = " @@ -3487,7 +3487,7 @@ AsyncResult * NoteStore::getTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetTagPrepareParams( @@ -3656,7 +3656,7 @@ Tag NoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createTag: request id = " @@ -3687,7 +3687,7 @@ AsyncResult * NoteStore::createTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateTagPrepareParams( @@ -3856,7 +3856,7 @@ qint32 NoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateTag: request id = " @@ -3887,7 +3887,7 @@ AsyncResult * NoteStore::updateTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateTagPrepareParams( @@ -4036,7 +4036,7 @@ void NoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::untagAll: request id = " @@ -4067,7 +4067,7 @@ AsyncResult * NoteStore::untagAllAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUntagAllPrepareParams( @@ -4236,7 +4236,7 @@ qint32 NoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::expungeTag: request id = " @@ -4267,7 +4267,7 @@ AsyncResult * NoteStore::expungeTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreExpungeTagPrepareParams( @@ -4429,7 +4429,7 @@ QList NoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listSearches: request id = " @@ -4454,7 +4454,7 @@ AsyncResult * NoteStore::listSearchesAsync( QEC_DEBUG("note_store", "NoteStore::listSearchesAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListSearchesPrepareParams( @@ -4622,7 +4622,7 @@ SavedSearch NoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getSearch: request id = " @@ -4653,7 +4653,7 @@ AsyncResult * NoteStore::getSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetSearchPrepareParams( @@ -4811,7 +4811,7 @@ SavedSearch NoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createSearch: request id = " @@ -4842,7 +4842,7 @@ AsyncResult * NoteStore::createSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateSearchPrepareParams( @@ -5011,7 +5011,7 @@ qint32 NoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateSearch: request id = " @@ -5042,7 +5042,7 @@ AsyncResult * NoteStore::updateSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateSearchPrepareParams( @@ -5211,7 +5211,7 @@ qint32 NoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::expungeSearch: request id = " @@ -5242,7 +5242,7 @@ AsyncResult * NoteStore::expungeSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreExpungeSearchPrepareParams( @@ -5421,7 +5421,7 @@ qint32 NoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::findNoteOffset: request id = " @@ -5456,7 +5456,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreFindNoteOffsetPrepareParams( @@ -5656,7 +5656,7 @@ NotesMetadataList NoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::findNotesMetadata: request id = " @@ -5699,7 +5699,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreFindNotesMetadataPrepareParams( @@ -5881,7 +5881,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::findNoteCounts: request id = " @@ -5916,7 +5916,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( << " withTrash = " << withTrash); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreFindNoteCountsPrepareParams( @@ -6096,7 +6096,7 @@ Note NoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec: request id = " @@ -6131,7 +6131,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( @@ -6341,7 +6341,7 @@ Note NoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNote: request id = " @@ -6388,7 +6388,7 @@ AsyncResult * NoteStore::getNoteAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNotePrepareParams( @@ -6561,7 +6561,7 @@ LazyMap NoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData: request id = " @@ -6592,7 +6592,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( @@ -6771,7 +6771,7 @@ QString NoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry: request id = " @@ -6806,7 +6806,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( @@ -6996,7 +6996,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry: request id = " @@ -7035,7 +7035,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( @@ -7216,7 +7216,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry: request id = " @@ -7251,7 +7251,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( @@ -7421,7 +7421,7 @@ QString NoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteContent: request id = " @@ -7452,7 +7452,7 @@ AsyncResult * NoteStore::getNoteContentAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteContentPrepareParams( @@ -7641,7 +7641,7 @@ QString NoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteSearchText: request id = " @@ -7680,7 +7680,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( << " tokenizeForIndexing = " << tokenizeForIndexing); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( @@ -7851,7 +7851,7 @@ QString NoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceSearchText: request id = " @@ -7882,7 +7882,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( @@ -8065,7 +8065,7 @@ QStringList NoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteTagNames: request id = " @@ -8096,7 +8096,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( @@ -8265,7 +8265,7 @@ Note NoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createNote: request id = " @@ -8296,7 +8296,7 @@ AsyncResult * NoteStore::createNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateNotePrepareParams( @@ -8465,7 +8465,7 @@ Note NoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateNote: request id = " @@ -8496,7 +8496,7 @@ AsyncResult * NoteStore::updateNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateNotePrepareParams( @@ -8665,7 +8665,7 @@ qint32 NoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::deleteNote: request id = " @@ -8696,7 +8696,7 @@ AsyncResult * NoteStore::deleteNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreDeleteNotePrepareParams( @@ -8865,7 +8865,7 @@ qint32 NoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::expungeNote: request id = " @@ -8896,7 +8896,7 @@ AsyncResult * NoteStore::expungeNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreExpungeNotePrepareParams( @@ -9075,7 +9075,7 @@ Note NoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::copyNote: request id = " @@ -9110,7 +9110,7 @@ AsyncResult * NoteStore::copyNoteAsync( << " toNotebookGuid = " << toNotebookGuid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCopyNotePrepareParams( @@ -9294,7 +9294,7 @@ QList NoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listNoteVersions: request id = " @@ -9325,7 +9325,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( << " noteGuid = " << noteGuid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListNoteVersionsPrepareParams( @@ -9534,7 +9534,7 @@ Note NoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNoteVersion: request id = " @@ -9581,7 +9581,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNoteVersionPrepareParams( @@ -9794,7 +9794,7 @@ Resource NoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResource: request id = " @@ -9841,7 +9841,7 @@ AsyncResult * NoteStore::getResourceAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourcePrepareParams( @@ -10014,7 +10014,7 @@ LazyMap NoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData: request id = " @@ -10045,7 +10045,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( @@ -10224,7 +10224,7 @@ QString NoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry: request id = " @@ -10259,7 +10259,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( @@ -10449,7 +10449,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry: request id = " @@ -10488,7 +10488,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( @@ -10669,7 +10669,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry: request id = " @@ -10704,7 +10704,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( @@ -10874,7 +10874,7 @@ qint32 NoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateResource: request id = " @@ -10905,7 +10905,7 @@ AsyncResult * NoteStore::updateResourceAsync( << " resource = " << resource); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateResourcePrepareParams( @@ -11074,7 +11074,7 @@ QByteArray NoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceData: request id = " @@ -11105,7 +11105,7 @@ AsyncResult * NoteStore::getResourceDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceDataPrepareParams( @@ -11314,7 +11314,7 @@ Resource NoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceByHash: request id = " @@ -11361,7 +11361,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceByHashPrepareParams( @@ -11534,7 +11534,7 @@ QByteArray NoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceRecognition: request id = " @@ -11565,7 +11565,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( @@ -11734,7 +11734,7 @@ QByteArray NoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData: request id = " @@ -11765,7 +11765,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( @@ -11934,7 +11934,7 @@ ResourceAttributes NoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getResourceAttributes: request id = " @@ -11965,7 +11965,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetResourceAttributesPrepareParams( @@ -12124,7 +12124,7 @@ Notebook NoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getPublicNotebook: request id = " @@ -12158,7 +12158,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( << " publicUri = " << publicUri); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetPublicNotebookPrepareParams( @@ -12337,7 +12337,7 @@ SharedNotebook NoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::shareNotebook: request id = " @@ -12372,7 +12372,7 @@ AsyncResult * NoteStore::shareNotebookAsync( << " message = " << message); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreShareNotebookPrepareParams( @@ -12553,7 +12553,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares: request id = " @@ -12584,7 +12584,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( << " shareTemplate = " << shareTemplate); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( @@ -12753,7 +12753,7 @@ qint32 NoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook: request id = " @@ -12784,7 +12784,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( << " sharedNotebook = " << sharedNotebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( @@ -12963,7 +12963,7 @@ Notebook NoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings: request id = " @@ -12998,7 +12998,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( << " recipientSettings = " << recipientSettings); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( @@ -13172,7 +13172,7 @@ QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks: request id = " @@ -13197,7 +13197,7 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listSharedNotebooksAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListSharedNotebooksPrepareParams( @@ -13365,7 +13365,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook: request id = " @@ -13396,7 +13396,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( @@ -13565,7 +13565,7 @@ qint32 NoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook: request id = " @@ -13596,7 +13596,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( @@ -13769,7 +13769,7 @@ QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks: request id = " @@ -13794,7 +13794,7 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooksAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( @@ -13962,7 +13962,7 @@ qint32 NoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook: request id = " @@ -13993,7 +13993,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( @@ -14162,7 +14162,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook: request id = " @@ -14193,7 +14193,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( @@ -14352,7 +14352,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth: request id = " @@ -14377,7 +14377,7 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuthAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( @@ -14525,7 +14525,7 @@ void NoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::emailNote: request id = " @@ -14556,7 +14556,7 @@ AsyncResult * NoteStore::emailNoteAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreEmailNotePrepareParams( @@ -14725,7 +14725,7 @@ QString NoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::shareNote: request id = " @@ -14756,7 +14756,7 @@ AsyncResult * NoteStore::shareNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreShareNotePrepareParams( @@ -14905,7 +14905,7 @@ void NoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::stopSharingNote: request id = " @@ -14936,7 +14936,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreStopSharingNotePrepareParams( @@ -15115,7 +15115,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote: request id = " @@ -15150,7 +15150,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( << " noteKey = " << noteKey); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( @@ -15330,7 +15330,7 @@ RelatedResult NoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::findRelated: request id = " @@ -15365,7 +15365,7 @@ AsyncResult * NoteStore::findRelatedAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreFindRelatedPrepareParams( @@ -15535,7 +15535,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches: request id = " @@ -15566,7 +15566,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( @@ -15735,7 +15735,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::manageNotebookShares: request id = " @@ -15766,7 +15766,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreManageNotebookSharesPrepareParams( @@ -15935,7 +15935,7 @@ ShareRelationships NoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("note_store", "NoteStore::getNotebookShares: request id = " @@ -15966,7 +15966,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = NoteStoreGetNotebookSharesPrepareParams( @@ -16286,7 +16286,7 @@ bool UserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::checkVersion: request id = " @@ -16324,7 +16324,7 @@ AsyncResult * UserStore::checkVersionAsync( << " edamVersionMinor = " << edamVersionMinor); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreCheckVersionPrepareParams( @@ -16452,7 +16452,7 @@ BootstrapInfo UserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::getBootstrapInfo: request id = " @@ -16482,7 +16482,7 @@ AsyncResult * UserStore::getBootstrapInfoAsync( << " locale = " << locale); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreGetBootstrapInfoPrepareParams( @@ -16690,7 +16690,7 @@ AuthenticationResult UserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::authenticateLongSession: request id = " @@ -16738,7 +16738,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( << " supportsTwoFactor = " << supportsTwoFactor); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( @@ -16921,7 +16921,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication: request id = " @@ -16958,7 +16958,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( << " deviceDescription = " << deviceDescription); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( @@ -17088,7 +17088,7 @@ void UserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::revokeLongSession: request id = " @@ -17113,7 +17113,7 @@ AsyncResult * UserStore::revokeLongSessionAsync( QEC_DEBUG("user_store", "UserStore::revokeLongSessionAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreRevokeLongSessionPrepareParams( @@ -17260,7 +17260,7 @@ AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::authenticateToBusiness: request id = " @@ -17285,7 +17285,7 @@ AsyncResult * UserStore::authenticateToBusinessAsync( QEC_DEBUG("user_store", "UserStore::authenticateToBusinessAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( @@ -17432,7 +17432,7 @@ User UserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::getUser: request id = " @@ -17457,7 +17457,7 @@ AsyncResult * UserStore::getUserAsync( QEC_DEBUG("user_store", "UserStore::getUserAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreGetUserPrepareParams( @@ -17616,7 +17616,7 @@ PublicUserInfo UserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::getPublicUserInfo: request id = " @@ -17646,7 +17646,7 @@ AsyncResult * UserStore::getPublicUserInfoAsync( << " username = " << username); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreGetPublicUserInfoPrepareParams( @@ -17793,7 +17793,7 @@ UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::getUserUrls: request id = " @@ -17818,7 +17818,7 @@ AsyncResult * UserStore::getUserUrlsAsync( QEC_DEBUG("user_store", "UserStore::getUserUrlsAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreGetUserUrlsPrepareParams( @@ -17955,7 +17955,7 @@ void UserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::inviteToBusiness: request id = " @@ -17986,7 +17986,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreInviteToBusinessPrepareParams( @@ -18135,7 +18135,7 @@ void UserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::removeFromBusiness: request id = " @@ -18166,7 +18166,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreRemoveFromBusinessPrepareParams( @@ -18325,7 +18325,7 @@ void UserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier: request id = " @@ -18360,7 +18360,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( << " newEmailAddress = " << newEmailAddress); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( @@ -18523,7 +18523,7 @@ QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::listBusinessUsers: request id = " @@ -18548,7 +18548,7 @@ AsyncResult * UserStore::listBusinessUsersAsync( QEC_DEBUG("user_store", "UserStore::listBusinessUsersAsync"); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreListBusinessUsersPrepareParams( @@ -18719,7 +18719,7 @@ QList UserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::listBusinessInvitations: request id = " @@ -18750,7 +18750,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( << " includeRequestedInvitations = " << includeRequestedInvitations); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreListBusinessInvitationsPrepareParams( @@ -18888,7 +18888,7 @@ AccountLimits UserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QEC_DEBUG("user_store", "UserStore::getAccountLimits: request id = " @@ -18918,7 +18918,7 @@ AsyncResult * UserStore::getAccountLimitsAsync( << " serviceLevel = " << serviceLevel); if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } QByteArray params = UserStoreGetAccountLimitsPrepareParams( @@ -19804,7 +19804,7 @@ SyncState DurableNoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -19830,7 +19830,7 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -19857,7 +19857,7 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -19897,7 +19897,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -19933,7 +19933,7 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -19967,7 +19967,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20002,7 +20002,7 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20045,7 +20045,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20082,7 +20082,7 @@ QList DurableNoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20108,7 +20108,7 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20132,7 +20132,7 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20158,7 +20158,7 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20183,7 +20183,7 @@ Notebook DurableNoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20217,7 +20217,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20248,7 +20248,7 @@ Notebook DurableNoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20274,7 +20274,7 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20299,7 +20299,7 @@ Notebook DurableNoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20333,7 +20333,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20365,7 +20365,7 @@ qint32 DurableNoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20399,7 +20399,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20431,7 +20431,7 @@ qint32 DurableNoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20465,7 +20465,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20496,7 +20496,7 @@ QList DurableNoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20522,7 +20522,7 @@ AsyncResult * DurableNoteStore::listTagsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20547,7 +20547,7 @@ QList DurableNoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20581,7 +20581,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20613,7 +20613,7 @@ Tag DurableNoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20647,7 +20647,7 @@ AsyncResult * DurableNoteStore::getTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20679,7 +20679,7 @@ Tag DurableNoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20713,7 +20713,7 @@ AsyncResult * DurableNoteStore::createTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20745,7 +20745,7 @@ qint32 DurableNoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20779,7 +20779,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20811,7 +20811,7 @@ void DurableNoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20845,7 +20845,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20877,7 +20877,7 @@ qint32 DurableNoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20911,7 +20911,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20942,7 +20942,7 @@ QList DurableNoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -20968,7 +20968,7 @@ AsyncResult * DurableNoteStore::listSearchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -20993,7 +20993,7 @@ SavedSearch DurableNoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21027,7 +21027,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21059,7 +21059,7 @@ SavedSearch DurableNoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21093,7 +21093,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21125,7 +21125,7 @@ qint32 DurableNoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21159,7 +21159,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21191,7 +21191,7 @@ qint32 DurableNoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21225,7 +21225,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21258,7 +21258,7 @@ qint32 DurableNoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21295,7 +21295,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21332,7 +21332,7 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21375,7 +21375,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21414,7 +21414,7 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21451,7 +21451,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21486,7 +21486,7 @@ Note DurableNoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21523,7 +21523,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21561,7 +21561,7 @@ Note DurableNoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21607,7 +21607,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21647,7 +21647,7 @@ LazyMap DurableNoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21681,7 +21681,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21714,7 +21714,7 @@ QString DurableNoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21751,7 +21751,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21787,7 +21787,7 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21827,7 +21827,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21864,7 +21864,7 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21901,7 +21901,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -21935,7 +21935,7 @@ QString DurableNoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -21969,7 +21969,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22003,7 +22003,7 @@ QString DurableNoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22043,7 +22043,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22079,7 +22079,7 @@ QString DurableNoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22113,7 +22113,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22145,7 +22145,7 @@ QStringList DurableNoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22179,7 +22179,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22211,7 +22211,7 @@ Note DurableNoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22245,7 +22245,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22277,7 +22277,7 @@ Note DurableNoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22311,7 +22311,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22343,7 +22343,7 @@ qint32 DurableNoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22377,7 +22377,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22409,7 +22409,7 @@ qint32 DurableNoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22443,7 +22443,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22476,7 +22476,7 @@ Note DurableNoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22513,7 +22513,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22547,7 +22547,7 @@ QList DurableNoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22581,7 +22581,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22617,7 +22617,7 @@ Note DurableNoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22663,7 +22663,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22707,7 +22707,7 @@ Resource DurableNoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22753,7 +22753,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22793,7 +22793,7 @@ LazyMap DurableNoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22827,7 +22827,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22860,7 +22860,7 @@ QString DurableNoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22897,7 +22897,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -22933,7 +22933,7 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -22973,7 +22973,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23010,7 +23010,7 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23047,7 +23047,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23081,7 +23081,7 @@ qint32 DurableNoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23115,7 +23115,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23147,7 +23147,7 @@ QByteArray DurableNoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23181,7 +23181,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23217,7 +23217,7 @@ Resource DurableNoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23263,7 +23263,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23303,7 +23303,7 @@ QByteArray DurableNoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23337,7 +23337,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23369,7 +23369,7 @@ QByteArray DurableNoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23403,7 +23403,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23435,7 +23435,7 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23469,7 +23469,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23502,7 +23502,7 @@ Notebook DurableNoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23539,7 +23539,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23574,7 +23574,7 @@ SharedNotebook DurableNoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23611,7 +23611,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23645,7 +23645,7 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23679,7 +23679,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23711,7 +23711,7 @@ qint32 DurableNoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23745,7 +23745,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23778,7 +23778,7 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23815,7 +23815,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23848,7 +23848,7 @@ QList DurableNoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23874,7 +23874,7 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23899,7 +23899,7 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23933,7 +23933,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -23965,7 +23965,7 @@ qint32 DurableNoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -23999,7 +23999,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24030,7 +24030,7 @@ QList DurableNoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24056,7 +24056,7 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24081,7 +24081,7 @@ qint32 DurableNoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24115,7 +24115,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24147,7 +24147,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24181,7 +24181,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24212,7 +24212,7 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24238,7 +24238,7 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24263,7 +24263,7 @@ void DurableNoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24297,7 +24297,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24329,7 +24329,7 @@ QString DurableNoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24363,7 +24363,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24395,7 +24395,7 @@ void DurableNoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24429,7 +24429,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24462,7 +24462,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24499,7 +24499,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24534,7 +24534,7 @@ RelatedResult DurableNoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24571,7 +24571,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24605,7 +24605,7 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24639,7 +24639,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24671,7 +24671,7 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24705,7 +24705,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24737,7 +24737,7 @@ ShareRelationships DurableNoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24771,7 +24771,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24807,7 +24807,7 @@ bool DurableUserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24847,7 +24847,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24883,7 +24883,7 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -24917,7 +24917,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -24955,7 +24955,7 @@ AuthenticationResult DurableUserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25004,7 +25004,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25047,7 +25047,7 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25086,7 +25086,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25120,7 +25120,7 @@ void DurableUserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25146,7 +25146,7 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25170,7 +25170,7 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25196,7 +25196,7 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25220,7 +25220,7 @@ User DurableUserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25246,7 +25246,7 @@ AsyncResult * DurableUserStore::getUserAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25271,7 +25271,7 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25305,7 +25305,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25336,7 +25336,7 @@ UserUrls DurableUserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25362,7 +25362,7 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25387,7 +25387,7 @@ void DurableUserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25421,7 +25421,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25453,7 +25453,7 @@ void DurableUserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25487,7 +25487,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25520,7 +25520,7 @@ void DurableUserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25557,7 +25557,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25590,7 +25590,7 @@ QList DurableUserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25616,7 +25616,7 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25641,7 +25641,7 @@ QList DurableUserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25675,7 +25675,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( @@ -25707,7 +25707,7 @@ AccountLimits DurableUserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::SyncServiceCall( @@ -25741,7 +25741,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx.clone(); + ctx = m_ctx->clone(); } auto call = IDurableService::AsyncServiceCall( From 61eb6d885cde6d937dda56c6bb23c89394e72608 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 18:53:46 +0300 Subject: [PATCH 109/188] Remove no longer needed methods for working with timeouts --- QEverCloud/headers/Globals.h | 10 ---------- QEverCloud/src/Globals.cpp | 14 -------------- 2 files changed, 24 deletions(-) diff --git a/QEverCloud/headers/Globals.h b/QEverCloud/headers/Globals.h index 3ab053c2..191bb5b2 100644 --- a/QEverCloud/headers/Globals.h +++ b/QEverCloud/headers/Globals.h @@ -26,16 +26,6 @@ namespace qevercloud { */ QEVERCLOUD_EXPORT QNetworkAccessManager * evernoteNetworkAccessManager(); -/** - * Network request timeout in milliseconds - */ -QEVERCLOUD_EXPORT int requestTimeout(); - -/** - * Set network request timeout; negative values mean no timeout - */ -QEVERCLOUD_EXPORT void setRequestTimeout(int timeout); - /** * qevercloud library version. */ diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index c86b6153..931780f4 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -24,20 +24,6 @@ QNetworkAccessManager * evernoteNetworkAccessManager() //////////////////////////////////////////////////////////////////////////////// -static int qevercloudRequestTimeout = 180000; - -int requestTimeout() -{ - return qevercloudRequestTimeout; -} - -void setRequestTimeout(int timeout) -{ - qevercloudRequestTimeout = timeout; -} - -//////////////////////////////////////////////////////////////////////////////// - int libraryVersion() { return 5*10000 + 0*100 + 0; From 786ace77888651c70c766329db497168d61e33b4 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 19:51:28 +0300 Subject: [PATCH 110/188] Fix a couple of typos --- QEverCloud/headers/Thumbnail.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QEverCloud/headers/Thumbnail.h b/QEverCloud/headers/Thumbnail.h index 0bbd9e87..e652c2b9 100644 --- a/QEverCloud/headers/Thumbnail.h +++ b/QEverCloud/headers/Thumbnail.h @@ -41,7 +41,7 @@ QByteArray pngImage = thumb.download(noteGuid); @endcode * - * By defualt 300x300 PNG images are requested. + * By default 300x300 PNG images are requested. */ class QEVERCLOUD_EXPORT Thumbnail { @@ -119,7 +119,7 @@ class QEVERCLOUD_EXPORT Thumbnail /** * @param size * The size of the thumbnail. Evernote supports values from from 1 to 300. - * By defualt 300 is used. + * By default 300 is used. */ Thumbnail & setSize(int size); From 399a25826b10fa16276a7cb663835e5d69afa940 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 19:52:06 +0300 Subject: [PATCH 111/188] Fix download links in README.md + remove mention of Qt < 5.4 --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 95bc5664..731fa345 100644 --- a/README.md +++ b/README.md @@ -28,18 +28,18 @@ Prebuilt versions of the library can be downloaded from the following locations: * Stable version: * Windows binaries: - * [MSVC 2015 32 bit Qt 5.10](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt510-VS2015_x86.zip) - * [MSVC 2017 64 bit Qt 5.10](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt510-VS2017_x64.zip) + * [MSVC 2017 32 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt513-VS2017_x86.zip) + * [MSVC 2017 64 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt510-VS2017_x64.zip) * [MinGW 32 bit Qt 5.5](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt55-MinGW_x86.zip) * [Mac binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_mac_x86_64.zip) (built with latest Qt from Homebrew) - * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_linux_qt_592_x86_64.zip) built on Ubuntu 14.04 with Qt 5.9.2 + * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_linux_qt_5132_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 * Unstable version: * Windows binaries: - * [MSVC 2015 32 bit Qt 5.10](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt510-VS2015_x86.zip) - * [MSVC 2017 64 bit Qt 5.10](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt510-VS2017_x64.zip) + * [MSVC 2017 32 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt513-VS2017_x86.zip) + * [MSVC 2017 64 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt513-VS2017_x64.zip) * [MinGW 32 bit Qt 5.5](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt55-MinGW_x86.zip) * [Mac binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_mac_x86_64.zip) (built with latest Qt from Homebrew) - * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_linux_qt_592_x86_64.zip) built on Ubuntu 14.04 with Qt 5.9.2 + * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_linux_qt_5132_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 ## How to build @@ -47,7 +47,7 @@ The project can be built and shipped either as a static library or a shared libr Dependencies include the following Qt components: * Qt5: Qt5Core, Qt5Widgets, Qt5Network and, if the library is built with OAuth support, either: - * Qt5WebKit and Qt5WebKitWidgets - for Qt < 5.4 + * Qt5WebKit and Qt5WebKitWidgets * Qt5WebEngine and Qt5WebEngineWidgets - for Qt < 5.6 * Qt5WebEngineCore and Qt5WebEngineWidgets - for Qt >= 5.6 From 8cf13a0dc76516962afc8d7335833bcfb4aed527 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 19:52:26 +0300 Subject: [PATCH 112/188] Add description of 5.0 version to CHANGELOG.md --- CHANGELOG.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b0250da..c859c6da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,92 @@ # Changelog +## 5.0.0 + * **A lot of new features were added in this release which unfortunately + required to introduce several API breaks.** + * Network requests sent to Evernote service via `NoteStore` and `UserStore` + method calls are now automatically retried if network occasionally fails. + Retry logic can be parametrized either on `NoteStore` or `UserStore` level + or per each particular method call. + * `IRequestContext` interface was introduced and added to all methods of + `NoteStore` and `UserStore` as well as to their constructors. This interface + allows to specify and track various parameters for each request done from + QEverCloud to Evernote service: each such request (i.e. each `NoteStore` and + `UserStore` method call) now has a unique identifier, timeout, parameters + controlling automatic retry of requests which failed due to network problems. + Authentication token used for requests to Evernote service is also a part of + `IRequestContext` interface so it can be conveniently specified for `NoteStore` + and `UserStore` on their construction and overridden for individual requests + if necessary. + * Due to the introduction of request contexts global functions `connectionTimeout` + and `setConnectionTimeout` were removed. Their names were misleading as they + were actually request timeouts. + * Enumerations were migrated to strongly typed ones of modern C++, i.e. they + are `enum class` now and require explicit cast for conversion to/from integer + types. There is also no `structs` wrapping enums called `type` anymore so e.g. + `EDAMErrorCode::type` values are now simply `EDAMErrorCode` ones. + * A dedicated exception class representing network failures was added - + `NetworkException`. As other QEverCloud's exceptions, it is a subclass of + `EverCloudException`. By default QEverCloud catches such exceptions on its + own and retries the request up to several times. + * Some introspection capabilities were added to QEverCloud types: they now have + [Q_GADGET](https://doc.qt.io/qt-5/qobject.html#Q_GADGET) macro and each of + their attributes is registered as a [Q_PROPERTY](https://doc.qt.io/qt-5/qobject.html#Q_PROPERTY). + * In order to support the above mentioned introspection of QEverCloud types + `Optional` template class implementation was changed: `operator==` and + `operator!=` accepting another `Optional` were added to it. Unfortunately, it + has lead to some complications: you can no longer do comparisons like + ``` + Optional a = 42; + double b = 1.0; + bool res = (a == b); + ``` + Instead you need to cast the right hand side expression to proper type: + ``` + Optional a = 42; + double b = 1.0; + bool res = (a == static_cast(b)); + ``` + * Each QEverCloud type corresponding to Evernote API's type now has a member + called `localData` of class `EverCloudLocalData`. That class encapsulates some + attributes which are not present within Evernote API's types and thus do not + take part in communication with Evernote but they nevertheless can be useful + for implementation of rich Evernote client applications performing full and + partial synchronization of data with Evernote. `EverCloudLocalData` + contains: + * `id` string which by default is generated as a `QUuid` but can be substituted + with any string value + * `dirty`, `local` and `favorited` boolean flags + * `dict` which is a collection of arbitrary data in the form of `QVariant`s + indexed by strings + * Logging system was added to QEverCloud. It exists as `ILogger` interface + which you can implement and thus integrate QEverCloud's logging into your + application's logging system whatever that is. For convenience in debugging + QEverCloud also provides an option to dump log messages to stderr. + * For proper support of logging all QEverCloud's types, enumerations and + exceptions were made printable i.e. they can now be used with `QTextStream` + and `QDebug` to produce human readable representation of their values. + * `NoteStore` and `UserStore` classes were converted to `INoteStore` and + `IUserStore` abstract interfaces. It made the implementation of request retrying + logic simpler and it is now possible to substitute your own implementations + of `INoteStore` and/or `IUserStore`, for example, for unit tests of your code + using QEverCloud. + * Implementation of `NoteStore` and `UserStore` servers was added to QEverCloud. + These classes can be used to implement your own backend substituting real Evernote + service. + * Unit tests using the functionality of the above mentioned servers were added + to QEverCloud. Unit tests ensure the correctness of transport layer's implementation + i.e. the correctness of packing requests to Thrift format and unpacking the + responses ensuring that no data is lost or corrupted on either step. Hundreds + of tests covering literally every single method of `NoteStore` and `UserStore` + were added. + * Some header files were renamed so that they all start from capital letters + now. + * Support for Qt < 5.5 as well as support for building QEverCloud with older + compilers has been dropped. QEverCloud is now built with C++17 standard + although it does not use much of its features so even some not fully compliant + compilers can still build QEverCloud. Minimal supported gcc version is 5.4, + minimal supported Visual Studio version is 2017. + ## 4.1.0 * Migrate to Evernote API 1.29 from 1.28. The changes are incremental and API is not broken. ABI is changed though, hence minor version number increase. The changes in API include: From 8ac00aeb57ab66f947467a789ec193228056bc4b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 19:57:12 +0300 Subject: [PATCH 113/188] Update generated code --- QEverCloud/headers/generated/Servers.h | 8 +- QEverCloud/src/generated/Types.cpp | 3540 ++++++++++++++++-------- 2 files changed, 2364 insertions(+), 1184 deletions(-) diff --git a/QEverCloud/headers/generated/Servers.h b/QEverCloud/headers/generated/Servers.h index a76160aa..87e59bf8 100644 --- a/QEverCloud/headers/generated/Servers.h +++ b/QEverCloud/headers/generated/Servers.h @@ -26,8 +26,8 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// /** - * @brief The NoteStoreServer class represents - * customizable server for NoteStore requests. + * @brief The NoteStoreServer class represents + * customizable server for NoteStore requests. * It is primarily used for testing of QEverCloud */ class QEVERCLOUD_EXPORT NoteStoreServer: public QObject @@ -895,8 +895,8 @@ public Q_SLOTS: //////////////////////////////////////////////////////////////////////////////// /** - * @brief The UserStoreServer class represents - * customizable server for UserStore requests. + * @brief The UserStoreServer class represents + * customizable server for UserStore requests. * It is primarily used for testing of QEverCloud */ class QEVERCLOUD_EXPORT UserStoreServer: public QObject diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index eab273d8..2e64e32f 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -515,57 +515,69 @@ void readSyncState( qint64 v; reader.readI64(v); s.currentTime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { fullSyncBefore_isset = true; qint64 v; reader.readI64(v); s.fullSyncBefore = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { updateCount_isset = true; qint32 v; reader.readI32(v); s.updateCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.uploaded = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.userLastUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { MessageEventID v; reader.readI64(v); s.userMaxMessageEventId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -837,29 +849,35 @@ void readSyncChunk( qint64 v; reader.readI64(v); s.currentTime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.chunkHighUSN = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { updateCount_isset = true; qint32 v; reader.readI32(v); s.updateCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -879,10 +897,12 @@ void readSyncChunk( } reader.readListEnd(); s.notes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -902,10 +922,12 @@ void readSyncChunk( } reader.readListEnd(); s.notebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -925,10 +947,12 @@ void readSyncChunk( } reader.readListEnd(); s.tags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -948,10 +972,12 @@ void readSyncChunk( } reader.readListEnd(); s.searches = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -971,10 +997,12 @@ void readSyncChunk( } reader.readListEnd(); s.resources = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -994,10 +1022,12 @@ void readSyncChunk( } reader.readListEnd(); s.expungedNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1017,10 +1047,12 @@ void readSyncChunk( } reader.readListEnd(); s.expungedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1040,10 +1072,12 @@ void readSyncChunk( } reader.readListEnd(); s.expungedTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1063,10 +1097,12 @@ void readSyncChunk( } reader.readListEnd(); s.expungedSearches = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1086,10 +1122,12 @@ void readSyncChunk( } reader.readListEnd(); s.linkedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1109,10 +1147,12 @@ void readSyncChunk( } reader.readListEnd(); s.expungedLinkedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -1469,136 +1509,166 @@ void readSyncChunkFilter( bool v; reader.readBool(v); s.includeNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNoteResources = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNoteAttributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeSearches = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResources = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeLinkedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeExpunged = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNoteApplicationDataFullMap = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResourceApplicationDataFullMap = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNoteResourceApplicationDataFullMap = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeSharedNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.omitSharedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.requireNoteContentClass = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_SET) { QSet v; @@ -1618,10 +1688,12 @@ void readSyncChunkFilter( } reader.readSetEnd(); s.notebookGuids = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -1933,37 +2005,45 @@ void readNoteFilter( qint32 v; reader.readI32(v); s.order = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.ascending = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.words = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -1983,82 +2063,100 @@ void readNoteFilter( } reader.readListEnd(); s.tagGuids = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.timeZone = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.inactive = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.emphasized = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeAllReadableNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeAllReadableWorkspaces = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.context = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.rawWords = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.searchContextBytes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -2304,20 +2402,24 @@ void readNoteList( qint32 v; reader.readI32(v); s.startIndex = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { totalNotes_isset = true; qint32 v; reader.readI32(v); s.totalNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { notes_isset = true; @@ -2338,10 +2440,12 @@ void readNoteList( } reader.readListEnd(); s.notes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -2361,10 +2465,12 @@ void readNoteList( } reader.readListEnd(); s.stoppedWords = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -2384,37 +2490,45 @@ void readNoteList( } reader.readListEnd(); s.searchedWords = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.searchContextBytes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.debugInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -2645,73 +2759,89 @@ void readNoteMetadata( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.title = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.contentLength = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.created = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.deleted = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -2731,37 +2861,45 @@ void readNoteMetadata( } reader.readListEnd(); s.tagGuids = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteAttributes v; readNoteAttributes(reader, v); s.attributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.largestResourceMime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.largestResourceSize = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -2994,20 +3132,24 @@ void readNotesMetadataList( qint32 v; reader.readI32(v); s.startIndex = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { totalNotes_isset = true; qint32 v; reader.readI32(v); s.totalNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { notes_isset = true; @@ -3028,10 +3170,12 @@ void readNotesMetadataList( } reader.readListEnd(); s.notes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -3051,10 +3195,12 @@ void readNotesMetadataList( } reader.readListEnd(); s.stoppedWords = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -3074,37 +3220,45 @@ void readNotesMetadataList( } reader.readListEnd(); s.searchedWords = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.searchContextBytes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.debugInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -3320,100 +3474,122 @@ void readNotesMetadataResultSpec( bool v; reader.readBool(v); s.includeTitle = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeContentLength = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeCreated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeDeleted = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeUpdateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNotebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeTagGuids = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeAttributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeLargestResourceMime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeLargestResourceSize = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -3601,10 +3777,12 @@ void readNoteCollectionCounts( } reader.readMapEnd(); s.notebookCounts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_MAP) { QMap v; @@ -3623,19 +3801,23 @@ void readNoteCollectionCounts( } reader.readMapEnd(); s.tagCounts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.trashCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -3792,73 +3974,89 @@ void readNoteResultSpec( bool v; reader.readBool(v); s.includeContent = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResourcesData = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResourcesRecognition = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResourcesAlternateData = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeSharedNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeNoteAppDataValues = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeResourceAppDataValues = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeAccountLimits = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -4037,19 +4235,23 @@ void readNoteEmailParameters( QString v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Note v; readNote(reader, v); s.note = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -4069,10 +4271,12 @@ void readNoteEmailParameters( } reader.readListEnd(); s.toAddresses = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -4092,28 +4296,34 @@ void readNoteEmailParameters( } reader.readListEnd(); s.ccAddresses = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.subject = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.message = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -4261,49 +4471,59 @@ void readNoteVersionId( qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { updated_isset = true; qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { saved_isset = true; qint64 v; reader.readI64(v); s.saved = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { title_isset = true; QString v; reader.readString(v); s.title = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.lastEditorId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -4428,55 +4648,67 @@ void readRelatedQuery( QString v; reader.readString(v); s.noteGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.plainText = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteFilter v; readNoteFilter(reader, v); s.filter = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.referenceUri = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.context = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.cacheKey = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -4703,10 +4935,12 @@ void readRelatedResult( } reader.readListEnd(); s.notes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -4726,10 +4960,12 @@ void readRelatedResult( } reader.readListEnd(); s.notebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -4749,10 +4985,12 @@ void readRelatedResult( } reader.readListEnd(); s.tags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -4772,19 +5010,23 @@ void readRelatedResult( } reader.readListEnd(); s.containingNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.debugInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -4804,10 +5046,12 @@ void readRelatedResult( } reader.readListEnd(); s.experts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -4827,28 +5071,34 @@ void readRelatedResult( } reader.readListEnd(); s.relatedContent = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.cacheKey = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.cacheExpires = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5084,73 +5334,89 @@ void readRelatedResultSpec( qint32 v; reader.readI32(v); s.maxNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.maxNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.maxTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.writableNotebooksOnly = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeContainingNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeDebugInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.maxExperts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.maxRelatedContent = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_SET) { QSet v; @@ -5170,10 +5436,12 @@ void readRelatedResultSpec( } reader.readSetEnd(); s.relatedContentTypes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5314,19 +5582,23 @@ void readUpdateNoteIfUsnMatchesResult( Note v; readNote(reader, v); s.note = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5427,37 +5699,45 @@ void readShareRelationshipRestrictions( bool v; reader.readBool(v); s.noSetReadOnly = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetReadPlusActivity = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetModify = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetFullAccess = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5574,37 +5854,45 @@ void readInvitationShareRelationship( QString v; reader.readString(v); s.displayName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { UserIdentity v; readUserIdentity(reader, v); s.recipientUserIdentity = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.sharerUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5741,55 +6029,67 @@ void readMemberShareRelationship( QString v; reader.readString(v); s.displayName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.recipientUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(reader, v); s.bestPrivilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { ShareRelationshipPrivilegeLevel v; readEnumShareRelationshipPrivilegeLevel(reader, v); s.individualPrivilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { ShareRelationshipRestrictions v; readShareRelationshipRestrictions(reader, v); s.restrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.sharerUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -5936,10 +6236,12 @@ void readShareRelationships( } reader.readListEnd(); s.invitations = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -5959,19 +6261,23 @@ void readShareRelationships( } reader.readListEnd(); s.memberships = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { ShareRelationshipRestrictions v; readShareRelationshipRestrictions(reader, v); s.invitationRestrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6113,19 +6419,23 @@ void readManageNotebookSharesParameters( QString v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.inviteMessage = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6145,10 +6455,12 @@ void readManageNotebookSharesParameters( } reader.readListEnd(); s.membershipsToUpdate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6168,10 +6480,12 @@ void readManageNotebookSharesParameters( } reader.readListEnd(); s.invitationsToCreateOrUpdate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6191,10 +6505,12 @@ void readManageNotebookSharesParameters( } reader.readListEnd(); s.unshares = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6321,28 +6637,34 @@ void readManageNotebookSharesError( UserIdentity v; readUserIdentity(reader, v); s.userIdentity = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException v; readEDAMUserException(reader, v); s.userException = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException v; readEDAMNotFoundException(reader, v); s.notFoundException = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6440,10 +6762,12 @@ void readManageNotebookSharesResult( } reader.readListEnd(); s.errors = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6545,19 +6869,23 @@ void readSharedNoteTemplate( Guid v; reader.readString(v); s.noteGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { MessageThreadID v; reader.readI64(v); s.recipientThreadId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6577,19 +6905,23 @@ void readSharedNoteTemplate( } reader.readListEnd(); s.recipientContacts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6715,19 +7047,23 @@ void readNotebookShareTemplate( Guid v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { MessageThreadID v; reader.readI64(v); s.recipientThreadId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6747,19 +7083,23 @@ void readNotebookShareTemplate( } reader.readListEnd(); s.recipientContacts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6865,10 +7205,12 @@ void readCreateOrUpdateNotebookSharesResult( qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -6888,10 +7230,12 @@ void readCreateOrUpdateNotebookSharesResult( } reader.readListEnd(); s.matchingShares = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -6986,28 +7330,34 @@ void readNoteShareRelationshipRestrictions( bool v; reader.readBool(v); s.noSetReadNote = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetModifyNote = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetFullAccess = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -7126,46 +7476,56 @@ void readNoteMemberShareRelationship( QString v; reader.readString(v); s.displayName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.recipientUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteShareRelationshipRestrictions v; readNoteShareRelationshipRestrictions(reader, v); s.restrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.sharerUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -7290,37 +7650,45 @@ void readNoteInvitationShareRelationship( QString v; reader.readString(v); s.displayName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { IdentityID v; reader.readI64(v); s.recipientIdentityId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.sharerUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -7451,10 +7819,12 @@ void readNoteShareRelationships( } reader.readListEnd(); s.invitations = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -7474,19 +7844,23 @@ void readNoteShareRelationships( } reader.readListEnd(); s.memberships = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteShareRelationshipRestrictions v; readNoteShareRelationshipRestrictions(reader, v); s.invitationRestrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -7633,10 +8007,12 @@ void readManageNoteSharesParameters( QString v; reader.readString(v); s.noteGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -7656,10 +8032,12 @@ void readManageNoteSharesParameters( } reader.readListEnd(); s.membershipsToUpdate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -7679,10 +8057,12 @@ void readManageNoteSharesParameters( } reader.readListEnd(); s.invitationsToUpdate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -7702,10 +8082,12 @@ void readManageNoteSharesParameters( } reader.readListEnd(); s.membershipsToUnshare = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -7725,10 +8107,12 @@ void readManageNoteSharesParameters( } reader.readListEnd(); s.invitationsToUnshare = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -7869,37 +8253,45 @@ void readManageNoteSharesError( IdentityID v; reader.readI64(v); s.identityID = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.userID = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMUserException v; readEDAMUserException(reader, v); s.userException = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { EDAMNotFoundException v; readEDAMNotFoundException(reader, v); s.notFoundException = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -8005,10 +8397,12 @@ void readManageNoteSharesResult( } reader.readListEnd(); s.errors = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -8095,28 +8489,34 @@ void readData( QByteArray v; reader.readBinary(v); s.bodyHash = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.size = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.body = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -8545,37 +8945,45 @@ void readUserAttributes( QString v; reader.readString(v); s.defaultLocationName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.defaultLatitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.defaultLongitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.preactivation = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -8595,19 +9003,23 @@ void readUserAttributes( } reader.readListEnd(); s.viewedPromotions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.incomingEmailAddress = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -8627,262 +9039,320 @@ void readUserAttributes( } reader.readListEnd(); s.recentMailedAddresses = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.comments = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.dateAgreedToTermsOfService = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.maxReferrals = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.referralCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.refererCode = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.sentEmailDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.sentEmailCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.dailyEmailLimit = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.emailOptOutDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.partnerEmailOptInDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.preferredLanguage = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.preferredCountry = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.clipFullPage = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.twitterUserName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.twitterId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 25) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.groupName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.recognitionLanguage = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.referralProof = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.educationalDiscount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.businessAddress = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 31) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.hideSponsorBilling = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 33) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.useEmailAutoFiling = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 34) { if (fieldType == ThriftFieldType::T_I32) { ReminderEmailConfig v; readEnumReminderEmailConfig(reader, v); s.reminderEmailConfig = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 35) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.emailAddressLastConfirmed = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 36) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.passwordUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 37) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.salesforcePushEnabled = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 38) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.shouldLogClientEvent = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 39) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.optOutMachineLearning = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -9285,64 +9755,78 @@ void readBusinessUserAttributes( QString v; reader.readString(v); s.title = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.location = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.department = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.mobilePhone = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.linkedInProfileUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.workPhone = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.companyStartDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -9673,208 +10157,254 @@ void readAccounting( qint64 v; reader.readI64(v); s.uploadLimitEnd = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.uploadLimitNextMonth = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { PremiumOrderStatus v; readEnumPremiumOrderStatus(reader, v); s.premiumServiceStatus = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.premiumOrderNumber = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.premiumCommerceService = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.premiumServiceStart = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.premiumServiceSKU = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.lastSuccessfulCharge = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.lastFailedCharge = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.lastFailedChargeReason = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.nextPaymentDue = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.premiumLockUntil = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.premiumSubscriptionNumber = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.lastRequestedCharge = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.currency = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.unitPrice = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.businessId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.businessName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; readEnumBusinessUserRole(reader, v); s.businessRole = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.unitDiscount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.nextChargeDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 25) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.availablePoints = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -10153,46 +10683,56 @@ void readBusinessUserInfo( qint32 v; reader.readI32(v); s.businessId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.businessName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; readEnumBusinessUserRole(reader, v); s.role = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.email = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -10387,100 +10927,122 @@ void readAccountLimits( qint32 v; reader.readI32(v); s.userMailLimitDaily = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.noteSizeMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.resourceSizeMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.userLinkedNotebookMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.uploadLimit = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.userNoteCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.userNotebookCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.userTagCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.noteTagCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.userSavedSearchesMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.noteResourceCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -10793,163 +11355,199 @@ void readUser( UserID v; reader.readI32(v); s.id = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.username = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.email = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.timezone = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { PrivilegeLevel v; readEnumPrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_I32) { ServiceLevel v; readEnumServiceLevel(reader, v); s.serviceLevel = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.created = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.deleted = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.active = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.shardId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { UserAttributes v; readUserAttributes(reader, v); s.attributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRUCT) { Accounting v; readAccounting(reader, v); s.accounting = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessUserInfo v; readBusinessUserInfo(reader, v); s.businessUserInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.photoUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.photoLastUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_STRUCT) { AccountLimits v; readAccountLimits(reader, v); s.accountLimits = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -11208,64 +11806,78 @@ void readContact( QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.id = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { ContactType v; readEnumContactType(reader, v); s.type = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.photoUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.photoLastUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.messagingPermit = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.messagingPermitExpires = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -11446,73 +12058,89 @@ void readIdentity( IdentityID v; reader.readI64(v); s.id = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Contact v; readContact(reader, v); s.contact = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.userId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.deactivated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.sameBusiness = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.blocked = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.userConnected = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { MessageEventID v; reader.readI64(v); s.eventId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -11656,37 +12284,45 @@ void readTag( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.parentGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -11808,10 +12444,12 @@ void readLazyMap( } reader.readSetEnd(); s.keysOnly = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_MAP) { QMap v; @@ -11830,10 +12468,12 @@ void readLazyMap( } reader.readMapEnd(); s.fullMap = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -12022,109 +12662,133 @@ void readResourceAttributes( QString v; reader.readString(v); s.sourceURL = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.timestamp = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.latitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.longitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.altitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.cameraMake = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.cameraModel = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.clientWillIndex = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.recoType = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.fileName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.attachment = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRUCT) { LazyMap v; readLazyMap(reader, v); s.applicationData = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -12385,109 +13049,133 @@ void readResource( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.noteGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; readData(reader, v); s.data = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.mime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; reader.readI16(v); s.width = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; reader.readI16(v); s.height = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I16) { qint16 v; reader.readI16(v); s.duration = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.active = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; readData(reader, v); s.recognition = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRUCT) { ResourceAttributes v; readResourceAttributes(reader, v); s.attributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRUCT) { Data v; readData(reader, v); s.alternateData = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -12854,145 +13542,177 @@ void readNoteAttributes( qint64 v; reader.readI64(v); s.subjectDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.latitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.longitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.altitude = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.author = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.source = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceURL = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceApplication = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.shareDate = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.reminderOrder = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.reminderDoneTime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.reminderTime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.placeName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.contentClass = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_STRUCT) { LazyMap v; readLazyMap(reader, v); s.applicationData = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.lastEditedBy = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_MAP) { QMap v; @@ -13011,55 +13731,67 @@ void readNoteAttributes( } reader.readMapEnd(); s.classifications = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 27) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.creatorId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.lastEditorId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.sharedWithBusiness = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.conflictSourceNoteGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 31) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.noteTitleQuality = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -13344,55 +14076,67 @@ void readSharedNote( UserID v; reader.readI32(v); s.sharerUserID = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { Identity v; readIdentity(reader, v); s.recipientIdentity = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { SharedNotePrivilegeLevel v; readEnumSharedNotePrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceCreated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceAssigned = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -13535,46 +14279,56 @@ void readNoteRestrictions( bool v; reader.readBool(v); s.noUpdateTitle = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noUpdateContent = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noEmail = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noShare = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSharePublicly = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -13709,46 +14463,56 @@ void readNoteLimits( qint32 v; reader.readI32(v); s.noteResourceCountMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.uploadLimit = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.resourceSizeMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.noteSizeMax = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.uploaded = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -14033,100 +14797,122 @@ void readNote( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.title = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.content = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QByteArray v; reader.readBinary(v); s.contentHash = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.contentLength = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.created = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.updated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.deleted = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.active = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -14146,10 +14932,12 @@ void readNote( } reader.readListEnd(); s.tagGuids = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -14169,19 +14957,23 @@ void readNote( } reader.readListEnd(); s.resources = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteAttributes v; readNoteAttributes(reader, v); s.attributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -14201,10 +14993,12 @@ void readNote( } reader.readListEnd(); s.tagNames = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -14224,28 +15018,34 @@ void readNote( } reader.readListEnd(); s.sharedNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteRestrictions v; readNoteRestrictions(reader, v); s.restrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { NoteLimits v; readNoteLimits(reader, v); s.limits = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -14490,37 +15290,45 @@ void readPublishing( QString v; reader.readString(v); s.uri = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { NoteSortOrder v; readEnumNoteSortOrder(reader, v); s.order = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.ascending = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.publicDescription = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -14627,28 +15435,34 @@ void readBusinessNotebook( QString v; reader.readString(v); s.notebookDescription = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.recommended = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -14747,28 +15561,34 @@ void readSavedSearchScope( bool v; reader.readBool(v); s.includeAccount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includePersonalLinkedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.includeBusinessLinkedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -14897,55 +15717,67 @@ void readSavedSearch( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.query = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { QueryFormat v; readEnumQueryFormat(reader, v); s.format = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRUCT) { SavedSearchScope v; readSavedSearchScope(reader, v); s.scope = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -15058,19 +15890,23 @@ void readSharedNotebookRecipientSettings( bool v; reader.readBool(v); s.reminderNotifyEmail = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.reminderNotifyInApp = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -15181,46 +16017,56 @@ void readNotebookRecipientSettings( bool v; reader.readBool(v); s.reminderNotifyEmail = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.reminderNotifyInApp = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.inMyList = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.stack = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { RecipientStatus v; readEnumRecipientStatus(reader, v); s.recipientStatus = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -15465,145 +16311,177 @@ void readSharedNotebook( qint64 v; reader.readI64(v); s.id = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.userId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.notebookGuid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.email = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_I64) { IdentityID v; reader.readI64(v); s.recipientIdentityId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.notebookModifiable = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceCreated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.globalId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.username = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookPrivilegeLevel v; readEnumSharedNotebookPrivilegeLevel(reader, v); s.privilege = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRUCT) { SharedNotebookRecipientSettings v; readSharedNotebookRecipientSettings(reader, v); s.recipientSettings = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.sharerUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.recipientUsername = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.recipientUserId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceAssigned = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -15786,10 +16664,12 @@ void readCanMoveToContainerRestrictions( CanMoveToContainerStatus v; readEnumCanMoveToContainerStatus(reader, v); s.canMoveToContainer = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -16132,262 +17012,320 @@ void readNotebookRestrictions( bool v; reader.readBool(v); s.noReadNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noCreateNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noUpdateNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noExpungeNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noShareNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noEmailNotes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSendMessageToRecipients = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noUpdateNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noExpungeNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetDefaultNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetNotebookStack = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noPublishToPublic = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noPublishToBusinessLibrary = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noCreateTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noUpdateTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noExpungeTags = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetParentTag = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noCreateSharedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 19) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookInstanceRestrictions v; readEnumSharedNotebookInstanceRestrictions(reader, v); s.updateWhichSharedNotebookRestrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 20) { if (fieldType == ThriftFieldType::T_I32) { SharedNotebookInstanceRestrictions v; readEnumSharedNotebookInstanceRestrictions(reader, v); s.expungeWhichSharedNotebookRestrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 21) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noShareNotesWithBusiness = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 22) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noRenameNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 23) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetInMyList = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 24) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noChangeContact = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 26) { if (fieldType == ThriftFieldType::T_STRUCT) { CanMoveToContainerRestrictions v; readCanMoveToContainerRestrictions(reader, v); s.canMoveToContainerRestrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 27) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetReminderNotifyEmail = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 28) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetReminderNotifyInApp = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 29) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noSetRecipientSettingsStack = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 30) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.noCanMoveNote = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -16824,82 +17762,100 @@ void readNotebook( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.defaultNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceCreated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.serviceUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRUCT) { Publishing v; readPublishing(reader, v); s.publishing = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.published = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.stack = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -16919,10 +17875,12 @@ void readNotebook( } reader.readListEnd(); s.sharedNotebookIds = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -16942,46 +17900,56 @@ void readNotebook( } reader.readListEnd(); s.sharedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessNotebook v; readBusinessNotebook(reader, v); s.businessNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_STRUCT) { User v; readUser(reader, v); s.contact = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 17) { if (fieldType == ThriftFieldType::T_STRUCT) { NotebookRestrictions v; readNotebookRestrictions(reader, v); s.restrictions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 18) { if (fieldType == ThriftFieldType::T_STRUCT) { NotebookRecipientSettings v; readNotebookRecipientSettings(reader, v); s.recipientSettings = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -17264,100 +18232,122 @@ void readLinkedNotebook( QString v; reader.readString(v); s.shareName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.username = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.shardId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sharedNotebookGlobalId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.uri = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.updateSequenceNum = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.noteStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.webApiUrlPrefix = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.stack = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.businessId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -17540,46 +18530,56 @@ void readNotebookDescriptor( Guid v; reader.readString(v); s.guid = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.notebookDisplayName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.contactName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.hasSharedNotebook = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.joinedUserCount = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -17764,91 +18764,111 @@ void readUserProfile( UserID v; reader.readI32(v); s.id = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.email = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.username = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { BusinessUserAttributes v; readBusinessUserAttributes(reader, v); s.attributes = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.joined = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.photoLastUpdated = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.photoUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; readEnumBusinessUserRole(reader, v); s.role = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserStatus v; readEnumBusinessUserStatus(reader, v); s.status = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -18023,46 +19043,56 @@ void readRelatedContentImage( QString v; reader.readString(v); s.url = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.width = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.height = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_DOUBLE) { double v; reader.readDouble(v); s.pixelRatio = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.fileSize = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -18317,82 +19347,100 @@ void readRelatedContent( QString v; reader.readString(v); s.contentId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.title = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.url = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceFaviconUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.sourceName = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.date = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.teaser = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -18412,55 +19460,67 @@ void readRelatedContent( } reader.readListEnd(); s.thumbnails = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_I32) { RelatedContentType v; readEnumRelatedContentType(reader, v); s.contentType = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_I32) { RelatedContentAccess v; readEnumRelatedContentAccess(reader, v); s.accessType = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.visibleUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 14) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.clipUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 15) { if (fieldType == ThriftFieldType::T_STRUCT) { Contact v; readContact(reader, v); s.contact = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_LIST) { QStringList v; @@ -18480,10 +19540,12 @@ void readRelatedContent( } reader.readListEnd(); s.authors = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -18744,73 +19806,89 @@ void readBusinessInvitation( qint32 v; reader.readI32(v); s.businessId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.email = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { BusinessUserRole v; readEnumBusinessUserRole(reader, v); s.role = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_I32) { BusinessInvitationStatus v; readEnumBusinessInvitationStatus(reader, v); s.status = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_I32) { UserID v; reader.readI32(v); s.requesterId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.fromWorkChat = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.created = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.mostRecentReminder = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -18949,28 +20027,34 @@ void readUserIdentity( UserIdentityType v; readEnumUserIdentityType(reader, v); s.type = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.stringIdentifier = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { qint64 v; reader.readI64(v); s.longIdentifier = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -19089,46 +20173,56 @@ void readPublicUserInfo( UserID v; reader.readI32(v); s.userId = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_I32) { ServiceLevel v; readEnumServiceLevel(reader, v); s.serviceLevel = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.username = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.noteStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.webApiUrlPrefix = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -19268,55 +20362,67 @@ void readUserUrls( QString v; reader.readString(v); s.noteStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.webApiUrlPrefix = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.userStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.utilityUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.messageStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.userWebSocketUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -19507,93 +20613,113 @@ void readAuthenticationResult( qint64 v; reader.readI64(v); s.currentTime = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { authenticationToken_isset = true; QString v; reader.readString(v); s.authenticationToken = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I64) { expiration_isset = true; qint64 v; reader.readI64(v); s.expiration = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRUCT) { User v; readUser(reader, v); s.user = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_STRUCT) { PublicUserInfo v; readPublicUserInfo(reader, v); s.publicUserInfo = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.noteStoreUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.webApiUrlPrefix = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.secondFactorRequired = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.secondFactorDeliveryHint = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_STRUCT) { UserUrls v; readUserUrls(reader, v); s.urls = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -19840,130 +20966,158 @@ void readBootstrapSettings( QString v; reader.readString(v); s.serviceHost = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { marketingUrl_isset = true; QString v; reader.readString(v); s.marketingUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_STRING) { supportUrl_isset = true; QString v; reader.readString(v); s.supportUrl = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 4) { if (fieldType == ThriftFieldType::T_STRING) { accountEmailDomain_isset = true; QString v; reader.readString(v); s.accountEmailDomain = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 5) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableFacebookSharing = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 6) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableGiftSubscriptions = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 7) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableSupportTickets = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 8) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableSharedNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 9) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableSingleNoteSharing = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 10) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableSponsoredAccounts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 11) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableTwitterSharing = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 12) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableLinkedInSharing = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 13) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enablePublicNotebooks = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 16) { if (fieldType == ThriftFieldType::T_BOOL) { bool v; reader.readBool(v); s.enableGoogle = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20119,20 +21273,24 @@ void readBootstrapProfile( QString v; reader.readString(v); s.name = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRUCT) { settings_isset = true; BootstrapSettings v; readBootstrapSettings(reader, v); s.settings = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20211,10 +21369,12 @@ void readBootstrapInfo( } reader.readListEnd(); s.profiles = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20292,19 +21452,23 @@ void readEDAMUserException( EDAMErrorCode v; readEnumEDAMErrorCode(reader, v); s.errorCode = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.parameter = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20397,28 +21561,34 @@ void readEDAMSystemException( EDAMErrorCode v; readEnumEDAMErrorCode(reader, v); s.errorCode = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.message = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_I32) { qint32 v; reader.readI32(v); s.rateLimitDuration = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20508,19 +21678,23 @@ void readEDAMNotFoundException( QString v; reader.readString(v); s.identifier = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.key = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } @@ -20642,19 +21816,23 @@ void readEDAMInvalidContactsException( } reader.readListEnd(); s.contacts = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 2) { if (fieldType == ThriftFieldType::T_STRING) { QString v; reader.readString(v); s.parameter = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else if (fieldId == 3) { if (fieldType == ThriftFieldType::T_LIST) { QList v; @@ -20674,10 +21852,12 @@ void readEDAMInvalidContactsException( } reader.readListEnd(); s.reasons = v; - } else { + } + else { reader.skip(fieldType); } - } else + } + else { reader.skip(fieldType); } From fc7e1a7e817b34f676d037bb74a715daffdbaa6f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 20:11:56 +0300 Subject: [PATCH 114/188] Fix some typos in Doxygen documentation for both generated and non-generated code --- QEverCloud/headers/AsyncResult.h | 4 ++-- QEverCloud/headers/OAuth.h | 2 +- QEverCloud/headers/generated/Services.h | 4 ++-- QEverCloud/headers/generated/Types.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index abf707a7..e327d820 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -76,7 +76,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject ~AsyncResult(); /** - * @brief Wait for asyncronous operation to complete. + * @brief Wait for asynchronous operation to complete. * @param timeout * Maximum time to wait in milliseconds. Forever if < 0. * @return true if finished successfully, false in case of the timeout @@ -85,7 +85,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject Q_SIGNALS: /** - * @brief Emitted upon asyncronous call completition. + * @brief Emitted upon asynchronous call completition. * @param result * @param error * error != nullptr in case of an error. See EverCloudExceptionData diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index 934c065f..89def511 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -52,7 +52,7 @@ class EvernoteOAuthWebViewPrivate; * * %Note that you have to include QEverCloudOAuth.h header. * - * By deafult EvernoteOAuthWebView uses qrand() for generating nonce so do not + * By default EvernoteOAuthWebView uses qrand() for generating nonce so do not * forget to call qsrand() in your application. See @link setNonceGenerator @endlink * If you want more control over nonce generation. */ diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 7c538c6a..5eb4731c 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -2515,7 +2515,7 @@ class QEVERCLOUD_EXPORT INoteStore: public QObject * * If the Note is not shared, then this function will do nothing. * - * This function does not remove invididual shares for the note. To remove + * This function does not remove individual shares for the note. To remove * individual shares, see stopSharingNoteWithRecipients. * * @param guid @@ -3086,7 +3086,7 @@ class QEVERCLOUD_EXPORT IUserStore: public QObject *

    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 + *

    This method isn't needed by most clients, who can retrieve 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.

    diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index fbc0ab52..8cf75af4 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -5503,7 +5503,7 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable Optional messageStoreUrl; /** 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. + persistent web socket to receive notification of events for the authenticated user. */ Optional userWebSocketUrl; From 8578a7b1171497dd1caccf0b454ffb2ac237b6e5 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 22:07:46 +0300 Subject: [PATCH 115/188] Add Q_NAMESPACE declaration to Helpers.h + update generated code --- QEverCloud/headers/Helpers.h | 12 +++ QEverCloud/headers/generated/EDAMErrorCode.h | 93 ++++++++++++++++++++ QEverCloud/src/generated/Types.cpp | 3 - 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index fe9bf5d1..55db520a 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -27,11 +27,23 @@ #define QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H #include +#include namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// +/** + * It appears that Q_NAMESPACE declaration should be present in exactly one file + * per namespace, otherwise moc generates multiple definitions of corresponding + * meta object, so putting it here + */ +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_NAMESPACE +#endif + +//////////////////////////////////////////////////////////////////////////////// + #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) // this adds const to non-const objects (like std::as_const) diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 0ad79735..9bde7453 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -14,6 +14,7 @@ #include "../Export.h" +#include "../Helpers.h" #include #include #include @@ -130,6 +131,10 @@ enum class EDAMErrorCode SSO_AUTHENTICATION_REQUIRED = 28 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(EDAMErrorCode) +#endif + inline uint qHash(EDAMErrorCode value) { return static_cast(value); @@ -187,6 +192,10 @@ enum class EDAMInvalidContactReason NO_CONNECTION }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(EDAMInvalidContactReason) +#endif + inline uint qHash(EDAMInvalidContactReason value) { return static_cast(value); @@ -233,6 +242,10 @@ enum class ShareRelationshipPrivilegeLevel FULL_ACCESS = 30 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(ShareRelationshipPrivilegeLevel) +#endif + inline uint qHash(ShareRelationshipPrivilegeLevel value) { return static_cast(value); @@ -265,6 +278,10 @@ enum class PrivilegeLevel ADMIN = 9 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(PrivilegeLevel) +#endif + inline uint qHash(PrivilegeLevel value) { return static_cast(value); @@ -295,6 +312,10 @@ enum class ServiceLevel BUSINESS = 4 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(ServiceLevel) +#endif + inline uint qHash(ServiceLevel value) { return static_cast(value); @@ -322,6 +343,10 @@ enum class QueryFormat SEXP = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(QueryFormat) +#endif + inline uint qHash(QueryFormat value) { return static_cast(value); @@ -352,6 +377,10 @@ enum class NoteSortOrder TITLE = 5 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(NoteSortOrder) +#endif + inline uint qHash(NoteSortOrder value) { return static_cast(value); @@ -399,6 +428,10 @@ enum class PremiumOrderStatus CANCELED = 5 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(PremiumOrderStatus) +#endif + inline uint qHash(PremiumOrderStatus value) { return static_cast(value); @@ -461,6 +494,10 @@ enum class SharedNotebookPrivilegeLevel BUSINESS_FULL_ACCESS = 5 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(SharedNotebookPrivilegeLevel) +#endif + inline uint qHash(SharedNotebookPrivilegeLevel value) { return static_cast(value); @@ -499,6 +536,10 @@ enum class SharedNotePrivilegeLevel FULL_ACCESS = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(SharedNotePrivilegeLevel) +#endif + inline uint qHash(SharedNotePrivilegeLevel value) { return static_cast(value); @@ -532,6 +573,10 @@ enum class SponsoredGroupRole GROUP_OWNER = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(SponsoredGroupRole) +#endif + inline uint qHash(SponsoredGroupRole value) { return static_cast(value); @@ -562,6 +607,10 @@ enum class BusinessUserRole NORMAL = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(BusinessUserRole) +#endif + inline uint qHash(BusinessUserRole value) { return static_cast(value); @@ -598,6 +647,10 @@ enum class BusinessUserStatus DEACTIVATED = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(BusinessUserStatus) +#endif + inline uint qHash(BusinessUserStatus value) { return static_cast(value); @@ -631,6 +684,10 @@ enum class SharedNotebookInstanceRestrictions NO_SHARED_NOTEBOOKS = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(SharedNotebookInstanceRestrictions) +#endif + inline uint qHash(SharedNotebookInstanceRestrictions value) { return static_cast(value); @@ -664,6 +721,10 @@ enum class ReminderEmailConfig SEND_DAILY_EMAIL = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(ReminderEmailConfig) +#endif + inline uint qHash(ReminderEmailConfig value) { return static_cast(value); @@ -701,6 +762,10 @@ enum class BusinessInvitationStatus REDEEMED = 2 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(BusinessInvitationStatus) +#endif + inline uint qHash(BusinessInvitationStatus value) { return static_cast(value); @@ -731,6 +796,10 @@ enum class ContactType LINKEDIN = 6 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(ContactType) +#endif + inline uint qHash(ContactType value) { return static_cast(value); @@ -758,6 +827,10 @@ enum class EntityType WORKSPACE = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(EntityType) +#endif + inline uint qHash(EntityType value) { return static_cast(value); @@ -796,6 +869,10 @@ enum class RecipientStatus IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(RecipientStatus) +#endif + inline uint qHash(RecipientStatus value) { return static_cast(value); @@ -838,6 +915,10 @@ enum class CanMoveToContainerStatus INSUFFICIENT_CONTAINER_PRIVILEGE = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(CanMoveToContainerStatus) +#endif + inline uint qHash(CanMoveToContainerStatus value) { return static_cast(value); @@ -871,6 +952,10 @@ enum class RelatedContentType REFERENCE_MATERIAL = 4 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(RelatedContentType) +#endif + inline uint qHash(RelatedContentType value) { return static_cast(value); @@ -915,6 +1000,10 @@ enum class RelatedContentAccess DIRECT_LINK_EMBEDDED_VIEW = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(RelatedContentAccess) +#endif + inline uint qHash(RelatedContentAccess value) { return static_cast(value); @@ -942,6 +1031,10 @@ enum class UserIdentityType IDENTITYID = 3 }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_ENUM_NS(UserIdentityType) +#endif + inline uint qHash(UserIdentityType value) { return static_cast(value); diff --git a/QEverCloud/src/generated/Types.cpp b/QEverCloud/src/generated/Types.cpp index 2e64e32f..4ded6645 100644 --- a/QEverCloud/src/generated/Types.cpp +++ b/QEverCloud/src/generated/Types.cpp @@ -21902,9 +21902,6 @@ void EDAMInvalidContactsException::print(QTextStream & strm) const //////////////////////////////////////////////////////////////////////////////// - /** @endcond */ - - } // namespace qevercloud From 0aa413f3703246e20fe0b79b7e8252d59c4d3c30 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 22:15:21 +0300 Subject: [PATCH 116/188] Issue #23: mark LogLevel enum as Q_ENUM_NS --- QEverCloud/headers/Log.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 919ca9d5..c8bf8b9c 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -9,9 +9,11 @@ #define QEVERCLOUD_LOG_H #include "Export.h" +#include "Helpers.h" #include #include +#include #include #include @@ -28,6 +30,8 @@ enum class LogLevel Error }; +Q_ENUM_NS(LogLevel) + QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & out, const LogLevel level); From e00bcf4103aa6feaada4dd3e93a4efe655ff2819 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 7 Dec 2019 22:15:41 +0300 Subject: [PATCH 117/188] Add changelog entry about introspectable enums --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c859c6da..1bbf2c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ are `enum class` now and require explicit cast for conversion to/from integer types. There is also no `structs` wrapping enums called `type` anymore so e.g. `EDAMErrorCode::type` values are now simply `EDAMErrorCode` ones. + * Enumerations were also marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS) + macro in case build is done with Qt >= 5.8. This macro adds some introspection + capabilities for the bespoke enumerations. * A dedicated exception class representing network failures was added - `NetworkException`. As other QEverCloud's exceptions, it is a subclass of `EverCloudException`. By default QEverCloud catches such exceptions on its From e8266ef7ada833b9513e0babb84a51df42580d9a Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 8 Dec 2019 13:54:10 +0300 Subject: [PATCH 118/188] Remove Qt4 builds from Travis CI --- .travis.yml | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index a267f3de..df643697 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,16 +14,10 @@ branches: matrix: include: - os: linux - env: QT_BASE=48 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=Debug + env: COMPILER=g++-5.4 CMAKE_BUILD_TYPE=RelWithDebInfo - os: linux - env: QT_BASE=48 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug - - - os: linux - env: QT_BASE=5123 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=RelWithDebInfo - - - os: linux - env: QT_BASE=5123 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug + env: COMPILER=clang++ CMAKE_BUILD_TYPE=Debug - os: osx env: CMAKE_BUILD_TYPE=RelWithDebInfo @@ -59,22 +53,12 @@ install: sudo cp -fR cmake-3.2.0-Linux-x86_64/* /usr && sudo apt-get -qq install p7zip-full coreutils curl && sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test && - if [ "${QT_BASE}" = "5123" ]; then - sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.3-xenial && - sudo apt-get -qq update && - sudo apt-get -qq install qt512tools qt512base qt512webchannel qt512webengine qt512websockets mesa-common-dev libgl1-mesa-dev && - if [ "${COMPILER}" = "clang++" ]; then - export CXX="clang++" && - export CC="clang" - fi - else - export DISPLAY=:99.0 && - sudo apt-get -qq update && - sudo apt-get -qq install libqt4-dev libqt4-dev-bin libqt4-network libqtwebkit-dev && - if [ "${COMPILER}" = "clang++" ]; then - export CXX="clang++" && - export CC="clang" - fi + sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.3-xenial && + sudo apt-get -qq update && + sudo apt-get -qq install qt512tools qt512base qt512webchannel qt512webengine qt512websockets mesa-common-dev libgl1-mesa-dev && + if [ "${COMPILER}" = "clang++" ]; then + export CXX="clang++" && + export CC="clang" fi else brew update && @@ -92,7 +76,7 @@ before_script: - cd build - cmake --version - | - if [ "${QT_BASE}" = "5123" ]; then + if [ "${TRAVIS_OS_NAME}" = "linux" ]; then source /opt/qt512/bin/qt512-env.sh && cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir .. elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then @@ -106,21 +90,21 @@ script: - make check - make install - | - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ] && [ "${TRAVIS_BRANCH}" = "development" ]; then + if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${COMPILER}" = "g++-5.4" ] && [ "${TRAVIS_BRANCH}" = "development" ]; then echo "Triggering build at OpenSUSE build service for development branch" && curl -X POST -H "Authorization: Token $OSC_TOKEN" https://api.opensuse.org/trigger/runservice?project=home%3Ad1vanov%3Aquentier-development&package=qevercloud-development fi after_success: - | - if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ]; then + if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${COMPILER}" = "g++-5.4" ]; then if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then cd $QEVERCLOUD_DIR/build/installdir && - 7z a qevercloud_linux_qt_${QT_BASE}_x86_64.zip * && + 7z a qevercloud_linux_qt_513_x86_64.zip * && wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_linux.zip && unzip ciuploadtool_linux.zip && chmod 755 ciuploadtool && - ./ciuploadtool -suffix="$TRAVIS_BRANCH" qevercloud_linux_qt_${QT_BASE}_x86_64.zip + ./ciuploadtool -suffix="$TRAVIS_BRANCH" qevercloud_linux_qt_513_x86_64.zip fi elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then From 9c396ae72c935a5356f02f208aef8b15559c1cd9 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 8 Dec 2019 13:54:48 +0300 Subject: [PATCH 119/188] Update README.md --- README.md | 73 +++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 731fa345..3db6c318 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ your copy of Qt Creator to have context-sensitive help. See below for more detai ## How to contribute -Please see the [contribution guide](CONTRIBUTING.md) for detailed info. +See [contribution guide](CONTRIBUTING.md) for detailed info. ## Downloads @@ -29,35 +29,21 @@ Prebuilt versions of the library can be downloaded from the following locations: * Stable version: * Windows binaries: * [MSVC 2017 32 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt513-VS2017_x86.zip) - * [MSVC 2017 64 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt510-VS2017_x64.zip) + * [MSVC 2017 64 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt513-VS2017_x64.zip) * [MinGW 32 bit Qt 5.5](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud-windows-qt55-MinGW_x86.zip) * [Mac binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_mac_x86_64.zip) (built with latest Qt from Homebrew) - * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_linux_qt_5132_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 + * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-master/qevercloud_linux_qt_513_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 * Unstable version: * Windows binaries: * [MSVC 2017 32 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt513-VS2017_x86.zip) * [MSVC 2017 64 bit Qt 5.13](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt513-VS2017_x64.zip) * [MinGW 32 bit Qt 5.5](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud-windows-qt55-MinGW_x86.zip) * [Mac binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_mac_x86_64.zip) (built with latest Qt from Homebrew) - * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_linux_qt_5132_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 + * [Linux binary](https://github.com/d1vanov/QEverCloud/releases/download/continuous-development/qevercloud_linux_qt_513_x86_64.zip) built on Ubuntu 16.04 with Qt 5.13 ## How to build -The project can be built and shipped either as a static library or a shared library. Dll export/import symbols necessary for Windows platform are supported. - -Dependencies include the following Qt components: - * Qt5: Qt5Core, Qt5Widgets, Qt5Network and, if the library is built with OAuth support, either: - * Qt5WebKit and Qt5WebKitWidgets - * Qt5WebEngine and Qt5WebEngineWidgets - for Qt < 5.6 - * Qt5WebEngineCore and Qt5WebEngineWidgets - for Qt >= 5.6 - -Since QEverCloud 3.0.2 it is possible to choose Qt5WebKit over Qt5WebEngine using CMake option `USE_QT5_WEBKIT`. - -Since QEverCloud 4.0.0 it is possible to build the library without OAuth support and thus without QtWebKit or QtWebEngine dependencies, for this use CMake option `BUILD_WITH_OAUTH_SUPPORT=NO`. - -Also, if Qt5's Qt5Test modules are found during the pre-build configuration, the unit tests are enabled and can be run with `make test` command. - -The project uses CMake build system which can be used as simply as follows (on Unix platforms): +QEverCloud uses CMake build system which can be used as simply as follows (on Unix platforms): ``` mkdir build cd build @@ -66,43 +52,50 @@ make make install ``` -Please note that installing the library somewhere is mandatory because it puts the library's headers into the subfolder *qt5qevercloud*. The intended use of library's headers is something like this: -``` -#include -``` +The library can be built and shipped either as a static library or a shared library. Dll export/import symbols necessary for Windows platform are supported. + +QEverCloud requires the compiler to support certain elements of C++17 standard. CMake automatically checks whether the compiler is capable enough of building QEverCloud so if the pre-build configuration step was successful, the build step should be successful as well. + +QEverCloud depends on the following Qt components: + * Qt5Core + * Qt5Widgets + * Qt5Network -More CMake configurations options available: +If the library is built with OAuth support, more dependencies are required: + * Qt5WebKit and Qt5WebKitWidgets + * Qt5WebEngine and Qt5WebEngineWidgets - for Qt < 5.6 + * Qt5WebEngineCore and Qt5WebEngineWidgets - for Qt >= 5.6 -*BUILD_DOCUMENTATION* - when *ON*, attempts to find Doxygen and in case of success adds *doc* target so the documentation can be built using `make doc` command after the `cmake ../` step. By default this option is on. +By default CMake prefers QtWebEngine over QtWebKit if both are available but it is possible to choose Qt5WebKit over Qt5WebEngine using CMake option `USE_QT5_WEBKIT`. + +It is possible to build the library without OAuth support and thus eliminate the dependency on QtWebKit or QtWebEngine using CMake option `BUILD_WITH_OAUTH_SUPPORT=NO`. + +If Qt5's Qt5Test module is found during the pre-build configuration step, the unit tests are enabled and can be run with `make test` and more verbose `make check` commands. + +The minimal Qt version required to build the library is Qt 5.5. + +Other available CMake configurations options: + +*BUILD_DOCUMENTATION* - when *ON*, attempts to find Doxygen and in case of success adds *doc* target so the documentation can be built using `make doc` command after the pre-build configuration step. By default this option is on. *BUILD_QCH_DOCUMENTATION* - when *ON*, passes instructions on to Doxygen to build the documentation in *qch* format. This option only has any meaning if *BUILD_DOCUMENTATION* option is on. By default this option is off. *BUILD_SHARED* - when *ON*, CMake configures the build for the shared library. By default this option is on. -If *BUILD_SHARED* is *ON*, `make install` would install the CMake module necessary for applications using CMake's `find_package` command to find the installation of the library. +If *BUILD_SHARED* is *ON*, `make install` installs CMake module necessary for applications using CMake's `find_package` command to find the installation of QEverCloud. -Since QEverCloud 4.1.0 it is possible to build the library with enabled sanitizers using additional CMake options: +It is possible to build the library with enabled sanitizers using additional CMake options: * `-DSANITIZE_ADDRESS=ON` to enable address sanitizer * `-DSANITIZE_MEMORY=ON` to enable memory sanitizer * `-DSANITIZE_THREAD=ON` to enable thread sanitizer * `-DSANITIZE_UNDEFINED=ON` to enable undefined behaviour sanitizer -### QtWebKit vs QWebEngine - -The library uses Qt's web facilities for OAuth authentication. These can be based on either QtWebKit (for older versions of Qt5) or QWebEngine (for more recent versions of Qt5). With CMake build system the choice happens automatically during the pre-build configuration based on the used version of Qt. One can also choose to use QtWebKit even with newer versions of Qt via CMake option `USE_QT5_WEBKIT`. - -### Compiler requirements - -The library requires the compiler to support C++17 standard. CMake automatically checks whether the compiler is capable enough of building QEverCloud so if pre-build step was successful, the build should be successful as well. - ## Include files for applications using the library -Two "cumulative" headers - *QEverCloud.h* or *QEverCloudOAuth.h* - include everything needed for the general and OAuth functionality correspondingly. More "fine-grained" headers are available within the same subfolder if needed. +Two "cumulative" headers - *QEverCloud.h* or *QEverCloudOAuth.h* - include everything needed for the general and OAuth functionality correspondingly. More "fine-grained" headers can also be used if needed. ## Related projects -* [NotePoster](https://github.com/d1vanov/QEverCloud-example-NotePoster) is an example app using QEverCloud library to post notes to Evernote. -* [QEverCloud packaging](https://github.com/d1vanov/QEverCloud-packaging) repository contains various files and scripts required for building QEverCloud packages for various platforms and distributions. -* [QEverCloudGenerator](https://github.com/d1vanov/QEverCloudGenerator) repository contains the parser of [Evernote Thrift IDL files](https://github.com/evernote/evernote-thrift) generating headers and sources for QEverCloud library. -* [libquentier](https://github.com/d1vanov/libquentier) is a library for creating of feature rich full sync Evernote clients built on top of QEverCloud +* [QEverCloudGenerator](https://github.com/d1vanov/QEverCloudGenerator) repository hosts code generating parser of [Evernote Thrift IDL files](https://github.com/evernote/evernote-thrift). This parser is used to autogenerate a portion of QEverCloud's headers and sources. +* [libquentier](https://github.com/d1vanov/libquentier) is a library for creating feature rich full sync Evernote clients built on top of QEverCloud * [Quentier](https://github.com/d1vanov/quentier) is an open source desktop note taking app capable of working as Evernote client built on top of libquentier and QEverCloud From 85e6cc1ff34b31d3275511c6e53354c01c6d9853 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 8 Dec 2019 14:02:43 +0300 Subject: [PATCH 120/188] Change error text to more appropriate one --- QEverCloud/src/Http.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index c117b5d9..e69bb5c2 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -85,7 +85,7 @@ void ReplyFetcher::checkForTimeout() } if ((QDateTime::currentMSecsSinceEpoch() - m_lastNetworkTime) > m_timeoutMsec) { - setError(QNetworkReply::TimeoutError, QStringLiteral("Connection timeout.")); + setError(QNetworkReply::TimeoutError, QStringLiteral("Request timeout.")); } } From 2225100dea0056eba38bc4c3b083a831d1919623 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 8 Dec 2019 14:09:12 +0300 Subject: [PATCH 121/188] Mention minimal supported compilers in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3db6c318..29a297f1 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ make install The library can be built and shipped either as a static library or a shared library. Dll export/import symbols necessary for Windows platform are supported. -QEverCloud requires the compiler to support certain elements of C++17 standard. CMake automatically checks whether the compiler is capable enough of building QEverCloud so if the pre-build configuration step was successful, the build step should be successful as well. +QEverCloud requires the compiler to support certain elements of C++17 standard. CMake automatically checks whether the compiler is capable enough of building QEverCloud so if the pre-build configuration step was successful, the build step should be successful as well. Known capable compilers are g++ 5.4 or later and Visual Studio 2017 or later. QEverCloud depends on the following Qt components: * Qt5Core From c085ed4d024b8ec7850fb083b28945adaa2fa3b3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 9 Dec 2019 08:06:49 +0300 Subject: [PATCH 122/188] Propagate request context through AsyncResult's finished signal It seems to have broken queued connections somehow - now they started to require explicit metatype registration for unknown reason. Need to either find the source or provide some convenient method to initialize these at one place --- QEverCloud/headers/AsyncResult.h | 24 +- QEverCloud/src/AsyncResult.cpp | 29 +- QEverCloud/src/AsyncResult_p.cpp | 35 +- QEverCloud/src/AsyncResult_p.h | 15 +- QEverCloud/src/DurableService.cpp | 13 +- QEverCloud/src/Thumbnail.cpp | 11 +- QEverCloud/src/generated/Services.cpp | 267 ++++------- QEverCloud/src/tests/TestDurableService.cpp | 16 +- QEverCloud/src/tests/TestQEverCloud.cpp | 8 + .../src/tests/generated/TestNoteStore.cpp | 447 +++++++++++++++--- .../src/tests/generated/TestUserStore.cpp | 94 +++- 11 files changed, 637 insertions(+), 322 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index e327d820..6bf532e2 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -12,6 +12,7 @@ #include "EverCloudException.h" #include "Export.h" #include "Helpers.h" +#include "RequestContext.h" #include #include @@ -34,7 +35,10 @@ NoteStore* ns; Note note; ... QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, - [ns](QVariant result, QSharedPointer error) + [ns]( + QVariant result, + QSharedPointer error, + QSharedPointer ctx) { if (error) { // do something in case of an error @@ -56,12 +60,12 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject typedef QVariant (*ReadFunctionType)(QByteArray replyData); AsyncResult(QString url, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + IRequestContextPtr ctx, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); AsyncResult(QNetworkRequest request, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + IRequestContextPtr ctx, ReadFunctionType readFunction = AsyncResult::asIs, bool autoDelete = true, QObject * parent = nullptr); @@ -70,7 +74,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * for use in tests */ AsyncResult(QVariant result, QSharedPointer error, - QUuid requestId, bool autoDelete = true, + IRequestContextPtr ctx, bool autoDelete = true, QObject * parent = nullptr); ~AsyncResult(); @@ -86,16 +90,18 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject Q_SIGNALS: /** * @brief Emitted upon asynchronous call completition. - * @param result - * @param error - * error != nullptr in case of an error. See EverCloudExceptionData - * for more details. + * @param ctx Request context used to make the request + * @param result Request result + * @param error Non-nullptr in case of an error. See + * EverCloudExceptionData for more details * * AsyncResult deletes itself after emitting this signal (if autoDelete * parameter passed to its constructor was set to true). You don't have to * manage it's lifetime explicitly. */ - void finished(QVariant result, QSharedPointer error); + void finished( + QSharedPointer ctx, QVariant result, + QSharedPointer error); private: friend class DurableService; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index fdb849a3..b4bd7181 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -26,12 +26,17 @@ QVariant AsyncResult::asIs(QByteArray replyData) } AsyncResult::AsyncResult( - QString url, QByteArray postData, qint64 timeoutMsec, QUuid requestId, + QString url, QByteArray postData, IRequestContextPtr ctx, AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate( - url, postData, timeoutMsec, requestId, readFunction, autoDelete, this)) + url, + std::move(postData), + std::move(ctx), + std::move(readFunction), + autoDelete, + this)) { if (!url.isEmpty()) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); @@ -39,21 +44,31 @@ AsyncResult::AsyncResult( } AsyncResult::AsyncResult( - QNetworkRequest request, QByteArray postData, qint64 timeoutMsec, - QUuid requestId, qevercloud::AsyncResult::ReadFunctionType readFunction, + QNetworkRequest request, QByteArray postData, IRequestContextPtr ctx, + qevercloud::AsyncResult::ReadFunctionType readFunction, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate( - request, postData, timeoutMsec, requestId, readFunction, autoDelete, this)) + std::move(request), + std::move(postData), + std::move(ctx), + std::move(readFunction), + autoDelete, + this)) { QMetaObject::invokeMethod(d_ptr, "start", Qt::QueuedConnection); } AsyncResult::AsyncResult( QVariant result, QSharedPointer error, - QUuid requestId, bool autoDelete, QObject * parent) : + IRequestContextPtr ctx, bool autoDelete, QObject * parent) : QObject(parent), - d_ptr(new AsyncResultPrivate(result, error, requestId, autoDelete, this)) + d_ptr(new AsyncResultPrivate( + std::move(result), + std::move(error), + std::move(ctx), + autoDelete, + this)) {} AsyncResult::~AsyncResult() diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index cc4dff24..7cbd5631 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -14,37 +14,33 @@ namespace qevercloud { AsyncResultPrivate::AsyncResultPrivate( - QString url, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + QString url, QByteArray postData, IRequestContextPtr ctx, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : - m_requestId(requestId), m_request(createEvernoteRequest(url)), - m_postData(postData), - m_timeoutMsec(timeoutMsec), - m_readFunction(readFunction), + m_postData(std::move(postData)), + m_ctx(std::move(ctx)), + m_readFunction(std::move(readFunction)), m_autoDelete(autoDelete), q_ptr(q) {} AsyncResultPrivate::AsyncResultPrivate( - QNetworkRequest request, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + QNetworkRequest request, QByteArray postData, IRequestContextPtr ctx, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q) : - m_requestId(requestId), - m_request(request), - m_postData(postData), - m_timeoutMsec(timeoutMsec), - m_readFunction(readFunction), + m_request(std::move(request)), + m_postData(std::move(postData)), + m_ctx(std::move(ctx)), + m_readFunction(std::move(readFunction)), m_autoDelete(autoDelete), q_ptr(q) {} AsyncResultPrivate::AsyncResultPrivate( QVariant result, QSharedPointer error, - QUuid requestId, bool autoDelete, AsyncResult * q) : - m_requestId(requestId), + IRequestContextPtr ctx, bool autoDelete, AsyncResult * q) : + m_ctx(std::move(ctx)), m_autoDelete(autoDelete), q_ptr(q) { @@ -67,13 +63,16 @@ void AsyncResultPrivate::start() QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &AsyncResultPrivate::onReplyFetched); replyFetcher->start( - evernoteNetworkAccessManager(), m_request, m_timeoutMsec, m_postData); + evernoteNetworkAccessManager(), + m_request, + m_ctx->requestTimeout(), + m_postData); } void AsyncResultPrivate::onReplyFetched(QObject * rp) { QEC_DEBUG("async_result", "received reply for request with id " - << m_requestId); + << m_ctx->requestId()); ReplyFetcher * reply = qobject_cast(rp); QSharedPointer error; @@ -124,7 +123,7 @@ void AsyncResultPrivate::setValue( q, &AsyncResult::finished, Qt::QueuedConnection); - Q_EMIT finished(result, error); + Q_EMIT finished(m_ctx, result, error); if (m_autoDelete) { q->deleteLater(); diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 441fe721..5e52cec8 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -18,25 +18,25 @@ class AsyncResultPrivate: public QObject Q_OBJECT public: explicit AsyncResultPrivate( - QString url, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + QString url, QByteArray postData, IRequestContextPtr ctx, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); explicit AsyncResultPrivate( - QNetworkRequest request, QByteArray postData, - qint64 timeoutMsec, QUuid requestId, + QNetworkRequest request, QByteArray postData, IRequestContextPtr ctx, AsyncResult::ReadFunctionType readFunction, bool autoDelete, AsyncResult * q); explicit AsyncResultPrivate( QVariant result, QSharedPointer error, - QUuid requestId, bool autoDelete, AsyncResult * q); + IRequestContextPtr ctx, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); Q_SIGNALS: - void finished(QVariant result, QSharedPointer error); + void finished( + QSharedPointer ctx, QVariant result, + QSharedPointer error); public Q_SLOTS: void start(); @@ -46,10 +46,9 @@ public Q_SLOTS: void setValue(QVariant result, QSharedPointer error); public: - QUuid m_requestId; QNetworkRequest m_request; QByteArray m_postData; - qint64 m_timeoutMsec = 0; + IRequestContextPtr m_ctx; AsyncResult::ReadFunctionType m_readFunction; bool m_autoDelete; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 0408f596..7b9982a2 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -137,13 +137,17 @@ DurableService::DurableService(IRetryPolicyPtr retryPolicy, if (!m_retryPolicy) { m_retryPolicy = newRetryPolicy(); } + + if (!m_ctx) { + m_ctx = newRequestContext(); + } } DurableService::SyncResult DurableService::executeSyncRequest( SyncRequest && syncRequest, IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx->clone(); } RetryState state; @@ -222,13 +226,13 @@ AsyncResult * DurableService::executeAsyncRequest( AsyncRequest && asyncRequest, IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx; + ctx = m_ctx->clone(); } RetryState state; state.m_retryCount = ctx->maxRequestRetryCount(); - AsyncResult * result = new AsyncResult(QString(), QByteArray(), 0, ctx->requestId()); + AsyncResult * result = new AsyncResult(QString(), QByteArray(), ctx); doExecuteAsyncRequest(std::move(asyncRequest), std::move(ctx), std::move(state), result); @@ -251,9 +255,12 @@ void DurableService::doExecuteAsyncRequest( &AsyncResult::finished, result, [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( + QSharedPointer c, QVariant value, QSharedPointer exceptionData) mutable { + Q_UNUSED(c) + if (!exceptionData) { QEC_DEBUG("durable_service", "Successfully executed async " << asyncRequest.m_name << " request with id " diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 6bfb3598..5e4cc62e 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -10,6 +10,7 @@ #include "Http.h" #include +#include #include namespace qevercloud { @@ -122,17 +123,19 @@ AsyncResult * Thumbnail::downloadAsync( << (isResourceGuid ? "resource guid" : "not a resource guid")); auto pair = createPostRequest(guid, isPublic, isResourceGuid); + auto ctx = newRequestContext({}, timeoutMsec); auto res = new AsyncResult( pair.first, pair.second, - timeoutMsec, - QUuid::createUuid()); + ctx); QObject::connect(res, &AsyncResult::finished, - [=] (const QVariant & value, - const QSharedPointer error) + [=] (const QSharedPointer & ctx, + const QVariant & value, + const QSharedPointer & error) { Q_UNUSED(value) + Q_UNUSED(ctx) if (!error) { QEC_DEBUG("thumbnail", "Finished async download " diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index ef204707..345c08ae 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -889,8 +889,7 @@ AsyncResult * NoteStore::getSyncStateAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetSyncStateReadReplyAsync); } @@ -1108,8 +1107,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetFilteredSyncChunkReadReplyAsync); } @@ -1308,8 +1306,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetLinkedNotebookSyncStateReadReplyAsync); } @@ -1553,8 +1550,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetLinkedNotebookSyncChunkReadReplyAsync); } @@ -1739,8 +1735,7 @@ AsyncResult * NoteStore::listNotebooksAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListNotebooksReadReplyAsync); } @@ -1925,8 +1920,7 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListAccessibleBusinessNotebooksReadReplyAsync); } @@ -2125,8 +2119,7 @@ AsyncResult * NoteStore::getNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNotebookReadReplyAsync); } @@ -2297,8 +2290,7 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetDefaultNotebookReadReplyAsync); } @@ -2497,8 +2489,7 @@ AsyncResult * NoteStore::createNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateNotebookReadReplyAsync); } @@ -2697,8 +2688,7 @@ AsyncResult * NoteStore::updateNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateNotebookReadReplyAsync); } @@ -2897,8 +2887,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreExpungeNotebookReadReplyAsync); } @@ -3083,8 +3072,7 @@ AsyncResult * NoteStore::listTagsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListTagsReadReplyAsync); } @@ -3297,8 +3285,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListTagsByNotebookReadReplyAsync); } @@ -3497,8 +3484,7 @@ AsyncResult * NoteStore::getTagAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetTagReadReplyAsync); } @@ -3697,8 +3683,7 @@ AsyncResult * NoteStore::createTagAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateTagReadReplyAsync); } @@ -3897,8 +3882,7 @@ AsyncResult * NoteStore::updateTagAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateTagReadReplyAsync); } @@ -4077,8 +4061,7 @@ AsyncResult * NoteStore::untagAllAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUntagAllReadReplyAsync); } @@ -4277,8 +4260,7 @@ AsyncResult * NoteStore::expungeTagAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreExpungeTagReadReplyAsync); } @@ -4463,8 +4445,7 @@ AsyncResult * NoteStore::listSearchesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListSearchesReadReplyAsync); } @@ -4663,8 +4644,7 @@ AsyncResult * NoteStore::getSearchAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetSearchReadReplyAsync); } @@ -4852,8 +4832,7 @@ AsyncResult * NoteStore::createSearchAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateSearchReadReplyAsync); } @@ -5052,8 +5031,7 @@ AsyncResult * NoteStore::updateSearchAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateSearchReadReplyAsync); } @@ -5252,8 +5230,7 @@ AsyncResult * NoteStore::expungeSearchAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreExpungeSearchReadReplyAsync); } @@ -5467,8 +5444,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreFindNoteOffsetReadReplyAsync); } @@ -5712,8 +5688,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreFindNotesMetadataReadReplyAsync); } @@ -5927,8 +5902,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreFindNoteCountsReadReplyAsync); } @@ -6142,8 +6116,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteWithResultSpecReadReplyAsync); } @@ -6402,8 +6375,7 @@ AsyncResult * NoteStore::getNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteReadReplyAsync); } @@ -6602,8 +6574,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteApplicationDataReadReplyAsync); } @@ -6817,8 +6788,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteApplicationDataEntryReadReplyAsync); } @@ -7047,8 +7017,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreSetNoteApplicationDataEntryReadReplyAsync); } @@ -7262,8 +7231,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUnsetNoteApplicationDataEntryReadReplyAsync); } @@ -7462,8 +7430,7 @@ AsyncResult * NoteStore::getNoteContentAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteContentReadReplyAsync); } @@ -7692,8 +7659,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteSearchTextReadReplyAsync); } @@ -7892,8 +7858,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceSearchTextReadReplyAsync); } @@ -8106,8 +8071,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteTagNamesReadReplyAsync); } @@ -8306,8 +8270,7 @@ AsyncResult * NoteStore::createNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateNoteReadReplyAsync); } @@ -8506,8 +8469,7 @@ AsyncResult * NoteStore::updateNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateNoteReadReplyAsync); } @@ -8706,8 +8668,7 @@ AsyncResult * NoteStore::deleteNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreDeleteNoteReadReplyAsync); } @@ -8906,8 +8867,7 @@ AsyncResult * NoteStore::expungeNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreExpungeNoteReadReplyAsync); } @@ -9121,8 +9081,7 @@ AsyncResult * NoteStore::copyNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCopyNoteReadReplyAsync); } @@ -9335,8 +9294,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListNoteVersionsReadReplyAsync); } @@ -9595,8 +9553,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNoteVersionReadReplyAsync); } @@ -9855,8 +9812,7 @@ AsyncResult * NoteStore::getResourceAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceReadReplyAsync); } @@ -10055,8 +10011,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceApplicationDataReadReplyAsync); } @@ -10270,8 +10225,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceApplicationDataEntryReadReplyAsync); } @@ -10500,8 +10454,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreSetResourceApplicationDataEntryReadReplyAsync); } @@ -10715,8 +10668,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUnsetResourceApplicationDataEntryReadReplyAsync); } @@ -10915,8 +10867,7 @@ AsyncResult * NoteStore::updateResourceAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateResourceReadReplyAsync); } @@ -11115,8 +11066,7 @@ AsyncResult * NoteStore::getResourceDataAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceDataReadReplyAsync); } @@ -11375,8 +11325,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceByHashReadReplyAsync); } @@ -11575,8 +11524,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceRecognitionReadReplyAsync); } @@ -11775,8 +11723,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceAlternateDataReadReplyAsync); } @@ -11975,8 +11922,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetResourceAttributesReadReplyAsync); } @@ -12168,8 +12114,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetPublicNotebookReadReplyAsync); } @@ -12383,8 +12328,7 @@ AsyncResult * NoteStore::shareNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreShareNotebookReadReplyAsync); } @@ -12594,8 +12538,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateOrUpdateNotebookSharesReadReplyAsync); } @@ -12794,8 +12737,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateSharedNotebookReadReplyAsync); } @@ -13009,8 +12951,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreSetNotebookRecipientSettingsReadReplyAsync); } @@ -13206,8 +13147,7 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListSharedNotebooksReadReplyAsync); } @@ -13406,8 +13346,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreCreateLinkedNotebookReadReplyAsync); } @@ -13606,8 +13545,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateLinkedNotebookReadReplyAsync); } @@ -13803,8 +13741,7 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreListLinkedNotebooksReadReplyAsync); } @@ -14003,8 +13940,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreExpungeLinkedNotebookReadReplyAsync); } @@ -14203,8 +14139,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreAuthenticateToSharedNotebookReadReplyAsync); } @@ -14386,8 +14321,7 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetSharedNotebookByAuthReadReplyAsync); } @@ -14566,8 +14500,7 @@ AsyncResult * NoteStore::emailNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreEmailNoteReadReplyAsync); } @@ -14766,8 +14699,7 @@ AsyncResult * NoteStore::shareNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreShareNoteReadReplyAsync); } @@ -14946,8 +14878,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreStopSharingNoteReadReplyAsync); } @@ -15161,8 +15092,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreAuthenticateToSharedNoteReadReplyAsync); } @@ -15376,8 +15306,7 @@ AsyncResult * NoteStore::findRelatedAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreFindRelatedReadReplyAsync); } @@ -15576,8 +15505,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreUpdateNoteIfUsnMatchesReadReplyAsync); } @@ -15776,8 +15704,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreManageNotebookSharesReadReplyAsync); } @@ -15976,8 +15903,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, NoteStoreGetNotebookSharesReadReplyAsync); } @@ -16335,8 +16261,7 @@ AsyncResult * UserStore::checkVersionAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreCheckVersionReadReplyAsync); } @@ -16491,8 +16416,7 @@ AsyncResult * UserStore::getBootstrapInfoAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreGetBootstrapInfoReadReplyAsync); } @@ -16753,8 +16677,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreAuthenticateLongSessionReadReplyAsync); } @@ -16970,8 +16893,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreCompleteTwoFactorAuthenticationReadReplyAsync); } @@ -17122,8 +17044,7 @@ AsyncResult * UserStore::revokeLongSessionAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreRevokeLongSessionReadReplyAsync); } @@ -17294,8 +17215,7 @@ AsyncResult * UserStore::authenticateToBusinessAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreAuthenticateToBusinessReadReplyAsync); } @@ -17466,8 +17386,7 @@ AsyncResult * UserStore::getUserAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreGetUserReadReplyAsync); } @@ -17655,8 +17574,7 @@ AsyncResult * UserStore::getPublicUserInfoAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreGetPublicUserInfoReadReplyAsync); } @@ -17827,8 +17745,7 @@ AsyncResult * UserStore::getUserUrlsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreGetUserUrlsReadReplyAsync); } @@ -17996,8 +17913,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreInviteToBusinessReadReplyAsync); } @@ -18176,8 +18092,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreRemoveFromBusinessReadReplyAsync); } @@ -18371,8 +18286,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreUpdateBusinessUserIdentifierReadReplyAsync); } @@ -18557,8 +18471,7 @@ AsyncResult * UserStore::listBusinessUsersAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreListBusinessUsersReadReplyAsync); } @@ -18760,8 +18673,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreListBusinessInvitationsReadReplyAsync); } @@ -18927,8 +18839,7 @@ AsyncResult * UserStore::getAccountLimitsAsync( return new AsyncResult( m_url, params, - ctx->requestTimeout(), - ctx->requestId(), + ctx, UserStoreGetAccountLimitsReadReplyAsync); } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 403578c2..fe938dff 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -33,8 +33,12 @@ class ValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(ctx) m_value = value; m_exceptionData = data; Q_EMIT finished(); @@ -81,7 +85,7 @@ void DurableServiceTester::shouldExecuteAsyncServiceCall() [&] (IRequestContextPtr ctx) -> AsyncResult* { Q_ASSERT(ctx); serviceCallDetected = true; - return new AsyncResult(value, {}, ctx->requestId()); + return new AsyncResult(value, {}, ctx); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -179,10 +183,10 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() data = e.exceptionData(); } - return new AsyncResult(QVariant(), data, ctx->requestId()); + return new AsyncResult(QVariant(), data, ctx); } - return new AsyncResult(value, {}, ctx->requestId()); + return new AsyncResult(value, {}, ctx); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -279,7 +283,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() data = e.exceptionData(); } - return new AsyncResult(QVariant(), data, ctx->requestId()); + return new AsyncResult(QVariant(), data, ctx); }); AsyncResult * result = durableService->executeAsyncRequest( @@ -390,7 +394,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro data = e.exceptionData(); } - return new AsyncResult(QVariant(), data, ctx->requestId()); + return new AsyncResult(QVariant(), data, ctx); }); AsyncResult * result = durableService->executeAsyncRequest( diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index f527ee6b..4ef15157 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -11,6 +11,8 @@ #include "generated/TestNoteStore.h" #include "generated/TestUserStore.h" +#include + #include #include @@ -27,6 +29,12 @@ int main(int argc, char *argv[]) QCoreApplication app(argc, argv); + // FIXME: figure out why things don't work without this + qRegisterMetaType>( + "QSharedPointer"); + qRegisterMetaType>( + "QSharedPointer"); + #define RUN_TESTS(tester) \ res = QTest::qExec(new tester); \ if (res != 0) { \ diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 84107c69..245eae86 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -3910,9 +3910,13 @@ class NoteStoreGetSyncStateAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -3935,9 +3939,13 @@ class NoteStoreGetFilteredSyncChunkAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -3960,9 +3968,13 @@ class NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -3985,9 +3997,13 @@ class NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4010,9 +4026,13 @@ class NoteStoreListNotebooksAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4035,9 +4055,13 @@ class NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4060,9 +4084,13 @@ class NoteStoreGetNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4085,9 +4113,13 @@ class NoteStoreGetDefaultNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4110,9 +4142,13 @@ class NoteStoreCreateNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4135,9 +4171,13 @@ class NoteStoreUpdateNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4160,9 +4200,13 @@ class NoteStoreExpungeNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4185,9 +4229,13 @@ class NoteStoreListTagsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4210,9 +4258,13 @@ class NoteStoreListTagsByNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4235,9 +4287,13 @@ class NoteStoreGetTagAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4260,9 +4316,13 @@ class NoteStoreCreateTagAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4285,9 +4345,13 @@ class NoteStoreUpdateTagAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4309,8 +4373,13 @@ class NoteStoreUntagAllAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4333,9 +4402,13 @@ class NoteStoreExpungeTagAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4358,9 +4431,13 @@ class NoteStoreListSearchesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4383,9 +4460,13 @@ class NoteStoreGetSearchAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4408,9 +4489,13 @@ class NoteStoreCreateSearchAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4433,9 +4518,13 @@ class NoteStoreUpdateSearchAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4458,9 +4547,13 @@ class NoteStoreExpungeSearchAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4483,9 +4576,13 @@ class NoteStoreFindNoteOffsetAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4508,9 +4605,13 @@ class NoteStoreFindNotesMetadataAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4533,9 +4634,13 @@ class NoteStoreFindNoteCountsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4558,9 +4663,13 @@ class NoteStoreGetNoteWithResultSpecAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4583,9 +4692,13 @@ class NoteStoreGetNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4608,9 +4721,13 @@ class NoteStoreGetNoteApplicationDataAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4633,9 +4750,13 @@ class NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4658,9 +4779,13 @@ class NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4683,9 +4808,13 @@ class NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4708,9 +4837,13 @@ class NoteStoreGetNoteContentAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4733,9 +4866,13 @@ class NoteStoreGetNoteSearchTextAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4758,9 +4895,13 @@ class NoteStoreGetResourceSearchTextAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4783,9 +4924,13 @@ class NoteStoreGetNoteTagNamesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4808,9 +4953,13 @@ class NoteStoreCreateNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4833,9 +4982,13 @@ class NoteStoreUpdateNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4858,9 +5011,13 @@ class NoteStoreDeleteNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4883,9 +5040,13 @@ class NoteStoreExpungeNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4908,9 +5069,13 @@ class NoteStoreCopyNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4933,9 +5098,13 @@ class NoteStoreListNoteVersionsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4958,9 +5127,13 @@ class NoteStoreGetNoteVersionAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -4983,9 +5156,13 @@ class NoteStoreGetResourceAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5008,9 +5185,13 @@ class NoteStoreGetResourceApplicationDataAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5033,9 +5214,13 @@ class NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5058,9 +5243,13 @@ class NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5083,9 +5272,13 @@ class NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher: public QObjec void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5108,9 +5301,13 @@ class NoteStoreUpdateResourceAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5133,9 +5330,13 @@ class NoteStoreGetResourceDataAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5158,9 +5359,13 @@ class NoteStoreGetResourceByHashAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5183,9 +5388,13 @@ class NoteStoreGetResourceRecognitionAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5208,9 +5417,13 @@ class NoteStoreGetResourceAlternateDataAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5233,9 +5446,13 @@ class NoteStoreGetResourceAttributesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5258,9 +5475,13 @@ class NoteStoreGetPublicNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5283,9 +5504,13 @@ class NoteStoreShareNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5308,9 +5533,13 @@ class NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5333,9 +5562,13 @@ class NoteStoreUpdateSharedNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5358,9 +5591,13 @@ class NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5383,9 +5620,13 @@ class NoteStoreListSharedNotebooksAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5408,9 +5649,13 @@ class NoteStoreCreateLinkedNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5433,9 +5678,13 @@ class NoteStoreUpdateLinkedNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5458,9 +5707,13 @@ class NoteStoreListLinkedNotebooksAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5483,9 +5736,13 @@ class NoteStoreExpungeLinkedNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5508,9 +5765,13 @@ class NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5533,9 +5794,13 @@ class NoteStoreGetSharedNotebookByAuthAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5557,8 +5822,13 @@ class NoteStoreEmailNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5581,9 +5851,13 @@ class NoteStoreShareNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5605,8 +5879,13 @@ class NoteStoreStopSharingNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5629,9 +5908,13 @@ class NoteStoreAuthenticateToSharedNoteAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5654,9 +5937,13 @@ class NoteStoreFindRelatedAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5679,9 +5966,13 @@ class NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5704,9 +5995,13 @@ class NoteStoreManageNotebookSharesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -5729,9 +6024,13 @@ class NoteStoreGetNotebookSharesAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 24c45557..b5ca5c49 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -814,9 +814,13 @@ class UserStoreCheckVersionAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -839,9 +843,13 @@ class UserStoreGetBootstrapInfoAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -864,9 +872,13 @@ class UserStoreAuthenticateLongSessionAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -889,9 +901,13 @@ class UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -913,8 +929,13 @@ class UserStoreRevokeLongSessionAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -937,9 +958,13 @@ class UserStoreAuthenticateToBusinessAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -962,9 +987,13 @@ class UserStoreGetUserAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -987,9 +1016,13 @@ class UserStoreGetPublicUserInfoAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1012,9 +1045,13 @@ class UserStoreGetUserUrlsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1036,8 +1073,13 @@ class UserStoreInviteToBusinessAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1059,8 +1101,13 @@ class UserStoreRemoveFromBusinessAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1082,8 +1129,13 @@ class UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { + Q_UNUSED(value) + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1106,9 +1158,13 @@ class UserStoreListBusinessUsersAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1131,9 +1187,13 @@ class UserStoreListBusinessInvitationsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast>(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } @@ -1156,9 +1216,13 @@ class UserStoreGetAccountLimitsAsyncValueFetcher: public QObject void finished(); public Q_SLOTS: - void onFinished(QVariant value, QSharedPointer data) + void onFinished( + QSharedPointer ctx, + QVariant value, + QSharedPointer data) { m_value = qvariant_cast(value); + Q_UNUSED(ctx) m_exceptionData = data; Q_EMIT finished(); } From c04987bbba78dd50d248566b378f1975aeb38bf1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 10 Dec 2019 07:16:21 +0300 Subject: [PATCH 123/188] Solve the problem of metatypes registration by introducing initialization function --- QEverCloud/headers/AsyncResult.h | 9 +- QEverCloud/headers/Globals.h | 14 +- QEverCloud/src/AsyncResult_p.cpp | 4 +- QEverCloud/src/AsyncResult_p.h | 5 +- QEverCloud/src/DurableService.cpp | 4 +- QEverCloud/src/Globals.cpp | 25 ++ QEverCloud/src/Thumbnail.cpp | 6 +- QEverCloud/src/tests/TestDurableService.cpp | 4 +- QEverCloud/src/tests/TestQEverCloud.cpp | 11 +- .../src/tests/generated/TestNoteStore.cpp | 296 +++++++++--------- .../src/tests/generated/TestUserStore.cpp | 60 ++-- 11 files changed, 236 insertions(+), 202 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 6bf532e2..0a8a1b76 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -38,7 +38,7 @@ QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, [ns]( QVariant result, QSharedPointer error, - QSharedPointer ctx) + IRequestContextPtr ctx) { if (error) { // do something in case of an error @@ -90,18 +90,19 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject Q_SIGNALS: /** * @brief Emitted upon asynchronous call completition. - * @param ctx Request context used to make the request * @param result Request result * @param error Non-nullptr in case of an error. See * EverCloudExceptionData for more details + * @param ctx Request context used to make the request * * AsyncResult deletes itself after emitting this signal (if autoDelete * parameter passed to its constructor was set to true). You don't have to * manage it's lifetime explicitly. */ void finished( - QSharedPointer ctx, QVariant result, - QSharedPointer error); + QVariant result, + QSharedPointer error, + IRequestContextPtr ctx); private: friend class DurableService; diff --git a/QEverCloud/headers/Globals.h b/QEverCloud/headers/Globals.h index 191bb5b2..cf0bb1fe 100644 --- a/QEverCloud/headers/Globals.h +++ b/QEverCloud/headers/Globals.h @@ -18,6 +18,8 @@ */ namespace qevercloud { +//////////////////////////////////////////////////////////////////////////////// + /** * All network request made by QEverCloud - including OAuth - are * served by this NetworkAccessManager. @@ -26,11 +28,21 @@ namespace qevercloud { */ QEVERCLOUD_EXPORT QNetworkAccessManager * evernoteNetworkAccessManager(); +//////////////////////////////////////////////////////////////////////////////// + /** - * qevercloud library version. + * QEverCloud library version. */ QEVERCLOUD_EXPORT int libraryVersion(); +//////////////////////////////////////////////////////////////////////////////// + +/** + * Initialization function for QEverCloud, needs to be called once + * before using the library. There is no harm if it is called multiple times + */ +QEVERCLOUD_EXPORT void initializeQEverCloud(); + } // namespace qevercloud #endif // QEVERCLOUD_GLOBALS_H diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 7cbd5631..d946a38f 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -121,9 +121,9 @@ void AsyncResultPrivate::setValue( Q_Q(AsyncResult); QObject::connect(this, &AsyncResultPrivate::finished, q, &AsyncResult::finished, - Qt::QueuedConnection); + Qt::DirectConnection); - Q_EMIT finished(m_ctx, result, error); + Q_EMIT finished(result, error, m_ctx); if (m_autoDelete) { q->deleteLater(); diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index 5e52cec8..f418ca52 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -35,8 +35,9 @@ class AsyncResultPrivate: public QObject Q_SIGNALS: void finished( - QSharedPointer ctx, QVariant result, - QSharedPointer error); + QVariant result, + QSharedPointer error, + IRequestContextPtr ctx); public Q_SLOTS: void start(); diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 7b9982a2..132b2666 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -255,9 +255,9 @@ void DurableService::doExecuteAsyncRequest( &AsyncResult::finished, result, [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( - QSharedPointer c, QVariant value, - QSharedPointer exceptionData) mutable + QSharedPointer exceptionData, + IRequestContextPtr c) mutable { Q_UNUSED(c) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 931780f4..67dba1e3 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -8,15 +8,33 @@ */ #include +#include +#include +#include #include namespace qevercloud { +namespace { + +//////////////////////////////////////////////////////////////////////////////// + Q_GLOBAL_STATIC(QNetworkAccessManager, globalEvernoteNetworkAccessManager) //////////////////////////////////////////////////////////////////////////////// +void registerMetatypes() +{ + qRegisterMetaType>( + "QSharedPointer"); + qRegisterMetaType("IRequestContextPtr"); +} + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// + QNetworkAccessManager * evernoteNetworkAccessManager() { return globalEvernoteNetworkAccessManager; @@ -29,4 +47,11 @@ int libraryVersion() return 5*10000 + 0*100 + 0; } +//////////////////////////////////////////////////////////////////////////////// + +void initializeQEverCloud() +{ + registerMetatypes(); +} + } // namespace qevercloud diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 5e4cc62e..34479f27 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -130,9 +130,9 @@ AsyncResult * Thumbnail::downloadAsync( ctx); QObject::connect(res, &AsyncResult::finished, - [=] (const QSharedPointer & ctx, - const QVariant & value, - const QSharedPointer & error) + [=] (QVariant value, + QSharedPointer error, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index fe938dff..c7d6a14a 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -34,9 +34,9 @@ class ValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(ctx) m_value = value; diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 4ef15157..b318a5dd 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -11,7 +11,7 @@ #include "generated/TestNoteStore.h" #include "generated/TestUserStore.h" -#include +#include #include #include @@ -25,16 +25,11 @@ int main(int argc, char *argv[]) // Fixed seed for rand() calls std::srand(1575003691); - int res = 0; - QCoreApplication app(argc, argv); - // FIXME: figure out why things don't work without this - qRegisterMetaType>( - "QSharedPointer"); - qRegisterMetaType>( - "QSharedPointer"); + initializeQEverCloud(); + int res = 0; #define RUN_TESTS(tester) \ res = QTest::qExec(new tester); \ if (res != 0) { \ diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 245eae86..f404093a 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -3911,9 +3911,9 @@ class NoteStoreGetSyncStateAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -3940,9 +3940,9 @@ class NoteStoreGetFilteredSyncChunkAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -3969,9 +3969,9 @@ class NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -3998,9 +3998,9 @@ class NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4027,9 +4027,9 @@ class NoteStoreListNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -4056,9 +4056,9 @@ class NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -4085,9 +4085,9 @@ class NoteStoreGetNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4114,9 +4114,9 @@ class NoteStoreGetDefaultNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4143,9 +4143,9 @@ class NoteStoreCreateNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4172,9 +4172,9 @@ class NoteStoreUpdateNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4201,9 +4201,9 @@ class NoteStoreExpungeNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4230,9 +4230,9 @@ class NoteStoreListTagsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -4259,9 +4259,9 @@ class NoteStoreListTagsByNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -4288,9 +4288,9 @@ class NoteStoreGetTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4317,9 +4317,9 @@ class NoteStoreCreateTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4346,9 +4346,9 @@ class NoteStoreUpdateTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4374,9 +4374,9 @@ class NoteStoreUntagAllAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -4403,9 +4403,9 @@ class NoteStoreExpungeTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4432,9 +4432,9 @@ class NoteStoreListSearchesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -4461,9 +4461,9 @@ class NoteStoreGetSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4490,9 +4490,9 @@ class NoteStoreCreateSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4519,9 +4519,9 @@ class NoteStoreUpdateSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4548,9 +4548,9 @@ class NoteStoreExpungeSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4577,9 +4577,9 @@ class NoteStoreFindNoteOffsetAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4606,9 +4606,9 @@ class NoteStoreFindNotesMetadataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4635,9 +4635,9 @@ class NoteStoreFindNoteCountsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4664,9 +4664,9 @@ class NoteStoreGetNoteWithResultSpecAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4693,9 +4693,9 @@ class NoteStoreGetNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4722,9 +4722,9 @@ class NoteStoreGetNoteApplicationDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4751,9 +4751,9 @@ class NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4780,9 +4780,9 @@ class NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4809,9 +4809,9 @@ class NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4838,9 +4838,9 @@ class NoteStoreGetNoteContentAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4867,9 +4867,9 @@ class NoteStoreGetNoteSearchTextAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4896,9 +4896,9 @@ class NoteStoreGetResourceSearchTextAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4925,9 +4925,9 @@ class NoteStoreGetNoteTagNamesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4954,9 +4954,9 @@ class NoteStoreCreateNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -4983,9 +4983,9 @@ class NoteStoreUpdateNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5012,9 +5012,9 @@ class NoteStoreDeleteNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5041,9 +5041,9 @@ class NoteStoreExpungeNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5070,9 +5070,9 @@ class NoteStoreCopyNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5099,9 +5099,9 @@ class NoteStoreListNoteVersionsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -5128,9 +5128,9 @@ class NoteStoreGetNoteVersionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5157,9 +5157,9 @@ class NoteStoreGetResourceAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5186,9 +5186,9 @@ class NoteStoreGetResourceApplicationDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5215,9 +5215,9 @@ class NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5244,9 +5244,9 @@ class NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5273,9 +5273,9 @@ class NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher: public QObjec public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5302,9 +5302,9 @@ class NoteStoreUpdateResourceAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5331,9 +5331,9 @@ class NoteStoreGetResourceDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5360,9 +5360,9 @@ class NoteStoreGetResourceByHashAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5389,9 +5389,9 @@ class NoteStoreGetResourceRecognitionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5418,9 +5418,9 @@ class NoteStoreGetResourceAlternateDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5447,9 +5447,9 @@ class NoteStoreGetResourceAttributesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5476,9 +5476,9 @@ class NoteStoreGetPublicNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5505,9 +5505,9 @@ class NoteStoreShareNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5534,9 +5534,9 @@ class NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5563,9 +5563,9 @@ class NoteStoreUpdateSharedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5592,9 +5592,9 @@ class NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5621,9 +5621,9 @@ class NoteStoreListSharedNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -5650,9 +5650,9 @@ class NoteStoreCreateLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5679,9 +5679,9 @@ class NoteStoreUpdateLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5708,9 +5708,9 @@ class NoteStoreListLinkedNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -5737,9 +5737,9 @@ class NoteStoreExpungeLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5766,9 +5766,9 @@ class NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5795,9 +5795,9 @@ class NoteStoreGetSharedNotebookByAuthAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5823,9 +5823,9 @@ class NoteStoreEmailNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -5852,9 +5852,9 @@ class NoteStoreShareNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5880,9 +5880,9 @@ class NoteStoreStopSharingNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -5909,9 +5909,9 @@ class NoteStoreAuthenticateToSharedNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5938,9 +5938,9 @@ class NoteStoreFindRelatedAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5967,9 +5967,9 @@ class NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -5996,9 +5996,9 @@ class NoteStoreManageNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -6025,9 +6025,9 @@ class NoteStoreGetNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index b5ca5c49..d832bb39 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -815,9 +815,9 @@ class UserStoreCheckVersionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -844,9 +844,9 @@ class UserStoreGetBootstrapInfoAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -873,9 +873,9 @@ class UserStoreAuthenticateLongSessionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -902,9 +902,9 @@ class UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -930,9 +930,9 @@ class UserStoreRevokeLongSessionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -959,9 +959,9 @@ class UserStoreAuthenticateToBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -988,9 +988,9 @@ class UserStoreGetUserAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -1017,9 +1017,9 @@ class UserStoreGetPublicUserInfoAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -1046,9 +1046,9 @@ class UserStoreGetUserUrlsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) @@ -1074,9 +1074,9 @@ class UserStoreInviteToBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -1102,9 +1102,9 @@ class UserStoreRemoveFromBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -1130,9 +1130,9 @@ class UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { Q_UNUSED(value) Q_UNUSED(ctx) @@ -1159,9 +1159,9 @@ class UserStoreListBusinessUsersAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -1188,9 +1188,9 @@ class UserStoreListBusinessInvitationsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast>(value); Q_UNUSED(ctx) @@ -1217,9 +1217,9 @@ class UserStoreGetAccountLimitsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( - QSharedPointer ctx, QVariant value, - QSharedPointer data) + QSharedPointer data, + IRequestContextPtr ctx) { m_value = qvariant_cast(value); Q_UNUSED(ctx) From 8e6523fd1ed5fcea57ffe105d48c1b5f1b36d51f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 11 Dec 2019 07:32:26 +0300 Subject: [PATCH 124/188] Migrate from using QSharedPointer to using std::shared_ptr --- QEverCloud/headers/AsyncResult.h | 6 +- QEverCloud/headers/DurableService.h | 10 +- QEverCloud/headers/EverCloudException.h | 25 +- QEverCloud/headers/Exceptions.h | 8 +- QEverCloud/headers/Log.h | 5 +- QEverCloud/headers/RequestContext.h | 9 +- QEverCloud/headers/generated/Servers.h | 178 ++--- QEverCloud/headers/generated/Services.h | 4 +- QEverCloud/headers/generated/Types.h | 8 +- QEverCloud/src/AsyncResult.cpp | 4 +- QEverCloud/src/AsyncResult_p.cpp | 17 +- QEverCloud/src/AsyncResult_p.h | 6 +- QEverCloud/src/DurableService.cpp | 15 +- QEverCloud/src/EverCloudException.cpp | 9 +- QEverCloud/src/Exceptions.cpp | 33 +- QEverCloud/src/Globals.cpp | 3 +- QEverCloud/src/Log.cpp | 7 +- QEverCloud/src/RequestContext.cpp | 6 +- QEverCloud/src/Thumbnail.cpp | 2 +- QEverCloud/src/generated/Servers.cpp | 530 ++++++------- QEverCloud/src/generated/Services.cpp | 712 +++++++++--------- QEverCloud/src/tests/TestDurableService.cpp | 16 +- .../src/tests/generated/TestNoteStore.cpp | 592 +++++++-------- .../src/tests/generated/TestUserStore.cpp | 120 +-- 24 files changed, 1170 insertions(+), 1155 deletions(-) diff --git a/QEverCloud/headers/AsyncResult.h b/QEverCloud/headers/AsyncResult.h index 0a8a1b76..c656226e 100644 --- a/QEverCloud/headers/AsyncResult.h +++ b/QEverCloud/headers/AsyncResult.h @@ -37,7 +37,7 @@ Note note; QObject::connect(ns->createNoteAsync(note), &AsyncResult::finished, [ns]( QVariant result, - QSharedPointer error, + EverCloudExceptionDataPtr error, IRequestContextPtr ctx) { if (error) { @@ -73,7 +73,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject * Constructor accepting already prepared value and/or exception, * for use in tests */ - AsyncResult(QVariant result, QSharedPointer error, + AsyncResult(QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx, bool autoDelete = true, QObject * parent = nullptr); @@ -101,7 +101,7 @@ class QEVERCLOUD_EXPORT AsyncResult: public QObject */ void finished( QVariant result, - QSharedPointer error, + EverCloudExceptionDataPtr error, IRequestContextPtr ctx); private: diff --git a/QEverCloud/headers/DurableService.h b/QEverCloud/headers/DurableService.h index 3f5ababf..37bfede7 100644 --- a/QEverCloud/headers/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -13,10 +13,10 @@ #include "RequestContext.h" #include -#include #include #include +#include #include namespace qevercloud { @@ -26,10 +26,10 @@ namespace qevercloud { struct QEVERCLOUD_EXPORT IRetryPolicy { virtual bool shouldRetry( - QSharedPointer exceptionData) = 0; + const EverCloudExceptionDataPtr & exceptionData) = 0; }; -using IRetryPolicyPtr = QSharedPointer; +using IRetryPolicyPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// @@ -38,7 +38,7 @@ QT_FORWARD_DECLARE_CLASS(DurableServicePrivate) class QEVERCLOUD_EXPORT IDurableService { public: - using SyncResult = std::pair>; + using SyncResult = std::pair; using SyncServiceCall = std::function; using AsyncServiceCall = std::function; @@ -78,7 +78,7 @@ class QEVERCLOUD_EXPORT IDurableService AsyncRequest && asyncRequest, IRequestContextPtr ctx) = 0; }; -using IDurableServicePtr = QSharedPointer; +using IDurableServicePtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/EverCloudException.h b/QEverCloud/headers/EverCloudException.h index a946ae84..ea8b0e94 100644 --- a/QEverCloud/headers/EverCloudException.h +++ b/QEverCloud/headers/EverCloudException.h @@ -13,10 +13,10 @@ #include "Helpers.h" #include -#include #include #include +#include namespace qevercloud { @@ -44,7 +44,7 @@ class QEVERCLOUD_EXPORT EverCloudException: public std::exception virtual const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const; + virtual std::shared_ptr exceptionData() const; }; //////////////////////////////////////////////////////////////////////////////// @@ -73,12 +73,17 @@ QObject::connect(ns->getNotebook(notebookGuid), &AsyncResult::finished, { if (!error.isNull()) { - QSharedPointer errorNotFound = - error.objectCast(); - QSharedPointer errorUser = - error.objectCast(); - QSharedPointer errorSystem = - error.objectCast(); + auto errorNotFound = + std::dynamic_pointer_cast( + error); + + auto errorUser = + std::dynamic_pointer_cast( + error); + + auto errorSystem = + std::dynamic_pointer_cast( + error); if (!errorNotFound.isNull()) { @@ -141,6 +146,8 @@ class QEVERCLOUD_EXPORT EverCloudExceptionData: public QObject virtual void throwException() const; }; +using EverCloudExceptionDataPtr = std::shared_ptr; + //////////////////////////////////////////////////////////////////////////////// /** @@ -155,7 +162,7 @@ class QEVERCLOUD_EXPORT EvernoteException: public EverCloudException explicit EvernoteException(const std::string & error); explicit EvernoteException(const char * error); - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/Exceptions.h b/QEverCloud/headers/Exceptions.h index a1cb1f5f..d3a943a5 100644 --- a/QEverCloud/headers/Exceptions.h +++ b/QEverCloud/headers/Exceptions.h @@ -41,7 +41,7 @@ class QEVERCLOUD_EXPORT NetworkException: public EverCloudException const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; protected: QNetworkReply::NetworkError m_type; @@ -99,7 +99,7 @@ class QEVERCLOUD_EXPORT ThriftException: public EverCloudException const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; protected: Type m_type; @@ -219,7 +219,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReached: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// @@ -249,7 +249,7 @@ class QEVERCLOUD_EXPORT EDAMSystemExceptionRateLimitReachedData: class QEVERCLOUD_EXPORT EDAMSystemExceptionAuthExpired: public EDAMSystemException { public: - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index c8bf8b9c..d359c6be 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -14,9 +14,10 @@ #include #include #include -#include #include +#include + namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// @@ -56,7 +57,7 @@ class QEVERCLOUD_EXPORT ILogger virtual LogLevel level() const = 0; }; -using ILoggerPtr = QSharedPointer; +using ILoggerPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 03cef6f9..2c43c7da 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -11,10 +11,11 @@ #include "Export.h" #include -#include #include #include +#include + namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// @@ -61,7 +62,9 @@ class QEVERCLOUD_EXPORT IRequestContext * Create a new instance of IRequestContext with all the same parameters * as in the source but a distinct id */ - virtual QSharedPointer clone() const = 0; + virtual IRequestContext * clone() const = 0; + + virtual ~IRequestContext() = default; friend QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & strm, const IRequestContext & ctx); @@ -70,7 +73,7 @@ class QEVERCLOUD_EXPORT IRequestContext QDebug & dbg, const IRequestContext & ctx); }; -using IRequestContextPtr = QSharedPointer; +using IRequestContextPtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/Servers.h b/QEverCloud/headers/generated/Servers.h index 87e59bf8..2c485d7c 100644 --- a/QEverCloud/headers/generated/Servers.h +++ b/QEverCloud/headers/generated/Servers.h @@ -599,296 +599,296 @@ public Q_SLOTS: // Slots for replies to requests void onGetSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetFilteredSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetLinkedNotebookSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetLinkedNotebookSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListAccessibleBusinessNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetDefaultNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onExpungeNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListTagsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListTagsByNotebookRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetTagRequestReady( Tag value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateTagRequestReady( Tag value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateTagRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUntagAllRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onExpungeTagRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListSearchesRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateSearchRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onExpungeSearchRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onFindNoteOffsetRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onFindNotesMetadataRequestReady( NotesMetadataList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onFindNoteCountsRequestReady( NoteCollectionCounts value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteWithResultSpecRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onSetNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUnsetNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteContentRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteSearchTextRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceSearchTextRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteTagNamesRequestReady( QStringList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onDeleteNoteRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onExpungeNoteRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCopyNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListNoteVersionsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNoteVersionRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceRequestReady( Resource value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onSetResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUnsetResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateResourceRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceDataRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceByHashRequestReady( Resource value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceRecognitionRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceAlternateDataRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetResourceAttributesRequestReady( ResourceAttributes value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetPublicNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onShareNotebookRequestReady( SharedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateOrUpdateNotebookSharesRequestReady( CreateOrUpdateNotebookSharesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateSharedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onSetNotebookRecipientSettingsRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListSharedNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCreateLinkedNotebookRequestReady( LinkedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListLinkedNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onExpungeLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onAuthenticateToSharedNotebookRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetSharedNotebookByAuthRequestReady( SharedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onEmailNoteRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onShareNoteRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onStopSharingNoteRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onAuthenticateToSharedNoteRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onFindRelatedRequestReady( RelatedResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateNoteIfUsnMatchesRequestReady( UpdateNoteIfUsnMatchesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onManageNotebookSharesRequestReady( ManageNotebookSharesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetNotebookSharesRequestReady( ShareRelationships value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); }; @@ -1027,59 +1027,59 @@ public Q_SLOTS: // Slots for replies to requests void onCheckVersionRequestReady( bool value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetBootstrapInfoRequestReady( BootstrapInfo value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onAuthenticateLongSessionRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onCompleteTwoFactorAuthenticationRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onRevokeLongSessionRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onAuthenticateToBusinessRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetUserRequestReady( User value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetPublicUserInfoRequestReady( PublicUserInfo value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetUserUrlsRequestReady( UserUrls value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onInviteToBusinessRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onRemoveFromBusinessRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onUpdateBusinessUserIdentifierRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListBusinessUsersRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onListBusinessInvitationsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); void onGetAccountLimitsRequestReady( AccountLimits value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); }; diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 5eb4731c..8852c81d 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -2732,7 +2732,7 @@ class QEVERCLOUD_EXPORT INoteStore: public QObject }; -using INoteStorePtr = QSharedPointer; +using INoteStorePtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// @@ -3305,7 +3305,7 @@ class QEVERCLOUD_EXPORT IUserStore: public QObject }; -using IUserStorePtr = QSharedPointer; +using IUserStorePtr = std::shared_ptr; //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 8cf75af4..fc663e21 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -5870,7 +5870,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin EDAMUserException(const EDAMUserException & other); const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -5917,7 +5917,7 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr EDAMSystemException(const EDAMSystemException & other); const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -5964,7 +5964,7 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public EDAMNotFoundException(const EDAMNotFoundException & other); const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; @@ -6019,7 +6019,7 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, EDAMInvalidContactsException(const EDAMInvalidContactsException & other); const char * what() const noexcept override; - virtual QSharedPointer exceptionData() const override; + virtual EverCloudExceptionDataPtr exceptionData() const override; virtual void print(QTextStream & strm) const override; diff --git a/QEverCloud/src/AsyncResult.cpp b/QEverCloud/src/AsyncResult.cpp index b4bd7181..7b6b7ba7 100644 --- a/QEverCloud/src/AsyncResult.cpp +++ b/QEverCloud/src/AsyncResult.cpp @@ -60,7 +60,7 @@ AsyncResult::AsyncResult( } AsyncResult::AsyncResult( - QVariant result, QSharedPointer error, + QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx, bool autoDelete, QObject * parent) : QObject(parent), d_ptr(new AsyncResultPrivate( @@ -81,7 +81,7 @@ bool AsyncResult::waitForFinished(int timeout) QEventLoop loop; QObject::connect( this, - SIGNAL(finished(QVariant,QSharedPointer)), + SIGNAL(finished(QVariant,EverCloudExceptionDataPtr,IRequestContextPtr)), &loop, SLOT(quit())); diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index d946a38f..57e85501 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -10,6 +10,7 @@ #include "Http.h" #include +#include namespace qevercloud { @@ -38,7 +39,7 @@ AsyncResultPrivate::AsyncResultPrivate( {} AsyncResultPrivate::AsyncResultPrivate( - QVariant result, QSharedPointer error, + QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx, bool autoDelete, AsyncResult * q) : m_ctx(std::move(ctx)), m_autoDelete(autoDelete), @@ -46,7 +47,7 @@ AsyncResultPrivate::AsyncResultPrivate( { QMetaObject::invokeMethod(this, "setValue", Qt::QueuedConnection, Q_ARG(QVariant, result), - Q_ARG(QSharedPointer, error)); + Q_ARG(EverCloudExceptionDataPtr, error)); } AsyncResultPrivate::~AsyncResultPrivate() @@ -75,19 +76,19 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) << m_ctx->requestId()); ReplyFetcher * reply = qobject_cast(rp); - QSharedPointer error; + EverCloudExceptionDataPtr error; QVariant result; try { if (reply->isError()) { - error = QSharedPointer::create( + error = std::make_shared( reply->errorText()); } else if (reply->httpStatusCode() != 200) { - error = QSharedPointer::create( + error = std::make_shared( QString::fromUtf8("HTTP Status Code = %1") .arg(reply->httpStatusCode())); } @@ -102,13 +103,13 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } catch(const std::exception & e) { - error = QSharedPointer::create( + error = std::make_shared( QString::fromUtf8("Exception of type \"%1\" with the message: %2") .arg(QString::fromUtf8(typeid(e).name()), QString::fromUtf8(e.what()))); } catch(...) { - error = QSharedPointer::create( + error = std::make_shared( QStringLiteral("Unknown exception")); } @@ -116,7 +117,7 @@ void AsyncResultPrivate::onReplyFetched(QObject * rp) } void AsyncResultPrivate::setValue( - QVariant result, QSharedPointer error) + QVariant result, EverCloudExceptionDataPtr error) { Q_Q(AsyncResult); QObject::connect(this, &AsyncResultPrivate::finished, diff --git a/QEverCloud/src/AsyncResult_p.h b/QEverCloud/src/AsyncResult_p.h index f418ca52..372b298c 100644 --- a/QEverCloud/src/AsyncResult_p.h +++ b/QEverCloud/src/AsyncResult_p.h @@ -28,7 +28,7 @@ class AsyncResultPrivate: public QObject AsyncResult * q); explicit AsyncResultPrivate( - QVariant result, QSharedPointer error, + QVariant result, EverCloudExceptionDataPtr error, IRequestContextPtr ctx, bool autoDelete, AsyncResult * q); virtual ~AsyncResultPrivate(); @@ -36,7 +36,7 @@ class AsyncResultPrivate: public QObject Q_SIGNALS: void finished( QVariant result, - QSharedPointer error, + EverCloudExceptionDataPtr error, IRequestContextPtr ctx); public Q_SLOTS: @@ -44,7 +44,7 @@ public Q_SLOTS: void onReplyFetched(QObject * rp); - void setValue(QVariant result, QSharedPointer error); + void setValue(QVariant result, EverCloudExceptionDataPtr error); public: QNetworkRequest m_request; diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 132b2666..dc064eb9 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -13,6 +13,7 @@ #include #include +#include namespace qevercloud { @@ -40,7 +41,7 @@ quint64 exponentiallyIncreasedTimeoutMsec( struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy { virtual bool shouldRetry( - QSharedPointer exceptionData) override + const EverCloudExceptionDataPtr & exceptionData) override { if (Q_UNLIKELY(!exceptionData)) { return true; @@ -147,7 +148,7 @@ DurableService::SyncResult DurableService::executeSyncRequest( SyncRequest && syncRequest, IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } RetryState state; @@ -170,7 +171,7 @@ DurableService::SyncResult DurableService::executeSyncRequest( result.second = e.exceptionData(); } catch(const std::exception & e) { - result.second = QSharedPointer::create( + result.second = std::make_shared( QString::fromLocal8Bit(e.what())); return result; } @@ -226,7 +227,7 @@ AsyncResult * DurableService::executeAsyncRequest( AsyncRequest && asyncRequest, IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } RetryState state; @@ -256,7 +257,7 @@ void DurableService::doExecuteAsyncRequest( result, [=, retryState = std::move(retryState), retryPolicy = m_retryPolicy] ( QVariant value, - QSharedPointer exceptionData, + EverCloudExceptionDataPtr exceptionData, IRequestContextPtr c) mutable { Q_UNUSED(c) @@ -314,14 +315,14 @@ void DurableService::doExecuteAsyncRequest( IRetryPolicyPtr newRetryPolicy() { - return QSharedPointer::create(); + return std::make_shared(); } IDurableServicePtr newDurableService( IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) { - return QSharedPointer::create(retryPolicy, ctx); + return std::make_shared(retryPolicy, ctx); } } // namespace qevercloud diff --git a/QEverCloud/src/EverCloudException.cpp b/QEverCloud/src/EverCloudException.cpp index c5dbbb82..ae5dfd6b 100644 --- a/QEverCloud/src/EverCloudException.cpp +++ b/QEverCloud/src/EverCloudException.cpp @@ -8,6 +8,7 @@ */ #include +#include namespace qevercloud { @@ -35,9 +36,9 @@ const char * EverCloudException::what() const throw() return m_error.constData(); } -QSharedPointer EverCloudException::exceptionData() const +EverCloudExceptionDataPtr EverCloudException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what())); } @@ -66,9 +67,9 @@ EvernoteException::EvernoteException(const char * error) : EverCloudException(error) {} -QSharedPointer EvernoteException::exceptionData() const +EverCloudExceptionDataPtr EvernoteException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what())); } diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 683d6b9c..91d5beb0 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -15,6 +15,7 @@ #include #include +#include namespace qevercloud { @@ -139,9 +140,9 @@ const char * NetworkException::what() const noexcept } } -QSharedPointer NetworkException::exceptionData() const +EverCloudExceptionDataPtr NetworkException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), type()); } @@ -265,9 +266,9 @@ const char * ThriftException::what() const noexcept } } -QSharedPointer ThriftException::exceptionData() const +EverCloudExceptionDataPtr ThriftException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), type()); } @@ -408,9 +409,9 @@ void writeThriftException( writer.writeStructEnd(); } -QSharedPointer EDAMInvalidContactsException::exceptionData() const +EverCloudExceptionDataPtr EDAMInvalidContactsException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( contacts, parameter, reasons); } @@ -438,9 +439,9 @@ void EDAMInvalidContactsExceptionData::throwException() const throw e; } -QSharedPointer EDAMUserException::exceptionData() const +EverCloudExceptionDataPtr EDAMUserException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), errorCode, parameter); } @@ -452,9 +453,9 @@ void EDAMUserExceptionData::throwException() const throw e; } -QSharedPointer EDAMSystemException::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), errorCode, message, rateLimitDuration); } @@ -494,9 +495,9 @@ void EDAMSystemExceptionRateLimitReachedData::throwException() const throw e; } -QSharedPointer EDAMNotFoundException::exceptionData() const +EverCloudExceptionDataPtr EDAMNotFoundException::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), identifier, key); } @@ -538,18 +539,18 @@ void throwEDAMSystemException(const EDAMSystemException & baseException) throw baseException; } -QSharedPointer EDAMSystemExceptionRateLimitReached::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemExceptionRateLimitReached::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), errorCode, message, rateLimitDuration); } -QSharedPointer EDAMSystemExceptionAuthExpired::exceptionData() const +EverCloudExceptionDataPtr EDAMSystemExceptionAuthExpired::exceptionData() const { - return QSharedPointer::create( + return std::make_shared( QString::fromUtf8(what()), errorCode, message, diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 67dba1e3..b2ba3d7f 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -26,8 +26,7 @@ Q_GLOBAL_STATIC(QNetworkAccessManager, globalEvernoteNetworkAccessManager) void registerMetatypes() { - qRegisterMetaType>( - "QSharedPointer"); + qRegisterMetaType("EverCloudExceptionDataPtr"); qRegisterMetaType("IRequestContextPtr"); } diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 3be75323..3265f326 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace qevercloud { @@ -189,7 +190,7 @@ ILoggerPtr logger() { if (globalLogger.exists() && !globalLogger.isDestroyed() && - !globalLogger->isNull()) + (globalLogger->get() != nullptr)) { return *globalLogger; } @@ -206,12 +207,12 @@ void setLogger(ILoggerPtr logger) ILoggerPtr newNullLogger() { - return QSharedPointer::create(); + return std::make_shared(); } ILoggerPtr newStdErrLogger(LogLevel level) { - return QSharedPointer::create(level); + return std::make_shared(level); } QTextStream & operator<<(QTextStream & out, const LogLevel level) diff --git a/QEverCloud/src/RequestContext.cpp b/QEverCloud/src/RequestContext.cpp index 7aebcbf6..8bf732c1 100644 --- a/QEverCloud/src/RequestContext.cpp +++ b/QEverCloud/src/RequestContext.cpp @@ -56,9 +56,9 @@ class Q_DECL_HIDDEN RequestContext final: public IRequestContext return m_maxRequestRetryCount; } - virtual QSharedPointer clone() const override + virtual IRequestContext * clone() const override { - return QSharedPointer::create( + return new RequestContext( m_authenticationToken, m_requestTimeout, m_increaseRequestTimeoutExponentially, @@ -111,7 +111,7 @@ IRequestContextPtr newRequestContext( qint64 maxRequestTimeout, quint32 maxRequestRetryCount) { - return QSharedPointer::create( + return std::make_shared( std::move(authenticationToken), requestTimeout, increaseRequestTimeoutExponentially, diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 34479f27..8e76fa2c 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -131,7 +131,7 @@ AsyncResult * Thumbnail::downloadAsync( QObject::connect(res, &AsyncResult::finished, [=] (QVariant value, - QSharedPointer error, + EverCloudExceptionDataPtr error, IRequestContextPtr ctx) { Q_UNUSED(value) diff --git a/QEverCloud/src/generated/Servers.cpp b/QEverCloud/src/generated/Servers.cpp index 4bbd153a..56a7af89 100644 --- a/QEverCloud/src/generated/Servers.cpp +++ b/QEverCloud/src/generated/Servers.cpp @@ -6753,12 +6753,12 @@ void NoteStoreServer::onRequest(QByteArray data) void NoteStoreServer::onGetSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -6791,7 +6791,7 @@ void NoteStoreServer::onGetSyncStateRequestReady( writer.writeStructBegin( QStringLiteral("getSyncState")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -6864,12 +6864,12 @@ void NoteStoreServer::onGetSyncStateRequestReady( void NoteStoreServer::onGetFilteredSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -6902,7 +6902,7 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( writer.writeStructBegin( QStringLiteral("getFilteredSyncChunk")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -6975,12 +6975,12 @@ void NoteStoreServer::onGetFilteredSyncChunkRequestReady( void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7013,7 +7013,7 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( writer.writeStructBegin( QStringLiteral("getLinkedNotebookSyncState")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7104,12 +7104,12 @@ void NoteStoreServer::onGetLinkedNotebookSyncStateRequestReady( void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7142,7 +7142,7 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( writer.writeStructBegin( QStringLiteral("getLinkedNotebookSyncChunk")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7233,12 +7233,12 @@ void NoteStoreServer::onGetLinkedNotebookSyncChunkRequestReady( void NoteStoreServer::onListNotebooksRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7271,7 +7271,7 @@ void NoteStoreServer::onListNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listNotebooks")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7348,12 +7348,12 @@ void NoteStoreServer::onListNotebooksRequestReady( void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7386,7 +7386,7 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listAccessibleBusinessNotebooks")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7463,12 +7463,12 @@ void NoteStoreServer::onListAccessibleBusinessNotebooksRequestReady( void NoteStoreServer::onGetNotebookRequestReady( Notebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7501,7 +7501,7 @@ void NoteStoreServer::onGetNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7592,12 +7592,12 @@ void NoteStoreServer::onGetNotebookRequestReady( void NoteStoreServer::onGetDefaultNotebookRequestReady( Notebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7630,7 +7630,7 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getDefaultNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7703,12 +7703,12 @@ void NoteStoreServer::onGetDefaultNotebookRequestReady( void NoteStoreServer::onCreateNotebookRequestReady( Notebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7741,7 +7741,7 @@ void NoteStoreServer::onCreateNotebookRequestReady( writer.writeStructBegin( QStringLiteral("createNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7832,12 +7832,12 @@ void NoteStoreServer::onCreateNotebookRequestReady( void NoteStoreServer::onUpdateNotebookRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7870,7 +7870,7 @@ void NoteStoreServer::onUpdateNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7961,12 +7961,12 @@ void NoteStoreServer::onUpdateNotebookRequestReady( void NoteStoreServer::onExpungeNotebookRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -7999,7 +7999,7 @@ void NoteStoreServer::onExpungeNotebookRequestReady( writer.writeStructBegin( QStringLiteral("expungeNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8090,12 +8090,12 @@ void NoteStoreServer::onExpungeNotebookRequestReady( void NoteStoreServer::onListTagsRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8128,7 +8128,7 @@ void NoteStoreServer::onListTagsRequestReady( writer.writeStructBegin( QStringLiteral("listTags")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8205,12 +8205,12 @@ void NoteStoreServer::onListTagsRequestReady( void NoteStoreServer::onListTagsByNotebookRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8243,7 +8243,7 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( writer.writeStructBegin( QStringLiteral("listTagsByNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8338,12 +8338,12 @@ void NoteStoreServer::onListTagsByNotebookRequestReady( void NoteStoreServer::onGetTagRequestReady( Tag value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8376,7 +8376,7 @@ void NoteStoreServer::onGetTagRequestReady( writer.writeStructBegin( QStringLiteral("getTag")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8467,12 +8467,12 @@ void NoteStoreServer::onGetTagRequestReady( void NoteStoreServer::onCreateTagRequestReady( Tag value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8505,7 +8505,7 @@ void NoteStoreServer::onCreateTagRequestReady( writer.writeStructBegin( QStringLiteral("createTag")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8596,12 +8596,12 @@ void NoteStoreServer::onCreateTagRequestReady( void NoteStoreServer::onUpdateTagRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8634,7 +8634,7 @@ void NoteStoreServer::onUpdateTagRequestReady( writer.writeStructBegin( QStringLiteral("updateTag")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8724,12 +8724,12 @@ void NoteStoreServer::onUpdateTagRequestReady( } void NoteStoreServer::onUntagAllRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8762,7 +8762,7 @@ void NoteStoreServer::onUntagAllRequestReady( writer.writeStructBegin( QStringLiteral("untagAll")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8852,12 +8852,12 @@ void NoteStoreServer::onUntagAllRequestReady( void NoteStoreServer::onExpungeTagRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8890,7 +8890,7 @@ void NoteStoreServer::onExpungeTagRequestReady( writer.writeStructBegin( QStringLiteral("expungeTag")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -8981,12 +8981,12 @@ void NoteStoreServer::onExpungeTagRequestReady( void NoteStoreServer::onListSearchesRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9019,7 +9019,7 @@ void NoteStoreServer::onListSearchesRequestReady( writer.writeStructBegin( QStringLiteral("listSearches")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9096,12 +9096,12 @@ void NoteStoreServer::onListSearchesRequestReady( void NoteStoreServer::onGetSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9134,7 +9134,7 @@ void NoteStoreServer::onGetSearchRequestReady( writer.writeStructBegin( QStringLiteral("getSearch")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9225,12 +9225,12 @@ void NoteStoreServer::onGetSearchRequestReady( void NoteStoreServer::onCreateSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9263,7 +9263,7 @@ void NoteStoreServer::onCreateSearchRequestReady( writer.writeStructBegin( QStringLiteral("createSearch")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9336,12 +9336,12 @@ void NoteStoreServer::onCreateSearchRequestReady( void NoteStoreServer::onUpdateSearchRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9374,7 +9374,7 @@ void NoteStoreServer::onUpdateSearchRequestReady( writer.writeStructBegin( QStringLiteral("updateSearch")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9465,12 +9465,12 @@ void NoteStoreServer::onUpdateSearchRequestReady( void NoteStoreServer::onExpungeSearchRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9503,7 +9503,7 @@ void NoteStoreServer::onExpungeSearchRequestReady( writer.writeStructBegin( QStringLiteral("expungeSearch")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9594,12 +9594,12 @@ void NoteStoreServer::onExpungeSearchRequestReady( void NoteStoreServer::onFindNoteOffsetRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9632,7 +9632,7 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( writer.writeStructBegin( QStringLiteral("findNoteOffset")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9723,12 +9723,12 @@ void NoteStoreServer::onFindNoteOffsetRequestReady( void NoteStoreServer::onFindNotesMetadataRequestReady( NotesMetadataList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9761,7 +9761,7 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( writer.writeStructBegin( QStringLiteral("findNotesMetadata")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9852,12 +9852,12 @@ void NoteStoreServer::onFindNotesMetadataRequestReady( void NoteStoreServer::onFindNoteCountsRequestReady( NoteCollectionCounts value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9890,7 +9890,7 @@ void NoteStoreServer::onFindNoteCountsRequestReady( writer.writeStructBegin( QStringLiteral("findNoteCounts")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -9981,12 +9981,12 @@ void NoteStoreServer::onFindNoteCountsRequestReady( void NoteStoreServer::onGetNoteWithResultSpecRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10019,7 +10019,7 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( writer.writeStructBegin( QStringLiteral("getNoteWithResultSpec")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10110,12 +10110,12 @@ void NoteStoreServer::onGetNoteWithResultSpecRequestReady( void NoteStoreServer::onGetNoteRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10148,7 +10148,7 @@ void NoteStoreServer::onGetNoteRequestReady( writer.writeStructBegin( QStringLiteral("getNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10239,12 +10239,12 @@ void NoteStoreServer::onGetNoteRequestReady( void NoteStoreServer::onGetNoteApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10277,7 +10277,7 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( writer.writeStructBegin( QStringLiteral("getNoteApplicationData")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10368,12 +10368,12 @@ void NoteStoreServer::onGetNoteApplicationDataRequestReady( void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10406,7 +10406,7 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("getNoteApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10497,12 +10497,12 @@ void NoteStoreServer::onGetNoteApplicationDataEntryRequestReady( void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10535,7 +10535,7 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("setNoteApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10626,12 +10626,12 @@ void NoteStoreServer::onSetNoteApplicationDataEntryRequestReady( void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10664,7 +10664,7 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("unsetNoteApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10755,12 +10755,12 @@ void NoteStoreServer::onUnsetNoteApplicationDataEntryRequestReady( void NoteStoreServer::onGetNoteContentRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10793,7 +10793,7 @@ void NoteStoreServer::onGetNoteContentRequestReady( writer.writeStructBegin( QStringLiteral("getNoteContent")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10884,12 +10884,12 @@ void NoteStoreServer::onGetNoteContentRequestReady( void NoteStoreServer::onGetNoteSearchTextRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -10922,7 +10922,7 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( writer.writeStructBegin( QStringLiteral("getNoteSearchText")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11013,12 +11013,12 @@ void NoteStoreServer::onGetNoteSearchTextRequestReady( void NoteStoreServer::onGetResourceSearchTextRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11051,7 +11051,7 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( writer.writeStructBegin( QStringLiteral("getResourceSearchText")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11142,12 +11142,12 @@ void NoteStoreServer::onGetResourceSearchTextRequestReady( void NoteStoreServer::onGetNoteTagNamesRequestReady( QStringList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11180,7 +11180,7 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( writer.writeStructBegin( QStringLiteral("getNoteTagNames")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11275,12 +11275,12 @@ void NoteStoreServer::onGetNoteTagNamesRequestReady( void NoteStoreServer::onCreateNoteRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11313,7 +11313,7 @@ void NoteStoreServer::onCreateNoteRequestReady( writer.writeStructBegin( QStringLiteral("createNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11404,12 +11404,12 @@ void NoteStoreServer::onCreateNoteRequestReady( void NoteStoreServer::onUpdateNoteRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11442,7 +11442,7 @@ void NoteStoreServer::onUpdateNoteRequestReady( writer.writeStructBegin( QStringLiteral("updateNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11533,12 +11533,12 @@ void NoteStoreServer::onUpdateNoteRequestReady( void NoteStoreServer::onDeleteNoteRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11571,7 +11571,7 @@ void NoteStoreServer::onDeleteNoteRequestReady( writer.writeStructBegin( QStringLiteral("deleteNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11662,12 +11662,12 @@ void NoteStoreServer::onDeleteNoteRequestReady( void NoteStoreServer::onExpungeNoteRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11700,7 +11700,7 @@ void NoteStoreServer::onExpungeNoteRequestReady( writer.writeStructBegin( QStringLiteral("expungeNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11791,12 +11791,12 @@ void NoteStoreServer::onExpungeNoteRequestReady( void NoteStoreServer::onCopyNoteRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11829,7 +11829,7 @@ void NoteStoreServer::onCopyNoteRequestReady( writer.writeStructBegin( QStringLiteral("copyNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11920,12 +11920,12 @@ void NoteStoreServer::onCopyNoteRequestReady( void NoteStoreServer::onListNoteVersionsRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -11958,7 +11958,7 @@ void NoteStoreServer::onListNoteVersionsRequestReady( writer.writeStructBegin( QStringLiteral("listNoteVersions")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12053,12 +12053,12 @@ void NoteStoreServer::onListNoteVersionsRequestReady( void NoteStoreServer::onGetNoteVersionRequestReady( Note value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12091,7 +12091,7 @@ void NoteStoreServer::onGetNoteVersionRequestReady( writer.writeStructBegin( QStringLiteral("getNoteVersion")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12182,12 +12182,12 @@ void NoteStoreServer::onGetNoteVersionRequestReady( void NoteStoreServer::onGetResourceRequestReady( Resource value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12220,7 +12220,7 @@ void NoteStoreServer::onGetResourceRequestReady( writer.writeStructBegin( QStringLiteral("getResource")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12311,12 +12311,12 @@ void NoteStoreServer::onGetResourceRequestReady( void NoteStoreServer::onGetResourceApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12349,7 +12349,7 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceApplicationData")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12440,12 +12440,12 @@ void NoteStoreServer::onGetResourceApplicationDataRequestReady( void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12478,7 +12478,7 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("getResourceApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12569,12 +12569,12 @@ void NoteStoreServer::onGetResourceApplicationDataEntryRequestReady( void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12607,7 +12607,7 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("setResourceApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12698,12 +12698,12 @@ void NoteStoreServer::onSetResourceApplicationDataEntryRequestReady( void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12736,7 +12736,7 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( writer.writeStructBegin( QStringLiteral("unsetResourceApplicationDataEntry")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12827,12 +12827,12 @@ void NoteStoreServer::onUnsetResourceApplicationDataEntryRequestReady( void NoteStoreServer::onUpdateResourceRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12865,7 +12865,7 @@ void NoteStoreServer::onUpdateResourceRequestReady( writer.writeStructBegin( QStringLiteral("updateResource")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12956,12 +12956,12 @@ void NoteStoreServer::onUpdateResourceRequestReady( void NoteStoreServer::onGetResourceDataRequestReady( QByteArray value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -12994,7 +12994,7 @@ void NoteStoreServer::onGetResourceDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceData")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13085,12 +13085,12 @@ void NoteStoreServer::onGetResourceDataRequestReady( void NoteStoreServer::onGetResourceByHashRequestReady( Resource value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13123,7 +13123,7 @@ void NoteStoreServer::onGetResourceByHashRequestReady( writer.writeStructBegin( QStringLiteral("getResourceByHash")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13214,12 +13214,12 @@ void NoteStoreServer::onGetResourceByHashRequestReady( void NoteStoreServer::onGetResourceRecognitionRequestReady( QByteArray value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13252,7 +13252,7 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( writer.writeStructBegin( QStringLiteral("getResourceRecognition")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13343,12 +13343,12 @@ void NoteStoreServer::onGetResourceRecognitionRequestReady( void NoteStoreServer::onGetResourceAlternateDataRequestReady( QByteArray value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13381,7 +13381,7 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( writer.writeStructBegin( QStringLiteral("getResourceAlternateData")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13472,12 +13472,12 @@ void NoteStoreServer::onGetResourceAlternateDataRequestReady( void NoteStoreServer::onGetResourceAttributesRequestReady( ResourceAttributes value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13510,7 +13510,7 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( writer.writeStructBegin( QStringLiteral("getResourceAttributes")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13601,12 +13601,12 @@ void NoteStoreServer::onGetResourceAttributesRequestReady( void NoteStoreServer::onGetPublicNotebookRequestReady( Notebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13639,7 +13639,7 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( writer.writeStructBegin( QStringLiteral("getPublicNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13712,12 +13712,12 @@ void NoteStoreServer::onGetPublicNotebookRequestReady( void NoteStoreServer::onShareNotebookRequestReady( SharedNotebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13750,7 +13750,7 @@ void NoteStoreServer::onShareNotebookRequestReady( writer.writeStructBegin( QStringLiteral("shareNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13841,12 +13841,12 @@ void NoteStoreServer::onShareNotebookRequestReady( void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( CreateOrUpdateNotebookSharesResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13879,7 +13879,7 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("createOrUpdateNotebookShares")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -13988,12 +13988,12 @@ void NoteStoreServer::onCreateOrUpdateNotebookSharesRequestReady( void NoteStoreServer::onUpdateSharedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14026,7 +14026,7 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateSharedNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14117,12 +14117,12 @@ void NoteStoreServer::onUpdateSharedNotebookRequestReady( void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( Notebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14155,7 +14155,7 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( writer.writeStructBegin( QStringLiteral("setNotebookRecipientSettings")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14246,12 +14246,12 @@ void NoteStoreServer::onSetNotebookRecipientSettingsRequestReady( void NoteStoreServer::onListSharedNotebooksRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14284,7 +14284,7 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listSharedNotebooks")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14379,12 +14379,12 @@ void NoteStoreServer::onListSharedNotebooksRequestReady( void NoteStoreServer::onCreateLinkedNotebookRequestReady( LinkedNotebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14417,7 +14417,7 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("createLinkedNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14508,12 +14508,12 @@ void NoteStoreServer::onCreateLinkedNotebookRequestReady( void NoteStoreServer::onUpdateLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14546,7 +14546,7 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("updateLinkedNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14637,12 +14637,12 @@ void NoteStoreServer::onUpdateLinkedNotebookRequestReady( void NoteStoreServer::onListLinkedNotebooksRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14675,7 +14675,7 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( writer.writeStructBegin( QStringLiteral("listLinkedNotebooks")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14770,12 +14770,12 @@ void NoteStoreServer::onListLinkedNotebooksRequestReady( void NoteStoreServer::onExpungeLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14808,7 +14808,7 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("expungeLinkedNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14899,12 +14899,12 @@ void NoteStoreServer::onExpungeLinkedNotebookRequestReady( void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( AuthenticationResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -14937,7 +14937,7 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( writer.writeStructBegin( QStringLiteral("authenticateToSharedNotebook")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15028,12 +15028,12 @@ void NoteStoreServer::onAuthenticateToSharedNotebookRequestReady( void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( SharedNotebook value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15066,7 +15066,7 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( writer.writeStructBegin( QStringLiteral("getSharedNotebookByAuth")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15156,12 +15156,12 @@ void NoteStoreServer::onGetSharedNotebookByAuthRequestReady( } void NoteStoreServer::onEmailNoteRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15194,7 +15194,7 @@ void NoteStoreServer::onEmailNoteRequestReady( writer.writeStructBegin( QStringLiteral("emailNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15284,12 +15284,12 @@ void NoteStoreServer::onEmailNoteRequestReady( void NoteStoreServer::onShareNoteRequestReady( QString value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15322,7 +15322,7 @@ void NoteStoreServer::onShareNoteRequestReady( writer.writeStructBegin( QStringLiteral("shareNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15412,12 +15412,12 @@ void NoteStoreServer::onShareNoteRequestReady( } void NoteStoreServer::onStopSharingNoteRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15450,7 +15450,7 @@ void NoteStoreServer::onStopSharingNoteRequestReady( writer.writeStructBegin( QStringLiteral("stopSharingNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15540,12 +15540,12 @@ void NoteStoreServer::onStopSharingNoteRequestReady( void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( AuthenticationResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15578,7 +15578,7 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( writer.writeStructBegin( QStringLiteral("authenticateToSharedNote")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15669,12 +15669,12 @@ void NoteStoreServer::onAuthenticateToSharedNoteRequestReady( void NoteStoreServer::onFindRelatedRequestReady( RelatedResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15707,7 +15707,7 @@ void NoteStoreServer::onFindRelatedRequestReady( writer.writeStructBegin( QStringLiteral("findRelated")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15798,12 +15798,12 @@ void NoteStoreServer::onFindRelatedRequestReady( void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( UpdateNoteIfUsnMatchesResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15836,7 +15836,7 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( writer.writeStructBegin( QStringLiteral("updateNoteIfUsnMatches")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15927,12 +15927,12 @@ void NoteStoreServer::onUpdateNoteIfUsnMatchesRequestReady( void NoteStoreServer::onManageNotebookSharesRequestReady( ManageNotebookSharesResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -15965,7 +15965,7 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("manageNotebookShares")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16056,12 +16056,12 @@ void NoteStoreServer::onManageNotebookSharesRequestReady( void NoteStoreServer::onGetNotebookSharesRequestReady( ShareRelationships value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16094,7 +16094,7 @@ void NoteStoreServer::onGetNotebookSharesRequestReady( writer.writeStructBegin( QStringLiteral("getNotebookShares")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16435,12 +16435,12 @@ void UserStoreServer::onRequest(QByteArray data) void UserStoreServer::onCheckVersionRequestReady( bool value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16492,12 +16492,12 @@ void UserStoreServer::onCheckVersionRequestReady( void UserStoreServer::onGetBootstrapInfoRequestReady( BootstrapInfo value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16549,12 +16549,12 @@ void UserStoreServer::onGetBootstrapInfoRequestReady( void UserStoreServer::onAuthenticateLongSessionRequestReady( AuthenticationResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16587,7 +16587,7 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( writer.writeStructBegin( QStringLiteral("authenticateLongSession")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16660,12 +16660,12 @@ void UserStoreServer::onAuthenticateLongSessionRequestReady( void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( AuthenticationResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16698,7 +16698,7 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( writer.writeStructBegin( QStringLiteral("completeTwoFactorAuthentication")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16770,12 +16770,12 @@ void UserStoreServer::onCompleteTwoFactorAuthenticationRequestReady( } void UserStoreServer::onRevokeLongSessionRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16808,7 +16808,7 @@ void UserStoreServer::onRevokeLongSessionRequestReady( writer.writeStructBegin( QStringLiteral("revokeLongSession")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16880,12 +16880,12 @@ void UserStoreServer::onRevokeLongSessionRequestReady( void UserStoreServer::onAuthenticateToBusinessRequestReady( AuthenticationResult value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16918,7 +16918,7 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( writer.writeStructBegin( QStringLiteral("authenticateToBusiness")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -16991,12 +16991,12 @@ void UserStoreServer::onAuthenticateToBusinessRequestReady( void UserStoreServer::onGetUserRequestReady( User value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17029,7 +17029,7 @@ void UserStoreServer::onGetUserRequestReady( writer.writeStructBegin( QStringLiteral("getUser")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17102,12 +17102,12 @@ void UserStoreServer::onGetUserRequestReady( void UserStoreServer::onGetPublicUserInfoRequestReady( PublicUserInfo value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17140,7 +17140,7 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( writer.writeStructBegin( QStringLiteral("getPublicUserInfo")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17231,12 +17231,12 @@ void UserStoreServer::onGetPublicUserInfoRequestReady( void UserStoreServer::onGetUserUrlsRequestReady( UserUrls value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17269,7 +17269,7 @@ void UserStoreServer::onGetUserUrlsRequestReady( writer.writeStructBegin( QStringLiteral("getUserUrls")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17341,12 +17341,12 @@ void UserStoreServer::onGetUserUrlsRequestReady( } void UserStoreServer::onInviteToBusinessRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17379,7 +17379,7 @@ void UserStoreServer::onInviteToBusinessRequestReady( writer.writeStructBegin( QStringLiteral("inviteToBusiness")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17450,12 +17450,12 @@ void UserStoreServer::onInviteToBusinessRequestReady( } void UserStoreServer::onRemoveFromBusinessRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17488,7 +17488,7 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( writer.writeStructBegin( QStringLiteral("removeFromBusiness")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17577,12 +17577,12 @@ void UserStoreServer::onRemoveFromBusinessRequestReady( } void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17615,7 +17615,7 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( writer.writeStructBegin( QStringLiteral("updateBusinessUserIdentifier")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17705,12 +17705,12 @@ void UserStoreServer::onUpdateBusinessUserIdentifierRequestReady( void UserStoreServer::onListBusinessUsersRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17743,7 +17743,7 @@ void UserStoreServer::onListBusinessUsersRequestReady( writer.writeStructBegin( QStringLiteral("listBusinessUsers")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17820,12 +17820,12 @@ void UserStoreServer::onListBusinessUsersRequestReady( void UserStoreServer::onListBusinessInvitationsRequestReady( QList value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17858,7 +17858,7 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( writer.writeStructBegin( QStringLiteral("listBusinessInvitations")); - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17935,12 +17935,12 @@ void UserStoreServer::onListBusinessInvitationsRequestReady( void UserStoreServer::onGetAccountLimitsRequestReady( AccountLimits value, - QSharedPointer exceptionData) + EverCloudExceptionDataPtr exceptionData) { ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - if (!exceptionData.isNull()) + if (exceptionData) { try { @@ -17973,7 +17973,7 @@ void UserStoreServer::onGetAccountLimitsRequestReady( writer.writeStructBegin( QStringLiteral("getAccountLimits")); - if (!exceptionData.isNull()) + if (exceptionData) { try { diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 345c08ae..03abcef5 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -855,7 +855,7 @@ SyncState NoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getSyncState: request id = " @@ -880,7 +880,7 @@ AsyncResult * NoteStore::getSyncStateAsync( QEC_DEBUG("note_store", "NoteStore::getSyncStateAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetSyncStatePrepareParams( @@ -1056,7 +1056,7 @@ SyncChunk NoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getFilteredSyncChunk: request id = " @@ -1095,7 +1095,7 @@ AsyncResult * NoteStore::getFilteredSyncChunkAsync( << " filter = " << filter); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetFilteredSyncChunkPrepareParams( @@ -1265,7 +1265,7 @@ SyncState NoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncState: request id = " @@ -1296,7 +1296,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncStateAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetLinkedNotebookSyncStatePrepareParams( @@ -1494,7 +1494,7 @@ SyncChunk NoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getLinkedNotebookSyncChunk: request id = " @@ -1537,7 +1537,7 @@ AsyncResult * NoteStore::getLinkedNotebookSyncChunkAsync( << " fullSyncOnly = " << fullSyncOnly); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetLinkedNotebookSyncChunkPrepareParams( @@ -1701,7 +1701,7 @@ QList NoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listNotebooks: request id = " @@ -1726,7 +1726,7 @@ AsyncResult * NoteStore::listNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listNotebooksAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListNotebooksPrepareParams( @@ -1886,7 +1886,7 @@ QList NoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooks: request id = " @@ -1911,7 +1911,7 @@ AsyncResult * NoteStore::listAccessibleBusinessNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listAccessibleBusinessNotebooksAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListAccessibleBusinessNotebooksPrepareParams( @@ -2078,7 +2078,7 @@ Notebook NoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNotebook: request id = " @@ -2109,7 +2109,7 @@ AsyncResult * NoteStore::getNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNotebookPrepareParams( @@ -2256,7 +2256,7 @@ Notebook NoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getDefaultNotebook: request id = " @@ -2281,7 +2281,7 @@ AsyncResult * NoteStore::getDefaultNotebookAsync( QEC_DEBUG("note_store", "NoteStore::getDefaultNotebookAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetDefaultNotebookPrepareParams( @@ -2448,7 +2448,7 @@ Notebook NoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createNotebook: request id = " @@ -2479,7 +2479,7 @@ AsyncResult * NoteStore::createNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateNotebookPrepareParams( @@ -2647,7 +2647,7 @@ qint32 NoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateNotebook: request id = " @@ -2678,7 +2678,7 @@ AsyncResult * NoteStore::updateNotebookAsync( << " notebook = " << notebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateNotebookPrepareParams( @@ -2846,7 +2846,7 @@ qint32 NoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::expungeNotebook: request id = " @@ -2877,7 +2877,7 @@ AsyncResult * NoteStore::expungeNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreExpungeNotebookPrepareParams( @@ -3038,7 +3038,7 @@ QList NoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listTags: request id = " @@ -3063,7 +3063,7 @@ AsyncResult * NoteStore::listTagsAsync( QEC_DEBUG("note_store", "NoteStore::listTagsAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListTagsPrepareParams( @@ -3244,7 +3244,7 @@ QList NoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listTagsByNotebook: request id = " @@ -3275,7 +3275,7 @@ AsyncResult * NoteStore::listTagsByNotebookAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListTagsByNotebookPrepareParams( @@ -3443,7 +3443,7 @@ Tag NoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getTag: request id = " @@ -3474,7 +3474,7 @@ AsyncResult * NoteStore::getTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetTagPrepareParams( @@ -3642,7 +3642,7 @@ Tag NoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createTag: request id = " @@ -3673,7 +3673,7 @@ AsyncResult * NoteStore::createTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateTagPrepareParams( @@ -3841,7 +3841,7 @@ qint32 NoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateTag: request id = " @@ -3872,7 +3872,7 @@ AsyncResult * NoteStore::updateTagAsync( << " tag = " << tag); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateTagPrepareParams( @@ -4020,7 +4020,7 @@ void NoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::untagAll: request id = " @@ -4051,7 +4051,7 @@ AsyncResult * NoteStore::untagAllAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUntagAllPrepareParams( @@ -4219,7 +4219,7 @@ qint32 NoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::expungeTag: request id = " @@ -4250,7 +4250,7 @@ AsyncResult * NoteStore::expungeTagAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreExpungeTagPrepareParams( @@ -4411,7 +4411,7 @@ QList NoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listSearches: request id = " @@ -4436,7 +4436,7 @@ AsyncResult * NoteStore::listSearchesAsync( QEC_DEBUG("note_store", "NoteStore::listSearchesAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListSearchesPrepareParams( @@ -4603,7 +4603,7 @@ SavedSearch NoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getSearch: request id = " @@ -4634,7 +4634,7 @@ AsyncResult * NoteStore::getSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetSearchPrepareParams( @@ -4791,7 +4791,7 @@ SavedSearch NoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createSearch: request id = " @@ -4822,7 +4822,7 @@ AsyncResult * NoteStore::createSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateSearchPrepareParams( @@ -4990,7 +4990,7 @@ qint32 NoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateSearch: request id = " @@ -5021,7 +5021,7 @@ AsyncResult * NoteStore::updateSearchAsync( << " search = " << search); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateSearchPrepareParams( @@ -5189,7 +5189,7 @@ qint32 NoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::expungeSearch: request id = " @@ -5220,7 +5220,7 @@ AsyncResult * NoteStore::expungeSearchAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreExpungeSearchPrepareParams( @@ -5398,7 +5398,7 @@ qint32 NoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::findNoteOffset: request id = " @@ -5433,7 +5433,7 @@ AsyncResult * NoteStore::findNoteOffsetAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreFindNoteOffsetPrepareParams( @@ -5632,7 +5632,7 @@ NotesMetadataList NoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::findNotesMetadata: request id = " @@ -5675,7 +5675,7 @@ AsyncResult * NoteStore::findNotesMetadataAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreFindNotesMetadataPrepareParams( @@ -5856,7 +5856,7 @@ NoteCollectionCounts NoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::findNoteCounts: request id = " @@ -5891,7 +5891,7 @@ AsyncResult * NoteStore::findNoteCountsAsync( << " withTrash = " << withTrash); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreFindNoteCountsPrepareParams( @@ -6070,7 +6070,7 @@ Note NoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteWithResultSpec: request id = " @@ -6105,7 +6105,7 @@ AsyncResult * NoteStore::getNoteWithResultSpecAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteWithResultSpecPrepareParams( @@ -6314,7 +6314,7 @@ Note NoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNote: request id = " @@ -6361,7 +6361,7 @@ AsyncResult * NoteStore::getNoteAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNotePrepareParams( @@ -6533,7 +6533,7 @@ LazyMap NoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationData: request id = " @@ -6564,7 +6564,7 @@ AsyncResult * NoteStore::getNoteApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteApplicationDataPrepareParams( @@ -6742,7 +6742,7 @@ QString NoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteApplicationDataEntry: request id = " @@ -6777,7 +6777,7 @@ AsyncResult * NoteStore::getNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteApplicationDataEntryPrepareParams( @@ -6966,7 +6966,7 @@ qint32 NoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::setNoteApplicationDataEntry: request id = " @@ -7005,7 +7005,7 @@ AsyncResult * NoteStore::setNoteApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreSetNoteApplicationDataEntryPrepareParams( @@ -7185,7 +7185,7 @@ qint32 NoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::unsetNoteApplicationDataEntry: request id = " @@ -7220,7 +7220,7 @@ AsyncResult * NoteStore::unsetNoteApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUnsetNoteApplicationDataEntryPrepareParams( @@ -7389,7 +7389,7 @@ QString NoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteContent: request id = " @@ -7420,7 +7420,7 @@ AsyncResult * NoteStore::getNoteContentAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteContentPrepareParams( @@ -7608,7 +7608,7 @@ QString NoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteSearchText: request id = " @@ -7647,7 +7647,7 @@ AsyncResult * NoteStore::getNoteSearchTextAsync( << " tokenizeForIndexing = " << tokenizeForIndexing); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteSearchTextPrepareParams( @@ -7817,7 +7817,7 @@ QString NoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceSearchText: request id = " @@ -7848,7 +7848,7 @@ AsyncResult * NoteStore::getResourceSearchTextAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceSearchTextPrepareParams( @@ -8030,7 +8030,7 @@ QStringList NoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteTagNames: request id = " @@ -8061,7 +8061,7 @@ AsyncResult * NoteStore::getNoteTagNamesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteTagNamesPrepareParams( @@ -8229,7 +8229,7 @@ Note NoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createNote: request id = " @@ -8260,7 +8260,7 @@ AsyncResult * NoteStore::createNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateNotePrepareParams( @@ -8428,7 +8428,7 @@ Note NoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateNote: request id = " @@ -8459,7 +8459,7 @@ AsyncResult * NoteStore::updateNoteAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateNotePrepareParams( @@ -8627,7 +8627,7 @@ qint32 NoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::deleteNote: request id = " @@ -8658,7 +8658,7 @@ AsyncResult * NoteStore::deleteNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreDeleteNotePrepareParams( @@ -8826,7 +8826,7 @@ qint32 NoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::expungeNote: request id = " @@ -8857,7 +8857,7 @@ AsyncResult * NoteStore::expungeNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreExpungeNotePrepareParams( @@ -9035,7 +9035,7 @@ Note NoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::copyNote: request id = " @@ -9070,7 +9070,7 @@ AsyncResult * NoteStore::copyNoteAsync( << " toNotebookGuid = " << toNotebookGuid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCopyNotePrepareParams( @@ -9253,7 +9253,7 @@ QList NoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listNoteVersions: request id = " @@ -9284,7 +9284,7 @@ AsyncResult * NoteStore::listNoteVersionsAsync( << " noteGuid = " << noteGuid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListNoteVersionsPrepareParams( @@ -9492,7 +9492,7 @@ Note NoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNoteVersion: request id = " @@ -9539,7 +9539,7 @@ AsyncResult * NoteStore::getNoteVersionAsync( << " withResourcesAlternateData = " << withResourcesAlternateData); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNoteVersionPrepareParams( @@ -9751,7 +9751,7 @@ Resource NoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResource: request id = " @@ -9798,7 +9798,7 @@ AsyncResult * NoteStore::getResourceAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourcePrepareParams( @@ -9970,7 +9970,7 @@ LazyMap NoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationData: request id = " @@ -10001,7 +10001,7 @@ AsyncResult * NoteStore::getResourceApplicationDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceApplicationDataPrepareParams( @@ -10179,7 +10179,7 @@ QString NoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceApplicationDataEntry: request id = " @@ -10214,7 +10214,7 @@ AsyncResult * NoteStore::getResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceApplicationDataEntryPrepareParams( @@ -10403,7 +10403,7 @@ qint32 NoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::setResourceApplicationDataEntry: request id = " @@ -10442,7 +10442,7 @@ AsyncResult * NoteStore::setResourceApplicationDataEntryAsync( << " value = " << value); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreSetResourceApplicationDataEntryPrepareParams( @@ -10622,7 +10622,7 @@ qint32 NoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::unsetResourceApplicationDataEntry: request id = " @@ -10657,7 +10657,7 @@ AsyncResult * NoteStore::unsetResourceApplicationDataEntryAsync( << " key = " << key); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUnsetResourceApplicationDataEntryPrepareParams( @@ -10826,7 +10826,7 @@ qint32 NoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateResource: request id = " @@ -10857,7 +10857,7 @@ AsyncResult * NoteStore::updateResourceAsync( << " resource = " << resource); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateResourcePrepareParams( @@ -11025,7 +11025,7 @@ QByteArray NoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceData: request id = " @@ -11056,7 +11056,7 @@ AsyncResult * NoteStore::getResourceDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceDataPrepareParams( @@ -11264,7 +11264,7 @@ Resource NoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceByHash: request id = " @@ -11311,7 +11311,7 @@ AsyncResult * NoteStore::getResourceByHashAsync( << " withAlternateData = " << withAlternateData); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceByHashPrepareParams( @@ -11483,7 +11483,7 @@ QByteArray NoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceRecognition: request id = " @@ -11514,7 +11514,7 @@ AsyncResult * NoteStore::getResourceRecognitionAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceRecognitionPrepareParams( @@ -11682,7 +11682,7 @@ QByteArray NoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceAlternateData: request id = " @@ -11713,7 +11713,7 @@ AsyncResult * NoteStore::getResourceAlternateDataAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceAlternateDataPrepareParams( @@ -11881,7 +11881,7 @@ ResourceAttributes NoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getResourceAttributes: request id = " @@ -11912,7 +11912,7 @@ AsyncResult * NoteStore::getResourceAttributesAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetResourceAttributesPrepareParams( @@ -12070,7 +12070,7 @@ Notebook NoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getPublicNotebook: request id = " @@ -12104,7 +12104,7 @@ AsyncResult * NoteStore::getPublicNotebookAsync( << " publicUri = " << publicUri); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetPublicNotebookPrepareParams( @@ -12282,7 +12282,7 @@ SharedNotebook NoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::shareNotebook: request id = " @@ -12317,7 +12317,7 @@ AsyncResult * NoteStore::shareNotebookAsync( << " message = " << message); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreShareNotebookPrepareParams( @@ -12497,7 +12497,7 @@ CreateOrUpdateNotebookSharesResult NoteStore::createOrUpdateNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createOrUpdateNotebookShares: request id = " @@ -12528,7 +12528,7 @@ AsyncResult * NoteStore::createOrUpdateNotebookSharesAsync( << " shareTemplate = " << shareTemplate); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateOrUpdateNotebookSharesPrepareParams( @@ -12696,7 +12696,7 @@ qint32 NoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateSharedNotebook: request id = " @@ -12727,7 +12727,7 @@ AsyncResult * NoteStore::updateSharedNotebookAsync( << " sharedNotebook = " << sharedNotebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateSharedNotebookPrepareParams( @@ -12905,7 +12905,7 @@ Notebook NoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::setNotebookRecipientSettings: request id = " @@ -12940,7 +12940,7 @@ AsyncResult * NoteStore::setNotebookRecipientSettingsAsync( << " recipientSettings = " << recipientSettings); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreSetNotebookRecipientSettingsPrepareParams( @@ -13113,7 +13113,7 @@ QList NoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listSharedNotebooks: request id = " @@ -13138,7 +13138,7 @@ AsyncResult * NoteStore::listSharedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listSharedNotebooksAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListSharedNotebooksPrepareParams( @@ -13305,7 +13305,7 @@ LinkedNotebook NoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::createLinkedNotebook: request id = " @@ -13336,7 +13336,7 @@ AsyncResult * NoteStore::createLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreCreateLinkedNotebookPrepareParams( @@ -13504,7 +13504,7 @@ qint32 NoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateLinkedNotebook: request id = " @@ -13535,7 +13535,7 @@ AsyncResult * NoteStore::updateLinkedNotebookAsync( << " linkedNotebook = " << linkedNotebook); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateLinkedNotebookPrepareParams( @@ -13707,7 +13707,7 @@ QList NoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooks: request id = " @@ -13732,7 +13732,7 @@ AsyncResult * NoteStore::listLinkedNotebooksAsync( QEC_DEBUG("note_store", "NoteStore::listLinkedNotebooksAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreListLinkedNotebooksPrepareParams( @@ -13899,7 +13899,7 @@ qint32 NoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::expungeLinkedNotebook: request id = " @@ -13930,7 +13930,7 @@ AsyncResult * NoteStore::expungeLinkedNotebookAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreExpungeLinkedNotebookPrepareParams( @@ -14098,7 +14098,7 @@ AuthenticationResult NoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNotebook: request id = " @@ -14129,7 +14129,7 @@ AsyncResult * NoteStore::authenticateToSharedNotebookAsync( << " shareKeyOrGlobalId = " << shareKeyOrGlobalId); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreAuthenticateToSharedNotebookPrepareParams( @@ -14287,7 +14287,7 @@ SharedNotebook NoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuth: request id = " @@ -14312,7 +14312,7 @@ AsyncResult * NoteStore::getSharedNotebookByAuthAsync( QEC_DEBUG("note_store", "NoteStore::getSharedNotebookByAuthAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetSharedNotebookByAuthPrepareParams( @@ -14459,7 +14459,7 @@ void NoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::emailNote: request id = " @@ -14490,7 +14490,7 @@ AsyncResult * NoteStore::emailNoteAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreEmailNotePrepareParams( @@ -14658,7 +14658,7 @@ QString NoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::shareNote: request id = " @@ -14689,7 +14689,7 @@ AsyncResult * NoteStore::shareNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreShareNotePrepareParams( @@ -14837,7 +14837,7 @@ void NoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::stopSharingNote: request id = " @@ -14868,7 +14868,7 @@ AsyncResult * NoteStore::stopSharingNoteAsync( << " guid = " << guid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreStopSharingNotePrepareParams( @@ -15046,7 +15046,7 @@ AuthenticationResult NoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::authenticateToSharedNote: request id = " @@ -15081,7 +15081,7 @@ AsyncResult * NoteStore::authenticateToSharedNoteAsync( << " noteKey = " << noteKey); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreAuthenticateToSharedNotePrepareParams( @@ -15260,7 +15260,7 @@ RelatedResult NoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::findRelated: request id = " @@ -15295,7 +15295,7 @@ AsyncResult * NoteStore::findRelatedAsync( << " resultSpec = " << resultSpec); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreFindRelatedPrepareParams( @@ -15464,7 +15464,7 @@ UpdateNoteIfUsnMatchesResult NoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::updateNoteIfUsnMatches: request id = " @@ -15495,7 +15495,7 @@ AsyncResult * NoteStore::updateNoteIfUsnMatchesAsync( << " note = " << note); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreUpdateNoteIfUsnMatchesPrepareParams( @@ -15663,7 +15663,7 @@ ManageNotebookSharesResult NoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::manageNotebookShares: request id = " @@ -15694,7 +15694,7 @@ AsyncResult * NoteStore::manageNotebookSharesAsync( << " parameters = " << parameters); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreManageNotebookSharesPrepareParams( @@ -15862,7 +15862,7 @@ ShareRelationships NoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("note_store", "NoteStore::getNotebookShares: request id = " @@ -15893,7 +15893,7 @@ AsyncResult * NoteStore::getNotebookSharesAsync( << " notebookGuid = " << notebookGuid); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = NoteStoreGetNotebookSharesPrepareParams( @@ -16212,7 +16212,7 @@ bool UserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::checkVersion: request id = " @@ -16250,7 +16250,7 @@ AsyncResult * UserStore::checkVersionAsync( << " edamVersionMinor = " << edamVersionMinor); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreCheckVersionPrepareParams( @@ -16377,7 +16377,7 @@ BootstrapInfo UserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::getBootstrapInfo: request id = " @@ -16407,7 +16407,7 @@ AsyncResult * UserStore::getBootstrapInfoAsync( << " locale = " << locale); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreGetBootstrapInfoPrepareParams( @@ -16614,7 +16614,7 @@ AuthenticationResult UserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::authenticateLongSession: request id = " @@ -16662,7 +16662,7 @@ AsyncResult * UserStore::authenticateLongSessionAsync( << " supportsTwoFactor = " << supportsTwoFactor); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreAuthenticateLongSessionPrepareParams( @@ -16844,7 +16844,7 @@ AuthenticationResult UserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::completeTwoFactorAuthentication: request id = " @@ -16881,7 +16881,7 @@ AsyncResult * UserStore::completeTwoFactorAuthenticationAsync( << " deviceDescription = " << deviceDescription); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreCompleteTwoFactorAuthenticationPrepareParams( @@ -17010,7 +17010,7 @@ void UserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::revokeLongSession: request id = " @@ -17035,7 +17035,7 @@ AsyncResult * UserStore::revokeLongSessionAsync( QEC_DEBUG("user_store", "UserStore::revokeLongSessionAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreRevokeLongSessionPrepareParams( @@ -17181,7 +17181,7 @@ AuthenticationResult UserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::authenticateToBusiness: request id = " @@ -17206,7 +17206,7 @@ AsyncResult * UserStore::authenticateToBusinessAsync( QEC_DEBUG("user_store", "UserStore::authenticateToBusinessAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreAuthenticateToBusinessPrepareParams( @@ -17352,7 +17352,7 @@ User UserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::getUser: request id = " @@ -17377,7 +17377,7 @@ AsyncResult * UserStore::getUserAsync( QEC_DEBUG("user_store", "UserStore::getUserAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreGetUserPrepareParams( @@ -17535,7 +17535,7 @@ PublicUserInfo UserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::getPublicUserInfo: request id = " @@ -17565,7 +17565,7 @@ AsyncResult * UserStore::getPublicUserInfoAsync( << " username = " << username); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreGetPublicUserInfoPrepareParams( @@ -17711,7 +17711,7 @@ UserUrls UserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::getUserUrls: request id = " @@ -17736,7 +17736,7 @@ AsyncResult * UserStore::getUserUrlsAsync( QEC_DEBUG("user_store", "UserStore::getUserUrlsAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreGetUserUrlsPrepareParams( @@ -17872,7 +17872,7 @@ void UserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::inviteToBusiness: request id = " @@ -17903,7 +17903,7 @@ AsyncResult * UserStore::inviteToBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreInviteToBusinessPrepareParams( @@ -18051,7 +18051,7 @@ void UserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::removeFromBusiness: request id = " @@ -18082,7 +18082,7 @@ AsyncResult * UserStore::removeFromBusinessAsync( << " emailAddress = " << emailAddress); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreRemoveFromBusinessPrepareParams( @@ -18240,7 +18240,7 @@ void UserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::updateBusinessUserIdentifier: request id = " @@ -18275,7 +18275,7 @@ AsyncResult * UserStore::updateBusinessUserIdentifierAsync( << " newEmailAddress = " << newEmailAddress); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreUpdateBusinessUserIdentifierPrepareParams( @@ -18437,7 +18437,7 @@ QList UserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::listBusinessUsers: request id = " @@ -18462,7 +18462,7 @@ AsyncResult * UserStore::listBusinessUsersAsync( QEC_DEBUG("user_store", "UserStore::listBusinessUsersAsync"); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreListBusinessUsersPrepareParams( @@ -18632,7 +18632,7 @@ QList UserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::listBusinessInvitations: request id = " @@ -18663,7 +18663,7 @@ AsyncResult * UserStore::listBusinessInvitationsAsync( << " includeRequestedInvitations = " << includeRequestedInvitations); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreListBusinessInvitationsPrepareParams( @@ -18800,7 +18800,7 @@ AccountLimits UserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QEC_DEBUG("user_store", "UserStore::getAccountLimits: request id = " @@ -18830,7 +18830,7 @@ AsyncResult * UserStore::getAccountLimitsAsync( << " serviceLevel = " << serviceLevel); if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } QByteArray params = UserStoreGetAccountLimitsPrepareParams( @@ -19715,7 +19715,7 @@ SyncState DurableNoteStore::getSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -19741,7 +19741,7 @@ AsyncResult * DurableNoteStore::getSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -19768,7 +19768,7 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -19808,7 +19808,7 @@ AsyncResult * DurableNoteStore::getFilteredSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -19844,7 +19844,7 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -19878,7 +19878,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncStateAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -19913,7 +19913,7 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -19956,7 +19956,7 @@ AsyncResult * DurableNoteStore::getLinkedNotebookSyncChunkAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -19993,7 +19993,7 @@ QList DurableNoteStore::listNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20019,7 +20019,7 @@ AsyncResult * DurableNoteStore::listNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20043,7 +20043,7 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20069,7 +20069,7 @@ AsyncResult * DurableNoteStore::listAccessibleBusinessNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20094,7 +20094,7 @@ Notebook DurableNoteStore::getNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20128,7 +20128,7 @@ AsyncResult * DurableNoteStore::getNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20159,7 +20159,7 @@ Notebook DurableNoteStore::getDefaultNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20185,7 +20185,7 @@ AsyncResult * DurableNoteStore::getDefaultNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20210,7 +20210,7 @@ Notebook DurableNoteStore::createNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20244,7 +20244,7 @@ AsyncResult * DurableNoteStore::createNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20276,7 +20276,7 @@ qint32 DurableNoteStore::updateNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20310,7 +20310,7 @@ AsyncResult * DurableNoteStore::updateNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20342,7 +20342,7 @@ qint32 DurableNoteStore::expungeNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20376,7 +20376,7 @@ AsyncResult * DurableNoteStore::expungeNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20407,7 +20407,7 @@ QList DurableNoteStore::listTags( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20433,7 +20433,7 @@ AsyncResult * DurableNoteStore::listTagsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20458,7 +20458,7 @@ QList DurableNoteStore::listTagsByNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20492,7 +20492,7 @@ AsyncResult * DurableNoteStore::listTagsByNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20524,7 +20524,7 @@ Tag DurableNoteStore::getTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20558,7 +20558,7 @@ AsyncResult * DurableNoteStore::getTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20590,7 +20590,7 @@ Tag DurableNoteStore::createTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20624,7 +20624,7 @@ AsyncResult * DurableNoteStore::createTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20656,7 +20656,7 @@ qint32 DurableNoteStore::updateTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20690,7 +20690,7 @@ AsyncResult * DurableNoteStore::updateTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20722,7 +20722,7 @@ void DurableNoteStore::untagAll( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20756,7 +20756,7 @@ AsyncResult * DurableNoteStore::untagAllAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20788,7 +20788,7 @@ qint32 DurableNoteStore::expungeTag( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20822,7 +20822,7 @@ AsyncResult * DurableNoteStore::expungeTagAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20853,7 +20853,7 @@ QList DurableNoteStore::listSearches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20879,7 +20879,7 @@ AsyncResult * DurableNoteStore::listSearchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20904,7 +20904,7 @@ SavedSearch DurableNoteStore::getSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -20938,7 +20938,7 @@ AsyncResult * DurableNoteStore::getSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -20970,7 +20970,7 @@ SavedSearch DurableNoteStore::createSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21004,7 +21004,7 @@ AsyncResult * DurableNoteStore::createSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21036,7 +21036,7 @@ qint32 DurableNoteStore::updateSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21070,7 +21070,7 @@ AsyncResult * DurableNoteStore::updateSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21102,7 +21102,7 @@ qint32 DurableNoteStore::expungeSearch( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21136,7 +21136,7 @@ AsyncResult * DurableNoteStore::expungeSearchAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21169,7 +21169,7 @@ qint32 DurableNoteStore::findNoteOffset( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21206,7 +21206,7 @@ AsyncResult * DurableNoteStore::findNoteOffsetAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21243,7 +21243,7 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21286,7 +21286,7 @@ AsyncResult * DurableNoteStore::findNotesMetadataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21325,7 +21325,7 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21362,7 +21362,7 @@ AsyncResult * DurableNoteStore::findNoteCountsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21397,7 +21397,7 @@ Note DurableNoteStore::getNoteWithResultSpec( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21434,7 +21434,7 @@ AsyncResult * DurableNoteStore::getNoteWithResultSpecAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21472,7 +21472,7 @@ Note DurableNoteStore::getNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21518,7 +21518,7 @@ AsyncResult * DurableNoteStore::getNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21558,7 +21558,7 @@ LazyMap DurableNoteStore::getNoteApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21592,7 +21592,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21625,7 +21625,7 @@ QString DurableNoteStore::getNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21662,7 +21662,7 @@ AsyncResult * DurableNoteStore::getNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21698,7 +21698,7 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21738,7 +21738,7 @@ AsyncResult * DurableNoteStore::setNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21775,7 +21775,7 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21812,7 +21812,7 @@ AsyncResult * DurableNoteStore::unsetNoteApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21846,7 +21846,7 @@ QString DurableNoteStore::getNoteContent( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21880,7 +21880,7 @@ AsyncResult * DurableNoteStore::getNoteContentAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21914,7 +21914,7 @@ QString DurableNoteStore::getNoteSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -21954,7 +21954,7 @@ AsyncResult * DurableNoteStore::getNoteSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -21990,7 +21990,7 @@ QString DurableNoteStore::getResourceSearchText( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22024,7 +22024,7 @@ AsyncResult * DurableNoteStore::getResourceSearchTextAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22056,7 +22056,7 @@ QStringList DurableNoteStore::getNoteTagNames( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22090,7 +22090,7 @@ AsyncResult * DurableNoteStore::getNoteTagNamesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22122,7 +22122,7 @@ Note DurableNoteStore::createNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22156,7 +22156,7 @@ AsyncResult * DurableNoteStore::createNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22188,7 +22188,7 @@ Note DurableNoteStore::updateNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22222,7 +22222,7 @@ AsyncResult * DurableNoteStore::updateNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22254,7 +22254,7 @@ qint32 DurableNoteStore::deleteNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22288,7 +22288,7 @@ AsyncResult * DurableNoteStore::deleteNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22320,7 +22320,7 @@ qint32 DurableNoteStore::expungeNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22354,7 +22354,7 @@ AsyncResult * DurableNoteStore::expungeNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22387,7 +22387,7 @@ Note DurableNoteStore::copyNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22424,7 +22424,7 @@ AsyncResult * DurableNoteStore::copyNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22458,7 +22458,7 @@ QList DurableNoteStore::listNoteVersions( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22492,7 +22492,7 @@ AsyncResult * DurableNoteStore::listNoteVersionsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22528,7 +22528,7 @@ Note DurableNoteStore::getNoteVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22574,7 +22574,7 @@ AsyncResult * DurableNoteStore::getNoteVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22618,7 +22618,7 @@ Resource DurableNoteStore::getResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22664,7 +22664,7 @@ AsyncResult * DurableNoteStore::getResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22704,7 +22704,7 @@ LazyMap DurableNoteStore::getResourceApplicationData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22738,7 +22738,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22771,7 +22771,7 @@ QString DurableNoteStore::getResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22808,7 +22808,7 @@ AsyncResult * DurableNoteStore::getResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22844,7 +22844,7 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22884,7 +22884,7 @@ AsyncResult * DurableNoteStore::setResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22921,7 +22921,7 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -22958,7 +22958,7 @@ AsyncResult * DurableNoteStore::unsetResourceApplicationDataEntryAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -22992,7 +22992,7 @@ qint32 DurableNoteStore::updateResource( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23026,7 +23026,7 @@ AsyncResult * DurableNoteStore::updateResourceAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23058,7 +23058,7 @@ QByteArray DurableNoteStore::getResourceData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23092,7 +23092,7 @@ AsyncResult * DurableNoteStore::getResourceDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23128,7 +23128,7 @@ Resource DurableNoteStore::getResourceByHash( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23174,7 +23174,7 @@ AsyncResult * DurableNoteStore::getResourceByHashAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23214,7 +23214,7 @@ QByteArray DurableNoteStore::getResourceRecognition( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23248,7 +23248,7 @@ AsyncResult * DurableNoteStore::getResourceRecognitionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23280,7 +23280,7 @@ QByteArray DurableNoteStore::getResourceAlternateData( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23314,7 +23314,7 @@ AsyncResult * DurableNoteStore::getResourceAlternateDataAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23346,7 +23346,7 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23380,7 +23380,7 @@ AsyncResult * DurableNoteStore::getResourceAttributesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23413,7 +23413,7 @@ Notebook DurableNoteStore::getPublicNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23450,7 +23450,7 @@ AsyncResult * DurableNoteStore::getPublicNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23485,7 +23485,7 @@ SharedNotebook DurableNoteStore::shareNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23522,7 +23522,7 @@ AsyncResult * DurableNoteStore::shareNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23556,7 +23556,7 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23590,7 +23590,7 @@ AsyncResult * DurableNoteStore::createOrUpdateNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23622,7 +23622,7 @@ qint32 DurableNoteStore::updateSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23656,7 +23656,7 @@ AsyncResult * DurableNoteStore::updateSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23689,7 +23689,7 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23726,7 +23726,7 @@ AsyncResult * DurableNoteStore::setNotebookRecipientSettingsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23759,7 +23759,7 @@ QList DurableNoteStore::listSharedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23785,7 +23785,7 @@ AsyncResult * DurableNoteStore::listSharedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23810,7 +23810,7 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23844,7 +23844,7 @@ AsyncResult * DurableNoteStore::createLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23876,7 +23876,7 @@ qint32 DurableNoteStore::updateLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23910,7 +23910,7 @@ AsyncResult * DurableNoteStore::updateLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23941,7 +23941,7 @@ QList DurableNoteStore::listLinkedNotebooks( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -23967,7 +23967,7 @@ AsyncResult * DurableNoteStore::listLinkedNotebooksAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -23992,7 +23992,7 @@ qint32 DurableNoteStore::expungeLinkedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24026,7 +24026,7 @@ AsyncResult * DurableNoteStore::expungeLinkedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24058,7 +24058,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24092,7 +24092,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNotebookAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24123,7 +24123,7 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24149,7 +24149,7 @@ AsyncResult * DurableNoteStore::getSharedNotebookByAuthAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24174,7 +24174,7 @@ void DurableNoteStore::emailNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24208,7 +24208,7 @@ AsyncResult * DurableNoteStore::emailNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24240,7 +24240,7 @@ QString DurableNoteStore::shareNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24274,7 +24274,7 @@ AsyncResult * DurableNoteStore::shareNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24306,7 +24306,7 @@ void DurableNoteStore::stopSharingNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24340,7 +24340,7 @@ AsyncResult * DurableNoteStore::stopSharingNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24373,7 +24373,7 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24410,7 +24410,7 @@ AsyncResult * DurableNoteStore::authenticateToSharedNoteAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24445,7 +24445,7 @@ RelatedResult DurableNoteStore::findRelated( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24482,7 +24482,7 @@ AsyncResult * DurableNoteStore::findRelatedAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24516,7 +24516,7 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24550,7 +24550,7 @@ AsyncResult * DurableNoteStore::updateNoteIfUsnMatchesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24582,7 +24582,7 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24616,7 +24616,7 @@ AsyncResult * DurableNoteStore::manageNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24648,7 +24648,7 @@ ShareRelationships DurableNoteStore::getNotebookShares( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24682,7 +24682,7 @@ AsyncResult * DurableNoteStore::getNotebookSharesAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24718,7 +24718,7 @@ bool DurableUserStore::checkVersion( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24758,7 +24758,7 @@ AsyncResult * DurableUserStore::checkVersionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24794,7 +24794,7 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24828,7 +24828,7 @@ AsyncResult * DurableUserStore::getBootstrapInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24866,7 +24866,7 @@ AuthenticationResult DurableUserStore::authenticateLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24915,7 +24915,7 @@ AsyncResult * DurableUserStore::authenticateLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -24958,7 +24958,7 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -24997,7 +24997,7 @@ AsyncResult * DurableUserStore::completeTwoFactorAuthenticationAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25031,7 +25031,7 @@ void DurableUserStore::revokeLongSession( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25057,7 +25057,7 @@ AsyncResult * DurableUserStore::revokeLongSessionAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25081,7 +25081,7 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25107,7 +25107,7 @@ AsyncResult * DurableUserStore::authenticateToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25131,7 +25131,7 @@ User DurableUserStore::getUser( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25157,7 +25157,7 @@ AsyncResult * DurableUserStore::getUserAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25182,7 +25182,7 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25216,7 +25216,7 @@ AsyncResult * DurableUserStore::getPublicUserInfoAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25247,7 +25247,7 @@ UserUrls DurableUserStore::getUserUrls( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25273,7 +25273,7 @@ AsyncResult * DurableUserStore::getUserUrlsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25298,7 +25298,7 @@ void DurableUserStore::inviteToBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25332,7 +25332,7 @@ AsyncResult * DurableUserStore::inviteToBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25364,7 +25364,7 @@ void DurableUserStore::removeFromBusiness( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25398,7 +25398,7 @@ AsyncResult * DurableUserStore::removeFromBusinessAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25431,7 +25431,7 @@ void DurableUserStore::updateBusinessUserIdentifier( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25468,7 +25468,7 @@ AsyncResult * DurableUserStore::updateBusinessUserIdentifierAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25501,7 +25501,7 @@ QList DurableUserStore::listBusinessUsers( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25527,7 +25527,7 @@ AsyncResult * DurableUserStore::listBusinessUsersAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25552,7 +25552,7 @@ QList DurableUserStore::listBusinessInvitations( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25586,7 +25586,7 @@ AsyncResult * DurableUserStore::listBusinessInvitationsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( @@ -25618,7 +25618,7 @@ AccountLimits DurableUserStore::getAccountLimits( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::SyncServiceCall( @@ -25652,7 +25652,7 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( IRequestContextPtr ctx) { if (!ctx) { - ctx = m_ctx->clone(); + ctx.reset(m_ctx->clone()); } auto call = IDurableService::AsyncServiceCall( diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index c7d6a14a..bda25213 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -27,7 +27,7 @@ class ValueFetcher: public QObject {} QVariant m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -35,7 +35,7 @@ class ValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(ctx) @@ -130,7 +130,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -175,7 +175,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() ++serviceCallCounter; if (serviceCallCounter < maxServiceCallCounter) { - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -227,7 +227,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -275,7 +275,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { throw NetworkException(QNetworkReply::TimeoutError); } @@ -334,7 +334,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; @@ -384,7 +384,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro Q_ASSERT(ctx->maxRequestRetryCount() == maxServiceCallCounter); ++serviceCallCounter; - QSharedPointer data; + EverCloudExceptionDataPtr data; try { EDAMUserException e; e.errorCode = EDAMErrorCode::AUTH_EXPIRED; diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index f404093a..1d0787aa 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -47,7 +47,7 @@ class NoteStoreGetSyncStateTesterHelper: public QObject Q_SIGNALS: void getSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetSyncStateRequestReceived( @@ -60,7 +60,7 @@ public Q_SLOTS: Q_EMIT getSyncStateRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -98,7 +98,7 @@ class NoteStoreGetFilteredSyncChunkTesterHelper: public QObject Q_SIGNALS: void getFilteredSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetFilteredSyncChunkRequestReceived( @@ -117,7 +117,7 @@ public Q_SLOTS: Q_EMIT getFilteredSyncChunkRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -153,7 +153,7 @@ class NoteStoreGetLinkedNotebookSyncStateTesterHelper: public QObject Q_SIGNALS: void getLinkedNotebookSyncStateRequestReady( SyncState value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetLinkedNotebookSyncStateRequestReceived( @@ -168,7 +168,7 @@ public Q_SLOTS: Q_EMIT getLinkedNotebookSyncStateRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -207,7 +207,7 @@ class NoteStoreGetLinkedNotebookSyncChunkTesterHelper: public QObject Q_SIGNALS: void getLinkedNotebookSyncChunkRequestReady( SyncChunk value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetLinkedNotebookSyncChunkRequestReceived( @@ -228,7 +228,7 @@ public Q_SLOTS: Q_EMIT getLinkedNotebookSyncChunkRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -263,7 +263,7 @@ class NoteStoreListNotebooksTesterHelper: public QObject Q_SIGNALS: void listNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListNotebooksRequestReceived( @@ -276,7 +276,7 @@ public Q_SLOTS: Q_EMIT listNotebooksRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -311,7 +311,7 @@ class NoteStoreListAccessibleBusinessNotebooksTesterHelper: public QObject Q_SIGNALS: void listAccessibleBusinessNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListAccessibleBusinessNotebooksRequestReceived( @@ -324,7 +324,7 @@ public Q_SLOTS: Q_EMIT listAccessibleBusinessNotebooksRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -360,7 +360,7 @@ class NoteStoreGetNotebookTesterHelper: public QObject Q_SIGNALS: void getNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNotebookRequestReceived( @@ -375,7 +375,7 @@ public Q_SLOTS: Q_EMIT getNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -410,7 +410,7 @@ class NoteStoreGetDefaultNotebookTesterHelper: public QObject Q_SIGNALS: void getDefaultNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetDefaultNotebookRequestReceived( @@ -423,7 +423,7 @@ public Q_SLOTS: Q_EMIT getDefaultNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -459,7 +459,7 @@ class NoteStoreCreateNotebookTesterHelper: public QObject Q_SIGNALS: void createNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateNotebookRequestReceived( @@ -474,7 +474,7 @@ public Q_SLOTS: Q_EMIT createNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -510,7 +510,7 @@ class NoteStoreUpdateNotebookTesterHelper: public QObject Q_SIGNALS: void updateNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateNotebookRequestReceived( @@ -525,7 +525,7 @@ public Q_SLOTS: Q_EMIT updateNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -561,7 +561,7 @@ class NoteStoreExpungeNotebookTesterHelper: public QObject Q_SIGNALS: void expungeNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onExpungeNotebookRequestReceived( @@ -576,7 +576,7 @@ public Q_SLOTS: Q_EMIT expungeNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -611,7 +611,7 @@ class NoteStoreListTagsTesterHelper: public QObject Q_SIGNALS: void listTagsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListTagsRequestReceived( @@ -624,7 +624,7 @@ public Q_SLOTS: Q_EMIT listTagsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -660,7 +660,7 @@ class NoteStoreListTagsByNotebookTesterHelper: public QObject Q_SIGNALS: void listTagsByNotebookRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListTagsByNotebookRequestReceived( @@ -675,7 +675,7 @@ public Q_SLOTS: Q_EMIT listTagsByNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -711,7 +711,7 @@ class NoteStoreGetTagTesterHelper: public QObject Q_SIGNALS: void getTagRequestReady( Tag value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetTagRequestReceived( @@ -726,7 +726,7 @@ public Q_SLOTS: Q_EMIT getTagRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -762,7 +762,7 @@ class NoteStoreCreateTagTesterHelper: public QObject Q_SIGNALS: void createTagRequestReady( Tag value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateTagRequestReceived( @@ -777,7 +777,7 @@ public Q_SLOTS: Q_EMIT createTagRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -813,7 +813,7 @@ class NoteStoreUpdateTagTesterHelper: public QObject Q_SIGNALS: void updateTagRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateTagRequestReceived( @@ -828,7 +828,7 @@ public Q_SLOTS: Q_EMIT updateTagRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -863,7 +863,7 @@ class NoteStoreUntagAllTesterHelper: public QObject Q_SIGNALS: void untagAllRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUntagAllRequestReceived( @@ -877,7 +877,7 @@ public Q_SLOTS: ctx); Q_EMIT untagAllRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -912,7 +912,7 @@ class NoteStoreExpungeTagTesterHelper: public QObject Q_SIGNALS: void expungeTagRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onExpungeTagRequestReceived( @@ -927,7 +927,7 @@ public Q_SLOTS: Q_EMIT expungeTagRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -962,7 +962,7 @@ class NoteStoreListSearchesTesterHelper: public QObject Q_SIGNALS: void listSearchesRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListSearchesRequestReceived( @@ -975,7 +975,7 @@ public Q_SLOTS: Q_EMIT listSearchesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1011,7 +1011,7 @@ class NoteStoreGetSearchTesterHelper: public QObject Q_SIGNALS: void getSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetSearchRequestReceived( @@ -1026,7 +1026,7 @@ public Q_SLOTS: Q_EMIT getSearchRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1062,7 +1062,7 @@ class NoteStoreCreateSearchTesterHelper: public QObject Q_SIGNALS: void createSearchRequestReady( SavedSearch value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateSearchRequestReceived( @@ -1077,7 +1077,7 @@ public Q_SLOTS: Q_EMIT createSearchRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1113,7 +1113,7 @@ class NoteStoreUpdateSearchTesterHelper: public QObject Q_SIGNALS: void updateSearchRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateSearchRequestReceived( @@ -1128,7 +1128,7 @@ public Q_SLOTS: Q_EMIT updateSearchRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1164,7 +1164,7 @@ class NoteStoreExpungeSearchTesterHelper: public QObject Q_SIGNALS: void expungeSearchRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onExpungeSearchRequestReceived( @@ -1179,7 +1179,7 @@ public Q_SLOTS: Q_EMIT expungeSearchRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1216,7 +1216,7 @@ class NoteStoreFindNoteOffsetTesterHelper: public QObject Q_SIGNALS: void findNoteOffsetRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onFindNoteOffsetRequestReceived( @@ -1233,7 +1233,7 @@ public Q_SLOTS: Q_EMIT findNoteOffsetRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1272,7 +1272,7 @@ class NoteStoreFindNotesMetadataTesterHelper: public QObject Q_SIGNALS: void findNotesMetadataRequestReady( NotesMetadataList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onFindNotesMetadataRequestReceived( @@ -1293,7 +1293,7 @@ public Q_SLOTS: Q_EMIT findNotesMetadataRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1330,7 +1330,7 @@ class NoteStoreFindNoteCountsTesterHelper: public QObject Q_SIGNALS: void findNoteCountsRequestReady( NoteCollectionCounts value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onFindNoteCountsRequestReceived( @@ -1347,7 +1347,7 @@ public Q_SLOTS: Q_EMIT findNoteCountsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1384,7 +1384,7 @@ class NoteStoreGetNoteWithResultSpecTesterHelper: public QObject Q_SIGNALS: void getNoteWithResultSpecRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteWithResultSpecRequestReceived( @@ -1401,7 +1401,7 @@ public Q_SLOTS: Q_EMIT getNoteWithResultSpecRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1441,7 +1441,7 @@ class NoteStoreGetNoteTesterHelper: public QObject Q_SIGNALS: void getNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteRequestReceived( @@ -1464,7 +1464,7 @@ public Q_SLOTS: Q_EMIT getNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1500,7 +1500,7 @@ class NoteStoreGetNoteApplicationDataTesterHelper: public QObject Q_SIGNALS: void getNoteApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteApplicationDataRequestReceived( @@ -1515,7 +1515,7 @@ public Q_SLOTS: Q_EMIT getNoteApplicationDataRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1552,7 +1552,7 @@ class NoteStoreGetNoteApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void getNoteApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteApplicationDataEntryRequestReceived( @@ -1569,7 +1569,7 @@ public Q_SLOTS: Q_EMIT getNoteApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1607,7 +1607,7 @@ class NoteStoreSetNoteApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void setNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onSetNoteApplicationDataEntryRequestReceived( @@ -1626,7 +1626,7 @@ public Q_SLOTS: Q_EMIT setNoteApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1663,7 +1663,7 @@ class NoteStoreUnsetNoteApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void unsetNoteApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUnsetNoteApplicationDataEntryRequestReceived( @@ -1680,7 +1680,7 @@ public Q_SLOTS: Q_EMIT unsetNoteApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1716,7 +1716,7 @@ class NoteStoreGetNoteContentTesterHelper: public QObject Q_SIGNALS: void getNoteContentRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteContentRequestReceived( @@ -1731,7 +1731,7 @@ public Q_SLOTS: Q_EMIT getNoteContentRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1769,7 +1769,7 @@ class NoteStoreGetNoteSearchTextTesterHelper: public QObject Q_SIGNALS: void getNoteSearchTextRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteSearchTextRequestReceived( @@ -1788,7 +1788,7 @@ public Q_SLOTS: Q_EMIT getNoteSearchTextRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1824,7 +1824,7 @@ class NoteStoreGetResourceSearchTextTesterHelper: public QObject Q_SIGNALS: void getResourceSearchTextRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceSearchTextRequestReceived( @@ -1839,7 +1839,7 @@ public Q_SLOTS: Q_EMIT getResourceSearchTextRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1875,7 +1875,7 @@ class NoteStoreGetNoteTagNamesTesterHelper: public QObject Q_SIGNALS: void getNoteTagNamesRequestReady( QStringList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteTagNamesRequestReceived( @@ -1890,7 +1890,7 @@ public Q_SLOTS: Q_EMIT getNoteTagNamesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1926,7 +1926,7 @@ class NoteStoreCreateNoteTesterHelper: public QObject Q_SIGNALS: void createNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateNoteRequestReceived( @@ -1941,7 +1941,7 @@ public Q_SLOTS: Q_EMIT createNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -1977,7 +1977,7 @@ class NoteStoreUpdateNoteTesterHelper: public QObject Q_SIGNALS: void updateNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateNoteRequestReceived( @@ -1992,7 +1992,7 @@ public Q_SLOTS: Q_EMIT updateNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2028,7 +2028,7 @@ class NoteStoreDeleteNoteTesterHelper: public QObject Q_SIGNALS: void deleteNoteRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onDeleteNoteRequestReceived( @@ -2043,7 +2043,7 @@ public Q_SLOTS: Q_EMIT deleteNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2079,7 +2079,7 @@ class NoteStoreExpungeNoteTesterHelper: public QObject Q_SIGNALS: void expungeNoteRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onExpungeNoteRequestReceived( @@ -2094,7 +2094,7 @@ public Q_SLOTS: Q_EMIT expungeNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2131,7 +2131,7 @@ class NoteStoreCopyNoteTesterHelper: public QObject Q_SIGNALS: void copyNoteRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCopyNoteRequestReceived( @@ -2148,7 +2148,7 @@ public Q_SLOTS: Q_EMIT copyNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2184,7 +2184,7 @@ class NoteStoreListNoteVersionsTesterHelper: public QObject Q_SIGNALS: void listNoteVersionsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListNoteVersionsRequestReceived( @@ -2199,7 +2199,7 @@ public Q_SLOTS: Q_EMIT listNoteVersionsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2239,7 +2239,7 @@ class NoteStoreGetNoteVersionTesterHelper: public QObject Q_SIGNALS: void getNoteVersionRequestReady( Note value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNoteVersionRequestReceived( @@ -2262,7 +2262,7 @@ public Q_SLOTS: Q_EMIT getNoteVersionRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2302,7 +2302,7 @@ class NoteStoreGetResourceTesterHelper: public QObject Q_SIGNALS: void getResourceRequestReady( Resource value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceRequestReceived( @@ -2325,7 +2325,7 @@ public Q_SLOTS: Q_EMIT getResourceRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2361,7 +2361,7 @@ class NoteStoreGetResourceApplicationDataTesterHelper: public QObject Q_SIGNALS: void getResourceApplicationDataRequestReady( LazyMap value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceApplicationDataRequestReceived( @@ -2376,7 +2376,7 @@ public Q_SLOTS: Q_EMIT getResourceApplicationDataRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2413,7 +2413,7 @@ class NoteStoreGetResourceApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void getResourceApplicationDataEntryRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceApplicationDataEntryRequestReceived( @@ -2430,7 +2430,7 @@ public Q_SLOTS: Q_EMIT getResourceApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2468,7 +2468,7 @@ class NoteStoreSetResourceApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void setResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onSetResourceApplicationDataEntryRequestReceived( @@ -2487,7 +2487,7 @@ public Q_SLOTS: Q_EMIT setResourceApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2524,7 +2524,7 @@ class NoteStoreUnsetResourceApplicationDataEntryTesterHelper: public QObject Q_SIGNALS: void unsetResourceApplicationDataEntryRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUnsetResourceApplicationDataEntryRequestReceived( @@ -2541,7 +2541,7 @@ public Q_SLOTS: Q_EMIT unsetResourceApplicationDataEntryRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2577,7 +2577,7 @@ class NoteStoreUpdateResourceTesterHelper: public QObject Q_SIGNALS: void updateResourceRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateResourceRequestReceived( @@ -2592,7 +2592,7 @@ public Q_SLOTS: Q_EMIT updateResourceRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2628,7 +2628,7 @@ class NoteStoreGetResourceDataTesterHelper: public QObject Q_SIGNALS: void getResourceDataRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceDataRequestReceived( @@ -2643,7 +2643,7 @@ public Q_SLOTS: Q_EMIT getResourceDataRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2683,7 +2683,7 @@ class NoteStoreGetResourceByHashTesterHelper: public QObject Q_SIGNALS: void getResourceByHashRequestReady( Resource value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceByHashRequestReceived( @@ -2706,7 +2706,7 @@ public Q_SLOTS: Q_EMIT getResourceByHashRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2742,7 +2742,7 @@ class NoteStoreGetResourceRecognitionTesterHelper: public QObject Q_SIGNALS: void getResourceRecognitionRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceRecognitionRequestReceived( @@ -2757,7 +2757,7 @@ public Q_SLOTS: Q_EMIT getResourceRecognitionRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2793,7 +2793,7 @@ class NoteStoreGetResourceAlternateDataTesterHelper: public QObject Q_SIGNALS: void getResourceAlternateDataRequestReady( QByteArray value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceAlternateDataRequestReceived( @@ -2808,7 +2808,7 @@ public Q_SLOTS: Q_EMIT getResourceAlternateDataRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2844,7 +2844,7 @@ class NoteStoreGetResourceAttributesTesterHelper: public QObject Q_SIGNALS: void getResourceAttributesRequestReady( ResourceAttributes value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetResourceAttributesRequestReceived( @@ -2859,7 +2859,7 @@ public Q_SLOTS: Q_EMIT getResourceAttributesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2896,7 +2896,7 @@ class NoteStoreGetPublicNotebookTesterHelper: public QObject Q_SIGNALS: void getPublicNotebookRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetPublicNotebookRequestReceived( @@ -2913,7 +2913,7 @@ public Q_SLOTS: Q_EMIT getPublicNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -2950,7 +2950,7 @@ class NoteStoreShareNotebookTesterHelper: public QObject Q_SIGNALS: void shareNotebookRequestReady( SharedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onShareNotebookRequestReceived( @@ -2967,7 +2967,7 @@ public Q_SLOTS: Q_EMIT shareNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3003,7 +3003,7 @@ class NoteStoreCreateOrUpdateNotebookSharesTesterHelper: public QObject Q_SIGNALS: void createOrUpdateNotebookSharesRequestReady( CreateOrUpdateNotebookSharesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateOrUpdateNotebookSharesRequestReceived( @@ -3018,7 +3018,7 @@ public Q_SLOTS: Q_EMIT createOrUpdateNotebookSharesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3054,7 +3054,7 @@ class NoteStoreUpdateSharedNotebookTesterHelper: public QObject Q_SIGNALS: void updateSharedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateSharedNotebookRequestReceived( @@ -3069,7 +3069,7 @@ public Q_SLOTS: Q_EMIT updateSharedNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3106,7 +3106,7 @@ class NoteStoreSetNotebookRecipientSettingsTesterHelper: public QObject Q_SIGNALS: void setNotebookRecipientSettingsRequestReady( Notebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onSetNotebookRecipientSettingsRequestReceived( @@ -3123,7 +3123,7 @@ public Q_SLOTS: Q_EMIT setNotebookRecipientSettingsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3158,7 +3158,7 @@ class NoteStoreListSharedNotebooksTesterHelper: public QObject Q_SIGNALS: void listSharedNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListSharedNotebooksRequestReceived( @@ -3171,7 +3171,7 @@ public Q_SLOTS: Q_EMIT listSharedNotebooksRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3207,7 +3207,7 @@ class NoteStoreCreateLinkedNotebookTesterHelper: public QObject Q_SIGNALS: void createLinkedNotebookRequestReady( LinkedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCreateLinkedNotebookRequestReceived( @@ -3222,7 +3222,7 @@ public Q_SLOTS: Q_EMIT createLinkedNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3258,7 +3258,7 @@ class NoteStoreUpdateLinkedNotebookTesterHelper: public QObject Q_SIGNALS: void updateLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateLinkedNotebookRequestReceived( @@ -3273,7 +3273,7 @@ public Q_SLOTS: Q_EMIT updateLinkedNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3308,7 +3308,7 @@ class NoteStoreListLinkedNotebooksTesterHelper: public QObject Q_SIGNALS: void listLinkedNotebooksRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListLinkedNotebooksRequestReceived( @@ -3321,7 +3321,7 @@ public Q_SLOTS: Q_EMIT listLinkedNotebooksRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3357,7 +3357,7 @@ class NoteStoreExpungeLinkedNotebookTesterHelper: public QObject Q_SIGNALS: void expungeLinkedNotebookRequestReady( qint32 value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onExpungeLinkedNotebookRequestReceived( @@ -3372,7 +3372,7 @@ public Q_SLOTS: Q_EMIT expungeLinkedNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3408,7 +3408,7 @@ class NoteStoreAuthenticateToSharedNotebookTesterHelper: public QObject Q_SIGNALS: void authenticateToSharedNotebookRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onAuthenticateToSharedNotebookRequestReceived( @@ -3423,7 +3423,7 @@ public Q_SLOTS: Q_EMIT authenticateToSharedNotebookRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3458,7 +3458,7 @@ class NoteStoreGetSharedNotebookByAuthTesterHelper: public QObject Q_SIGNALS: void getSharedNotebookByAuthRequestReady( SharedNotebook value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetSharedNotebookByAuthRequestReceived( @@ -3471,7 +3471,7 @@ public Q_SLOTS: Q_EMIT getSharedNotebookByAuthRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3506,7 +3506,7 @@ class NoteStoreEmailNoteTesterHelper: public QObject Q_SIGNALS: void emailNoteRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onEmailNoteRequestReceived( @@ -3520,7 +3520,7 @@ public Q_SLOTS: ctx); Q_EMIT emailNoteRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3555,7 +3555,7 @@ class NoteStoreShareNoteTesterHelper: public QObject Q_SIGNALS: void shareNoteRequestReady( QString value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onShareNoteRequestReceived( @@ -3570,7 +3570,7 @@ public Q_SLOTS: Q_EMIT shareNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3605,7 +3605,7 @@ class NoteStoreStopSharingNoteTesterHelper: public QObject Q_SIGNALS: void stopSharingNoteRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onStopSharingNoteRequestReceived( @@ -3619,7 +3619,7 @@ public Q_SLOTS: ctx); Q_EMIT stopSharingNoteRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3655,7 +3655,7 @@ class NoteStoreAuthenticateToSharedNoteTesterHelper: public QObject Q_SIGNALS: void authenticateToSharedNoteRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onAuthenticateToSharedNoteRequestReceived( @@ -3672,7 +3672,7 @@ public Q_SLOTS: Q_EMIT authenticateToSharedNoteRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3709,7 +3709,7 @@ class NoteStoreFindRelatedTesterHelper: public QObject Q_SIGNALS: void findRelatedRequestReady( RelatedResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onFindRelatedRequestReceived( @@ -3726,7 +3726,7 @@ public Q_SLOTS: Q_EMIT findRelatedRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3762,7 +3762,7 @@ class NoteStoreUpdateNoteIfUsnMatchesTesterHelper: public QObject Q_SIGNALS: void updateNoteIfUsnMatchesRequestReady( UpdateNoteIfUsnMatchesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateNoteIfUsnMatchesRequestReceived( @@ -3777,7 +3777,7 @@ public Q_SLOTS: Q_EMIT updateNoteIfUsnMatchesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3813,7 +3813,7 @@ class NoteStoreManageNotebookSharesTesterHelper: public QObject Q_SIGNALS: void manageNotebookSharesRequestReady( ManageNotebookSharesResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onManageNotebookSharesRequestReceived( @@ -3828,7 +3828,7 @@ public Q_SLOTS: Q_EMIT manageNotebookSharesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3864,7 +3864,7 @@ class NoteStoreGetNotebookSharesTesterHelper: public QObject Q_SIGNALS: void getNotebookSharesRequestReady( ShareRelationships value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetNotebookSharesRequestReceived( @@ -3879,7 +3879,7 @@ public Q_SLOTS: Q_EMIT getNotebookSharesRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -3904,7 +3904,7 @@ class NoteStoreGetSyncStateAsyncValueFetcher: public QObject {} SyncState m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -3912,7 +3912,7 @@ class NoteStoreGetSyncStateAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -3933,7 +3933,7 @@ class NoteStoreGetFilteredSyncChunkAsyncValueFetcher: public QObject {} SyncChunk m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -3941,7 +3941,7 @@ class NoteStoreGetFilteredSyncChunkAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -3962,7 +3962,7 @@ class NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher: public QObject {} SyncState m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -3970,7 +3970,7 @@ class NoteStoreGetLinkedNotebookSyncStateAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -3991,7 +3991,7 @@ class NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher: public QObject {} SyncChunk m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -3999,7 +3999,7 @@ class NoteStoreGetLinkedNotebookSyncChunkAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4020,7 +4020,7 @@ class NoteStoreListNotebooksAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4028,7 +4028,7 @@ class NoteStoreListNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -4049,7 +4049,7 @@ class NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4057,7 +4057,7 @@ class NoteStoreListAccessibleBusinessNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -4078,7 +4078,7 @@ class NoteStoreGetNotebookAsyncValueFetcher: public QObject {} Notebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4086,7 +4086,7 @@ class NoteStoreGetNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4107,7 +4107,7 @@ class NoteStoreGetDefaultNotebookAsyncValueFetcher: public QObject {} Notebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4115,7 +4115,7 @@ class NoteStoreGetDefaultNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4136,7 +4136,7 @@ class NoteStoreCreateNotebookAsyncValueFetcher: public QObject {} Notebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4144,7 +4144,7 @@ class NoteStoreCreateNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4165,7 +4165,7 @@ class NoteStoreUpdateNotebookAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4173,7 +4173,7 @@ class NoteStoreUpdateNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4194,7 +4194,7 @@ class NoteStoreExpungeNotebookAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4202,7 +4202,7 @@ class NoteStoreExpungeNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4223,7 +4223,7 @@ class NoteStoreListTagsAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4231,7 +4231,7 @@ class NoteStoreListTagsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -4252,7 +4252,7 @@ class NoteStoreListTagsByNotebookAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4260,7 +4260,7 @@ class NoteStoreListTagsByNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -4281,7 +4281,7 @@ class NoteStoreGetTagAsyncValueFetcher: public QObject {} Tag m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4289,7 +4289,7 @@ class NoteStoreGetTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4310,7 +4310,7 @@ class NoteStoreCreateTagAsyncValueFetcher: public QObject {} Tag m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4318,7 +4318,7 @@ class NoteStoreCreateTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4339,7 +4339,7 @@ class NoteStoreUpdateTagAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4347,7 +4347,7 @@ class NoteStoreUpdateTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4367,7 +4367,7 @@ class NoteStoreUntagAllAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4375,7 +4375,7 @@ class NoteStoreUntagAllAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -4396,7 +4396,7 @@ class NoteStoreExpungeTagAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4404,7 +4404,7 @@ class NoteStoreExpungeTagAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4425,7 +4425,7 @@ class NoteStoreListSearchesAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4433,7 +4433,7 @@ class NoteStoreListSearchesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -4454,7 +4454,7 @@ class NoteStoreGetSearchAsyncValueFetcher: public QObject {} SavedSearch m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4462,7 +4462,7 @@ class NoteStoreGetSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4483,7 +4483,7 @@ class NoteStoreCreateSearchAsyncValueFetcher: public QObject {} SavedSearch m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4491,7 +4491,7 @@ class NoteStoreCreateSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4512,7 +4512,7 @@ class NoteStoreUpdateSearchAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4520,7 +4520,7 @@ class NoteStoreUpdateSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4541,7 +4541,7 @@ class NoteStoreExpungeSearchAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4549,7 +4549,7 @@ class NoteStoreExpungeSearchAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4570,7 +4570,7 @@ class NoteStoreFindNoteOffsetAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4578,7 +4578,7 @@ class NoteStoreFindNoteOffsetAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4599,7 +4599,7 @@ class NoteStoreFindNotesMetadataAsyncValueFetcher: public QObject {} NotesMetadataList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4607,7 +4607,7 @@ class NoteStoreFindNotesMetadataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4628,7 +4628,7 @@ class NoteStoreFindNoteCountsAsyncValueFetcher: public QObject {} NoteCollectionCounts m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4636,7 +4636,7 @@ class NoteStoreFindNoteCountsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4657,7 +4657,7 @@ class NoteStoreGetNoteWithResultSpecAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4665,7 +4665,7 @@ class NoteStoreGetNoteWithResultSpecAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4686,7 +4686,7 @@ class NoteStoreGetNoteAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4694,7 +4694,7 @@ class NoteStoreGetNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4715,7 +4715,7 @@ class NoteStoreGetNoteApplicationDataAsyncValueFetcher: public QObject {} LazyMap m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4723,7 +4723,7 @@ class NoteStoreGetNoteApplicationDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4744,7 +4744,7 @@ class NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4752,7 +4752,7 @@ class NoteStoreGetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4773,7 +4773,7 @@ class NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4781,7 +4781,7 @@ class NoteStoreSetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4802,7 +4802,7 @@ class NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4810,7 +4810,7 @@ class NoteStoreUnsetNoteApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4831,7 +4831,7 @@ class NoteStoreGetNoteContentAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4839,7 +4839,7 @@ class NoteStoreGetNoteContentAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4860,7 +4860,7 @@ class NoteStoreGetNoteSearchTextAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4868,7 +4868,7 @@ class NoteStoreGetNoteSearchTextAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4889,7 +4889,7 @@ class NoteStoreGetResourceSearchTextAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4897,7 +4897,7 @@ class NoteStoreGetResourceSearchTextAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4918,7 +4918,7 @@ class NoteStoreGetNoteTagNamesAsyncValueFetcher: public QObject {} QStringList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4926,7 +4926,7 @@ class NoteStoreGetNoteTagNamesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4947,7 +4947,7 @@ class NoteStoreCreateNoteAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4955,7 +4955,7 @@ class NoteStoreCreateNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -4976,7 +4976,7 @@ class NoteStoreUpdateNoteAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -4984,7 +4984,7 @@ class NoteStoreUpdateNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5005,7 +5005,7 @@ class NoteStoreDeleteNoteAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5013,7 +5013,7 @@ class NoteStoreDeleteNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5034,7 +5034,7 @@ class NoteStoreExpungeNoteAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5042,7 +5042,7 @@ class NoteStoreExpungeNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5063,7 +5063,7 @@ class NoteStoreCopyNoteAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5071,7 +5071,7 @@ class NoteStoreCopyNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5092,7 +5092,7 @@ class NoteStoreListNoteVersionsAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5100,7 +5100,7 @@ class NoteStoreListNoteVersionsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -5121,7 +5121,7 @@ class NoteStoreGetNoteVersionAsyncValueFetcher: public QObject {} Note m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5129,7 +5129,7 @@ class NoteStoreGetNoteVersionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5150,7 +5150,7 @@ class NoteStoreGetResourceAsyncValueFetcher: public QObject {} Resource m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5158,7 +5158,7 @@ class NoteStoreGetResourceAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5179,7 +5179,7 @@ class NoteStoreGetResourceApplicationDataAsyncValueFetcher: public QObject {} LazyMap m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5187,7 +5187,7 @@ class NoteStoreGetResourceApplicationDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5208,7 +5208,7 @@ class NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5216,7 +5216,7 @@ class NoteStoreGetResourceApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5237,7 +5237,7 @@ class NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5245,7 +5245,7 @@ class NoteStoreSetResourceApplicationDataEntryAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5266,7 +5266,7 @@ class NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher: public QObjec {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5274,7 +5274,7 @@ class NoteStoreUnsetResourceApplicationDataEntryAsyncValueFetcher: public QObjec public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5295,7 +5295,7 @@ class NoteStoreUpdateResourceAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5303,7 +5303,7 @@ class NoteStoreUpdateResourceAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5324,7 +5324,7 @@ class NoteStoreGetResourceDataAsyncValueFetcher: public QObject {} QByteArray m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5332,7 +5332,7 @@ class NoteStoreGetResourceDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5353,7 +5353,7 @@ class NoteStoreGetResourceByHashAsyncValueFetcher: public QObject {} Resource m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5361,7 +5361,7 @@ class NoteStoreGetResourceByHashAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5382,7 +5382,7 @@ class NoteStoreGetResourceRecognitionAsyncValueFetcher: public QObject {} QByteArray m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5390,7 +5390,7 @@ class NoteStoreGetResourceRecognitionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5411,7 +5411,7 @@ class NoteStoreGetResourceAlternateDataAsyncValueFetcher: public QObject {} QByteArray m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5419,7 +5419,7 @@ class NoteStoreGetResourceAlternateDataAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5440,7 +5440,7 @@ class NoteStoreGetResourceAttributesAsyncValueFetcher: public QObject {} ResourceAttributes m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5448,7 +5448,7 @@ class NoteStoreGetResourceAttributesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5469,7 +5469,7 @@ class NoteStoreGetPublicNotebookAsyncValueFetcher: public QObject {} Notebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5477,7 +5477,7 @@ class NoteStoreGetPublicNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5498,7 +5498,7 @@ class NoteStoreShareNotebookAsyncValueFetcher: public QObject {} SharedNotebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5506,7 +5506,7 @@ class NoteStoreShareNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5527,7 +5527,7 @@ class NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher: public QObject {} CreateOrUpdateNotebookSharesResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5535,7 +5535,7 @@ class NoteStoreCreateOrUpdateNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5556,7 +5556,7 @@ class NoteStoreUpdateSharedNotebookAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5564,7 +5564,7 @@ class NoteStoreUpdateSharedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5585,7 +5585,7 @@ class NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher: public QObject {} Notebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5593,7 +5593,7 @@ class NoteStoreSetNotebookRecipientSettingsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5614,7 +5614,7 @@ class NoteStoreListSharedNotebooksAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5622,7 +5622,7 @@ class NoteStoreListSharedNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -5643,7 +5643,7 @@ class NoteStoreCreateLinkedNotebookAsyncValueFetcher: public QObject {} LinkedNotebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5651,7 +5651,7 @@ class NoteStoreCreateLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5672,7 +5672,7 @@ class NoteStoreUpdateLinkedNotebookAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5680,7 +5680,7 @@ class NoteStoreUpdateLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5701,7 +5701,7 @@ class NoteStoreListLinkedNotebooksAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5709,7 +5709,7 @@ class NoteStoreListLinkedNotebooksAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -5730,7 +5730,7 @@ class NoteStoreExpungeLinkedNotebookAsyncValueFetcher: public QObject {} qint32 m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5738,7 +5738,7 @@ class NoteStoreExpungeLinkedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5759,7 +5759,7 @@ class NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher: public QObject {} AuthenticationResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5767,7 +5767,7 @@ class NoteStoreAuthenticateToSharedNotebookAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5788,7 +5788,7 @@ class NoteStoreGetSharedNotebookByAuthAsyncValueFetcher: public QObject {} SharedNotebook m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5796,7 +5796,7 @@ class NoteStoreGetSharedNotebookByAuthAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5816,7 +5816,7 @@ class NoteStoreEmailNoteAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5824,7 +5824,7 @@ class NoteStoreEmailNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -5845,7 +5845,7 @@ class NoteStoreShareNoteAsyncValueFetcher: public QObject {} QString m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5853,7 +5853,7 @@ class NoteStoreShareNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5873,7 +5873,7 @@ class NoteStoreStopSharingNoteAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5881,7 +5881,7 @@ class NoteStoreStopSharingNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -5902,7 +5902,7 @@ class NoteStoreAuthenticateToSharedNoteAsyncValueFetcher: public QObject {} AuthenticationResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5910,7 +5910,7 @@ class NoteStoreAuthenticateToSharedNoteAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5931,7 +5931,7 @@ class NoteStoreFindRelatedAsyncValueFetcher: public QObject {} RelatedResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5939,7 +5939,7 @@ class NoteStoreFindRelatedAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5960,7 +5960,7 @@ class NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher: public QObject {} UpdateNoteIfUsnMatchesResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5968,7 +5968,7 @@ class NoteStoreUpdateNoteIfUsnMatchesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -5989,7 +5989,7 @@ class NoteStoreManageNotebookSharesAsyncValueFetcher: public QObject {} ManageNotebookSharesResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -5997,7 +5997,7 @@ class NoteStoreManageNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -6018,7 +6018,7 @@ class NoteStoreGetNotebookSharesAsyncValueFetcher: public QObject {} ShareRelationships m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -6026,7 +6026,7 @@ class NoteStoreGetNotebookSharesAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index d832bb39..f4fad6b7 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -50,7 +50,7 @@ class UserStoreCheckVersionTesterHelper: public QObject Q_SIGNALS: void checkVersionRequestReady( bool value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCheckVersionRequestReceived( @@ -69,7 +69,7 @@ public Q_SLOTS: Q_EMIT checkVersionRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -105,7 +105,7 @@ class UserStoreGetBootstrapInfoTesterHelper: public QObject Q_SIGNALS: void getBootstrapInfoRequestReady( BootstrapInfo value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetBootstrapInfoRequestReceived( @@ -120,7 +120,7 @@ public Q_SLOTS: Q_EMIT getBootstrapInfoRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -162,7 +162,7 @@ class UserStoreAuthenticateLongSessionTesterHelper: public QObject Q_SIGNALS: void authenticateLongSessionRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onAuthenticateLongSessionRequestReceived( @@ -189,7 +189,7 @@ public Q_SLOTS: Q_EMIT authenticateLongSessionRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -227,7 +227,7 @@ class UserStoreCompleteTwoFactorAuthenticationTesterHelper: public QObject Q_SIGNALS: void completeTwoFactorAuthenticationRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onCompleteTwoFactorAuthenticationRequestReceived( @@ -246,7 +246,7 @@ public Q_SLOTS: Q_EMIT completeTwoFactorAuthenticationRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -280,7 +280,7 @@ class UserStoreRevokeLongSessionTesterHelper: public QObject Q_SIGNALS: void revokeLongSessionRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onRevokeLongSessionRequestReceived( @@ -292,7 +292,7 @@ public Q_SLOTS: ctx); Q_EMIT revokeLongSessionRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -326,7 +326,7 @@ class UserStoreAuthenticateToBusinessTesterHelper: public QObject Q_SIGNALS: void authenticateToBusinessRequestReady( AuthenticationResult value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onAuthenticateToBusinessRequestReceived( @@ -339,7 +339,7 @@ public Q_SLOTS: Q_EMIT authenticateToBusinessRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -374,7 +374,7 @@ class UserStoreGetUserTesterHelper: public QObject Q_SIGNALS: void getUserRequestReady( User value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetUserRequestReceived( @@ -387,7 +387,7 @@ public Q_SLOTS: Q_EMIT getUserRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -423,7 +423,7 @@ class UserStoreGetPublicUserInfoTesterHelper: public QObject Q_SIGNALS: void getPublicUserInfoRequestReady( PublicUserInfo value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetPublicUserInfoRequestReceived( @@ -438,7 +438,7 @@ public Q_SLOTS: Q_EMIT getPublicUserInfoRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -473,7 +473,7 @@ class UserStoreGetUserUrlsTesterHelper: public QObject Q_SIGNALS: void getUserUrlsRequestReady( UserUrls value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetUserUrlsRequestReceived( @@ -486,7 +486,7 @@ public Q_SLOTS: Q_EMIT getUserUrlsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -521,7 +521,7 @@ class UserStoreInviteToBusinessTesterHelper: public QObject Q_SIGNALS: void inviteToBusinessRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onInviteToBusinessRequestReceived( @@ -535,7 +535,7 @@ public Q_SLOTS: ctx); Q_EMIT inviteToBusinessRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -569,7 +569,7 @@ class UserStoreRemoveFromBusinessTesterHelper: public QObject Q_SIGNALS: void removeFromBusinessRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onRemoveFromBusinessRequestReceived( @@ -583,7 +583,7 @@ public Q_SLOTS: ctx); Q_EMIT removeFromBusinessRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -618,7 +618,7 @@ class UserStoreUpdateBusinessUserIdentifierTesterHelper: public QObject Q_SIGNALS: void updateBusinessUserIdentifierRequestReady( - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onUpdateBusinessUserIdentifierRequestReceived( @@ -634,7 +634,7 @@ public Q_SLOTS: ctx); Q_EMIT updateBusinessUserIdentifierRequestReady( - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -668,7 +668,7 @@ class UserStoreListBusinessUsersTesterHelper: public QObject Q_SIGNALS: void listBusinessUsersRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListBusinessUsersRequestReceived( @@ -681,7 +681,7 @@ public Q_SLOTS: Q_EMIT listBusinessUsersRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -717,7 +717,7 @@ class UserStoreListBusinessInvitationsTesterHelper: public QObject Q_SIGNALS: void listBusinessInvitationsRequestReady( QList value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onListBusinessInvitationsRequestReceived( @@ -732,7 +732,7 @@ public Q_SLOTS: Q_EMIT listBusinessInvitationsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -768,7 +768,7 @@ class UserStoreGetAccountLimitsTesterHelper: public QObject Q_SIGNALS: void getAccountLimitsRequestReady( AccountLimits value, - QSharedPointer exceptionData); + EverCloudExceptionDataPtr exceptionData); public Q_SLOTS: void onGetAccountLimitsRequestReceived( @@ -783,7 +783,7 @@ public Q_SLOTS: Q_EMIT getAccountLimitsRequestReady( v, - QSharedPointer()); + EverCloudExceptionDataPtr()); } catch(const EverCloudException & e) { @@ -808,7 +808,7 @@ class UserStoreCheckVersionAsyncValueFetcher: public QObject {} bool m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -816,7 +816,7 @@ class UserStoreCheckVersionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -837,7 +837,7 @@ class UserStoreGetBootstrapInfoAsyncValueFetcher: public QObject {} BootstrapInfo m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -845,7 +845,7 @@ class UserStoreGetBootstrapInfoAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -866,7 +866,7 @@ class UserStoreAuthenticateLongSessionAsyncValueFetcher: public QObject {} AuthenticationResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -874,7 +874,7 @@ class UserStoreAuthenticateLongSessionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -895,7 +895,7 @@ class UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher: public QObject {} AuthenticationResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -903,7 +903,7 @@ class UserStoreCompleteTwoFactorAuthenticationAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -923,7 +923,7 @@ class UserStoreRevokeLongSessionAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -931,7 +931,7 @@ class UserStoreRevokeLongSessionAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -952,7 +952,7 @@ class UserStoreAuthenticateToBusinessAsyncValueFetcher: public QObject {} AuthenticationResult m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -960,7 +960,7 @@ class UserStoreAuthenticateToBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -981,7 +981,7 @@ class UserStoreGetUserAsyncValueFetcher: public QObject {} User m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -989,7 +989,7 @@ class UserStoreGetUserAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -1010,7 +1010,7 @@ class UserStoreGetPublicUserInfoAsyncValueFetcher: public QObject {} PublicUserInfo m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1018,7 +1018,7 @@ class UserStoreGetPublicUserInfoAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -1039,7 +1039,7 @@ class UserStoreGetUserUrlsAsyncValueFetcher: public QObject {} UserUrls m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1047,7 +1047,7 @@ class UserStoreGetUserUrlsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); @@ -1067,7 +1067,7 @@ class UserStoreInviteToBusinessAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1075,7 +1075,7 @@ class UserStoreInviteToBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -1095,7 +1095,7 @@ class UserStoreRemoveFromBusinessAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1103,7 +1103,7 @@ class UserStoreRemoveFromBusinessAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -1123,7 +1123,7 @@ class UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher: public QObject QObject(parent) {} - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1131,7 +1131,7 @@ class UserStoreUpdateBusinessUserIdentifierAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { Q_UNUSED(value) @@ -1152,7 +1152,7 @@ class UserStoreListBusinessUsersAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1160,7 +1160,7 @@ class UserStoreListBusinessUsersAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -1181,7 +1181,7 @@ class UserStoreListBusinessInvitationsAsyncValueFetcher: public QObject {} QList m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1189,7 +1189,7 @@ class UserStoreListBusinessInvitationsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast>(value); @@ -1210,7 +1210,7 @@ class UserStoreGetAccountLimitsAsyncValueFetcher: public QObject {} AccountLimits m_value; - QSharedPointer m_exceptionData; + EverCloudExceptionDataPtr m_exceptionData; Q_SIGNALS: void finished(); @@ -1218,7 +1218,7 @@ class UserStoreGetAccountLimitsAsyncValueFetcher: public QObject public Q_SLOTS: void onFinished( QVariant value, - QSharedPointer data, + EverCloudExceptionDataPtr data, IRequestContextPtr ctx) { m_value = qvariant_cast(value); From f6030d40d20e0b9203128fcbffc459c0e32c12fb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 12 Dec 2019 07:08:26 +0300 Subject: [PATCH 125/188] Fix missing propagation of network error type --- QEverCloud/src/Http.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index e69bb5c2..bc5c0937 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -126,6 +126,7 @@ void ReplyFetcher::setError( QNetworkReply::NetworkError errorType, QString errorText) { m_ticker->stop(); + m_errorType = errorType; m_errorText = errorText; QObject::disconnect(m_reply.get()); emit replyFetched(this); From 91ba1a677d8a9da214b8f83193efbd57c11a825f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 12 Dec 2019 07:50:58 +0300 Subject: [PATCH 126/188] Don't retry EDAMSystemException of RATE_LIMIT_REACHED type + rethrow exceptions in DurableService for synchronous service calls --- QEverCloud/src/DurableService.cpp | 14 ++++---- QEverCloud/src/tests/TestDurableService.cpp | 36 +++++++++++++++++---- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index dc064eb9..184bfaa2 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -93,9 +93,9 @@ struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy return false; } } - catch(const EDAMSystemException &) + catch(const EDAMSystemException & e) { - return true; + return e.errorCode != EDAMErrorCode::RATE_LIMIT_REACHED; } catch(...) { @@ -184,13 +184,13 @@ DurableService::SyncResult DurableService::executeSyncRequest( if (!m_retryPolicy->shouldRetry(result.second)) { QEC_WARNING("durable_service", "Error is not retriable"); - return result; + result.second->throwException(); } --state.m_retryCount; if (!state.m_retryCount) { QEC_WARNING("durable_service", "No retry attempts left"); - break; + result.second->throwException(); } if (ctx->increaseRequestTimeoutExponentially()) @@ -212,10 +212,8 @@ DurableService::SyncResult DurableService::executeSyncRequest( continue; } - if (!result.second) { - QEC_DEBUG("durable_service", "Successfully executed sync " - << syncRequest.m_name << " request"); - } + QEC_DEBUG("durable_service", "Successfully executed sync " + << syncRequest.m_name << " request"); break; } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index bda25213..a4a3cfb8 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -65,9 +65,15 @@ void DurableServiceTester::shouldExecuteSyncServiceCall() return {value, {}}; }); - auto result = durableService->executeSyncRequest( - std::move(request), - newRequestContext()); + IDurableService::SyncResult result; + try { + result = durableService->executeSyncRequest( + std::move(request), + newRequestContext()); + } + catch(const EverCloudException & e) { + result.second = e.exceptionData(); + } QVERIFY(serviceCallDetected); QVERIFY(result.first == value); @@ -144,7 +150,13 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() return {value, {}}; }); - auto result = durableService->executeSyncRequest(std::move(request), ctx); + IDurableService::SyncResult result; + try { + result = durableService->executeSyncRequest(std::move(request), ctx); + } + catch(const EverCloudException & e) { + result.second = e.exceptionData(); + } QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(result.first == value); @@ -238,7 +250,13 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() return {{}, data}; }); - auto result = durableService->executeSyncRequest(std::move(request), ctx); + IDurableService::SyncResult result; + try { + result = durableService->executeSyncRequest(std::move(request), ctx); + } + catch(const EverCloudException & e) { + result.second = e.exceptionData(); + } QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!result.first.isValid()); @@ -347,7 +365,13 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError return {{}, data}; }); - auto result = durableService->executeSyncRequest(std::move(request), ctx); + IDurableService::SyncResult result; + try { + result = durableService->executeSyncRequest(std::move(request), ctx); + } + catch(const EverCloudException & e) { + result.second = e.exceptionData(); + } QVERIFY(serviceCallCounter == 1); QVERIFY(!result.first.isValid()); From abf82ed35176fc53347be774317bf034e5598a07 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 12 Dec 2019 20:50:51 +0300 Subject: [PATCH 127/188] Revert "Don't retry EDAMSystemException of RATE_LIMIT_REACHED type + rethrow exceptions in DurableService for synchronous service calls" This reverts commit 91ba1a677d8a9da214b8f83193efbd57c11a825f. --- QEverCloud/src/DurableService.cpp | 14 ++++---- QEverCloud/src/tests/TestDurableService.cpp | 36 ++++----------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index 184bfaa2..dc064eb9 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -93,9 +93,9 @@ struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy return false; } } - catch(const EDAMSystemException & e) + catch(const EDAMSystemException &) { - return e.errorCode != EDAMErrorCode::RATE_LIMIT_REACHED; + return true; } catch(...) { @@ -184,13 +184,13 @@ DurableService::SyncResult DurableService::executeSyncRequest( if (!m_retryPolicy->shouldRetry(result.second)) { QEC_WARNING("durable_service", "Error is not retriable"); - result.second->throwException(); + return result; } --state.m_retryCount; if (!state.m_retryCount) { QEC_WARNING("durable_service", "No retry attempts left"); - result.second->throwException(); + break; } if (ctx->increaseRequestTimeoutExponentially()) @@ -212,8 +212,10 @@ DurableService::SyncResult DurableService::executeSyncRequest( continue; } - QEC_DEBUG("durable_service", "Successfully executed sync " - << syncRequest.m_name << " request"); + if (!result.second) { + QEC_DEBUG("durable_service", "Successfully executed sync " + << syncRequest.m_name << " request"); + } break; } diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index a4a3cfb8..bda25213 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -65,15 +65,9 @@ void DurableServiceTester::shouldExecuteSyncServiceCall() return {value, {}}; }); - IDurableService::SyncResult result; - try { - result = durableService->executeSyncRequest( - std::move(request), - newRequestContext()); - } - catch(const EverCloudException & e) { - result.second = e.exceptionData(); - } + auto result = durableService->executeSyncRequest( + std::move(request), + newRequestContext()); QVERIFY(serviceCallDetected); QVERIFY(result.first == value); @@ -150,13 +144,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() return {value, {}}; }); - IDurableService::SyncResult result; - try { - result = durableService->executeSyncRequest(std::move(request), ctx); - } - catch(const EverCloudException & e) { - result.second = e.exceptionData(); - } + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(result.first == value); @@ -250,13 +238,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() return {{}, data}; }); - IDurableService::SyncResult result; - try { - result = durableService->executeSyncRequest(std::move(request), ctx); - } - catch(const EverCloudException & e) { - result.second = e.exceptionData(); - } + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!result.first.isValid()); @@ -365,13 +347,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError return {{}, data}; }); - IDurableService::SyncResult result; - try { - result = durableService->executeSyncRequest(std::move(request), ctx); - } - catch(const EverCloudException & e) { - result.second = e.exceptionData(); - } + auto result = durableService->executeSyncRequest(std::move(request), ctx); QVERIFY(serviceCallCounter == 1); QVERIFY(!result.first.isValid()); From 6ea0fd780683bba936698663f59ff06d4501a3d4 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 13 Dec 2019 07:07:00 +0300 Subject: [PATCH 128/188] Add null retry policy --- QEverCloud/headers/DurableService.h | 2 ++ QEverCloud/src/DurableService.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/QEverCloud/headers/DurableService.h b/QEverCloud/headers/DurableService.h index 37bfede7..6d1dca7b 100644 --- a/QEverCloud/headers/DurableService.h +++ b/QEverCloud/headers/DurableService.h @@ -84,6 +84,8 @@ using IDurableServicePtr = std::shared_ptr; QEVERCLOUD_EXPORT IRetryPolicyPtr newRetryPolicy(); +QEVERCLOUD_EXPORT IRetryPolicyPtr nullRetryPolicy(); + QEVERCLOUD_EXPORT IDurableServicePtr newDurableService( IRetryPolicyPtr = {}, IRequestContextPtr = {}); diff --git a/QEverCloud/src/DurableService.cpp b/QEverCloud/src/DurableService.cpp index dc064eb9..2ce96d26 100644 --- a/QEverCloud/src/DurableService.cpp +++ b/QEverCloud/src/DurableService.cpp @@ -105,6 +105,18 @@ struct Q_DECL_HIDDEN RetryPolicy: public IRetryPolicy } }; +//////////////////////////////////////////////////////////////////////////////// + +struct Q_DECL_HIDDEN NullRetryPolicy: public IRetryPolicy +{ + virtual bool shouldRetry( + const EverCloudExceptionDataPtr & exceptionData) override + { + Q_UNUSED(exceptionData) + return false; + } +}; + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -318,6 +330,11 @@ IRetryPolicyPtr newRetryPolicy() return std::make_shared(); } +IRetryPolicyPtr nullRetryPolicy() +{ + return std::make_shared(); +} + IDurableServicePtr newDurableService( IRetryPolicyPtr retryPolicy, IRequestContextPtr ctx) From 669299eea6e44e4740f861814c38ccaf1e86514e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 13 Dec 2019 07:09:20 +0300 Subject: [PATCH 129/188] Update generated code --- QEverCloud/headers/generated/Services.h | 9 +- QEverCloud/src/generated/Services.cpp | 418 +- .../src/tests/generated/TestNoteStore.cpp | 3620 +++++++++++++---- .../src/tests/generated/TestUserStore.cpp | 580 ++- 4 files changed, 3777 insertions(+), 850 deletions(-) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 8852c81d..9409de73 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -15,6 +15,7 @@ #include "../Export.h" #include "../AsyncResult.h" +#include "../DurableService.h" #include "../Optional.h" #include "../RequestContext.h" #include "Constants.h" @@ -3312,13 +3313,13 @@ using IUserStorePtr = std::shared_ptr; QEVERCLOUD_EXPORT INoteStore * newNoteStore( QString noteStoreUrl = {}, IRequestContextPtr ctx = {}, - QObject * parent = nullptr); - + QObject * parent = nullptr, + IRetryPolicyPtr retryPolicy = {}); QEVERCLOUD_EXPORT IUserStore * newUserStore( QString userStoreUrl = {}, IRequestContextPtr ctx = {}, - QObject * parent = nullptr); - + QObject * parent = nullptr, + IRetryPolicyPtr retryPolicy = {}); } // namespace qevercloud Q_DECLARE_METATYPE(QList) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 03abcef5..2513950b 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -18853,15 +18853,24 @@ class Q_DECL_HIDDEN DurableNoteStore: public INoteStore explicit DurableNoteStore( INoteStorePtr service, IRequestContextPtr ctx = {}, + IRetryPolicyPtr retryPolicy = newRetryPolicy(), QObject * parent = nullptr) : INoteStore(parent), m_service(std::move(service)), - m_durableService(newDurableService(newRetryPolicy(), ctx)), + m_durableService(newDurableService(retryPolicy, ctx)), m_ctx(std::move(ctx)) { if (!m_ctx) { m_ctx = newRequestContext(); } + + m_service->setParent(this); + } + + ~DurableNoteStore() + { + // Don't interfere with std::shared_ptr's lifetime tracking + m_service->setParent(nullptr); } virtual void setNoteStoreUrl(QString noteStoreUrl) override @@ -19550,15 +19559,24 @@ class Q_DECL_HIDDEN DurableUserStore: public IUserStore explicit DurableUserStore( IUserStorePtr service, IRequestContextPtr ctx = {}, + IRetryPolicyPtr retryPolicy = newRetryPolicy(), QObject * parent = nullptr) : IUserStore(parent), m_service(std::move(service)), - m_durableService(newDurableService(newRetryPolicy(), ctx)), + m_durableService(newDurableService(retryPolicy, ctx)), m_ctx(std::move(ctx)) { if (!m_ctx) { m_ctx = newRequestContext(); } + + m_service->setParent(this); + } + + ~DurableUserStore() + { + // Don't interfere with std::shared_ptr's lifetime tracking + m_service->setParent(nullptr); } virtual void setUserStoreUrl(QString userStoreUrl) override @@ -19734,6 +19752,10 @@ SyncState DurableNoteStore::getSyncState( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -19798,6 +19820,10 @@ SyncChunk DurableNoteStore::getFilteredSyncChunk( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -19870,6 +19896,10 @@ SyncState DurableNoteStore::getLinkedNotebookSyncState( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -19945,6 +19975,10 @@ SyncChunk DurableNoteStore::getLinkedNotebookSyncChunk( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20012,6 +20046,10 @@ QList DurableNoteStore::listNotebooks( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -20062,6 +20100,10 @@ QList DurableNoteStore::listAccessibleBusinessNotebooks( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -20120,6 +20162,10 @@ Notebook DurableNoteStore::getNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20178,6 +20224,10 @@ Notebook DurableNoteStore::getDefaultNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20236,6 +20286,10 @@ Notebook DurableNoteStore::createNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20302,6 +20356,10 @@ qint32 DurableNoteStore::updateNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20368,6 +20426,10 @@ qint32 DurableNoteStore::expungeNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20426,6 +20488,10 @@ QList DurableNoteStore::listTags( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -20484,6 +20550,10 @@ QList DurableNoteStore::listTagsByNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -20550,6 +20620,10 @@ Tag DurableNoteStore::getTag( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20616,6 +20690,10 @@ Tag DurableNoteStore::createTag( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20682,6 +20760,10 @@ qint32 DurableNoteStore::updateTag( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20748,6 +20830,10 @@ void DurableNoteStore::untagAll( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -20814,6 +20900,10 @@ qint32 DurableNoteStore::expungeTag( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20872,6 +20962,10 @@ QList DurableNoteStore::listSearches( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -20930,6 +21024,10 @@ SavedSearch DurableNoteStore::getSearch( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -20996,6 +21094,10 @@ SavedSearch DurableNoteStore::createSearch( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21062,6 +21164,10 @@ qint32 DurableNoteStore::updateSearch( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21128,6 +21234,10 @@ qint32 DurableNoteStore::expungeSearch( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21197,6 +21307,10 @@ qint32 DurableNoteStore::findNoteOffset( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21275,6 +21389,10 @@ NotesMetadataList DurableNoteStore::findNotesMetadata( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21353,6 +21471,10 @@ NoteCollectionCounts DurableNoteStore::findNoteCounts( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21425,6 +21547,10 @@ Note DurableNoteStore::getNoteWithResultSpec( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21506,6 +21632,10 @@ Note DurableNoteStore::getNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21584,6 +21714,10 @@ LazyMap DurableNoteStore::getNoteApplicationData( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21653,6 +21787,10 @@ QString DurableNoteStore::getNoteApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -21728,6 +21866,10 @@ qint32 DurableNoteStore::setNoteApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21803,6 +21945,10 @@ qint32 DurableNoteStore::unsetNoteApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -21872,6 +22018,10 @@ QString DurableNoteStore::getNoteContent( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -21944,6 +22094,10 @@ QString DurableNoteStore::getNoteSearchText( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -22016,6 +22170,10 @@ QString DurableNoteStore::getResourceSearchText( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -22082,6 +22240,10 @@ QStringList DurableNoteStore::getNoteTagNames( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toStringList(); } @@ -22148,6 +22310,10 @@ Note DurableNoteStore::createNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22214,6 +22380,10 @@ Note DurableNoteStore::updateNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22280,6 +22450,10 @@ qint32 DurableNoteStore::deleteNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22346,6 +22520,10 @@ qint32 DurableNoteStore::expungeNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22415,6 +22593,10 @@ Note DurableNoteStore::copyNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22484,6 +22666,10 @@ QList DurableNoteStore::listNoteVersions( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -22562,6 +22748,10 @@ Note DurableNoteStore::getNoteVersion( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22652,6 +22842,10 @@ Resource DurableNoteStore::getResource( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22730,6 +22924,10 @@ LazyMap DurableNoteStore::getResourceApplicationData( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22799,6 +22997,10 @@ QString DurableNoteStore::getResourceApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -22874,6 +23076,10 @@ qint32 DurableNoteStore::setResourceApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -22949,6 +23155,10 @@ qint32 DurableNoteStore::unsetResourceApplicationDataEntry( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23018,6 +23228,10 @@ qint32 DurableNoteStore::updateResource( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23084,6 +23298,10 @@ QByteArray DurableNoteStore::getResourceData( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toByteArray(); } @@ -23162,6 +23380,10 @@ Resource DurableNoteStore::getResourceByHash( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23240,6 +23462,10 @@ QByteArray DurableNoteStore::getResourceRecognition( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toByteArray(); } @@ -23306,6 +23532,10 @@ QByteArray DurableNoteStore::getResourceAlternateData( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toByteArray(); } @@ -23372,6 +23602,10 @@ ResourceAttributes DurableNoteStore::getResourceAttributes( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23441,6 +23675,10 @@ Notebook DurableNoteStore::getPublicNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23513,6 +23751,10 @@ SharedNotebook DurableNoteStore::shareNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23582,6 +23824,10 @@ CreateOrUpdateNotebookSharesResult DurableNoteStore::createOrUpdateNotebookShare auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23648,6 +23894,10 @@ qint32 DurableNoteStore::updateSharedNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23717,6 +23967,10 @@ Notebook DurableNoteStore::setNotebookRecipientSettings( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23778,6 +24032,10 @@ QList DurableNoteStore::listSharedNotebooks( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -23836,6 +24094,10 @@ LinkedNotebook DurableNoteStore::createLinkedNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23902,6 +24164,10 @@ qint32 DurableNoteStore::updateLinkedNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -23960,6 +24226,10 @@ QList DurableNoteStore::listLinkedNotebooks( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -24018,6 +24288,10 @@ qint32 DurableNoteStore::expungeLinkedNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24084,6 +24358,10 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNotebook( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24142,6 +24420,10 @@ SharedNotebook DurableNoteStore::getSharedNotebookByAuth( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24200,6 +24482,10 @@ void DurableNoteStore::emailNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -24266,6 +24552,10 @@ QString DurableNoteStore::shareNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toString(); } @@ -24332,6 +24622,10 @@ void DurableNoteStore::stopSharingNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -24401,6 +24695,10 @@ AuthenticationResult DurableNoteStore::authenticateToSharedNote( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24473,6 +24771,10 @@ RelatedResult DurableNoteStore::findRelated( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24542,6 +24844,10 @@ UpdateNoteIfUsnMatchesResult DurableNoteStore::updateNoteIfUsnMatches( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24608,6 +24914,10 @@ ManageNotebookSharesResult DurableNoteStore::manageNotebookShares( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24674,6 +24984,10 @@ ShareRelationships DurableNoteStore::getNotebookShares( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24748,6 +25062,10 @@ bool DurableUserStore::checkVersion( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.toBool(); } @@ -24820,6 +25138,10 @@ BootstrapInfo DurableUserStore::getBootstrapInfo( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24901,6 +25223,10 @@ AuthenticationResult DurableUserStore::authenticateLongSession( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -24987,6 +25313,10 @@ AuthenticationResult DurableUserStore::completeTwoFactorAuthentication( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25050,6 +25380,10 @@ void DurableUserStore::revokeLongSession( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -25100,6 +25434,10 @@ AuthenticationResult DurableUserStore::authenticateToBusiness( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25150,6 +25488,10 @@ User DurableUserStore::getUser( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25208,6 +25550,10 @@ PublicUserInfo DurableUserStore::getPublicUserInfo( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25266,6 +25612,10 @@ UserUrls DurableUserStore::getUserUrls( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25324,6 +25674,10 @@ void DurableUserStore::inviteToBusiness( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -25390,6 +25744,10 @@ void DurableUserStore::removeFromBusiness( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -25459,6 +25817,10 @@ void DurableUserStore::updateBusinessUserIdentifier( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return; } @@ -25520,6 +25882,10 @@ QList DurableUserStore::listBusinessUsers( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -25578,6 +25944,10 @@ QList DurableUserStore::listBusinessInvitations( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value>(); } @@ -25644,6 +26014,10 @@ AccountLimits DurableUserStore::getAccountLimits( auto result = m_durableService->executeSyncRequest( std::move(request), ctx); + if (result.second) { + result.second->throwException(); + } + return result.first.value(); } @@ -25684,17 +26058,49 @@ AsyncResult * DurableUserStore::getAccountLimitsAsync( INoteStore * newNoteStore( QString noteStoreUrl, IRequestContextPtr ctx, - QObject * parent) + QObject * parent, + IRetryPolicyPtr retryPolicy) { - return new NoteStore(noteStoreUrl, ctx, parent); + if (ctx && ctx->maxRequestRetryCount() == 0) + { + return new NoteStore(noteStoreUrl, ctx); + } + else + { + if (!retryPolicy) { + retryPolicy = newRetryPolicy(); + } + + return new DurableNoteStore( + std::make_shared(noteStoreUrl, ctx), + ctx, + retryPolicy, + parent); + } } IUserStore * newUserStore( QString userStoreUrl, IRequestContextPtr ctx, - QObject * parent) + QObject * parent, + IRetryPolicyPtr retryPolicy) { - return new UserStore(userStoreUrl, ctx, parent); + if (ctx && ctx->maxRequestRetryCount() == 0) + { + return new UserStore(userStoreUrl, ctx); + } + else + { + if (!retryPolicy) { + retryPolicy = newRetryPolicy(); + } + + return new DurableUserStore( + std::make_shared(userStoreUrl, ctx), + ctx, + retryPolicy, + parent); + } } } // namespace qevercloud diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 1d0787aa..c360c09b 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -6107,7 +6107,10 @@ void NoteStoreTester::shouldExecuteGetSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SyncState res = noteStore->getSyncState( ctx); QVERIFY(res == response); @@ -6184,7 +6187,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6273,7 +6279,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6361,7 +6370,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6447,7 +6459,10 @@ void NoteStoreTester::shouldExecuteGetSyncStateAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getSyncStateAsync( ctx); @@ -6542,7 +6557,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6649,7 +6667,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncStateAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6755,7 +6776,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncStateAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6870,7 +6894,10 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SyncChunk res = noteStore->getFilteredSyncChunk( afterUSN, maxEntries, @@ -6959,7 +6986,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7060,7 +7090,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7160,7 +7193,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7258,7 +7294,10 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunkAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getFilteredSyncChunkAsync( afterUSN, maxEntries, @@ -7365,7 +7404,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7484,7 +7526,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7602,7 +7647,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7714,7 +7762,10 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SyncState res = noteStore->getLinkedNotebookSyncState( linkedNotebook, ctx); @@ -7795,7 +7846,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7888,7 +7942,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7980,7 +8037,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8072,7 +8132,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8162,7 +8225,10 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncStateAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getLinkedNotebookSyncStateAsync( linkedNotebook, ctx); @@ -8261,7 +8327,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8372,7 +8441,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8482,7 +8554,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8592,7 +8667,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8711,7 +8789,10 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SyncChunk res = noteStore->getLinkedNotebookSyncChunk( linkedNotebook, afterUSN, @@ -8804,7 +8885,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8909,7 +8993,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9013,7 +9100,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9117,7 +9207,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9219,7 +9312,10 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunkAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getLinkedNotebookSyncChunkAsync( linkedNotebook, afterUSN, @@ -9330,7 +9426,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9453,7 +9552,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9575,7 +9677,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9697,7 +9802,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9810,7 +9918,10 @@ void NoteStoreTester::shouldExecuteListNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listNotebooks( ctx); QVERIFY(res == response); @@ -9887,7 +9998,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9976,7 +10090,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10064,7 +10181,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10153,7 +10273,10 @@ void NoteStoreTester::shouldExecuteListNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listNotebooksAsync( ctx); @@ -10248,7 +10371,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10355,7 +10481,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10461,7 +10590,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10570,7 +10702,10 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listAccessibleBusinessNotebooks( ctx); QVERIFY(res == response); @@ -10647,7 +10782,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10736,7 +10874,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10824,7 +10965,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10913,7 +11057,10 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listAccessibleBusinessNotebooksAsync( ctx); @@ -11008,7 +11155,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11115,7 +11265,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11221,7 +11374,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11330,7 +11486,10 @@ void NoteStoreTester::shouldExecuteGetNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Notebook res = noteStore->getNotebook( guid, ctx); @@ -11411,7 +11570,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11504,7 +11666,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11596,7 +11761,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11688,7 +11856,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11778,7 +11949,10 @@ void NoteStoreTester::shouldExecuteGetNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNotebookAsync( guid, ctx); @@ -11877,7 +12051,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11988,7 +12165,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12098,7 +12278,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12208,7 +12391,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12315,7 +12501,10 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Notebook res = noteStore->getDefaultNotebook( ctx); QVERIFY(res == response); @@ -12392,7 +12581,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12481,7 +12673,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12569,7 +12764,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12655,7 +12853,10 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getDefaultNotebookAsync( ctx); @@ -12750,7 +12951,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12857,7 +13061,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12963,7 +13170,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13072,7 +13282,10 @@ void NoteStoreTester::shouldExecuteCreateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Notebook res = noteStore->createNotebook( notebook, ctx); @@ -13153,7 +13366,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13246,7 +13462,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13338,7 +13557,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13430,7 +13652,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13520,7 +13745,10 @@ void NoteStoreTester::shouldExecuteCreateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createNotebookAsync( notebook, ctx); @@ -13619,7 +13847,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13730,7 +13961,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13840,7 +14074,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -13950,7 +14187,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14060,7 +14300,10 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateNotebook( notebook, ctx); @@ -14141,7 +14384,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14234,7 +14480,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14326,7 +14575,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14418,7 +14670,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14508,7 +14763,10 @@ void NoteStoreTester::shouldExecuteUpdateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateNotebookAsync( notebook, ctx); @@ -14607,7 +14865,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14718,7 +14979,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14828,7 +15092,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -14938,7 +15205,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15048,7 +15318,10 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->expungeNotebook( guid, ctx); @@ -15129,7 +15402,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15222,7 +15498,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15314,7 +15593,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15406,7 +15688,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15496,7 +15781,10 @@ void NoteStoreTester::shouldExecuteExpungeNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->expungeNotebookAsync( guid, ctx); @@ -15595,7 +15883,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15706,7 +15997,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15816,7 +16110,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -15926,7 +16223,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16036,7 +16336,10 @@ void NoteStoreTester::shouldExecuteListTags() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listTags( ctx); QVERIFY(res == response); @@ -16113,7 +16416,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16202,7 +16508,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16290,7 +16599,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16379,7 +16691,10 @@ void NoteStoreTester::shouldExecuteListTagsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listTagsAsync( ctx); @@ -16474,7 +16789,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16581,7 +16899,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16687,7 +17008,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16799,7 +17123,10 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listTagsByNotebook( notebookGuid, ctx); @@ -16880,7 +17207,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -16973,7 +17303,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17065,7 +17398,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17157,7 +17493,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17250,7 +17589,10 @@ void NoteStoreTester::shouldExecuteListTagsByNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listTagsByNotebookAsync( notebookGuid, ctx); @@ -17349,7 +17691,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17460,7 +17805,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17570,7 +17918,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17680,7 +18031,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17790,7 +18144,10 @@ void NoteStoreTester::shouldExecuteGetTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Tag res = noteStore->getTag( guid, ctx); @@ -17871,7 +18228,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -17964,7 +18324,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18056,7 +18419,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18148,7 +18514,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18238,7 +18607,10 @@ void NoteStoreTester::shouldExecuteGetTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getTagAsync( guid, ctx); @@ -18337,7 +18709,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18448,7 +18823,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18558,7 +18936,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18668,7 +19049,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18778,7 +19162,10 @@ void NoteStoreTester::shouldExecuteCreateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Tag res = noteStore->createTag( tag, ctx); @@ -18859,7 +19246,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -18952,7 +19342,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19044,7 +19437,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19136,7 +19532,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19226,7 +19625,10 @@ void NoteStoreTester::shouldExecuteCreateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createTagAsync( tag, ctx); @@ -19325,7 +19727,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19436,7 +19841,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19546,7 +19954,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19656,7 +20067,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19766,7 +20180,10 @@ void NoteStoreTester::shouldExecuteUpdateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateTag( tag, ctx); @@ -19847,7 +20264,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -19940,7 +20360,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20032,7 +20455,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20124,7 +20550,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20214,7 +20643,10 @@ void NoteStoreTester::shouldExecuteUpdateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateTagAsync( tag, ctx); @@ -20313,7 +20745,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20424,7 +20859,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20534,7 +20972,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20644,7 +21085,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20752,7 +21196,10 @@ void NoteStoreTester::shouldExecuteUntagAll() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); noteStore->untagAll( guid, ctx); @@ -20832,7 +21279,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -20924,7 +21374,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21015,7 +21468,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21106,7 +21562,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21193,7 +21652,10 @@ void NoteStoreTester::shouldExecuteUntagAllAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->untagAllAsync( guid, ctx); @@ -21291,7 +21753,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21402,7 +21867,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAllAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21512,7 +21980,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAllAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21622,7 +22093,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAllAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21732,7 +22206,10 @@ void NoteStoreTester::shouldExecuteExpungeTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->expungeTag( guid, ctx); @@ -21813,7 +22290,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21906,7 +22386,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -21998,7 +22481,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22090,7 +22576,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22180,7 +22669,10 @@ void NoteStoreTester::shouldExecuteExpungeTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->expungeTagAsync( guid, ctx); @@ -22279,7 +22771,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22390,7 +22885,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22500,7 +22998,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22610,7 +23111,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTagAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22720,7 +23224,10 @@ void NoteStoreTester::shouldExecuteListSearches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listSearches( ctx); QVERIFY(res == response); @@ -22797,7 +23304,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22886,7 +23396,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -22974,7 +23487,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23063,7 +23579,10 @@ void NoteStoreTester::shouldExecuteListSearchesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listSearchesAsync( ctx); @@ -23158,7 +23677,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23265,7 +23787,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearchesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23371,7 +23896,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearchesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23480,7 +24008,10 @@ void NoteStoreTester::shouldExecuteGetSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SavedSearch res = noteStore->getSearch( guid, ctx); @@ -23561,7 +24092,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23654,7 +24188,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23746,7 +24283,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23838,7 +24378,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -23928,7 +24471,10 @@ void NoteStoreTester::shouldExecuteGetSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getSearchAsync( guid, ctx); @@ -24027,7 +24573,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24138,7 +24687,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24248,7 +24800,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24358,7 +24913,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24468,7 +25026,10 @@ void NoteStoreTester::shouldExecuteCreateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SavedSearch res = noteStore->createSearch( search, ctx); @@ -24549,7 +25110,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24642,7 +25206,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24734,7 +25301,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -24824,7 +25394,10 @@ void NoteStoreTester::shouldExecuteCreateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createSearchAsync( search, ctx); @@ -24923,7 +25496,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25034,7 +25610,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25144,7 +25723,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25254,7 +25836,10 @@ void NoteStoreTester::shouldExecuteUpdateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateSearch( search, ctx); @@ -25335,7 +25920,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25428,7 +26016,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25520,7 +26111,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25612,7 +26206,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25702,7 +26299,10 @@ void NoteStoreTester::shouldExecuteUpdateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateSearchAsync( search, ctx); @@ -25801,7 +26401,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -25912,7 +26515,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26022,7 +26628,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26132,7 +26741,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26242,7 +26854,10 @@ void NoteStoreTester::shouldExecuteExpungeSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->expungeSearch( guid, ctx); @@ -26323,7 +26938,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26416,7 +27034,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26508,7 +27129,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26600,7 +27224,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26690,7 +27317,10 @@ void NoteStoreTester::shouldExecuteExpungeSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->expungeSearchAsync( guid, ctx); @@ -26789,7 +27419,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -26900,7 +27533,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27010,7 +27646,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27120,7 +27759,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearchAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27233,7 +27875,10 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->findNoteOffset( filter, guid, @@ -27318,7 +27963,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27415,7 +28063,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27511,7 +28162,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27607,7 +28261,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27701,7 +28358,10 @@ void NoteStoreTester::shouldExecuteFindNoteOffsetAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->findNoteOffsetAsync( filter, guid, @@ -27804,7 +28464,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -27919,7 +28582,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28033,7 +28699,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28147,7 +28816,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffsetAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28267,7 +28939,10 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); NotesMetadataList res = noteStore->findNotesMetadata( filter, offset, @@ -28360,7 +29035,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28465,7 +29143,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28569,7 +29250,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28673,7 +29357,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -28775,7 +29462,10 @@ void NoteStoreTester::shouldExecuteFindNotesMetadataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->findNotesMetadataAsync( filter, offset, @@ -28886,7 +29576,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29009,7 +29702,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29131,7 +29827,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29253,7 +29952,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29369,7 +30071,10 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); NoteCollectionCounts res = noteStore->findNoteCounts( filter, withTrash, @@ -29454,7 +30159,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29551,7 +30259,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29647,7 +30358,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29743,7 +30457,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -29837,7 +30554,10 @@ void NoteStoreTester::shouldExecuteFindNoteCountsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->findNoteCountsAsync( filter, withTrash, @@ -29940,7 +30660,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30055,7 +30778,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30169,7 +30895,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30283,7 +31012,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCountsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30397,7 +31129,10 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->getNoteWithResultSpec( guid, resultSpec, @@ -30482,7 +31217,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30579,7 +31317,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30675,7 +31416,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30771,7 +31515,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -30865,7 +31612,10 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpecAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteWithResultSpecAsync( guid, resultSpec, @@ -30968,7 +31718,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31083,7 +31836,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31197,7 +31953,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31311,7 +32070,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31434,7 +32196,10 @@ void NoteStoreTester::shouldExecuteGetNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->getNote( guid, withContent, @@ -31531,7 +32296,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31640,7 +32408,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31748,7 +32519,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31856,7 +32630,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -31962,7 +32739,10 @@ void NoteStoreTester::shouldExecuteGetNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteAsync( guid, withContent, @@ -32077,7 +32857,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32204,7 +32987,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32330,7 +33116,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32456,7 +33245,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32570,7 +33362,10 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); LazyMap res = noteStore->getNoteApplicationData( guid, ctx); @@ -32651,7 +33446,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32744,7 +33542,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32836,7 +33637,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -32928,7 +33732,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33018,7 +33825,10 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteApplicationDataAsync( guid, ctx); @@ -33117,7 +33927,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33228,7 +34041,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33338,7 +34154,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33448,7 +34267,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33561,7 +34383,10 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->getNoteApplicationDataEntry( guid, key, @@ -33646,7 +34471,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33743,7 +34571,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33839,7 +34670,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -33935,7 +34769,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34029,7 +34866,10 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteApplicationDataEntryAsync( guid, key, @@ -34132,7 +34972,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34247,7 +35090,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34361,7 +35207,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34475,7 +35324,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntryA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34592,7 +35444,10 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->setNoteApplicationDataEntry( guid, key, @@ -34681,7 +35536,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34782,7 +35640,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34882,7 +35743,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -34982,7 +35846,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35080,7 +35947,10 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->setNoteApplicationDataEntryAsync( guid, key, @@ -35187,7 +36057,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35306,7 +36179,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35424,7 +36300,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35542,7 +36421,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntryA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35657,7 +36539,10 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->unsetNoteApplicationDataEntry( guid, key, @@ -35742,7 +36627,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35839,7 +36727,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -35935,7 +36826,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36031,7 +36925,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36125,7 +37022,10 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->unsetNoteApplicationDataEntryAsync( guid, key, @@ -36228,7 +37128,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36343,7 +37246,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36457,7 +37363,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36571,7 +37480,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36682,7 +37594,10 @@ void NoteStoreTester::shouldExecuteGetNoteContent() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->getNoteContent( guid, ctx); @@ -36763,7 +37678,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36856,7 +37774,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -36948,7 +37869,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37040,7 +37964,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37130,7 +38057,10 @@ void NoteStoreTester::shouldExecuteGetNoteContentAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteContentAsync( guid, ctx); @@ -37229,7 +38159,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37340,7 +38273,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContentAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37450,7 +38386,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37560,7 +38499,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContentAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37676,7 +38618,10 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->getNoteSearchText( guid, noteOnly, @@ -37765,7 +38710,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37866,7 +38814,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -37966,7 +38917,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38066,7 +39020,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38164,7 +39121,10 @@ void NoteStoreTester::shouldExecuteGetNoteSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteSearchTextAsync( guid, noteOnly, @@ -38271,7 +39231,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38390,7 +39353,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38508,7 +39474,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38626,7 +39595,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38738,7 +39710,10 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->getResourceSearchText( guid, ctx); @@ -38819,7 +39794,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -38912,7 +39890,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39004,7 +39985,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39096,7 +40080,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39186,7 +40173,10 @@ void NoteStoreTester::shouldExecuteGetResourceSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceSearchTextAsync( guid, ctx); @@ -39285,7 +40275,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39396,7 +40389,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39506,7 +40502,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39616,7 +40615,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchTextAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39729,7 +40731,10 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QStringList res = noteStore->getNoteTagNames( guid, ctx); @@ -39810,7 +40815,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39903,7 +40911,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -39995,7 +41006,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40087,7 +41101,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40180,7 +41197,10 @@ void NoteStoreTester::shouldExecuteGetNoteTagNamesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteTagNamesAsync( guid, ctx); @@ -40279,7 +41299,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40390,7 +41413,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40500,7 +41526,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40610,7 +41639,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNamesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40720,7 +41752,10 @@ void NoteStoreTester::shouldExecuteCreateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->createNote( note, ctx); @@ -40801,7 +41836,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40894,7 +41932,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -40986,7 +42027,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41078,7 +42122,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41168,7 +42215,10 @@ void NoteStoreTester::shouldExecuteCreateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createNoteAsync( note, ctx); @@ -41267,7 +42317,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41378,7 +42431,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41488,7 +42544,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41598,7 +42657,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41708,7 +42770,10 @@ void NoteStoreTester::shouldExecuteUpdateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->updateNote( note, ctx); @@ -41789,7 +42854,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41882,7 +42950,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -41974,7 +43045,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42066,7 +43140,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42156,7 +43233,10 @@ void NoteStoreTester::shouldExecuteUpdateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateNoteAsync( note, ctx); @@ -42255,7 +43335,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42366,7 +43449,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42476,7 +43562,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42586,7 +43675,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42696,7 +43788,10 @@ void NoteStoreTester::shouldExecuteDeleteNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->deleteNote( guid, ctx); @@ -42777,7 +43872,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42870,7 +43968,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -42962,7 +44063,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43054,7 +44158,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43144,7 +44251,10 @@ void NoteStoreTester::shouldExecuteDeleteNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->deleteNoteAsync( guid, ctx); @@ -43243,7 +44353,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43354,7 +44467,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43464,7 +44580,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43574,7 +44693,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43684,7 +44806,10 @@ void NoteStoreTester::shouldExecuteExpungeNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->expungeNote( guid, ctx); @@ -43765,7 +44890,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43858,7 +44986,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -43950,7 +45081,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44042,7 +45176,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44132,7 +45269,10 @@ void NoteStoreTester::shouldExecuteExpungeNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->expungeNoteAsync( guid, ctx); @@ -44231,7 +45371,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44342,7 +45485,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44452,7 +45598,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44562,7 +45711,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44675,7 +45827,10 @@ void NoteStoreTester::shouldExecuteCopyNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->copyNote( noteGuid, toNotebookGuid, @@ -44760,7 +45915,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44857,7 +46015,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -44953,7 +46114,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45049,7 +46213,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45143,7 +46310,10 @@ void NoteStoreTester::shouldExecuteCopyNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->copyNoteAsync( noteGuid, toNotebookGuid, @@ -45246,7 +46416,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45361,7 +46534,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45475,7 +46651,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45589,7 +46768,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45703,7 +46885,10 @@ void NoteStoreTester::shouldExecuteListNoteVersions() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listNoteVersions( noteGuid, ctx); @@ -45784,7 +46969,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45877,7 +47065,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -45969,7 +47160,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46061,7 +47255,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46154,7 +47351,10 @@ void NoteStoreTester::shouldExecuteListNoteVersionsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listNoteVersionsAsync( noteGuid, ctx); @@ -46253,7 +47453,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46364,7 +47567,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46474,7 +47680,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46584,7 +47793,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersionsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46706,7 +47918,10 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Note res = noteStore->getNoteVersion( noteGuid, updateSequenceNum, @@ -46803,7 +48018,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -46912,7 +48130,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47020,7 +48241,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47128,7 +48352,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47234,7 +48461,10 @@ void NoteStoreTester::shouldExecuteGetNoteVersionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNoteVersionAsync( noteGuid, updateSequenceNum, @@ -47349,7 +48579,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47476,7 +48709,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47602,7 +48838,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47728,7 +48967,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -47854,7 +49096,10 @@ void NoteStoreTester::shouldExecuteGetResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Resource res = noteStore->getResource( guid, withData, @@ -47951,7 +49196,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48060,7 +49308,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48168,7 +49419,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48276,7 +49530,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48382,7 +49639,10 @@ void NoteStoreTester::shouldExecuteGetResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceAsync( guid, withData, @@ -48497,7 +49757,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48624,7 +49887,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48750,7 +50016,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48876,7 +50145,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -48990,7 +50262,10 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); LazyMap res = noteStore->getResourceApplicationData( guid, ctx); @@ -49071,7 +50346,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49164,7 +50442,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49256,7 +50537,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49348,7 +50632,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49438,7 +50725,10 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceApplicationDataAsync( guid, ctx); @@ -49537,7 +50827,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49648,7 +50941,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49758,7 +51054,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49868,7 +51167,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -49981,7 +51283,10 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->getResourceApplicationDataEntry( guid, key, @@ -50066,7 +51371,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50163,7 +51471,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50259,7 +51570,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50355,7 +51669,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50449,7 +51766,10 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceApplicationDataEntryAsync( guid, key, @@ -50552,7 +51872,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50667,7 +51990,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50781,7 +52107,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -50895,7 +52224,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51012,7 +52344,10 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->setResourceApplicationDataEntry( guid, key, @@ -51101,7 +52436,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51202,7 +52540,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51302,7 +52643,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51402,7 +52746,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51500,7 +52847,10 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->setResourceApplicationDataEntryAsync( guid, key, @@ -51607,7 +52957,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51726,7 +53079,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51844,7 +53200,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -51962,7 +53321,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52077,7 +53439,10 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->unsetResourceApplicationDataEntry( guid, key, @@ -52162,7 +53527,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52259,7 +53627,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52355,7 +53726,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52451,7 +53825,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52545,7 +53922,10 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntryAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->unsetResourceApplicationDataEntryAsync( guid, key, @@ -52648,7 +54028,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52763,7 +54146,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52877,7 +54263,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -52991,7 +54380,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53102,7 +54494,10 @@ void NoteStoreTester::shouldExecuteUpdateResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateResource( resource, ctx); @@ -53183,7 +54578,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53276,7 +54674,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53368,7 +54769,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53460,7 +54864,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53550,7 +54957,10 @@ void NoteStoreTester::shouldExecuteUpdateResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateResourceAsync( resource, ctx); @@ -53649,7 +55059,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53760,7 +55173,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53870,7 +55286,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -53980,7 +55399,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResourceAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54090,7 +55512,10 @@ void NoteStoreTester::shouldExecuteGetResourceData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QByteArray res = noteStore->getResourceData( guid, ctx); @@ -54171,7 +55596,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54264,7 +55692,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54356,7 +55787,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54448,7 +55882,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54538,7 +55975,10 @@ void NoteStoreTester::shouldExecuteGetResourceDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceDataAsync( guid, ctx); @@ -54637,7 +56077,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54748,7 +56191,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54858,7 +56304,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -54968,7 +56417,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55090,7 +56542,10 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Resource res = noteStore->getResourceByHash( noteGuid, contentHash, @@ -55187,7 +56642,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55296,7 +56754,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55404,7 +56865,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55512,7 +56976,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55618,7 +57085,10 @@ void NoteStoreTester::shouldExecuteGetResourceByHashAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceByHashAsync( noteGuid, contentHash, @@ -55733,7 +57203,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55860,7 +57333,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -55986,7 +57462,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56112,7 +57591,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHashAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56226,7 +57708,10 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QByteArray res = noteStore->getResourceRecognition( guid, ctx); @@ -56307,7 +57792,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56400,7 +57888,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56492,7 +57983,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56584,7 +58078,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56674,7 +58171,10 @@ void NoteStoreTester::shouldExecuteGetResourceRecognitionAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceRecognitionAsync( guid, ctx); @@ -56773,7 +58273,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56884,7 +58387,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -56994,7 +58500,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57104,7 +58613,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognitionAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57214,7 +58726,10 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QByteArray res = noteStore->getResourceAlternateData( guid, ctx); @@ -57295,7 +58810,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57388,7 +58906,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57480,7 +59001,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57572,7 +59096,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57662,7 +59189,10 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateDataAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceAlternateDataAsync( guid, ctx); @@ -57761,7 +59291,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57872,7 +59405,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -57982,7 +59518,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58092,7 +59631,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateDataAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58202,7 +59744,10 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); ResourceAttributes res = noteStore->getResourceAttributes( guid, ctx); @@ -58283,7 +59828,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58376,7 +59924,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58468,7 +60019,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58560,7 +60114,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58650,7 +60207,10 @@ void NoteStoreTester::shouldExecuteGetResourceAttributesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getResourceAttributesAsync( guid, ctx); @@ -58749,7 +60309,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58860,7 +60423,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -58970,7 +60536,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59080,7 +60649,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59191,7 +60763,10 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Notebook res = noteStore->getPublicNotebook( userId, publicUri, @@ -59275,7 +60850,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59369,7 +60947,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59463,7 +61044,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59555,7 +61139,10 @@ void NoteStoreTester::shouldExecuteGetPublicNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getPublicNotebookAsync( userId, publicUri, @@ -59657,7 +61244,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59769,7 +61359,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59881,7 +61474,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -59995,7 +61591,10 @@ void NoteStoreTester::shouldExecuteShareNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SharedNotebook res = noteStore->shareNotebook( sharedNotebook, message, @@ -60080,7 +61679,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60176,7 +61778,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60273,7 +61878,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60369,7 +61977,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60463,7 +62074,10 @@ void NoteStoreTester::shouldExecuteShareNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->shareNotebookAsync( sharedNotebook, message, @@ -60566,7 +62180,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60680,7 +62297,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60795,7 +62415,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -60909,7 +62532,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61020,7 +62646,10 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); CreateOrUpdateNotebookSharesResult res = noteStore->createOrUpdateNotebookShares( shareTemplate, ctx); @@ -61101,7 +62730,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61193,7 +62825,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61286,7 +62921,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61384,7 +63022,10 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61476,7 +63117,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61566,7 +63210,10 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createOrUpdateNotebookSharesAsync( shareTemplate, ctx); @@ -61665,7 +63312,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61775,7 +63425,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -61886,7 +63539,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62002,7 +63658,10 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62112,7 +63771,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62222,7 +63884,10 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateSharedNotebook( sharedNotebook, ctx); @@ -62303,7 +63968,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62395,7 +64063,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62488,7 +64159,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62580,7 +64254,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62670,7 +64347,10 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateSharedNotebookAsync( sharedNotebook, ctx); @@ -62769,7 +64449,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62879,7 +64562,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -62990,7 +64676,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63100,7 +64789,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63213,7 +64905,10 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); Notebook res = noteStore->setNotebookRecipientSettings( notebookGuid, recipientSettings, @@ -63298,7 +64993,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63394,7 +65092,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63491,7 +65192,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63587,7 +65291,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63681,7 +65388,10 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettingsAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->setNotebookRecipientSettingsAsync( notebookGuid, recipientSettings, @@ -63784,7 +65494,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -63898,7 +65611,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64013,7 +65729,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64127,7 +65846,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64238,7 +65960,10 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listSharedNotebooks( ctx); QVERIFY(res == response); @@ -64315,7 +66040,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64403,7 +66131,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64492,7 +66223,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64580,7 +66314,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64669,7 +66406,10 @@ void NoteStoreTester::shouldExecuteListSharedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listSharedNotebooksAsync( ctx); @@ -64764,7 +66504,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64870,7 +66613,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -64977,7 +66723,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65083,7 +66832,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65192,7 +66944,10 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); LinkedNotebook res = noteStore->createLinkedNotebook( linkedNotebook, ctx); @@ -65273,7 +67028,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65365,7 +67123,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65458,7 +67219,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65550,7 +67314,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65640,7 +67407,10 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->createLinkedNotebookAsync( linkedNotebook, ctx); @@ -65739,7 +67509,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65849,7 +67622,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -65960,7 +67736,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66070,7 +67849,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66180,7 +67962,10 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->updateLinkedNotebook( linkedNotebook, ctx); @@ -66261,7 +68046,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66353,7 +68141,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66446,7 +68237,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66538,7 +68332,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66628,7 +68425,10 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateLinkedNotebookAsync( linkedNotebook, ctx); @@ -66727,7 +68527,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66837,7 +68640,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -66948,7 +68754,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67058,7 +68867,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67168,7 +68980,10 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = noteStore->listLinkedNotebooks( ctx); QVERIFY(res == response); @@ -67245,7 +69060,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67333,7 +69151,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67422,7 +69243,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67510,7 +69334,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67599,7 +69426,10 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->listLinkedNotebooksAsync( ctx); @@ -67694,7 +69524,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67800,7 +69633,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -67907,7 +69743,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68013,7 +69852,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooksAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68122,7 +69964,10 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); qint32 res = noteStore->expungeLinkedNotebook( guid, ctx); @@ -68203,7 +70048,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68295,7 +70143,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68388,7 +70239,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68480,7 +70334,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68570,7 +70427,10 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->expungeLinkedNotebookAsync( guid, ctx); @@ -68669,7 +70529,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68779,7 +70642,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -68890,7 +70756,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69000,7 +70869,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69110,7 +70982,10 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AuthenticationResult res = noteStore->authenticateToSharedNotebook( shareKeyOrGlobalId, ctx); @@ -69191,7 +71066,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69283,7 +71161,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69376,7 +71257,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69468,7 +71352,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69558,7 +71445,10 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebookAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->authenticateToSharedNotebookAsync( shareKeyOrGlobalId, ctx); @@ -69657,7 +71547,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69767,7 +71660,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69878,7 +71774,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -69988,7 +71887,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70095,7 +71997,10 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); SharedNotebook res = noteStore->getSharedNotebookByAuth( ctx); QVERIFY(res == response); @@ -70172,7 +72077,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70260,7 +72168,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70349,7 +72260,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70437,7 +72351,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70523,7 +72440,10 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getSharedNotebookByAuthAsync( ctx); @@ -70618,7 +72538,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsy }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70724,7 +72647,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70831,7 +72757,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthA }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -70937,7 +72866,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71044,7 +72976,10 @@ void NoteStoreTester::shouldExecuteEmailNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); noteStore->emailNote( parameters, ctx); @@ -71124,7 +73059,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71215,7 +73153,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71307,7 +73248,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71398,7 +73342,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71485,7 +73432,10 @@ void NoteStoreTester::shouldExecuteEmailNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->emailNoteAsync( parameters, ctx); @@ -71583,7 +73533,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71693,7 +73646,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71804,7 +73760,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -71914,7 +73873,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72024,7 +73986,10 @@ void NoteStoreTester::shouldExecuteShareNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QString res = noteStore->shareNote( guid, ctx); @@ -72105,7 +74070,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72197,7 +74165,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72290,7 +74261,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72382,7 +74356,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72472,7 +74449,10 @@ void NoteStoreTester::shouldExecuteShareNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->shareNoteAsync( guid, ctx); @@ -72571,7 +74551,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72681,7 +74664,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72792,7 +74778,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -72902,7 +74891,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73010,7 +75002,10 @@ void NoteStoreTester::shouldExecuteStopSharingNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); noteStore->stopSharingNote( guid, ctx); @@ -73090,7 +75085,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73181,7 +75179,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73273,7 +75274,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73364,7 +75368,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73451,7 +75458,10 @@ void NoteStoreTester::shouldExecuteStopSharingNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->stopSharingNoteAsync( guid, ctx); @@ -73549,7 +75559,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73659,7 +75672,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73770,7 +75786,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73880,7 +75899,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -73993,7 +76015,10 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AuthenticationResult res = noteStore->authenticateToSharedNote( guid, noteKey, @@ -74078,7 +76103,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74174,7 +76202,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74271,7 +76302,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74367,7 +76401,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74461,7 +76498,10 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNoteAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->authenticateToSharedNoteAsync( guid, noteKey, @@ -74564,7 +76604,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74678,7 +76721,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74793,7 +76839,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -74907,7 +76956,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75021,7 +77073,10 @@ void NoteStoreTester::shouldExecuteFindRelated() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); RelatedResult res = noteStore->findRelated( query, resultSpec, @@ -75106,7 +77161,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75203,7 +77261,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75299,7 +77360,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75395,7 +77459,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75489,7 +77556,10 @@ void NoteStoreTester::shouldExecuteFindRelatedAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->findRelatedAsync( query, resultSpec, @@ -75592,7 +77662,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75707,7 +77780,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelatedAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75821,7 +77897,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -75935,7 +78014,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelatedAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76046,7 +78128,10 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); UpdateNoteIfUsnMatchesResult res = noteStore->updateNoteIfUsnMatches( note, ctx); @@ -76127,7 +78212,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76219,7 +78307,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76312,7 +78403,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76404,7 +78498,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76494,7 +78591,10 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatchesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->updateNoteIfUsnMatchesAsync( note, ctx); @@ -76593,7 +78693,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76703,7 +78806,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76814,7 +78920,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -76924,7 +79033,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77034,7 +79146,10 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); ManageNotebookSharesResult res = noteStore->manageNotebookShares( parameters, ctx); @@ -77115,7 +79230,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77207,7 +79325,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77300,7 +79421,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77392,7 +79516,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77482,7 +79609,10 @@ void NoteStoreTester::shouldExecuteManageNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->manageNotebookSharesAsync( parameters, ctx); @@ -77581,7 +79711,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync( }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77691,7 +79824,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAs }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77802,7 +79938,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsyn }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -77912,7 +80051,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78022,7 +80164,10 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); ShareRelationships res = noteStore->getNotebookShares( notebookGuid, ctx); @@ -78103,7 +80248,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78195,7 +80343,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78288,7 +80439,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78380,7 +80534,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78470,7 +80627,10 @@ void NoteStoreTester::shouldExecuteGetNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = noteStore->getNotebookSharesAsync( notebookGuid, ctx); @@ -78569,7 +80729,10 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78679,7 +80842,10 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78790,7 +80956,10 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -78900,7 +81069,10 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookSharesAsync() }); auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index f4fad6b7..10c0dd74 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -1306,7 +1306,10 @@ void UserStoreTester::shouldExecuteCheckVersion() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool res = userStore->checkVersion( clientName, edamVersionMajor, @@ -1393,7 +1396,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -1489,7 +1495,10 @@ void UserStoreTester::shouldExecuteCheckVersionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->checkVersionAsync( clientName, edamVersionMajor, @@ -1594,7 +1603,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -1704,7 +1716,10 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); BootstrapInfo res = userStore->getBootstrapInfo( locale, ctx); @@ -1783,7 +1798,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -1871,7 +1889,10 @@ void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->getBootstrapInfoAsync( locale, ctx); @@ -1968,7 +1989,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2094,7 +2118,10 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AuthenticationResult res = userStore->authenticateLongSession( username, password, @@ -2197,7 +2224,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2312,7 +2342,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2426,7 +2459,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2538,7 +2574,10 @@ void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->authenticateLongSessionAsync( username, password, @@ -2659,7 +2698,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsy }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2792,7 +2834,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionA }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -2924,7 +2969,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3046,7 +3094,10 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AuthenticationResult res = userStore->completeTwoFactorAuthentication( oneTimeCode, deviceIdentifier, @@ -3135,7 +3186,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3236,7 +3290,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3336,7 +3393,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3434,7 +3494,10 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->completeTwoFactorAuthenticationAsync( oneTimeCode, deviceIdentifier, @@ -3541,7 +3604,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3660,7 +3726,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3778,7 +3847,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -3885,7 +3957,10 @@ void UserStoreTester::shouldExecuteRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); userStore->revokeLongSession( ctx); } @@ -3961,7 +4036,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4049,7 +4127,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4136,7 +4217,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4219,7 +4303,10 @@ void UserStoreTester::shouldExecuteRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->revokeLongSessionAsync( ctx); @@ -4313,7 +4400,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4420,7 +4510,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4526,7 +4619,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4632,7 +4728,10 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AuthenticationResult res = userStore->authenticateToBusiness( ctx); QVERIFY(res == response); @@ -4709,7 +4808,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4798,7 +4900,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4886,7 +4991,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -4972,7 +5080,10 @@ void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->authenticateToBusinessAsync( ctx); @@ -5067,7 +5178,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsyn }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5174,7 +5288,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAs }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5280,7 +5397,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync( }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5386,7 +5506,10 @@ void UserStoreTester::shouldExecuteGetUser() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); User res = userStore->getUser( ctx); QVERIFY(res == response); @@ -5463,7 +5586,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5552,7 +5678,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5640,7 +5769,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5726,7 +5858,10 @@ void UserStoreTester::shouldExecuteGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->getUserAsync( ctx); @@ -5821,7 +5956,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -5928,7 +6066,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6034,7 +6175,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6141,7 +6285,10 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); PublicUserInfo res = userStore->getPublicUserInfo( username, ctx); @@ -6220,7 +6367,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6311,7 +6461,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6401,7 +6554,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6491,7 +6647,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6579,7 +6738,10 @@ void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->getPublicUserInfoAsync( username, ctx); @@ -6676,7 +6838,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6785,7 +6950,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -6893,7 +7061,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7001,7 +7172,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7108,7 +7282,10 @@ void UserStoreTester::shouldExecuteGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); UserUrls res = userStore->getUserUrls( ctx); QVERIFY(res == response); @@ -7185,7 +7362,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7274,7 +7454,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7362,7 +7545,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7448,7 +7634,10 @@ void UserStoreTester::shouldExecuteGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->getUserUrlsAsync( ctx); @@ -7543,7 +7732,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7650,7 +7842,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7756,7 +7951,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -7863,7 +8061,10 @@ void UserStoreTester::shouldExecuteInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); userStore->inviteToBusiness( emailAddress, ctx); @@ -7943,7 +8144,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8035,7 +8239,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8126,7 +8333,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8213,7 +8423,10 @@ void UserStoreTester::shouldExecuteInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->inviteToBusinessAsync( emailAddress, ctx); @@ -8311,7 +8524,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8422,7 +8638,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8532,7 +8751,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8640,7 +8862,10 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); userStore->removeFromBusiness( emailAddress, ctx); @@ -8720,7 +8945,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8812,7 +9040,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8903,7 +9134,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -8994,7 +9228,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9081,7 +9318,10 @@ void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->removeFromBusinessAsync( emailAddress, ctx); @@ -9179,7 +9419,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9290,7 +9533,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync( }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9400,7 +9646,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsyn }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9510,7 +9759,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9621,7 +9873,10 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); userStore->updateBusinessUserIdentifier( oldEmailAddress, newEmailAddress, @@ -9705,7 +9960,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9801,7 +10059,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9896,7 +10157,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -9991,7 +10255,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10082,7 +10349,10 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->updateBusinessUserIdentifierAsync( oldEmailAddress, newEmailAddress, @@ -10184,7 +10454,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10299,7 +10572,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10413,7 +10689,10 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10527,7 +10806,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10638,7 +10920,10 @@ void UserStoreTester::shouldExecuteListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = userStore->listBusinessUsers( ctx); QVERIFY(res == response); @@ -10715,7 +11000,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10804,7 +11092,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10892,7 +11183,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -10981,7 +11275,10 @@ void UserStoreTester::shouldExecuteListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->listBusinessUsersAsync( ctx); @@ -11076,7 +11373,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11183,7 +11483,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11289,7 +11592,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11401,7 +11707,10 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); QList res = userStore->listBusinessInvitations( includeRequestedInvitations, ctx); @@ -11482,7 +11791,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11575,7 +11887,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11667,7 +11982,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11760,7 +12078,10 @@ void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->listBusinessInvitationsAsync( includeRequestedInvitations, ctx); @@ -11859,7 +12180,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsy }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -11970,7 +12294,10 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsA }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12080,7 +12407,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12188,7 +12518,10 @@ void UserStoreTester::shouldExecuteGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AccountLimits res = userStore->getAccountLimits( serviceLevel, ctx); @@ -12267,7 +12600,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12357,7 +12693,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12445,7 +12784,10 @@ void UserStoreTester::shouldExecuteGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); AsyncResult * result = userStore->getAccountLimitsAsync( serviceLevel, ctx); @@ -12542,7 +12884,10 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { @@ -12650,7 +12995,10 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() }); auto userStore = newUserStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port)); + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); bool caughtException = false; try { From 6833a03c5cd714beff93a8551a79c7b64de98f5c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 13 Dec 2019 07:58:28 +0300 Subject: [PATCH 130/188] Add missing header inclusions to QEverCloud.h --- QEverCloud/headers/QEverCloud.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/QEverCloud/headers/QEverCloud.h b/QEverCloud/headers/QEverCloud.h index a3624f82..e392e079 100644 --- a/QEverCloud/headers/QEverCloud.h +++ b/QEverCloud/headers/QEverCloud.h @@ -10,6 +10,7 @@ #define QEVERCLOUD_INFTHEADER_H #include "AsyncResult.h" +#include "DurableService.h" #include "EventLoopFinisher.h" #include "EverCloudException.h" #include "Exceptions.h" @@ -17,7 +18,10 @@ #include "Globals.h" #include "Helpers.h" #include "InkNoteImageDownloader.h" +#include "Log.h" #include "Optional.h" +#include "Printable.h" +#include "RequestContext.h" #include "Thumbnail.h" #include "VersionInfo.h" #include "generated/EDAMErrorCode.h" From 6d59ba24c1a3ebbcf17206a823aec00c3a47c4da Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 14 Dec 2019 13:19:41 +0300 Subject: [PATCH 131/188] Compatibility fixes for build with g++ 5.4 and Qt 5.5 --- CHANGELOG.md | 2 +- QEverCloud/CMakeLists.txt | 4 +- QEverCloud/headers/Log.h | 2 + QEverCloud/headers/generated/Types.h | 18 +- QEverCloud/src/Exceptions.cpp | 2 + QEverCloud/src/tests/TestDurableService.cpp | 8 +- .../src/tests/generated/TestNoteStore.cpp | 724 +++++++++--------- .../src/tests/generated/TestUserStore.cpp | 116 +-- 8 files changed, 444 insertions(+), 432 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bbf2c00..6f4e6f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,7 @@ * Some header files were renamed so that they all start from capital letters now. * Support for Qt < 5.5 as well as support for building QEverCloud with older - compilers has been dropped. QEverCloud is now built with C++17 standard + compilers has been dropped. QEverCloud is now built with C++14 standard although it does not use much of its features so even some not fully compliant compilers can still build QEverCloud. Minimal supported gcc version is 5.4, minimal supported Visual Studio version is 2017. diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index e9a47448..3003ba8e 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -111,7 +111,7 @@ add_sanitizers(${LIBNAME}) set_target_properties(${LIBNAME} PROPERTIES VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" SOVERSION ${PROJECT_VERSION_MAJOR} - CXX_STANDARD 17 + CXX_STANDARD 14 CXX_EXTENSIONS OFF MACOSX_RPATH 1 INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") @@ -161,7 +161,7 @@ if(Qt5Test_FOUND) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) set_target_properties(test_${PROJECT_NAME} PROPERTIES - CXX_STANDARD 17 + CXX_STANDARD 14 CXX_EXTENSIONS OFF) target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) else() diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index d359c6be..c3bd6bba 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -31,7 +31,9 @@ enum class LogLevel Error }; +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(LogLevel) +#endif QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & out, const LogLevel level); diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index fc663e21..8b00efea 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -153,7 +153,9 @@ class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable Q_PROPERTY(bool dirty MEMBER dirty) Q_PROPERTY(bool local MEMBER local) Q_PROPERTY(bool favorited MEMBER favorited) - Q_PROPERTY(QHash dict MEMBER dict) + + using Dict = QHash; + Q_PROPERTY(Dict dict MEMBER dict) }; /** @@ -687,9 +689,11 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable return !(*this == other); } + using TagCounts = QMap; + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> notebookCounts MEMBER notebookCounts) - Q_PROPERTY(Optional> tagCounts MEMBER tagCounts) + Q_PROPERTY(Optional notebookCounts MEMBER notebookCounts) + Q_PROPERTY(Optional tagCounts MEMBER tagCounts) Q_PROPERTY(Optional trashCount MEMBER trashCount) }; @@ -2767,9 +2771,11 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable return !(*this == other); } + using FullMap = QMap; + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) Q_PROPERTY(Optional> keysOnly MEMBER keysOnly) - Q_PROPERTY(Optional> fullMap MEMBER fullMap) + Q_PROPERTY(Optional fullMap MEMBER fullMap) }; /** @@ -3285,6 +3291,8 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable return !(*this == other); } + using Classifications = QMap; + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) Q_PROPERTY(Optional subjectDate MEMBER subjectDate) Q_PROPERTY(Optional latitude MEMBER latitude) @@ -3302,7 +3310,7 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable Q_PROPERTY(Optional contentClass MEMBER contentClass) Q_PROPERTY(Optional applicationData MEMBER applicationData) Q_PROPERTY(Optional lastEditedBy MEMBER lastEditedBy) - Q_PROPERTY(Optional> classifications MEMBER classifications) + Q_PROPERTY(Optional classifications MEMBER classifications) Q_PROPERTY(Optional creatorId MEMBER creatorId) Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) Q_PROPERTY(Optional sharedWithBusiness MEMBER sharedWithBusiness) diff --git a/QEverCloud/src/Exceptions.cpp b/QEverCloud/src/Exceptions.cpp index 91d5beb0..78b5279c 100644 --- a/QEverCloud/src/Exceptions.cpp +++ b/QEverCloud/src/Exceptions.cpp @@ -82,10 +82,12 @@ const char * NetworkException::what() const noexcept return "NetworkError: Network session failed"; case QNetworkReply::BackgroundRequestNotAllowedError: return "NetworkError: Background request not allowed"; +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) case QNetworkReply::TooManyRedirectsError: return "NetworkError: Too many redirects"; case QNetworkReply::InsecureRedirectError: return "NetworkError: Insecure redirect"; +#endif case QNetworkReply::ProxyConnectionRefusedError: return "NetworkError: Proxy connection refused"; case QNetworkReply::ProxyConnectionClosedError: diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index bda25213..7827f4a7 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -242,7 +242,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!result.first.isValid()); - QVERIFY(result.second); + QVERIFY(result.second.get() != nullptr); bool exceptionCaught = false; try { @@ -301,7 +301,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() QVERIFY(serviceCallCounter == maxServiceCallCounter); QVERIFY(!valueFetcher.m_value.isValid()); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); bool exceptionCaught = false; try { @@ -351,7 +351,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError QVERIFY(serviceCallCounter == 1); QVERIFY(!result.first.isValid()); - QVERIFY(result.second); + QVERIFY(result.second.get() != nullptr); bool exceptionCaught = false; try { @@ -412,7 +412,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro QVERIFY(serviceCallCounter == 1); QVERIFY(!valueFetcher.m_value.isValid()); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); bool exceptionCaught = false; try { diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index c360c09b..4c20e825 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -6483,7 +6483,7 @@ void NoteStoreTester::shouldExecuteGetSyncStateAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() @@ -6583,7 +6583,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -6693,7 +6693,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncStateAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -6802,7 +6802,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncStateAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -7321,7 +7321,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunkAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync() @@ -7433,7 +7433,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -7555,7 +7555,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -7676,7 +7676,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -8250,7 +8250,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncStateAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncStateAsync() @@ -8354,7 +8354,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -8468,7 +8468,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -8581,7 +8581,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -8694,7 +8694,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -9340,7 +9340,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunkAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunkAsync() @@ -9456,7 +9456,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -9582,7 +9582,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -9707,7 +9707,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -9832,7 +9832,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -10297,7 +10297,7 @@ void NoteStoreTester::shouldExecuteListNotebooksAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() @@ -10397,7 +10397,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -10507,7 +10507,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -10616,7 +10616,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -11081,7 +11081,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooksAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNotebooksAsync() @@ -11181,7 +11181,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -11291,7 +11291,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -11400,7 +11400,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -11974,7 +11974,7 @@ void NoteStoreTester::shouldExecuteGetNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() @@ -12078,7 +12078,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -12192,7 +12192,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -12305,7 +12305,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -12418,7 +12418,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -12877,7 +12877,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() @@ -12977,7 +12977,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -13087,7 +13087,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -13196,7 +13196,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -13770,7 +13770,7 @@ void NoteStoreTester::shouldExecuteCreateNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() @@ -13874,7 +13874,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -13988,7 +13988,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -14101,7 +14101,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -14214,7 +14214,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -14788,7 +14788,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() @@ -14892,7 +14892,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -15006,7 +15006,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -15119,7 +15119,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -15232,7 +15232,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -15806,7 +15806,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() @@ -15910,7 +15910,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -16024,7 +16024,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -16137,7 +16137,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -16250,7 +16250,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -16715,7 +16715,7 @@ void NoteStoreTester::shouldExecuteListTagsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() @@ -16815,7 +16815,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -16925,7 +16925,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -17034,7 +17034,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -17614,7 +17614,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() @@ -17718,7 +17718,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -17832,7 +17832,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -17945,7 +17945,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -18058,7 +18058,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -18632,7 +18632,7 @@ void NoteStoreTester::shouldExecuteGetTagAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() @@ -18736,7 +18736,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -18850,7 +18850,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -18963,7 +18963,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -19076,7 +19076,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -19650,7 +19650,7 @@ void NoteStoreTester::shouldExecuteCreateTagAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() @@ -19754,7 +19754,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -19868,7 +19868,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -19981,7 +19981,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -20094,7 +20094,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -20668,7 +20668,7 @@ void NoteStoreTester::shouldExecuteUpdateTagAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() @@ -20772,7 +20772,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -20886,7 +20886,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -20999,7 +20999,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -21112,7 +21112,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -21676,7 +21676,7 @@ void NoteStoreTester::shouldExecuteUntagAllAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() @@ -21780,7 +21780,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -21894,7 +21894,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAllAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -22007,7 +22007,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAllAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -22120,7 +22120,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAllAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -22694,7 +22694,7 @@ void NoteStoreTester::shouldExecuteExpungeTagAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() @@ -22798,7 +22798,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -22912,7 +22912,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -23025,7 +23025,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -23138,7 +23138,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTagAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -23603,7 +23603,7 @@ void NoteStoreTester::shouldExecuteListSearchesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() @@ -23703,7 +23703,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -23813,7 +23813,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearchesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -23922,7 +23922,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearchesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -24496,7 +24496,7 @@ void NoteStoreTester::shouldExecuteGetSearchAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() @@ -24600,7 +24600,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -24714,7 +24714,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -24827,7 +24827,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -24940,7 +24940,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -25419,7 +25419,7 @@ void NoteStoreTester::shouldExecuteCreateSearchAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() @@ -25523,7 +25523,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -25637,7 +25637,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -25750,7 +25750,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -26324,7 +26324,7 @@ void NoteStoreTester::shouldExecuteUpdateSearchAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() @@ -26428,7 +26428,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -26542,7 +26542,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -26655,7 +26655,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -26768,7 +26768,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -27342,7 +27342,7 @@ void NoteStoreTester::shouldExecuteExpungeSearchAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() @@ -27446,7 +27446,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -27560,7 +27560,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -27673,7 +27673,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -27786,7 +27786,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearchAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -28384,7 +28384,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffsetAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() @@ -28492,7 +28492,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -28610,7 +28610,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -28727,7 +28727,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -28844,7 +28844,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffsetAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -29490,7 +29490,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadataAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() @@ -29606,7 +29606,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -29732,7 +29732,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -29857,7 +29857,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -29982,7 +29982,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -30580,7 +30580,7 @@ void NoteStoreTester::shouldExecuteFindNoteCountsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() @@ -30688,7 +30688,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -30806,7 +30806,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -30923,7 +30923,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -31040,7 +31040,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCountsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -31638,7 +31638,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpecAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync() @@ -31746,7 +31746,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -31864,7 +31864,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -31981,7 +31981,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -32098,7 +32098,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -32768,7 +32768,7 @@ void NoteStoreTester::shouldExecuteGetNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() @@ -32888,7 +32888,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -33018,7 +33018,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -33147,7 +33147,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -33276,7 +33276,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -33850,7 +33850,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsync() @@ -33954,7 +33954,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -34068,7 +34068,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -34181,7 +34181,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -34294,7 +34294,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -34892,7 +34892,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntryAsync() @@ -35000,7 +35000,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -35118,7 +35118,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -35235,7 +35235,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -35352,7 +35352,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntryA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -35974,7 +35974,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntryAsync() @@ -36086,7 +36086,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -36208,7 +36208,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -36329,7 +36329,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -36450,7 +36450,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntryA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -37048,7 +37048,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEntryAsync() @@ -37156,7 +37156,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -37274,7 +37274,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -37391,7 +37391,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -37508,7 +37508,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -38082,7 +38082,7 @@ void NoteStoreTester::shouldExecuteGetNoteContentAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() @@ -38186,7 +38186,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -38300,7 +38300,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContentAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -38413,7 +38413,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -38526,7 +38526,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContentAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -39148,7 +39148,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchTextAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() @@ -39260,7 +39260,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -39382,7 +39382,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -39503,7 +39503,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -39624,7 +39624,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchTextAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -40198,7 +40198,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchTextAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync() @@ -40302,7 +40302,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -40416,7 +40416,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -40529,7 +40529,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -40642,7 +40642,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchTextAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -41222,7 +41222,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNamesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() @@ -41326,7 +41326,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -41440,7 +41440,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -41553,7 +41553,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -41666,7 +41666,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNamesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -42240,7 +42240,7 @@ void NoteStoreTester::shouldExecuteCreateNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() @@ -42344,7 +42344,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -42458,7 +42458,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -42571,7 +42571,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -42684,7 +42684,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -43258,7 +43258,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() @@ -43362,7 +43362,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -43476,7 +43476,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -43589,7 +43589,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -43702,7 +43702,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -44276,7 +44276,7 @@ void NoteStoreTester::shouldExecuteDeleteNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() @@ -44380,7 +44380,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -44494,7 +44494,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -44607,7 +44607,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -44720,7 +44720,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -45294,7 +45294,7 @@ void NoteStoreTester::shouldExecuteExpungeNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() @@ -45398,7 +45398,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -45512,7 +45512,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -45625,7 +45625,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -45738,7 +45738,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -46336,7 +46336,7 @@ void NoteStoreTester::shouldExecuteCopyNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() @@ -46444,7 +46444,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -46562,7 +46562,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -46679,7 +46679,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -46796,7 +46796,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -47376,7 +47376,7 @@ void NoteStoreTester::shouldExecuteListNoteVersionsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() @@ -47480,7 +47480,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -47594,7 +47594,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -47707,7 +47707,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -47820,7 +47820,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersionsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -48490,7 +48490,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersionAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() @@ -48610,7 +48610,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -48740,7 +48740,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -48869,7 +48869,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -48998,7 +48998,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -49668,7 +49668,7 @@ void NoteStoreTester::shouldExecuteGetResourceAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() @@ -49788,7 +49788,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -49918,7 +49918,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -50047,7 +50047,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -50176,7 +50176,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -50750,7 +50750,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataAsync() @@ -50854,7 +50854,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -50968,7 +50968,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -51081,7 +51081,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -51194,7 +51194,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -51792,7 +51792,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationDataEntryAsync() @@ -51900,7 +51900,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -52018,7 +52018,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -52135,7 +52135,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -52252,7 +52252,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -52874,7 +52874,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationDataEntryAsync() @@ -52986,7 +52986,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -53108,7 +53108,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -53229,7 +53229,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -53350,7 +53350,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -53948,7 +53948,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntryAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDataEntryAsync() @@ -54056,7 +54056,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -54174,7 +54174,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -54291,7 +54291,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -54408,7 +54408,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -54982,7 +54982,7 @@ void NoteStoreTester::shouldExecuteUpdateResourceAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() @@ -55086,7 +55086,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -55200,7 +55200,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -55313,7 +55313,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -55426,7 +55426,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResourceAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -56000,7 +56000,7 @@ void NoteStoreTester::shouldExecuteGetResourceDataAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() @@ -56104,7 +56104,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -56218,7 +56218,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceDataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -56331,7 +56331,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -56444,7 +56444,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceDataAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -57114,7 +57114,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHashAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() @@ -57234,7 +57234,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -57364,7 +57364,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -57493,7 +57493,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -57622,7 +57622,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHashAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -58196,7 +58196,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognitionAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsync() @@ -58300,7 +58300,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -58414,7 +58414,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -58527,7 +58527,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -58640,7 +58640,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognitionAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -59214,7 +59214,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateDataAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAsync() @@ -59318,7 +59318,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -59432,7 +59432,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -59545,7 +59545,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -59658,7 +59658,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateDataAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -60232,7 +60232,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync() @@ -60336,7 +60336,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -60450,7 +60450,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -60563,7 +60563,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -60676,7 +60676,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -61165,7 +61165,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() @@ -61272,7 +61272,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -61387,7 +61387,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -61502,7 +61502,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -62100,7 +62100,7 @@ void NoteStoreTester::shouldExecuteShareNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() @@ -62208,7 +62208,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -62325,7 +62325,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -62443,7 +62443,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -62560,7 +62560,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -63235,7 +63235,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookSharesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookSharesAsync() @@ -63339,7 +63339,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -63452,7 +63452,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -63566,7 +63566,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -63685,7 +63685,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMInvalidContactsException & e) @@ -63798,7 +63798,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -64372,7 +64372,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync() @@ -64476,7 +64476,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -64589,7 +64589,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -64703,7 +64703,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -64816,7 +64816,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -65414,7 +65414,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettingsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettingsAsync() @@ -65522,7 +65522,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -65639,7 +65639,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -65757,7 +65757,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -65874,7 +65874,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -66430,7 +66430,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooksAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() @@ -66530,7 +66530,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -66639,7 +66639,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -66749,7 +66749,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -66858,7 +66858,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -67432,7 +67432,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync() @@ -67536,7 +67536,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -67649,7 +67649,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -67763,7 +67763,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -67876,7 +67876,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -68450,7 +68450,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync() @@ -68554,7 +68554,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -68667,7 +68667,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -68781,7 +68781,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -68894,7 +68894,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -69450,7 +69450,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooksAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() @@ -69550,7 +69550,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -69659,7 +69659,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -69769,7 +69769,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -69878,7 +69878,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooksAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -70452,7 +70452,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync() @@ -70556,7 +70556,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -70669,7 +70669,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -70783,7 +70783,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -70896,7 +70896,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -71470,7 +71470,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebookAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebookAsync() @@ -71574,7 +71574,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -71687,7 +71687,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -71801,7 +71801,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -71914,7 +71914,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -72464,7 +72464,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsync() @@ -72564,7 +72564,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -72673,7 +72673,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -72783,7 +72783,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -72892,7 +72892,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -73456,7 +73456,7 @@ void NoteStoreTester::shouldExecuteEmailNoteAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() @@ -73560,7 +73560,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -73673,7 +73673,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -73787,7 +73787,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -73900,7 +73900,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -74474,7 +74474,7 @@ void NoteStoreTester::shouldExecuteShareNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() @@ -74578,7 +74578,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -74691,7 +74691,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -74805,7 +74805,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -74918,7 +74918,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -75482,7 +75482,7 @@ void NoteStoreTester::shouldExecuteStopSharingNoteAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() @@ -75586,7 +75586,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -75699,7 +75699,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -75813,7 +75813,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -75926,7 +75926,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNoteAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -76524,7 +76524,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNoteAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAsync() @@ -76632,7 +76632,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -76749,7 +76749,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -76867,7 +76867,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -76984,7 +76984,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -77582,7 +77582,7 @@ void NoteStoreTester::shouldExecuteFindRelatedAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() @@ -77690,7 +77690,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -77808,7 +77808,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelatedAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -77925,7 +77925,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -78042,7 +78042,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelatedAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -78616,7 +78616,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatchesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsync() @@ -78720,7 +78720,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -78833,7 +78833,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -78947,7 +78947,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -79060,7 +79060,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -79634,7 +79634,7 @@ void NoteStoreTester::shouldExecuteManageNotebookSharesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync() @@ -79738,7 +79738,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -79851,7 +79851,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -79965,7 +79965,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -80078,7 +80078,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookSharesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -80652,7 +80652,7 @@ void NoteStoreTester::shouldExecuteGetNotebookSharesAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() @@ -80756,7 +80756,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -80869,7 +80869,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -80983,7 +80983,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -81096,7 +81096,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookSharesAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 10c0dd74..5c8a6dd2 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -1522,7 +1522,7 @@ void UserStoreTester::shouldExecuteCheckVersionAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() @@ -1632,7 +1632,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -1914,7 +1914,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() @@ -2016,7 +2016,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -2605,7 +2605,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsync() @@ -2731,7 +2731,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -2867,7 +2867,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -3002,7 +3002,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -3521,7 +3521,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthenticationAsync() @@ -3633,7 +3633,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -3755,7 +3755,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -3876,7 +3876,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -4326,7 +4326,7 @@ void UserStoreTester::shouldExecuteRevokeLongSessionAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() @@ -4426,7 +4426,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -4536,7 +4536,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -4645,7 +4645,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -5104,7 +5104,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsync() @@ -5204,7 +5204,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -5314,7 +5314,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAs loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -5423,7 +5423,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -5882,7 +5882,7 @@ void UserStoreTester::shouldExecuteGetUserAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() @@ -5982,7 +5982,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -6092,7 +6092,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -6201,7 +6201,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -6763,7 +6763,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync() @@ -6865,7 +6865,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -6977,7 +6977,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -7088,7 +7088,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -7199,7 +7199,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -7658,7 +7658,7 @@ void UserStoreTester::shouldExecuteGetUserUrlsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() @@ -7758,7 +7758,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -7868,7 +7868,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -7977,7 +7977,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -8447,7 +8447,7 @@ void UserStoreTester::shouldExecuteInviteToBusinessAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() @@ -8551,7 +8551,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -8665,7 +8665,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -8778,7 +8778,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -9342,7 +9342,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() @@ -9446,7 +9446,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -9560,7 +9560,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync( loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -9673,7 +9673,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsyn loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -9786,7 +9786,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -10374,7 +10374,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() loop.exec(); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifierAsync() @@ -10482,7 +10482,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -10600,7 +10600,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -10717,7 +10717,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMNotFoundException & e) @@ -10834,7 +10834,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -11299,7 +11299,7 @@ void UserStoreTester::shouldExecuteListBusinessUsersAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() @@ -11399,7 +11399,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -11509,7 +11509,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -11618,7 +11618,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -12103,7 +12103,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsync() @@ -12207,7 +12207,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsy loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -12321,7 +12321,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsA loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMSystemException & e) @@ -12434,7 +12434,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) @@ -12809,7 +12809,7 @@ void UserStoreTester::shouldExecuteGetAccountLimitsAsync() loop.exec(); QVERIFY(valueFetcher.m_value == response); - QVERIFY(!valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() == nullptr); } void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() @@ -12911,7 +12911,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const EDAMUserException & e) @@ -13022,7 +13022,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() loop.exec(); - QVERIFY(valueFetcher.m_exceptionData); + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); valueFetcher.m_exceptionData->throwException(); } catch(const ThriftException & e) From 048c3384d9917316d899b1d5aa9e2f1bc9ff7580 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 15 Dec 2019 13:41:35 +0300 Subject: [PATCH 132/188] Update generated code --- .../tests/generated/RandomDataGenerators.cpp | 13 +- .../src/tests/generated/TestNoteStore.cpp | 2398 +++++++++++++---- .../src/tests/generated/TestUserStore.cpp | 232 ++ 3 files changed, 2164 insertions(+), 479 deletions(-) diff --git a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp index 2e170d08..f80b7ccf 100644 --- a/QEverCloud/src/tests/generated/RandomDataGenerators.cpp +++ b/QEverCloud/src/tests/generated/RandomDataGenerators.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -25,8 +26,11 @@ namespace { //////////////////////////////////////////////////////////////////////////////// -static const QString randomStringAvailableCharacters = QStringLiteral( - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); +Q_GLOBAL_STATIC_WITH_ARGS( + QString, + randomStringAvailableCharacters, + (QString::fromUtf8( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))) template T generateRandomIntType() @@ -49,8 +53,9 @@ QString generateRandomString(int len) QString res; res.reserve(len); for(int i = 0; i < len; ++i) { - int index = rand() % randomStringAvailableCharacters.length(); - res.append(randomStringAvailableCharacters.at(index)); } + int index = rand() % randomStringAvailableCharacters->length(); + res.append(randomStringAvailableCharacters->at(index)); + } return res; } diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index 4c20e825..ee606fae 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -6072,6 +6072,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6091,6 +6092,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6152,6 +6154,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6171,6 +6174,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncState() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6244,6 +6248,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6263,6 +6268,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncState() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6335,6 +6341,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6354,6 +6361,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncState() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6424,6 +6432,7 @@ void NoteStoreTester::shouldExecuteGetSyncStateAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6443,6 +6452,7 @@ void NoteStoreTester::shouldExecuteGetSyncStateAsync() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6522,6 +6532,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6541,6 +6552,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSyncStateAsync() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6632,6 +6644,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncStateAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6651,6 +6664,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSyncStateAsync() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6741,6 +6755,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncStateAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6760,6 +6775,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSyncStateAsync() QObject::connect( &server, &NoteStoreServer::getSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6859,6 +6875,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6878,6 +6895,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunk() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6951,6 +6969,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6970,6 +6989,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunk() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7055,6 +7075,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7074,6 +7095,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunk() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7158,6 +7180,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7177,6 +7200,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunk() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7259,6 +7283,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunkAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7278,6 +7303,7 @@ void NoteStoreTester::shouldExecuteGetFilteredSyncChunkAsync() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7369,6 +7395,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7388,6 +7415,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetFilteredSyncChunkAsync( QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7491,6 +7519,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7510,6 +7539,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetFilteredSyncChunkAsyn QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7612,6 +7642,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7631,6 +7662,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetFilteredSyncChunkAsync() QObject::connect( &server, &NoteStoreServer::getFilteredSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7727,6 +7759,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7746,6 +7779,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncState() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7811,6 +7845,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7830,6 +7865,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7907,6 +7943,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7926,6 +7963,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8002,6 +8040,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8021,6 +8060,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8097,6 +8137,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8116,6 +8157,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncState() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8190,6 +8232,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncStateAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8209,6 +8252,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncStateAsync() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8292,6 +8336,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8311,6 +8356,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncState QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8406,6 +8452,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8425,6 +8472,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncSta QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8519,6 +8567,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8538,6 +8587,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncS QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8632,6 +8682,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8651,6 +8702,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncStateAs QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncStateRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8754,6 +8806,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8773,6 +8826,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunk() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8850,6 +8904,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8869,6 +8924,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8958,6 +9014,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8977,6 +9034,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9065,6 +9123,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9084,6 +9143,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9172,6 +9232,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9191,6 +9252,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunk() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9277,6 +9339,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunkAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9296,6 +9359,7 @@ void NoteStoreTester::shouldExecuteGetLinkedNotebookSyncChunkAsync() QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9391,6 +9455,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9410,6 +9475,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetLinkedNotebookSyncChunk QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9517,6 +9583,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9536,6 +9603,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetLinkedNotebookSyncChu QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9642,6 +9710,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9661,6 +9730,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetLinkedNotebookSyncC QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9767,6 +9837,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9786,6 +9857,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetLinkedNotebookSyncChunkAs QObject::connect( &server, &NoteStoreServer::getLinkedNotebookSyncChunkRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9883,6 +9955,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9902,6 +9975,7 @@ void NoteStoreTester::shouldExecuteListNotebooks() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9963,6 +10037,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9982,6 +10057,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooks() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10055,97 +10131,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::listNotebooksRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port), - nullptr, - nullptr, - nullRetryPolicy()); - bool caughtException = false; - try - { - QList res = noteStore->listNotebooks( - ctx); - Q_UNUSED(res) - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto thriftException = ThriftException( - ThriftException::Type::INTERNAL_ERROR, - QStringLiteral("Internal error")); - - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - throw thriftException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::listNotebooksRequest, - &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); - QObject::connect( - &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, - &server, - &NoteStoreServer::onListNotebooksRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( &tcpServer, - &QTcpServer::newConnection, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10165,98 +10151,194 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port), - nullptr, - nullptr, - nullRetryPolicy()); - bool caughtException = false; - try - { - QList res = noteStore->listNotebooks( - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldExecuteListNotebooksAsync() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - QList response; - response << generateRandomNotebook(); - response << generateRandomNotebook(); - response << generateRandomNotebook(); - - NoteStoreListNotebooksTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> QList - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::listNotebooksRequest, - &helper, - &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); - QObject::connect( - &helper, - &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, - &server, - &NoteStoreServer::onListNotebooksRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( - &tcpServer, - &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( &server, - &NoteStoreServer::listNotebooksRequestReady, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooks() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + &tcpServer, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + &server, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); + bool caughtException = false; + try + { + QList res = noteStore->listNotebooks( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteListNotebooksAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + QList response; + response << generateRandomNotebook(); + response << generateRandomNotebook(); + response << generateRandomNotebook(); + + NoteStoreListNotebooksTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> QList + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequest, + &helper, + &NoteStoreListNotebooksTesterHelper::onListNotebooksRequestReceived); + QObject::connect( + &helper, + &NoteStoreListNotebooksTesterHelper::listNotebooksRequestReady, + &server, + &NoteStoreServer::onListNotebooksRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + &tcpServer, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10336,6 +10418,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10355,6 +10438,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10446,6 +10530,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10465,6 +10550,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10555,6 +10641,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10574,6 +10661,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10667,6 +10755,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10686,6 +10775,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooks() QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10747,6 +10837,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10766,6 +10857,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10839,6 +10931,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10858,6 +10951,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10930,6 +11024,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10949,6 +11044,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11022,6 +11118,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11041,6 +11138,7 @@ void NoteStoreTester::shouldExecuteListAccessibleBusinessNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11120,6 +11218,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11139,6 +11238,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListAccessibleBusinessNote QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11230,6 +11330,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11249,6 +11350,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListAccessibleBusinessNo QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11339,6 +11441,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11358,6 +11461,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListAccessibleBusinessNotebo QObject::connect( &server, &NoteStoreServer::listAccessibleBusinessNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11451,6 +11555,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11470,6 +11575,7 @@ void NoteStoreTester::shouldExecuteGetNotebook() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11535,6 +11641,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11554,6 +11661,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebook() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11631,6 +11739,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11650,6 +11759,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebook() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11726,6 +11836,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11745,6 +11856,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebook() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11821,6 +11933,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11840,6 +11953,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebook() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11914,6 +12028,7 @@ void NoteStoreTester::shouldExecuteGetNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11933,6 +12048,7 @@ void NoteStoreTester::shouldExecuteGetNotebookAsync() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12016,6 +12132,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12035,6 +12152,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookAsync() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12130,6 +12248,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12149,6 +12268,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookAsync() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12243,6 +12363,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12262,6 +12383,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookAsync() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12356,6 +12478,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12375,6 +12498,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookAsync() QObject::connect( &server, &NoteStoreServer::getNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12466,6 +12590,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12485,6 +12610,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebook() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12546,6 +12672,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12565,6 +12692,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebook() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12638,6 +12766,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12657,6 +12786,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebook() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12729,6 +12859,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12748,6 +12879,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebook() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12818,6 +12950,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12837,6 +12970,7 @@ void NoteStoreTester::shouldExecuteGetDefaultNotebookAsync() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12916,6 +13050,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12935,6 +13070,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetDefaultNotebookAsync() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13026,6 +13162,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13045,6 +13182,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetDefaultNotebookAsync( QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13135,6 +13273,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13154,6 +13293,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetDefaultNotebookAsync() QObject::connect( &server, &NoteStoreServer::getDefaultNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13247,6 +13387,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13266,6 +13407,7 @@ void NoteStoreTester::shouldExecuteCreateNotebook() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13331,6 +13473,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13350,6 +13493,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebook() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13427,6 +13571,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13446,6 +13591,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebook() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13522,6 +13668,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13541,6 +13688,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebook() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13617,6 +13765,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13636,6 +13785,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebook() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13710,6 +13860,7 @@ void NoteStoreTester::shouldExecuteCreateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13729,6 +13880,7 @@ void NoteStoreTester::shouldExecuteCreateNotebookAsync() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13812,6 +13964,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13831,6 +13984,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNotebookAsync() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -13926,6 +14080,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -13945,6 +14100,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNotebookAsync() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14039,6 +14195,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14058,6 +14215,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNotebookAsync() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14152,6 +14310,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14171,6 +14330,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNotebookAsync() QObject::connect( &server, &NoteStoreServer::createNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14265,6 +14425,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14284,6 +14445,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebook() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14349,6 +14511,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14368,6 +14531,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebook() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14445,6 +14609,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14464,6 +14629,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebook() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14540,6 +14706,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14559,6 +14726,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebook() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14635,6 +14803,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14654,6 +14823,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebook() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14728,6 +14898,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14747,6 +14918,7 @@ void NoteStoreTester::shouldExecuteUpdateNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14830,6 +15002,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14849,6 +15022,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -14944,6 +15118,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -14963,6 +15138,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15057,6 +15233,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15076,6 +15253,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15170,6 +15348,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15189,6 +15368,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15283,6 +15463,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15302,6 +15483,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebook() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15367,6 +15549,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15386,6 +15569,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebook() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15463,6 +15647,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15482,6 +15667,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebook() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15558,6 +15744,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15577,6 +15764,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebook() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15653,6 +15841,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15672,6 +15861,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebook() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15746,6 +15936,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15765,6 +15956,7 @@ void NoteStoreTester::shouldExecuteExpungeNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15848,6 +16040,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15867,6 +16060,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -15962,6 +16156,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -15981,6 +16176,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16075,6 +16271,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16094,6 +16291,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16188,6 +16386,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16207,6 +16406,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16301,6 +16501,7 @@ void NoteStoreTester::shouldExecuteListTags() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16320,6 +16521,7 @@ void NoteStoreTester::shouldExecuteListTags() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16381,6 +16583,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16400,6 +16603,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTags() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16473,6 +16677,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16492,6 +16697,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTags() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16564,6 +16770,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16583,6 +16790,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTags() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16656,6 +16864,7 @@ void NoteStoreTester::shouldExecuteListTagsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16675,6 +16884,7 @@ void NoteStoreTester::shouldExecuteListTagsAsync() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16754,6 +16964,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16773,6 +16984,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsAsync() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16864,6 +17076,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16883,6 +17096,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsAsync() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -16973,6 +17187,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -16992,6 +17207,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsAsync() QObject::connect( &server, &NoteStoreServer::listTagsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17088,6 +17304,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17107,6 +17324,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebook() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17172,6 +17390,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17191,6 +17410,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebook() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17268,6 +17488,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17287,6 +17508,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebook() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17363,6 +17585,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17382,6 +17605,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebook() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17458,6 +17682,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17477,6 +17702,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebook() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17554,6 +17780,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17573,6 +17800,7 @@ void NoteStoreTester::shouldExecuteListTagsByNotebookAsync() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17656,6 +17884,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17675,6 +17904,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListTagsByNotebookAsync() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17770,6 +18000,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17789,6 +18020,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListTagsByNotebookAsync( QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17883,6 +18115,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -17902,6 +18135,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListTagsByNotebookAsyn QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -17996,6 +18230,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18015,6 +18250,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListTagsByNotebookAsync() QObject::connect( &server, &NoteStoreServer::listTagsByNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18109,6 +18345,7 @@ void NoteStoreTester::shouldExecuteGetTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18128,6 +18365,7 @@ void NoteStoreTester::shouldExecuteGetTag() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18193,6 +18431,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18212,6 +18451,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTag() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18289,6 +18529,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18308,6 +18549,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTag() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18384,6 +18626,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18403,6 +18646,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTag() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18479,6 +18723,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18498,6 +18743,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTag() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18572,6 +18818,7 @@ void NoteStoreTester::shouldExecuteGetTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18591,6 +18838,7 @@ void NoteStoreTester::shouldExecuteGetTagAsync() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18674,6 +18922,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18693,6 +18942,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetTagAsync() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18788,6 +19038,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18807,6 +19058,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetTagAsync() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -18901,6 +19153,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -18920,6 +19173,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetTagAsync() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19014,6 +19268,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19033,6 +19288,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetTagAsync() QObject::connect( &server, &NoteStoreServer::getTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19127,6 +19383,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19146,6 +19403,7 @@ void NoteStoreTester::shouldExecuteCreateTag() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19211,6 +19469,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19230,6 +19489,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTag() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19307,6 +19567,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19326,6 +19587,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTag() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19402,6 +19664,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19421,6 +19684,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTag() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19497,6 +19761,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19516,6 +19781,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTag() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19590,6 +19856,7 @@ void NoteStoreTester::shouldExecuteCreateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19609,6 +19876,7 @@ void NoteStoreTester::shouldExecuteCreateTagAsync() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19692,6 +19960,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19711,6 +19980,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateTagAsync() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19806,6 +20076,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19825,6 +20096,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateTagAsync() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -19919,6 +20191,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -19938,6 +20211,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateTagAsync() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20032,6 +20306,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20051,6 +20326,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateTagAsync() QObject::connect( &server, &NoteStoreServer::createTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20145,6 +20421,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20164,6 +20441,7 @@ void NoteStoreTester::shouldExecuteUpdateTag() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20229,6 +20507,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20248,6 +20527,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTag() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20325,6 +20605,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20344,6 +20625,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTag() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20420,6 +20702,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20439,6 +20722,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTag() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20515,6 +20799,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20534,6 +20819,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTag() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20608,6 +20894,7 @@ void NoteStoreTester::shouldExecuteUpdateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20627,6 +20914,7 @@ void NoteStoreTester::shouldExecuteUpdateTagAsync() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20710,6 +20998,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20729,6 +21018,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateTagAsync() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20824,6 +21114,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20843,6 +21134,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateTagAsync() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -20937,6 +21229,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -20956,6 +21249,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateTagAsync() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21050,6 +21344,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21069,6 +21364,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateTagAsync() QObject::connect( &server, &NoteStoreServer::updateTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21161,6 +21457,7 @@ void NoteStoreTester::shouldExecuteUntagAll() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21180,6 +21477,7 @@ void NoteStoreTester::shouldExecuteUntagAll() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21244,6 +21542,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21263,6 +21562,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAll() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21339,6 +21639,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21358,6 +21659,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAll() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21433,6 +21735,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21452,6 +21755,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAll() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21527,6 +21831,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21546,6 +21851,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAll() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21617,6 +21923,7 @@ void NoteStoreTester::shouldExecuteUntagAllAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21636,6 +21943,7 @@ void NoteStoreTester::shouldExecuteUntagAllAsync() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21718,6 +22026,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21737,6 +22046,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUntagAllAsync() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21832,6 +22142,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAllAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21851,6 +22162,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUntagAllAsync() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -21945,6 +22257,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAllAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -21964,6 +22277,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUntagAllAsync() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22058,6 +22372,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAllAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22077,6 +22392,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUntagAllAsync() QObject::connect( &server, &NoteStoreServer::untagAllRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22171,6 +22487,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22190,6 +22507,7 @@ void NoteStoreTester::shouldExecuteExpungeTag() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22255,6 +22573,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22274,6 +22593,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTag() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22351,6 +22671,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22370,6 +22691,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTag() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22446,6 +22768,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22465,6 +22788,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTag() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22541,6 +22865,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22560,6 +22885,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTag() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22634,6 +22960,7 @@ void NoteStoreTester::shouldExecuteExpungeTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22653,6 +22980,7 @@ void NoteStoreTester::shouldExecuteExpungeTagAsync() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22736,6 +23064,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22755,6 +23084,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeTagAsync() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22850,6 +23180,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22869,6 +23200,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeTagAsync() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -22963,6 +23295,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -22982,6 +23315,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeTagAsync() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23076,6 +23410,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTagAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23095,6 +23430,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeTagAsync() QObject::connect( &server, &NoteStoreServer::expungeTagRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23189,6 +23525,7 @@ void NoteStoreTester::shouldExecuteListSearches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23208,6 +23545,7 @@ void NoteStoreTester::shouldExecuteListSearches() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23269,6 +23607,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23288,6 +23627,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearches() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23361,6 +23701,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23380,6 +23721,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearches() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23452,6 +23794,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23471,6 +23814,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearches() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23544,6 +23888,7 @@ void NoteStoreTester::shouldExecuteListSearchesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23563,6 +23908,7 @@ void NoteStoreTester::shouldExecuteListSearchesAsync() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23642,6 +23988,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23661,6 +24008,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSearchesAsync() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23752,6 +24100,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearchesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23771,6 +24120,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSearchesAsync() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23861,6 +24211,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearchesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23880,6 +24231,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSearchesAsync() QObject::connect( &server, &NoteStoreServer::listSearchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -23973,6 +24325,7 @@ void NoteStoreTester::shouldExecuteGetSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -23992,6 +24345,7 @@ void NoteStoreTester::shouldExecuteGetSearch() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24057,6 +24411,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24076,6 +24431,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearch() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24153,6 +24509,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24172,6 +24529,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearch() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24248,6 +24606,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24267,6 +24626,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearch() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24343,6 +24703,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24362,6 +24723,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearch() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24436,6 +24798,7 @@ void NoteStoreTester::shouldExecuteGetSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24455,6 +24818,7 @@ void NoteStoreTester::shouldExecuteGetSearchAsync() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24538,6 +24902,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24557,6 +24922,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSearchAsync() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24652,6 +25018,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24671,6 +25038,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSearchAsync() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24765,6 +25133,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24784,6 +25153,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSearchAsync() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24878,6 +25248,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -24897,6 +25268,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSearchAsync() QObject::connect( &server, &NoteStoreServer::getSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -24991,6 +25363,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25010,6 +25383,7 @@ void NoteStoreTester::shouldExecuteCreateSearch() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25075,6 +25449,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25094,6 +25469,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearch() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25171,6 +25547,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25190,6 +25567,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearch() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25266,6 +25644,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25285,6 +25664,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearch() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25359,6 +25739,7 @@ void NoteStoreTester::shouldExecuteCreateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25378,6 +25759,7 @@ void NoteStoreTester::shouldExecuteCreateSearchAsync() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25461,6 +25843,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25480,6 +25863,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateSearchAsync() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25575,6 +25959,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25594,6 +25979,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateSearchAsync() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25688,6 +26074,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25707,6 +26094,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateSearchAsync() QObject::connect( &server, &NoteStoreServer::createSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25801,6 +26189,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25820,6 +26209,7 @@ void NoteStoreTester::shouldExecuteUpdateSearch() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25885,6 +26275,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -25904,6 +26295,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearch() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -25981,6 +26373,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26000,6 +26393,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearch() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26076,6 +26470,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26095,6 +26490,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearch() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26171,6 +26567,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26190,6 +26587,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearch() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26264,6 +26662,7 @@ void NoteStoreTester::shouldExecuteUpdateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26283,6 +26682,7 @@ void NoteStoreTester::shouldExecuteUpdateSearchAsync() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26366,6 +26766,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26385,6 +26786,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSearchAsync() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26480,6 +26882,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26499,6 +26902,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSearchAsync() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26593,6 +26997,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26612,6 +27017,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSearchAsync() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26706,6 +27112,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26725,6 +27132,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSearchAsync() QObject::connect( &server, &NoteStoreServer::updateSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26819,6 +27227,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26838,6 +27247,7 @@ void NoteStoreTester::shouldExecuteExpungeSearch() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26903,6 +27313,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -26922,6 +27333,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearch() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -26999,6 +27411,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27018,6 +27431,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearch() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27094,6 +27508,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27113,6 +27528,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearch() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27189,6 +27605,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27208,6 +27625,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearch() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27282,6 +27700,7 @@ void NoteStoreTester::shouldExecuteExpungeSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27301,6 +27720,7 @@ void NoteStoreTester::shouldExecuteExpungeSearchAsync() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27384,6 +27804,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27403,6 +27824,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeSearchAsync() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27498,6 +27920,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27517,6 +27940,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeSearchAsync() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27611,6 +28035,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27630,6 +28055,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeSearchAsync() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27724,6 +28150,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearchAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27743,6 +28170,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeSearchAsync() QObject::connect( &server, &NoteStoreServer::expungeSearchRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27840,6 +28268,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27859,6 +28288,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffset() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -27928,6 +28358,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -27947,6 +28378,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffset() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28028,6 +28460,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28047,6 +28480,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffset() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28127,6 +28561,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28146,6 +28581,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffset() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28226,6 +28662,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28245,6 +28682,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffset() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28323,6 +28761,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffsetAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28342,6 +28781,7 @@ void NoteStoreTester::shouldExecuteFindNoteOffsetAsync() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28429,6 +28869,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28448,6 +28889,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteOffsetAsync() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28547,6 +28989,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28566,6 +29009,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteOffsetAsync() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28664,6 +29108,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28683,6 +29128,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteOffsetAsync() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28781,6 +29227,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffsetAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28800,6 +29247,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteOffsetAsync() QObject::connect( &server, &NoteStoreServer::findNoteOffsetRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -28904,6 +29352,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -28923,6 +29372,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadata() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29000,6 +29450,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29019,6 +29470,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadata() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29108,6 +29560,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29127,6 +29580,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadata() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29215,6 +29669,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29234,6 +29689,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadata() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29322,6 +29778,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29341,6 +29798,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadata() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29427,6 +29885,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29446,6 +29905,7 @@ void NoteStoreTester::shouldExecuteFindNotesMetadataAsync() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29541,6 +30001,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29560,6 +30021,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNotesMetadataAsync() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29667,6 +30129,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29686,6 +30149,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNotesMetadataAsync() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29792,6 +30256,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29811,6 +30276,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNotesMetadataAsync QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -29917,6 +30383,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -29936,6 +30403,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNotesMetadataAsync() QObject::connect( &server, &NoteStoreServer::findNotesMetadataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30036,6 +30504,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30055,6 +30524,7 @@ void NoteStoreTester::shouldExecuteFindNoteCounts() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30124,6 +30594,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30143,6 +30614,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCounts() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30224,6 +30696,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30243,6 +30716,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCounts() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30323,6 +30797,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30342,6 +30817,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCounts() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30422,6 +30898,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30441,6 +30918,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCounts() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30519,6 +30997,7 @@ void NoteStoreTester::shouldExecuteFindNoteCountsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30538,6 +31017,7 @@ void NoteStoreTester::shouldExecuteFindNoteCountsAsync() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30625,6 +31105,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30644,6 +31125,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindNoteCountsAsync() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30743,6 +31225,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30762,6 +31245,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindNoteCountsAsync() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30860,6 +31344,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30879,6 +31364,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindNoteCountsAsync() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -30977,6 +31463,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCountsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -30996,6 +31483,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindNoteCountsAsync() QObject::connect( &server, &NoteStoreServer::findNoteCountsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31094,6 +31582,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31113,6 +31602,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpec() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31182,6 +31672,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31201,6 +31692,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpec() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31282,6 +31774,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31301,6 +31794,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpec() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31381,6 +31875,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31400,6 +31895,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpec( QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31480,6 +31976,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31499,6 +31996,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpec() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31577,6 +32075,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpecAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31596,6 +32095,7 @@ void NoteStoreTester::shouldExecuteGetNoteWithResultSpecAsync() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31683,6 +32183,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31702,6 +32203,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteWithResultSpecAsync QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31801,6 +32303,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31820,6 +32323,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteWithResultSpecAsy QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -31918,6 +32422,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -31937,6 +32442,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteWithResultSpecA QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32035,6 +32541,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32054,6 +32561,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteWithResultSpecAsync() QObject::connect( &server, &NoteStoreServer::getNoteWithResultSpecRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32161,6 +32669,7 @@ void NoteStoreTester::shouldExecuteGetNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32180,6 +32689,7 @@ void NoteStoreTester::shouldExecuteGetNote() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32261,6 +32771,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32280,6 +32791,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNote() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32373,6 +32885,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32392,6 +32905,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNote() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32484,6 +32998,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32503,6 +33018,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNote() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32595,6 +33111,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32614,6 +33131,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNote() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32704,6 +33222,7 @@ void NoteStoreTester::shouldExecuteGetNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32723,6 +33242,7 @@ void NoteStoreTester::shouldExecuteGetNoteAsync() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32822,6 +33342,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32841,6 +33362,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteAsync() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -32952,6 +33474,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -32971,6 +33494,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteAsync() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33081,6 +33605,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33100,6 +33625,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteAsync() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33210,6 +33736,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33229,6 +33756,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteAsync() QObject::connect( &server, &NoteStoreServer::getNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33327,6 +33855,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33346,6 +33875,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationData() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33411,6 +33941,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33430,6 +33961,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationData() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33507,6 +34039,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33526,6 +34059,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationData() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33602,6 +34136,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33621,6 +34156,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33697,6 +34233,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33716,6 +34253,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationData() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33790,6 +34328,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33809,6 +34348,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataAsync() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -33892,6 +34432,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -33911,6 +34452,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataAsyn QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34006,6 +34548,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34025,6 +34568,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataAs QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34119,6 +34663,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34138,6 +34683,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34232,6 +34778,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34251,6 +34798,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataAsync( QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34348,6 +34896,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34367,6 +34916,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34436,6 +34986,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34455,6 +35006,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34536,6 +35088,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34555,6 +35108,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34635,6 +35189,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34654,6 +35209,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34734,6 +35290,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34753,6 +35310,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntry( QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34831,6 +35389,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34850,6 +35409,7 @@ void NoteStoreTester::shouldExecuteGetNoteApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -34937,6 +35497,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -34956,6 +35517,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35055,6 +35617,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35074,6 +35637,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35172,6 +35736,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35191,6 +35756,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteApplicationData QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35289,6 +35855,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntryA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35308,6 +35875,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteApplicationDataEntryA QObject::connect( &server, &NoteStoreServer::getNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35409,6 +35977,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35428,6 +35997,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35501,6 +36071,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35520,6 +36091,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35605,6 +36177,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35624,6 +36197,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35708,6 +36282,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35727,6 +36302,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35811,6 +36387,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35830,6 +36407,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntry( QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -35912,6 +36490,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -35931,6 +36510,7 @@ void NoteStoreTester::shouldExecuteSetNoteApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36022,6 +36602,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36041,6 +36622,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36144,6 +36726,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36163,6 +36746,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36265,6 +36849,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36284,6 +36869,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNoteApplicationData QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36386,6 +36972,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntryA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36405,6 +36992,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNoteApplicationDataEntryA QObject::connect( &server, &NoteStoreServer::setNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36504,6 +37092,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36523,6 +37112,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36592,6 +37182,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36611,6 +37202,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36692,6 +37284,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36711,6 +37304,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36791,6 +37385,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36810,6 +37405,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36890,6 +37486,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -36909,6 +37506,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -36987,6 +37585,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37006,6 +37605,7 @@ void NoteStoreTester::shouldExecuteUnsetNoteApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37093,6 +37693,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37112,6 +37713,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetNoteApplicationDataEn QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37211,6 +37813,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37230,6 +37833,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetNoteApplicationData QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37328,6 +37932,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37347,6 +37952,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetNoteApplicationDa QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37445,6 +38051,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37464,6 +38071,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetNoteApplicationDataEntr QObject::connect( &server, &NoteStoreServer::unsetNoteApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37559,6 +38167,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37578,6 +38187,7 @@ void NoteStoreTester::shouldExecuteGetNoteContent() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37643,6 +38253,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37662,6 +38273,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContent() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37739,6 +38351,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37758,6 +38371,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContent() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37834,6 +38448,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37853,6 +38468,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContent() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -37929,6 +38545,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -37948,6 +38565,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContent() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38022,6 +38640,7 @@ void NoteStoreTester::shouldExecuteGetNoteContentAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38041,6 +38660,7 @@ void NoteStoreTester::shouldExecuteGetNoteContentAsync() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38124,6 +38744,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38143,6 +38764,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteContentAsync() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38238,6 +38860,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContentAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38257,6 +38880,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteContentAsync() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38351,6 +38975,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38370,6 +38995,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteContentAsync() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38464,6 +39090,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContentAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38483,6 +39110,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteContentAsync() QObject::connect( &server, &NoteStoreServer::getNoteContentRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38583,6 +39211,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38602,6 +39231,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchText() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38675,6 +39305,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38694,6 +39325,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchText() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38779,6 +39411,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38798,6 +39431,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchText() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38882,6 +39516,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -38901,6 +39536,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchText() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -38985,6 +39621,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39004,6 +39641,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchText() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39086,6 +39724,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39105,6 +39744,7 @@ void NoteStoreTester::shouldExecuteGetNoteSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39196,6 +39836,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39215,6 +39856,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39318,6 +39960,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39337,6 +39980,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39439,6 +40083,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39458,6 +40103,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteSearchTextAsync QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39560,6 +40206,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39579,6 +40226,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getNoteSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39675,6 +40323,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39694,6 +40343,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchText() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39759,6 +40409,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39778,6 +40429,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchText() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39855,6 +40507,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -39874,6 +40527,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchText() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -39950,101 +40604,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchText( QObject::connect( &tcpServer, &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::getResourceSearchTextRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port), - nullptr, - nullptr, - nullRetryPolicy()); - bool caughtException = false; - try - { - QString res = noteStore->getResourceSearchText( - guid, - ctx); - Q_UNUSED(res) - } - catch(const EDAMNotFoundException & e) - { - caughtException = true; - QVERIFY(e == notFoundException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() -{ - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto thriftException = ThriftException( - ThriftException::Type::INTERNAL_ERROR, - QStringLiteral("Internal error")); - - NoteStoreGetResourceSearchTextTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QString - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw thriftException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::getResourceSearchTextRequest, - &helper, - &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); - QObject::connect( - &helper, - &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, - &server, - &NoteStoreServer::onGetResourceSearchTextRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( &tcpServer, - &QTcpServer::newConnection, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40064,6 +40624,104 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); + bool caughtException = false; + try + { + QString res = noteStore->getResourceSearchText( + guid, + ctx); + Q_UNUSED(res) + } + catch(const EDAMNotFoundException & e) + { + caughtException = true; + QVERIFY(e == notFoundException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchText() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto thriftException = ThriftException( + ThriftException::Type::INTERNAL_ERROR, + QStringLiteral("Internal error")); + + NoteStoreGetResourceSearchTextTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QString + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw thriftException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequest, + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::onGetResourceSearchTextRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceSearchTextTesterHelper::getResourceSearchTextRequestReady, + &server, + &NoteStoreServer::onGetResourceSearchTextRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + &tcpServer, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40138,6 +40796,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40157,6 +40816,7 @@ void NoteStoreTester::shouldExecuteGetResourceSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40240,6 +40900,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40259,6 +40920,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceSearchTextAsync QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40354,6 +41016,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40373,6 +41036,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceSearchTextAsy QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40467,6 +41131,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40486,6 +41151,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceSearchTextA QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40580,6 +41246,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchTextAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40599,6 +41266,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceSearchTextAsync() QObject::connect( &server, &NoteStoreServer::getResourceSearchTextRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40696,6 +41364,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40715,6 +41384,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNames() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40780,6 +41450,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40799,6 +41470,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNames() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40876,6 +41548,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40895,6 +41568,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNames() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -40971,6 +41645,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -40990,6 +41665,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNames() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41066,6 +41742,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41085,6 +41762,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNames() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41162,6 +41840,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNamesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41181,6 +41860,7 @@ void NoteStoreTester::shouldExecuteGetNoteTagNamesAsync() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41264,6 +41944,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41283,6 +41964,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteTagNamesAsync() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41378,6 +42060,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41397,6 +42080,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteTagNamesAsync() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41491,6 +42175,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41510,6 +42195,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteTagNamesAsync() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41604,6 +42290,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNamesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41623,6 +42310,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteTagNamesAsync() QObject::connect( &server, &NoteStoreServer::getNoteTagNamesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41717,6 +42405,7 @@ void NoteStoreTester::shouldExecuteCreateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41736,6 +42425,7 @@ void NoteStoreTester::shouldExecuteCreateNote() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41801,6 +42491,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41820,6 +42511,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNote() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41897,6 +42589,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -41916,6 +42609,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNote() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -41992,6 +42686,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42011,6 +42706,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNote() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42087,6 +42783,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42106,6 +42803,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNote() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42180,6 +42878,7 @@ void NoteStoreTester::shouldExecuteCreateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42199,6 +42898,7 @@ void NoteStoreTester::shouldExecuteCreateNoteAsync() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42282,6 +42982,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42301,6 +43002,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateNoteAsync() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42396,6 +43098,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42415,6 +43118,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateNoteAsync() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42509,6 +43213,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42528,6 +43233,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateNoteAsync() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42622,6 +43328,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42641,6 +43348,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateNoteAsync() QObject::connect( &server, &NoteStoreServer::createNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42735,6 +43443,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42754,6 +43463,7 @@ void NoteStoreTester::shouldExecuteUpdateNote() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42819,6 +43529,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42838,6 +43549,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNote() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -42915,6 +43627,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -42934,6 +43647,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNote() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43010,6 +43724,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43029,6 +43744,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNote() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43105,6 +43821,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43124,6 +43841,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNote() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43198,6 +43916,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43217,6 +43936,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteAsync() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43300,6 +44020,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43319,6 +44040,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteAsync() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43414,6 +44136,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43433,6 +44156,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteAsync() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43527,6 +44251,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43546,6 +44271,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteAsync() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43640,6 +44366,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43659,6 +44386,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteAsync() QObject::connect( &server, &NoteStoreServer::updateNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43753,6 +44481,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43772,6 +44501,7 @@ void NoteStoreTester::shouldExecuteDeleteNote() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43837,6 +44567,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43856,6 +44587,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNote() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -43933,6 +44665,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -43952,6 +44685,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNote() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44028,6 +44762,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44047,6 +44782,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNote() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44123,6 +44859,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44142,6 +44879,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNote() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44216,6 +44954,7 @@ void NoteStoreTester::shouldExecuteDeleteNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44235,6 +44974,7 @@ void NoteStoreTester::shouldExecuteDeleteNoteAsync() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44318,6 +45058,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44337,6 +45078,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInDeleteNoteAsync() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44432,6 +45174,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44451,6 +45194,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInDeleteNoteAsync() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44545,6 +45289,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44564,6 +45309,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInDeleteNoteAsync() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44658,6 +45404,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44677,6 +45424,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInDeleteNoteAsync() QObject::connect( &server, &NoteStoreServer::deleteNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44771,6 +45519,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44790,6 +45539,7 @@ void NoteStoreTester::shouldExecuteExpungeNote() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44855,6 +45605,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44874,6 +45625,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNote() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -44951,6 +45703,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -44970,6 +45723,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNote() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45046,6 +45800,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45065,6 +45820,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNote() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45141,6 +45897,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45160,6 +45917,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNote() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45234,6 +45992,7 @@ void NoteStoreTester::shouldExecuteExpungeNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45253,6 +46012,7 @@ void NoteStoreTester::shouldExecuteExpungeNoteAsync() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45336,6 +46096,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45355,6 +46116,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeNoteAsync() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45450,6 +46212,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45469,6 +46232,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeNoteAsync() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45563,6 +46327,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45582,6 +46347,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeNoteAsync() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45676,6 +46442,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45695,6 +46462,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeNoteAsync() QObject::connect( &server, &NoteStoreServer::expungeNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45792,6 +46560,7 @@ void NoteStoreTester::shouldExecuteCopyNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45811,6 +46580,7 @@ void NoteStoreTester::shouldExecuteCopyNote() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45880,6 +46650,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45899,6 +46670,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNote() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -45980,6 +46752,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -45999,6 +46772,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNote() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46079,6 +46853,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46098,6 +46873,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNote() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46178,6 +46954,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46197,6 +46974,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNote() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46275,6 +47053,7 @@ void NoteStoreTester::shouldExecuteCopyNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46294,6 +47073,7 @@ void NoteStoreTester::shouldExecuteCopyNoteAsync() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46381,6 +47161,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46400,6 +47181,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCopyNoteAsync() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46499,6 +47281,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46518,6 +47301,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCopyNoteAsync() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46616,6 +47400,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46635,6 +47420,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCopyNoteAsync() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46733,6 +47519,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46752,6 +47539,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCopyNoteAsync() QObject::connect( &server, &NoteStoreServer::copyNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46850,6 +47638,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46869,6 +47658,7 @@ void NoteStoreTester::shouldExecuteListNoteVersions() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -46934,6 +47724,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -46953,6 +47744,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersions() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47030,6 +47822,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47049,6 +47842,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersions() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47125,6 +47919,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47144,6 +47939,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersions() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47220,6 +48016,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47239,6 +48036,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersions() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47316,6 +48114,7 @@ void NoteStoreTester::shouldExecuteListNoteVersionsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47335,6 +48134,7 @@ void NoteStoreTester::shouldExecuteListNoteVersionsAsync() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47418,6 +48218,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47437,6 +48238,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListNoteVersionsAsync() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47532,6 +48334,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47551,6 +48354,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListNoteVersionsAsync() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47645,6 +48449,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47664,6 +48469,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListNoteVersionsAsync( QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47758,6 +48564,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersionsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47777,6 +48584,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListNoteVersionsAsync() QObject::connect( &server, &NoteStoreServer::listNoteVersionsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47883,6 +48691,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -47902,6 +48711,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersion() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -47983,6 +48793,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48002,6 +48813,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersion() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48095,6 +48907,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48114,6 +48927,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersion() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48206,6 +49020,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48225,6 +49040,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersion() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48317,6 +49133,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48336,6 +49153,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersion() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48426,6 +49244,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48445,6 +49264,7 @@ void NoteStoreTester::shouldExecuteGetNoteVersionAsync() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48544,6 +49364,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48563,6 +49384,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNoteVersionAsync() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48674,6 +49496,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48693,6 +49516,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNoteVersionAsync() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48803,6 +49627,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48822,6 +49647,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNoteVersionAsync() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -48932,6 +49758,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -48951,6 +49778,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNoteVersionAsync() QObject::connect( &server, &NoteStoreServer::getNoteVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49061,6 +49889,7 @@ void NoteStoreTester::shouldExecuteGetResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49080,6 +49909,7 @@ void NoteStoreTester::shouldExecuteGetResource() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49161,6 +49991,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49180,6 +50011,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResource() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49273,6 +50105,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49292,6 +50125,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResource() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49384,6 +50218,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49403,6 +50238,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResource() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49495,6 +50331,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49514,6 +50351,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResource() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49604,6 +50442,7 @@ void NoteStoreTester::shouldExecuteGetResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49623,6 +50462,7 @@ void NoteStoreTester::shouldExecuteGetResourceAsync() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49722,6 +50562,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49741,6 +50582,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAsync() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49852,6 +50694,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -49871,6 +50714,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAsync() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -49981,6 +50825,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50000,6 +50845,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAsync() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50110,6 +50956,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50129,6 +50976,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAsync() QObject::connect( &server, &NoteStoreServer::getResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50227,6 +51075,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50246,6 +51095,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationData() QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50311,6 +51161,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50330,6 +51181,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50407,6 +51259,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50426,6 +51279,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50502,6 +51356,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50521,6 +51376,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50597,6 +51453,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50616,6 +51473,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationData() QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50690,6 +51548,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50709,6 +51568,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50792,6 +51652,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50811,6 +51672,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -50906,6 +51768,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -50925,6 +51788,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51019,6 +51883,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51038,6 +51903,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51132,6 +51998,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51151,6 +52018,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataAs QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51248,6 +52116,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51267,6 +52136,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51336,6 +52206,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51355,6 +52226,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51436,6 +52308,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51455,6 +52328,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51535,6 +52409,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51554,6 +52429,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51634,6 +52510,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51653,6 +52530,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51731,6 +52609,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51750,6 +52629,7 @@ void NoteStoreTester::shouldExecuteGetResourceApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51837,6 +52717,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51856,6 +52737,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceApplicationData QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -51955,6 +52837,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -51974,6 +52857,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52072,6 +52956,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52091,6 +52976,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceApplication QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52189,6 +53075,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52208,6 +53095,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceApplicationDataEn QObject::connect( &server, &NoteStoreServer::getResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52309,6 +53197,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52328,6 +53217,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52401,6 +53291,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52420,6 +53311,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52505,6 +53397,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52524,6 +53417,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52608,6 +53502,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52627,6 +53522,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52711,6 +53607,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52730,6 +53627,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52812,6 +53710,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52831,6 +53730,7 @@ void NoteStoreTester::shouldExecuteSetResourceApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -52922,6 +53822,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -52941,6 +53842,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetResourceApplicationData QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53044,6 +53946,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53063,6 +53966,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53165,6 +54069,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53184,6 +54089,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetResourceApplication QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53286,6 +54192,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53305,6 +54212,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetResourceApplicationDataEn QObject::connect( &server, &NoteStoreServer::setResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53404,6 +54312,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53423,6 +54332,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntry() QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53492,6 +54402,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53511,6 +54422,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53592,6 +54504,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53611,6 +54524,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53691,6 +54605,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53710,6 +54625,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53790,6 +54706,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53809,6 +54726,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53887,6 +54805,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntryAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -53906,6 +54825,7 @@ void NoteStoreTester::shouldExecuteUnsetResourceApplicationDataEntryAsync() QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -53993,6 +54913,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54012,6 +54933,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUnsetResourceApplicationDa QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54111,6 +55033,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54130,6 +55053,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUnsetResourceApplication QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54228,6 +55152,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54247,6 +55172,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUnsetResourceApplicati QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54345,6 +55271,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54364,6 +55291,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUnsetResourceApplicationData QObject::connect( &server, &NoteStoreServer::unsetResourceApplicationDataEntryRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54459,6 +55387,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54478,6 +55407,7 @@ void NoteStoreTester::shouldExecuteUpdateResource() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54543,6 +55473,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54562,6 +55493,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResource() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54639,6 +55571,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54658,6 +55591,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResource() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54734,6 +55668,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54753,6 +55688,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResource() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54829,6 +55765,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54848,6 +55785,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResource() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -54922,6 +55860,7 @@ void NoteStoreTester::shouldExecuteUpdateResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -54941,6 +55880,7 @@ void NoteStoreTester::shouldExecuteUpdateResourceAsync() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55024,6 +55964,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55043,6 +55984,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateResourceAsync() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55138,6 +56080,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55157,6 +56100,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateResourceAsync() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55251,6 +56195,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55270,6 +56215,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateResourceAsync() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55364,6 +56310,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResourceAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55383,6 +56330,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateResourceAsync() QObject::connect( &server, &NoteStoreServer::updateResourceRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55477,6 +56425,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55496,6 +56445,7 @@ void NoteStoreTester::shouldExecuteGetResourceData() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55561,6 +56511,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55580,6 +56531,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceData() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55657,6 +56609,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55676,6 +56629,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceData() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55752,6 +56706,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55771,6 +56726,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceData() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55847,6 +56803,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55866,6 +56823,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceData() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -55940,6 +56898,7 @@ void NoteStoreTester::shouldExecuteGetResourceDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -55959,6 +56918,7 @@ void NoteStoreTester::shouldExecuteGetResourceDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56042,6 +57002,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56061,6 +57022,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56156,119 +57118,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::getResourceDataRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port), - nullptr, - nullptr, - nullRetryPolicy()); - bool caughtException = false; - try - { - AsyncResult * result = noteStore->getResourceDataAsync( - guid, - ctx); - - NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; - QObject::connect( - result, - &AsyncResult::finished, - &valueFetcher, - &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); - - QEventLoop loop; - QObject::connect( - &valueFetcher, - &NoteStoreGetResourceDataAsyncValueFetcher::finished, - &loop, - &QEventLoop::quit); - - loop.exec(); - - QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); - valueFetcher.m_exceptionData->throwException(); - } - catch(const EDAMSystemException & e) - { - caughtException = true; - QVERIFY(e == systemException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() -{ - Guid guid = generateRandomString(); - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - auto notFoundException = EDAMNotFoundException(); - notFoundException.identifier = generateRandomString(); - notFoundException.key = generateRandomString(); - - NoteStoreGetResourceDataTesterHelper helper( - [&] (const Guid & guidParam, - IRequestContextPtr ctxParam) -> QByteArray - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - Q_ASSERT(guid == guidParam); - throw notFoundException; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::getResourceDataRequest, - &helper, - &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); - QObject::connect( - &helper, - &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, - &server, - &NoteStoreServer::onGetResourceDataRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( &tcpServer, - &QTcpServer::newConnection, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56288,6 +57138,122 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); + bool caughtException = false; + try + { + AsyncResult * result = noteStore->getResourceDataAsync( + guid, + ctx); + + NoteStoreGetResourceDataAsyncValueFetcher valueFetcher; + QObject::connect( + result, + &AsyncResult::finished, + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::onFinished); + + QEventLoop loop; + QObject::connect( + &valueFetcher, + &NoteStoreGetResourceDataAsyncValueFetcher::finished, + &loop, + &QEventLoop::quit); + + loop.exec(); + + QVERIFY(valueFetcher.m_exceptionData.get() != nullptr); + valueFetcher.m_exceptionData->throwException(); + } + catch(const EDAMSystemException & e) + { + caughtException = true; + QVERIFY(e == systemException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceDataAsync() +{ + Guid guid = generateRandomString(); + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + auto notFoundException = EDAMNotFoundException(); + notFoundException.identifier = generateRandomString(); + notFoundException.key = generateRandomString(); + + NoteStoreGetResourceDataTesterHelper helper( + [&] (const Guid & guidParam, + IRequestContextPtr ctxParam) -> QByteArray + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + Q_ASSERT(guid == guidParam); + throw notFoundException; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequest, + &helper, + &NoteStoreGetResourceDataTesterHelper::onGetResourceDataRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetResourceDataTesterHelper::getResourceDataRequestReady, + &server, + &NoteStoreServer::onGetResourceDataRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + &tcpServer, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56382,6 +57348,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56401,6 +57368,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56507,6 +57475,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56526,6 +57495,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHash() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56607,6 +57577,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56626,6 +57597,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHash() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56719,6 +57691,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56738,6 +57711,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHash() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56830,6 +57804,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56849,6 +57824,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHash() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -56941,6 +57917,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -56960,6 +57937,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHash() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57050,6 +58028,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHashAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57069,6 +58048,7 @@ void NoteStoreTester::shouldExecuteGetResourceByHashAsync() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57168,6 +58148,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57187,6 +58168,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceByHashAsync() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57298,6 +58280,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57317,6 +58300,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceByHashAsync() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57427,6 +58411,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57446,6 +58431,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceByHashAsync QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57556,6 +58542,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHashAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57575,6 +58562,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceByHashAsync() QObject::connect( &server, &NoteStoreServer::getResourceByHashRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57673,6 +58661,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57692,6 +58681,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognition() QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57757,6 +58747,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57776,6 +58767,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognition() QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57853,6 +58845,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57872,6 +58865,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognition() QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -57948,6 +58942,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -57967,6 +58962,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58043,6 +59039,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58062,6 +59059,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognition() QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58136,6 +59134,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognitionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58155,6 +59154,7 @@ void NoteStoreTester::shouldExecuteGetResourceRecognitionAsync() QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58238,6 +59238,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58257,6 +59258,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceRecognitionAsyn QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58352,6 +59354,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58371,6 +59374,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceRecognitionAs QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58465,6 +59469,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58484,6 +59489,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceRecognition QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58578,6 +59584,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognitionAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58597,6 +59604,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceRecognitionAsync( QObject::connect( &server, &NoteStoreServer::getResourceRecognitionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58691,6 +59699,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58710,6 +59719,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateData() QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58775,6 +59785,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58794,6 +59805,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateData() QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58871,6 +59883,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58890,6 +59903,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -58966,6 +59980,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -58985,6 +60000,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59061,6 +60077,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59080,6 +60097,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateData() QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59154,6 +60172,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateDataAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59173,6 +60192,7 @@ void NoteStoreTester::shouldExecuteGetResourceAlternateDataAsync() QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59256,6 +60276,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59275,6 +60296,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAlternateDataAs QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59370,6 +60392,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59389,6 +60412,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAlternateData QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59483,6 +60507,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59502,6 +60527,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAlternateDa QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59596,6 +60622,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateDataAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59615,6 +60642,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAlternateDataAsyn QObject::connect( &server, &NoteStoreServer::getResourceAlternateDataRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59709,6 +60737,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59728,6 +60757,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributes() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59793,6 +60823,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59812,6 +60843,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributes() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59889,6 +60921,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -59908,6 +60941,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributes() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -59984,6 +61018,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60003,6 +61038,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributes( QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60079,6 +61115,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60098,6 +61135,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributes() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60172,6 +61210,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60191,6 +61230,7 @@ void NoteStoreTester::shouldExecuteGetResourceAttributesAsync() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60274,6 +61314,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60293,6 +61334,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetResourceAttributesAsync QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60388,6 +61430,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60407,6 +61450,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetResourceAttributesAsy QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60501,6 +61545,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60520,6 +61565,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetResourceAttributesA QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60614,6 +61660,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60633,6 +61680,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetResourceAttributesAsync() QObject::connect( &server, &NoteStoreServer::getResourceAttributesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60728,6 +61776,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60747,6 +61796,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebook() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60815,6 +61865,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60834,6 +61885,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebook() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -60912,6 +61964,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -60931,6 +61984,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebook() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61009,6 +62063,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61028,6 +62083,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebook() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61104,6 +62160,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61123,6 +62180,7 @@ void NoteStoreTester::shouldExecuteGetPublicNotebookAsync() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61209,6 +62267,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61228,6 +62287,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicNotebookAsync() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61324,6 +62384,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61343,6 +62404,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicNotebookAsync QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61439,6 +62501,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61458,6 +62521,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetPublicNotebookAsync() QObject::connect( &server, &NoteStoreServer::getPublicNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61556,6 +62620,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61575,6 +62640,7 @@ void NoteStoreTester::shouldExecuteShareNotebook() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61644,6 +62710,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61663,6 +62730,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebook() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61743,6 +62811,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61762,6 +62831,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebook() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61843,6 +62913,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61862,6 +62933,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebook() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -61942,6 +63014,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -61961,6 +63034,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebook() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62039,6 +63113,7 @@ void NoteStoreTester::shouldExecuteShareNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62058,6 +63133,7 @@ void NoteStoreTester::shouldExecuteShareNotebookAsync() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62145,6 +63221,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62164,6 +63241,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNotebookAsync() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62262,6 +63340,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62281,6 +63360,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNotebookAsync() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62380,6 +63460,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62399,6 +63480,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNotebookAsync() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62497,6 +63579,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62516,6 +63599,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNotebookAsync() QObject::connect( &server, &NoteStoreServer::shareNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62611,6 +63695,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62630,6 +63715,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookShares() QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62695,6 +63781,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62714,6 +63801,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62790,6 +63878,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62809,6 +63898,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62886,6 +63976,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -62905,6 +63996,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -62987,6 +64079,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63006,6 +64099,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63082,6 +64176,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63101,6 +64196,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63175,6 +64271,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63194,6 +64291,7 @@ void NoteStoreTester::shouldExecuteCreateOrUpdateNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63277,6 +64375,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63296,6 +64395,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateOrUpdateNotebookShar QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63390,6 +64490,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63409,6 +64510,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateOrUpdateNotebook QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63504,6 +64606,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63523,6 +64626,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateOrUpdateNotebookSh QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63623,6 +64727,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63642,6 +64747,7 @@ void NoteStoreTester::shouldDeliverEDAMInvalidContactsExceptionInCreateOrUpdateN QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63736,6 +64842,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63755,6 +64862,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateOrUpdateNotebookShares QObject::connect( &server, &NoteStoreServer::createOrUpdateNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63849,6 +64957,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63868,6 +64977,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebook() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -63933,6 +65043,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -63952,6 +65063,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebook() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64028,6 +65140,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64047,6 +65160,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebook() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64124,6 +65238,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64143,6 +65258,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebook() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64219,6 +65335,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64238,6 +65355,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebook() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64312,6 +65430,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64331,6 +65450,7 @@ void NoteStoreTester::shouldExecuteUpdateSharedNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64414,6 +65534,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64433,6 +65554,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateSharedNotebookAsync( QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64527,6 +65649,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64546,6 +65669,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateSharedNotebookAs QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64641,6 +65765,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64660,6 +65785,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateSharedNotebookAsyn QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64754,6 +65880,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64773,6 +65900,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateSharedNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64870,6 +65998,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64889,6 +66018,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettings() QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -64958,6 +66088,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -64977,6 +66108,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65057,6 +66189,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65076,6 +66209,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65157,6 +66291,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65176,6 +66311,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65256,6 +66392,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65275,6 +66412,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65353,6 +66491,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettingsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65372,6 +66511,7 @@ void NoteStoreTester::shouldExecuteSetNotebookRecipientSettingsAsync() QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65459,6 +66599,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65478,6 +66619,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInSetNotebookRecipientSettin QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65576,6 +66718,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65595,6 +66738,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInSetNotebookRecipientSe QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65694,6 +66838,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65713,6 +66858,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInSetNotebookRecipientSett QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65811,6 +66957,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65830,6 +66977,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInSetNotebookRecipientSettings QObject::connect( &server, &NoteStoreServer::setNotebookRecipientSettingsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -65925,6 +67073,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -65944,6 +67093,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooks() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66005,6 +67155,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66024,6 +67175,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooks() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66096,6 +67248,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66115,6 +67268,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooks() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66188,6 +67342,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66207,6 +67362,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooks() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66279,6 +67435,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66298,6 +67455,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooks() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66371,6 +67529,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66390,6 +67549,7 @@ void NoteStoreTester::shouldExecuteListSharedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66469,6 +67629,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66488,6 +67649,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListSharedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66578,6 +67740,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66597,6 +67760,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListSharedNotebooksAsy QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66688,6 +67852,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66707,6 +67872,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListSharedNotebooksAsync QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66797,6 +67963,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66816,6 +67983,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListSharedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listSharedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66909,6 +68077,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -66928,6 +68097,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -66993,6 +68163,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67012,6 +68183,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67088,6 +68260,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67107,6 +68280,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67184,6 +68358,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67203,6 +68378,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67279,6 +68455,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67298,6 +68475,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67372,6 +68550,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67391,6 +68570,7 @@ void NoteStoreTester::shouldExecuteCreateLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67474,6 +68654,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67493,6 +68674,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInCreateLinkedNotebookAsync( QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67587,6 +68769,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67606,6 +68789,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInCreateLinkedNotebookAs QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67701,6 +68885,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67720,6 +68905,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInCreateLinkedNotebookAsyn QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67814,6 +69000,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67833,6 +69020,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInCreateLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::createLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -67927,6 +69115,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -67946,6 +69135,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68011,6 +69201,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68030,6 +69221,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68106,6 +69298,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68125,6 +69318,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68202,6 +69396,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68221,6 +69416,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68297,6 +69493,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68316,6 +69513,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebook() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68390,6 +69588,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68409,6 +69608,7 @@ void NoteStoreTester::shouldExecuteUpdateLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68492,6 +69692,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68511,6 +69712,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateLinkedNotebookAsync( QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68605,6 +69807,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68624,6 +69827,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateLinkedNotebookAs QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68719,6 +69923,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68738,6 +69943,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateLinkedNotebookAsyn QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68832,6 +70038,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68851,6 +70058,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::updateLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -68945,6 +70153,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -68964,6 +70173,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooks() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69025,6 +70235,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69044,6 +70255,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooks() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69116,6 +70328,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69135,6 +70348,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooks() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69208,6 +70422,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69227,6 +70442,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooks() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69299,6 +70515,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69318,6 +70535,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooks() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69391,6 +70609,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69410,6 +70629,7 @@ void NoteStoreTester::shouldExecuteListLinkedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69489,6 +70709,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69508,6 +70729,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInListLinkedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69598,6 +70820,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69617,6 +70840,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInListLinkedNotebooksAsy QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69708,6 +70932,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69727,6 +70952,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInListLinkedNotebooksAsync QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69817,6 +71043,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooksAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69836,6 +71063,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInListLinkedNotebooksAsync() QObject::connect( &server, &NoteStoreServer::listLinkedNotebooksRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -69929,6 +71157,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -69948,6 +71177,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebook() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70013,6 +71243,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70032,6 +71263,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebook() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70108,6 +71340,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70127,6 +71360,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebook( QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70204,6 +71438,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70223,6 +71458,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebook() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70299,6 +71535,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70318,6 +71555,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebook() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70392,6 +71630,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70411,6 +71650,7 @@ void NoteStoreTester::shouldExecuteExpungeLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70494,6 +71734,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70513,6 +71754,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInExpungeLinkedNotebookAsync QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70607,6 +71849,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70626,6 +71869,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInExpungeLinkedNotebookA QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70721,6 +71965,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70740,6 +71985,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInExpungeLinkedNotebookAsy QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70834,6 +72080,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70853,6 +72100,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInExpungeLinkedNotebookAsync() QObject::connect( &server, &NoteStoreServer::expungeLinkedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -70947,6 +72195,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -70966,6 +72215,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebook() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71031,6 +72281,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71050,6 +72301,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71126,6 +72378,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71145,6 +72398,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71222,6 +72476,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71241,6 +72496,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71317,6 +72573,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71336,6 +72593,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71410,6 +72668,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebookAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71429,6 +72688,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNotebookAsync() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71512,6 +72772,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71531,6 +72792,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNotebo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71625,6 +72887,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71644,6 +72907,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71739,6 +73003,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71758,6 +73023,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71852,6 +73118,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71871,6 +73138,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNotebook QObject::connect( &server, &NoteStoreServer::authenticateToSharedNotebookRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -71962,6 +73230,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -71981,6 +73250,7 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuth() QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72042,6 +73312,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72061,6 +73332,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuth() QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72133,6 +73405,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72152,6 +73425,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72225,6 +73499,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72244,6 +73519,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuth( QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72316,95 +73592,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuth() QObject::connect( &tcpServer, &QTcpServer::newConnection, - [&] { - pSocket = tcpServer.nextPendingConnection(); - Q_ASSERT(pSocket); - QObject::connect( - pSocket, - &QAbstractSocket::disconnected, - pSocket, - &QAbstractSocket::deleteLater); - if (!pSocket->waitForConnected()) { - QFAIL("Failed to establish connection"); - } - - QByteArray requestData = readThriftRequestFromSocket(*pSocket); - server.onRequest(requestData); - }); - - QObject::connect( - &server, - &NoteStoreServer::getSharedNotebookByAuthRequestReady, - [&] (QByteArray responseData) - { - QByteArray buffer; - buffer.append("HTTP/1.1 200 OK\r\n"); - buffer.append("Content-Length: "); - buffer.append(QString::number(responseData.size()).toUtf8()); - buffer.append("\r\n"); - buffer.append("Content-Type: application/x-thrift\r\n\r\n"); - buffer.append(responseData); - - if (!writeBufferToSocket(buffer, *pSocket)) { - QFAIL("Failed to write response to socket"); - } - }); - - auto noteStore = newNoteStore( - QStringLiteral("http://127.0.0.1:") + QString::number(port), - nullptr, - nullptr, - nullRetryPolicy()); - bool caughtException = false; - try - { - SharedNotebook res = noteStore->getSharedNotebookByAuth( - ctx); - Q_UNUSED(res) - } - catch(const ThriftException & e) - { - caughtException = true; - QVERIFY(e == thriftException); - } - - QVERIFY(caughtException); -} - -void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() -{ - IRequestContextPtr ctx = newRequestContext( - QStringLiteral("authenticationToken")); - - SharedNotebook response = generateRandomSharedNotebook(); - - NoteStoreGetSharedNotebookByAuthTesterHelper helper( - [&] (IRequestContextPtr ctxParam) -> SharedNotebook - { - Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); - return response; - }); - - NoteStoreServer server; - QObject::connect( - &server, - &NoteStoreServer::getSharedNotebookByAuthRequest, - &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); - QObject::connect( - &helper, - &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, - &server, - &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); - - QTcpServer tcpServer; - QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - quint16 port = tcpServer.serverPort(); - - QTcpSocket * pSocket = nullptr; - QObject::connect( &tcpServer, - &QTcpServer::newConnection, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72424,6 +73612,98 @@ void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, + [&] (QByteArray responseData) + { + QByteArray buffer; + buffer.append("HTTP/1.1 200 OK\r\n"); + buffer.append("Content-Length: "); + buffer.append(QString::number(responseData.size()).toUtf8()); + buffer.append("\r\n"); + buffer.append("Content-Type: application/x-thrift\r\n\r\n"); + buffer.append(responseData); + + if (!writeBufferToSocket(buffer, *pSocket)) { + QFAIL("Failed to write response to socket"); + } + }); + + auto noteStore = newNoteStore( + QStringLiteral("http://127.0.0.1:") + QString::number(port), + nullptr, + nullptr, + nullRetryPolicy()); + bool caughtException = false; + try + { + SharedNotebook res = noteStore->getSharedNotebookByAuth( + ctx); + Q_UNUSED(res) + } + catch(const ThriftException & e) + { + caughtException = true; + QVERIFY(e == thriftException); + } + + QVERIFY(caughtException); +} + +void NoteStoreTester::shouldExecuteGetSharedNotebookByAuthAsync() +{ + IRequestContextPtr ctx = newRequestContext( + QStringLiteral("authenticationToken")); + + SharedNotebook response = generateRandomSharedNotebook(); + + NoteStoreGetSharedNotebookByAuthTesterHelper helper( + [&] (IRequestContextPtr ctxParam) -> SharedNotebook + { + Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); + return response; + }); + + NoteStoreServer server; + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequest, + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::onGetSharedNotebookByAuthRequestReceived); + QObject::connect( + &helper, + &NoteStoreGetSharedNotebookByAuthTesterHelper::getSharedNotebookByAuthRequestReady, + &server, + &NoteStoreServer::onGetSharedNotebookByAuthRequestReady); + + QTcpServer tcpServer; + QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + quint16 port = tcpServer.serverPort(); + + QTcpSocket * pSocket = nullptr; + QObject::connect( + &tcpServer, + &QTcpServer::newConnection, + &tcpServer, + [&] { + pSocket = tcpServer.nextPendingConnection(); + Q_ASSERT(pSocket); + QObject::connect( + pSocket, + &QAbstractSocket::disconnected, + pSocket, + &QAbstractSocket::deleteLater); + if (!pSocket->waitForConnected()) { + QFAIL("Failed to establish connection"); + } + + QByteArray requestData = readThriftRequestFromSocket(*pSocket); + server.onRequest(requestData); + }); + + QObject::connect( + &server, + &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72503,6 +73783,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72522,6 +73803,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetSharedNotebookByAuthAsy QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72612,6 +73894,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72631,6 +73914,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetSharedNotebookByAut QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72722,6 +74006,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72741,6 +74026,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetSharedNotebookByAuthA QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72831,6 +74117,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72850,6 +74137,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetSharedNotebookByAuthAsync QObject::connect( &server, &NoteStoreServer::getSharedNotebookByAuthRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -72941,6 +74229,7 @@ void NoteStoreTester::shouldExecuteEmailNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -72960,6 +74249,7 @@ void NoteStoreTester::shouldExecuteEmailNote() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73024,6 +74314,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73043,6 +74334,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNote() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73118,6 +74410,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73137,6 +74430,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNote() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73213,6 +74507,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73232,6 +74527,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNote() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73307,6 +74603,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73326,6 +74623,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNote() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73397,6 +74695,7 @@ void NoteStoreTester::shouldExecuteEmailNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73416,6 +74715,7 @@ void NoteStoreTester::shouldExecuteEmailNoteAsync() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73498,6 +74798,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73517,6 +74818,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInEmailNoteAsync() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73611,6 +74913,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73630,6 +74933,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInEmailNoteAsync() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73725,6 +75029,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73744,6 +75049,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInEmailNoteAsync() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73838,6 +75144,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73857,6 +75164,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInEmailNoteAsync() QObject::connect( &server, &NoteStoreServer::emailNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -73951,6 +75259,7 @@ void NoteStoreTester::shouldExecuteShareNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -73970,6 +75279,7 @@ void NoteStoreTester::shouldExecuteShareNote() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74035,6 +75345,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74054,6 +75365,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNote() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74130,6 +75442,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74149,6 +75462,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNote() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74226,6 +75540,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74245,6 +75560,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNote() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74321,6 +75637,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74340,6 +75657,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNote() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74414,6 +75732,7 @@ void NoteStoreTester::shouldExecuteShareNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74433,6 +75752,7 @@ void NoteStoreTester::shouldExecuteShareNoteAsync() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74516,6 +75836,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74535,6 +75856,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInShareNoteAsync() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74629,6 +75951,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74648,6 +75971,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInShareNoteAsync() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74743,6 +76067,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74762,6 +76087,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInShareNoteAsync() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74856,6 +76182,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74875,6 +76202,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInShareNoteAsync() QObject::connect( &server, &NoteStoreServer::shareNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -74967,6 +76295,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -74986,6 +76315,7 @@ void NoteStoreTester::shouldExecuteStopSharingNote() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75050,6 +76380,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75069,6 +76400,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNote() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75144,6 +76476,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75163,6 +76496,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNote() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75239,6 +76573,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75258,6 +76593,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNote() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75333,6 +76669,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75352,6 +76689,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNote() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75423,6 +76761,7 @@ void NoteStoreTester::shouldExecuteStopSharingNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75442,6 +76781,7 @@ void NoteStoreTester::shouldExecuteStopSharingNoteAsync() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75524,6 +76864,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75543,6 +76884,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInStopSharingNoteAsync() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75637,6 +76979,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75656,6 +76999,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInStopSharingNoteAsync() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75751,6 +77095,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75770,6 +77115,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInStopSharingNoteAsync() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75864,6 +77210,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75883,6 +77230,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInStopSharingNoteAsync() QObject::connect( &server, &NoteStoreServer::stopSharingNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -75980,6 +77328,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -75999,6 +77348,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNote() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76068,6 +77418,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76087,6 +77438,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNote() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76167,6 +77519,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76186,6 +77539,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76267,6 +77621,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76286,6 +77641,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76366,6 +77722,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76385,6 +77742,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNote() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76463,6 +77821,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNoteAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76482,6 +77841,7 @@ void NoteStoreTester::shouldExecuteAuthenticateToSharedNoteAsync() QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76569,6 +77929,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76588,6 +77949,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToSharedNoteAs QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76686,6 +78048,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76705,6 +78068,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInAuthenticateToSharedNo QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76804,6 +78168,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76823,6 +78188,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToSharedNote QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -76921,6 +78287,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -76940,6 +78307,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInAuthenticateToSharedNoteAsyn QObject::connect( &server, &NoteStoreServer::authenticateToSharedNoteRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77038,6 +78406,7 @@ void NoteStoreTester::shouldExecuteFindRelated() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77057,6 +78426,7 @@ void NoteStoreTester::shouldExecuteFindRelated() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77126,6 +78496,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77145,6 +78516,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelated() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77226,6 +78598,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77245,6 +78618,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelated() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77325,6 +78699,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77344,6 +78719,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelated() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77424,6 +78800,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77443,6 +78820,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelated() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77521,6 +78899,7 @@ void NoteStoreTester::shouldExecuteFindRelatedAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77540,6 +78919,7 @@ void NoteStoreTester::shouldExecuteFindRelatedAsync() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77627,6 +79007,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77646,6 +79027,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInFindRelatedAsync() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77745,6 +79127,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelatedAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77764,6 +79147,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInFindRelatedAsync() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77862,6 +79246,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77881,6 +79266,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInFindRelatedAsync() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -77979,6 +79365,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelatedAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -77998,6 +79385,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInFindRelatedAsync() QObject::connect( &server, &NoteStoreServer::findRelatedRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78093,6 +79481,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78112,6 +79501,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatches() QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78177,6 +79567,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78196,6 +79587,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78272,6 +79664,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78291,6 +79684,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78368,6 +79762,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78387,6 +79782,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78463,6 +79859,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78482,6 +79879,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatches() QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78556,6 +79954,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatchesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78575,6 +79974,7 @@ void NoteStoreTester::shouldExecuteUpdateNoteIfUsnMatchesAsync() QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78658,6 +80058,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78677,6 +80078,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInUpdateNoteIfUsnMatchesAsyn QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78771,6 +80173,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78790,6 +80193,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateNoteIfUsnMatches QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78885,6 +80289,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -78904,6 +80309,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInUpdateNoteIfUsnMatchesAs QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -78998,6 +80404,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79017,6 +80424,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInUpdateNoteIfUsnMatchesAsync( QObject::connect( &server, &NoteStoreServer::updateNoteIfUsnMatchesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79111,6 +80519,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79130,6 +80539,7 @@ void NoteStoreTester::shouldExecuteManageNotebookShares() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79195,6 +80605,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79214,6 +80625,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookShares() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79290,6 +80702,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79309,6 +80722,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookShares() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79386,6 +80800,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79405,6 +80820,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookShares() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79481,6 +80897,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79500,6 +80917,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookShares() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79574,6 +80992,7 @@ void NoteStoreTester::shouldExecuteManageNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79593,6 +81012,7 @@ void NoteStoreTester::shouldExecuteManageNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79676,6 +81096,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79695,6 +81116,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInManageNotebookSharesAsync( QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79789,6 +81211,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79808,6 +81231,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInManageNotebookSharesAs QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -79903,6 +81327,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -79922,6 +81347,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInManageNotebookSharesAsyn QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80016,6 +81442,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80035,6 +81462,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInManageNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::manageNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80129,6 +81557,7 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80148,6 +81577,7 @@ void NoteStoreTester::shouldExecuteGetNotebookShares() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80213,6 +81643,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80232,6 +81663,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookShares() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80308,6 +81740,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80327,6 +81760,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookShares() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80404,6 +81838,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80423,6 +81858,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookShares() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80499,6 +81935,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80518,6 +81955,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookShares() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80592,6 +82030,7 @@ void NoteStoreTester::shouldExecuteGetNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80611,6 +82050,7 @@ void NoteStoreTester::shouldExecuteGetNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80694,6 +82134,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80713,6 +82154,7 @@ void NoteStoreTester::shouldDeliverEDAMUserExceptionInGetNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80807,6 +82249,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80826,6 +82269,7 @@ void NoteStoreTester::shouldDeliverEDAMNotFoundExceptionInGetNotebookSharesAsync QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -80921,6 +82365,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -80940,6 +82385,7 @@ void NoteStoreTester::shouldDeliverEDAMSystemExceptionInGetNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -81034,6 +82480,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookSharesAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -81053,6 +82500,7 @@ void NoteStoreTester::shouldDeliverThriftExceptionInGetNotebookSharesAsync() QObject::connect( &server, &NoteStoreServer::getNotebookSharesRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; diff --git a/QEverCloud/src/tests/generated/TestUserStore.cpp b/QEverCloud/src/tests/generated/TestUserStore.cpp index 5c8a6dd2..131aeb6f 100644 --- a/QEverCloud/src/tests/generated/TestUserStore.cpp +++ b/QEverCloud/src/tests/generated/TestUserStore.cpp @@ -1271,6 +1271,7 @@ void UserStoreTester::shouldExecuteCheckVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1290,6 +1291,7 @@ void UserStoreTester::shouldExecuteCheckVersion() QObject::connect( &server, &UserStoreServer::checkVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1361,6 +1363,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1380,6 +1383,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersion() QObject::connect( &server, &UserStoreServer::checkVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1460,6 +1464,7 @@ void UserStoreTester::shouldExecuteCheckVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1479,6 +1484,7 @@ void UserStoreTester::shouldExecuteCheckVersionAsync() QObject::connect( &server, &UserStoreServer::checkVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1568,6 +1574,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1587,6 +1594,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCheckVersionAsync() QObject::connect( &server, &UserStoreServer::checkVersionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1681,6 +1689,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1700,6 +1709,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfo() QObject::connect( &server, &UserStoreServer::getBootstrapInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1763,6 +1773,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1782,6 +1793,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfo() QObject::connect( &server, &UserStoreServer::getBootstrapInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1854,6 +1866,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1873,6 +1886,7 @@ void UserStoreTester::shouldExecuteGetBootstrapInfoAsync() QObject::connect( &server, &UserStoreServer::getBootstrapInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -1954,6 +1968,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -1973,6 +1988,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetBootstrapInfoAsync() QObject::connect( &server, &UserStoreServer::getBootstrapInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2083,6 +2099,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2102,6 +2119,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSession() QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2189,6 +2207,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2208,6 +2227,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSession() QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2307,6 +2327,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2326,6 +2347,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSession( QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2424,6 +2446,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2443,6 +2466,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSession() QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2539,6 +2563,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2558,6 +2583,7 @@ void UserStoreTester::shouldExecuteAuthenticateLongSessionAsync() QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2663,6 +2689,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2682,6 +2709,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateLongSessionAsy QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2799,6 +2827,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2818,6 +2847,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateLongSessionA QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -2934,6 +2964,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -2953,6 +2984,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateLongSessionAsync QObject::connect( &server, &UserStoreServer::authenticateLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3059,6 +3091,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3078,6 +3111,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthentication() QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3151,6 +3185,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3170,6 +3205,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3255,6 +3291,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3274,6 +3311,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3358,6 +3396,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3377,6 +3416,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3459,6 +3499,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3478,6 +3519,7 @@ void UserStoreTester::shouldExecuteCompleteTwoFactorAuthenticationAsync() QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3569,6 +3611,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3588,6 +3631,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInCompleteTwoFactorAuthentic QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3691,6 +3735,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3710,6 +3755,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInCompleteTwoFactorAuthent QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3812,6 +3858,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3831,6 +3878,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInCompleteTwoFactorAuthenticat QObject::connect( &server, &UserStoreServer::completeTwoFactorAuthenticationRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -3922,6 +3970,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -3941,6 +3990,7 @@ void UserStoreTester::shouldExecuteRevokeLongSession() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4001,6 +4051,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4020,6 +4071,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSession() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4092,6 +4144,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4111,6 +4164,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSession() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4182,6 +4236,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4201,6 +4256,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSession() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4268,6 +4324,7 @@ void UserStoreTester::shouldExecuteRevokeLongSessionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4287,6 +4344,7 @@ void UserStoreTester::shouldExecuteRevokeLongSessionAsync() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4365,6 +4423,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4384,6 +4443,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRevokeLongSessionAsync() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4475,6 +4535,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4494,6 +4555,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRevokeLongSessionAsync() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4584,6 +4646,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4603,6 +4666,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRevokeLongSessionAsync() QObject::connect( &server, &UserStoreServer::revokeLongSessionRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4693,6 +4757,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4712,6 +4777,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusiness() QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4773,6 +4839,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4792,6 +4859,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusiness() QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4865,6 +4933,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4884,6 +4953,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusiness() QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -4956,6 +5026,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -4975,6 +5046,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusiness() QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5045,6 +5117,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5064,6 +5137,7 @@ void UserStoreTester::shouldExecuteAuthenticateToBusinessAsync() QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5143,6 +5217,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5162,6 +5237,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInAuthenticateToBusinessAsyn QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5253,6 +5329,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAs QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5272,6 +5349,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInAuthenticateToBusinessAs QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5362,6 +5440,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5381,6 +5460,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInAuthenticateToBusinessAsync( QObject::connect( &server, &UserStoreServer::authenticateToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5471,6 +5551,7 @@ void UserStoreTester::shouldExecuteGetUser() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5490,6 +5571,7 @@ void UserStoreTester::shouldExecuteGetUser() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5551,6 +5633,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5570,6 +5653,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUser() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5643,6 +5727,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5662,6 +5747,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUser() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5734,6 +5820,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5753,6 +5840,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUser() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5823,6 +5911,7 @@ void UserStoreTester::shouldExecuteGetUserAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5842,6 +5931,7 @@ void UserStoreTester::shouldExecuteGetUserAsync() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -5921,6 +6011,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -5940,6 +6031,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserAsync() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6031,6 +6123,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6050,6 +6143,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserAsync() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6140,6 +6234,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6159,6 +6254,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserAsync() QObject::connect( &server, &UserStoreServer::getUserRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6250,6 +6346,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6269,6 +6366,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfo() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6332,6 +6430,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6351,6 +6450,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfo() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6426,6 +6526,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6445,6 +6546,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfo() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6519,6 +6621,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6538,6 +6641,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfo() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6612,6 +6716,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6631,6 +6736,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfo() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6703,6 +6809,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6722,6 +6829,7 @@ void UserStoreTester::shouldExecuteGetPublicUserInfoAsync() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6803,6 +6911,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6822,6 +6931,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInGetPublicUserInfoAsync QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -6915,6 +7025,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -6934,6 +7045,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetPublicUserInfoAsync() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7026,6 +7138,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7045,6 +7158,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetPublicUserInfoAsync() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7137,6 +7251,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7156,6 +7271,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetPublicUserInfoAsync() QObject::connect( &server, &UserStoreServer::getPublicUserInfoRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7247,6 +7363,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7266,6 +7383,7 @@ void UserStoreTester::shouldExecuteGetUserUrls() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7327,6 +7445,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7346,6 +7465,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrls() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7419,6 +7539,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7438,6 +7559,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrls() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7510,6 +7632,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7529,6 +7652,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrls() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7599,6 +7723,7 @@ void UserStoreTester::shouldExecuteGetUserUrlsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7618,6 +7743,7 @@ void UserStoreTester::shouldExecuteGetUserUrlsAsync() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7697,6 +7823,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7716,6 +7843,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetUserUrlsAsync() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7807,6 +7935,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7826,6 +7955,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInGetUserUrlsAsync() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -7916,6 +8046,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -7935,6 +8066,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetUserUrlsAsync() QObject::connect( &server, &UserStoreServer::getUserUrlsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8026,6 +8158,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8045,6 +8178,7 @@ void UserStoreTester::shouldExecuteInviteToBusiness() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8109,6 +8243,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8128,6 +8263,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusiness() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8204,6 +8340,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8223,6 +8360,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusiness() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8298,6 +8436,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8317,6 +8456,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusiness() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8388,6 +8528,7 @@ void UserStoreTester::shouldExecuteInviteToBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8407,6 +8548,7 @@ void UserStoreTester::shouldExecuteInviteToBusinessAsync() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8489,6 +8631,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8508,6 +8651,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInInviteToBusinessAsync() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8603,6 +8747,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8622,6 +8767,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInInviteToBusinessAsync() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8716,6 +8862,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8735,6 +8882,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInInviteToBusinessAsync() QObject::connect( &server, &UserStoreServer::inviteToBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8827,6 +8975,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8846,6 +8995,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusiness() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -8910,6 +9060,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -8929,6 +9080,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusiness() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9005,6 +9157,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9024,6 +9177,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusiness() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9099,6 +9253,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9118,6 +9273,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusiness() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9193,6 +9349,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9212,6 +9369,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusiness() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9283,6 +9441,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9302,6 +9461,7 @@ void UserStoreTester::shouldExecuteRemoveFromBusinessAsync() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9384,6 +9544,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9403,6 +9564,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInRemoveFromBusinessAsync() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9498,6 +9660,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9517,6 +9680,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInRemoveFromBusinessAsync( QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9611,6 +9775,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsyn QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9630,6 +9795,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInRemoveFromBusinessAsyn QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9724,6 +9890,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9743,6 +9910,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInRemoveFromBusinessAsync() QObject::connect( &server, &UserStoreServer::removeFromBusinessRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9838,6 +10006,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9857,6 +10026,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifier() QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -9925,6 +10095,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -9944,6 +10115,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10024,6 +10196,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10043,6 +10216,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10122,6 +10296,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10141,6 +10316,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10220,6 +10396,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10239,6 +10416,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10314,6 +10492,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10333,6 +10512,7 @@ void UserStoreTester::shouldExecuteUpdateBusinessUserIdentifierAsync() QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10419,6 +10599,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10438,6 +10619,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInUpdateBusinessUserIdentifi QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10537,6 +10719,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10556,6 +10739,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInUpdateBusinessUserIdenti QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10654,6 +10838,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10673,6 +10858,7 @@ void UserStoreTester::shouldDeliverEDAMNotFoundExceptionInUpdateBusinessUserIden QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10771,6 +10957,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10790,6 +10977,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInUpdateBusinessUserIdentifier QObject::connect( &server, &UserStoreServer::updateBusinessUserIdentifierRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10885,6 +11073,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10904,6 +11093,7 @@ void UserStoreTester::shouldExecuteListBusinessUsers() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -10965,6 +11155,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -10984,6 +11175,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsers() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11057,6 +11249,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11076,6 +11269,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsers() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11148,6 +11342,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11167,6 +11362,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsers() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11240,6 +11436,7 @@ void UserStoreTester::shouldExecuteListBusinessUsersAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11259,6 +11456,7 @@ void UserStoreTester::shouldExecuteListBusinessUsersAsync() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11338,6 +11536,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11357,6 +11556,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessUsersAsync() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11448,6 +11648,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11467,6 +11668,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessUsersAsync() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11557,6 +11759,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11576,6 +11779,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessUsersAsync() QObject::connect( &server, &UserStoreServer::listBusinessUsersRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11672,6 +11876,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11691,6 +11896,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitations() QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11756,6 +11962,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11775,6 +11982,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitations() QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11852,6 +12060,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11871,6 +12080,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitations( QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -11947,6 +12157,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -11966,6 +12177,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitations() QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12043,6 +12255,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12062,6 +12275,7 @@ void UserStoreTester::shouldExecuteListBusinessInvitationsAsync() QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12145,6 +12359,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsy QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12164,6 +12379,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInListBusinessInvitationsAsy QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12259,6 +12475,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsA QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12278,6 +12495,7 @@ void UserStoreTester::shouldDeliverEDAMSystemExceptionInListBusinessInvitationsA QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12372,6 +12590,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12391,6 +12610,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInListBusinessInvitationsAsync QObject::connect( &server, &UserStoreServer::listBusinessInvitationsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12483,6 +12703,7 @@ void UserStoreTester::shouldExecuteGetAccountLimits() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12502,6 +12723,7 @@ void UserStoreTester::shouldExecuteGetAccountLimits() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12565,6 +12787,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12584,6 +12807,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimits() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12658,6 +12882,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12677,6 +12902,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimits() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12749,6 +12975,7 @@ void UserStoreTester::shouldExecuteGetAccountLimitsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12768,6 +12995,7 @@ void UserStoreTester::shouldExecuteGetAccountLimitsAsync() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12849,6 +13077,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12868,6 +13097,7 @@ void UserStoreTester::shouldDeliverEDAMUserExceptionInGetAccountLimitsAsync() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; @@ -12960,6 +13190,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() QObject::connect( &tcpServer, &QTcpServer::newConnection, + &tcpServer, [&] { pSocket = tcpServer.nextPendingConnection(); Q_ASSERT(pSocket); @@ -12979,6 +13210,7 @@ void UserStoreTester::shouldDeliverThriftExceptionInGetAccountLimitsAsync() QObject::connect( &server, &UserStoreServer::getAccountLimitsRequestReady, + &server, [&] (QByteArray responseData) { QByteArray buffer; From ed30474b18750570e9b3a6f03e986c5d6ff60896 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 16 Dec 2019 07:32:59 +0300 Subject: [PATCH 133/188] Start writing migration notes document from QEverCloud 4 to QEverCloud 5 Also move documents around and adjust some contents of other docs --- CONTRIBUTING.md | 7 ++--- .../API_breaks_3_to_4.md | 0 CodingStyle.md => docs/CodingStyle.md | 8 ++--- docs/Migration_notes_4_to_5.md | 30 +++++++++++++++++++ 4 files changed, 36 insertions(+), 9 deletions(-) rename API_breaks_3_to_4.md => docs/API_breaks_3_to_4.md (100%) rename CodingStyle.md => docs/CodingStyle.md (93%) create mode 100644 docs/Migration_notes_4_to_5.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 364e88cf..889d96ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ If you don't have a crash or exception but have some method of QEverCloud return If you have not only found a bug but have also identified its reason and would like to contribute a bugfix, please note the following: * `master` branch is meant to contain the current stable version of QEverCloud. Small and safe bugfixes are ok to land in `master`. More complicated bugfixes changing a lot of code or breaking the API/ABI compatibility are not indended for `master`. Instead, please contribute them to `development` branch. -* Make sure the changes you propose agree with the [coding style](CodingStyle.md) of the project. If they don't but the bugfix you are contributing is good enough, there's a chance your contribution would be accepted but the coding style would have to be cleaned up after that. You are encouraged to be a good citizen and not force others to clean up after you. +* Make sure the changes you propose agree with the [coding style](docs/CodingStyle.md) of the project. If they don't but the bugfix you are contributing is good enough, there's a chance your contribution would be accepted but the coding style would have to be cleaned up after that. You are encouraged to be a good citizen and not force others to clean up after you. * Make sure you don't attempt to change the code residing in `generated` folders, either for header files or cpp files: the code in those folders was [automatically generated](https://github.com/d1vanov/QEverCloudGenerator) from [Thrift IDL](https://github.com/evernote/evernote-thrift) files. So any manual changes there would be overwritten by the next re-generation from Thrift IDL files. Please see whether the fix you propose could belong to Thrift IDL files themselves - if it's a typo within some Doxygen comment, it can definitely be fixed in the Thrift IDL files with the corresponding QEverCloud code regenerated from corrected Thrift IDL files. So the fix for autogenerated code might need to be applied to [the generator](https://github.com/d1vanov/QEverCloudGenerator) of QEverCloud code from Thrift IDL files. ### How to suggest a new feature or improvement @@ -40,7 +40,7 @@ or It is important to discuss that for both preventing the duplication of effort and to ensure the implementation won't confront the vision of others and would be accepted when ready. Please don't start the actual work on the new features before the vision agreement is achieved - it can lead to problems with code acceptance to QEverCloud. -When working on a feature or improvement implementation, please comply with the [coding style](CodingStyle.md) of the project. +When working on a feature or improvement implementation, please comply with the [coding style](docs/CodingStyle.md) of the project. All the new features and major improvements should be contributed to `development` branch, not `master`. @@ -48,5 +48,4 @@ All the new features and major improvements should be contributed to `developmen * Breaking backward compatibility without a really good reason for that. * The introduction of dependencies on strictly the latest versions of anything, like, on some feature existing only in the latest version of Qt. -* The direct unconditional usage of C++11/14/17 features breaking the build with older compilers not supporting them (see the [coding style](CodingStyle.md) doc for more info on that) -* The breakage of building/working with Qt4 +* The direct unconditional usage of modern C++ features breaking the build with older compilers not supporting them (see the [coding style](docs/CodingStyle.md) doc for more info on that) diff --git a/API_breaks_3_to_4.md b/docs/API_breaks_3_to_4.md similarity index 100% rename from API_breaks_3_to_4.md rename to docs/API_breaks_3_to_4.md diff --git a/CodingStyle.md b/docs/CodingStyle.md similarity index 93% rename from CodingStyle.md rename to docs/CodingStyle.md index 3f066769..0209da9e 100644 --- a/CodingStyle.md +++ b/docs/CodingStyle.md @@ -163,10 +163,8 @@ Try to stick with the following layout of class contents: - Use `Q_SIGNALS` macro instead of `signals` and `Q_SLOTS` instead of `slots`, especially in the public interfaces of QEverCloud. The reason is that there are 3rdparty libraries which use `signals` and `slots` keyword in their own code and interfaces and the name clashing can create problems for library users. - Pass signal/slot parameters by value, not by const reference, unless you are certain that the objects interacting via the particular signals/slots would live in the same thread. The power and convenience of Qt’s signals/slots comes from their flexibility to the thread affinity of the connected objects but unless you pass parameters by value in signals/slots, it would be your job to provide the proper thread safety guarantees. There’s no reason to do this yourself when Qt can do it for you. -## C++11/14/17 features and Qt4 support +## Modern C++ features and supported Qt5 versions -The library does not use any C++11/14/17 features directly but only through macros such as `Q_DECL_OVERRIDE`, `Q_STATIC_ASSERT_X`, `QStringLiteral` and the like. These macros expand to proper C++ features if the compiler supports it or to nothing otherwise. +The library uses C++14 standard although it uses only those features of it which are supported by older compilers. The oldest supported g++ version is 5.4 and the oldest supported Visual Studio version is 2017. -As long as most of these macros exist only in Qt5 but not in Qt4, QEverCloud defines them on its own when building with Qt4. - -Building with Qt4 is still supported by QEverCloud. Yes, Qt4 may be dead and unsupported by the upstream. However, there are still LTS Linux distributions around which use and ship Qt4 and QEverCloud strives to be compatible with them. +The oldest supported version of Qt is 5.5. Even though this version of Qt is not supported by the upstream anymore, there are still LTS Linux distributions around which use and ship this version and QEverCloud strives to be compatible with them. diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md new file mode 100644 index 00000000..4bfa6d80 --- /dev/null +++ b/docs/Migration_notes_4_to_5.md @@ -0,0 +1,30 @@ +# Migration notes from major version 4 to major version 5 + +Release 5 of QEverCloud added several major new features which required to introduce API breaks. This document lists the changes made and suggests ways to adapt your code using QEverCloud to these changes. + +## Minimal required versions of compiler, Qt and CMake + +In release 5 QEverCloud bumped the minimal required versions of compiler, Qt and CMake. Minimal supported versions are as follows: + * g++: 5.4 + * Visual Studio: 2017 + * Qt: 5.5 + * CMake: 3.5.1 + +If your build infrastructure is older than than, unfortunately you want be able to build QEverCloud 5 before you upgrade your infrastructure. + +If you use any other compiler than g++ or Visual Studio, the requirement is that it should support C++14 standard features used by QEverCloud. CMake automatically checks the presence of support for most of required features during the pre-build configuration phase. + +## Removed CMake options + +Some CMake options existing in QEverCloud before version 5 were removed. These options include the following: + * `MAJOR_VERSION_LIB_NAME_SUFFIX` + * `MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX` + * `BUILD_WITH_QT4` + +## Changes in AsyncResult class + +The constructors of `AsyncResult` class now accept one more argument: `IRequextContextPtr`. See the section on request context within this document for details on what it is. Also, one more constructor was added to `AsyncResult` class which handles the case of pre-existing value and/or exception. + +It's very unlikely that your code uses `AsyncResult` constructors directly, instead it most probably receives pointers to `AsyncResult` objects created by QEverCloud's services methods. So it's unlikely that changes in `AsyncResult` constructors would affect your code in any way. + +What would affect your code though is the change in `AsyncResult::finished` signature: in addition to value and exception data it also passes the request context pointer. In your code you'd need to add the additional parameter to the slot connected to `AsyncResult::finished` signal. You might just do it and leave the new parameter unused but you can actually use request context for e.g. matching request id from it to the guid of a downloaded note, for example. If your code downloads many notes asynchronously and concurrently, your slot connected to `AsyncResult::finished` might be invoked several times for different notes. Now you can conveniently map each such invokation to a particular note. From f3b5d0f7f69b2d8d9cdc6fb14c5677e9d24de4de Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 16 Dec 2019 07:33:20 +0300 Subject: [PATCH 134/188] Remove check for Qt version less than 5.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4791a0fb..c20ee261 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ file(COPY QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesCore.cmake DESTI file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt5DependenciesCore.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake) if(BUILD_WITH_OAUTH_SUPPORT) - if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0")) + if(USE_QT5_WEBKIT) file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebKit.cmake WEBKIT_DEPS_FILE) file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBKIT_DEPS_FILE}") elseif(Qt5Core_VERSION VERSION_LESS "5.6.0") From 799cf050c0dd3680550d2f32ef839dc7c5e34e30 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 17 Dec 2019 07:55:57 +0300 Subject: [PATCH 135/188] Rename include guards --- QEverCloud/headers/Helpers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 55db520a..2a05ebe1 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -23,8 +23,8 @@ * SOFTWARE. */ -#ifndef QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H -#define QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H +#ifndef QEVERCLOUD_HELPERS_H +#define QEVERCLOUD_HELPERS_H #include #include @@ -173,4 +173,4 @@ QAssociativeContainerConstReferenceWrapper toRange( } // namespace qevercloud -#endif // QEVERCLOUD_GENERATOR_THRIFT_HELPERS_H +#endif // QEVERCLOUD_HELPERS_H From da5dec8b9e3cad89527b5dddc50ccf8b95e85d56 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Tue, 17 Dec 2019 07:56:18 +0300 Subject: [PATCH 136/188] Continue writing migration notes --- docs/Migration_notes_4_to_5.md | 65 ++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index 4bfa6d80..f231aed8 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -14,17 +14,76 @@ If your build infrastructure is older than than, unfortunately you want be able If you use any other compiler than g++ or Visual Studio, the requirement is that it should support C++14 standard features used by QEverCloud. CMake automatically checks the presence of support for most of required features during the pre-build configuration phase. -## Removed CMake options +## Removed functionality + +### Removed CMake options Some CMake options existing in QEverCloud before version 5 were removed. These options include the following: * `MAJOR_VERSION_LIB_NAME_SUFFIX` * `MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX` * `BUILD_WITH_QT4` -## Changes in AsyncResult class +### Removed functions + +Two functions were removed from QEverCloud 5 which used to control the request timeout: they were improperly called `connectionTimeout` and `setConnectionTimeout`. In QEverCloud 5 in order to specify request timeouts one should use `IRequestContext` interface (see below for more details). + +## Changes in API + +### Changes in names of headers + +Since QEverCloud 5 all header and source files have consistent naming: now they all start from capital letters i.e. `globals.h` has become `Globals.h`. Before that naming of header and source files was inconsistent - some file names started from capital letters, some did not. It was preserved for backward compatibility but since QEverCloud 5 breaks this compatibility in numerous ways, it was considered a good opportunity to clean up the headers naming as well. + +Most probably it shouldn't be a problem for your code as the recommendation has always been to include `QEverCloud.h` global header (or `QEverCloudOAuth.h` for OAuth functionality) instead of particular other headers. + +### Use of std::shared_ptr instead of QSharedPointer throughout the library + +In release 5 of QEverCloud all `QSharedPointers` were replaced with `std::shared_ptrs`. Smart pointers from the C++ standard library offer more convenience and flexibility than Qt's ones which were introduced back in times of C++98 when there was no choice to use standard library's smart pointers as there were none. + +One place within the library where the replacement took place is `AsyncResult::finished` signal. `QSharedPointer` was replaced with typedef `EverCloudExceptionDataPtr` which actually is `std::shared_ptr`. Note that Qt metatype is registered for the typedef rather than the shared_ptr so in your code you should use the typedef as well to ensure Qt doesn't have any troubles queuing the pointer in signal-slot connections. + +### Changes in AsyncResult class The constructors of `AsyncResult` class now accept one more argument: `IRequextContextPtr`. See the section on request context within this document for details on what it is. Also, one more constructor was added to `AsyncResult` class which handles the case of pre-existing value and/or exception. It's very unlikely that your code uses `AsyncResult` constructors directly, instead it most probably receives pointers to `AsyncResult` objects created by QEverCloud's services methods. So it's unlikely that changes in `AsyncResult` constructors would affect your code in any way. -What would affect your code though is the change in `AsyncResult::finished` signature: in addition to value and exception data it also passes the request context pointer. In your code you'd need to add the additional parameter to the slot connected to `AsyncResult::finished` signal. You might just do it and leave the new parameter unused but you can actually use request context for e.g. matching request id from it to the guid of a downloaded note, for example. If your code downloads many notes asynchronously and concurrently, your slot connected to `AsyncResult::finished` might be invoked several times for different notes. Now you can conveniently map each such invokation to a particular note. +What would affect your code though is the change in `AsyncResult::finished` signature: in addition to value and exception data it also passes the request context pointer. In your code you'd need to add the additional parameter to the slot connected to `AsyncResult::finished` signal. You might just do it and leave the new parameter unused but you can actually use request context for e.g. matching request id to the guid of a downloaded note, for example. If your code downloads many notes asynchronously and concurrently, your slot connected to `AsyncResult::finished` might be invoked several times for different notes. Now you can conveniently map each such invokation to a particular note. + +## New functionality + +### New interfaces: IDurableService and IRetryPolicy + +`IDurableService` interface encapsulates the logic of retrying the request if some *retriable* error has occurred during the attempt to execute it. A good example of a retriable error is a transient network failure. QEverCloud might have sent a http request to Evernote service but network has suddenly failed, the request was not delivered to Evernote service which thus has never sent the response back to QEverCloud. With retries the request is automatically sent again in the hope that it would succeed this time but it happens only for errors which are actually retriable. The logic of deciding whether some particular error is retriable is encapsulated within `IRetryPolicy` interface. QEverCloud offers two convenience functions for dealing with `IRetryPolicy`: + * `newRetryPolicy` creates the retry policy used by QEverCloud by default - only transient network errors are retried. + * `nullRetryPolicy` creates the retry policy which considers any error not retriable. In QEverCloud this policy is used for testing. + +In order to create the actual durable service instance, call `newDurableService`. In this function you can optionally pass the pointer to `IRetryPolicy` (the default one is used if you don't specify it) and the pointer to the "global" request context for this service. + +You don't have to use `IDurableService` or `IRetryPolicy` directly, they are already used by QEverClouds internals under the hood. But if you want to reuse QEverCloud's retry functionality for arbitrary code of yours, you can actually do so. + +### New class: NetworkException + +New exception class was introduced in QEverCloud 5: `NetworkException`. It encapsulates any network errors that might occur during the communication between QEverCloud and Evernote service. Some of these errors might be transient and thus retriable (see the section about `IDurableService` and `IRetryPolicy` above). The type of error is an element from `QNetworkReply::NetworkError` enumeration. + +### New global function: initializeQEverCloud + +The migration from `QSharedPointer` to `std::shared_ptr` required to explicitly specify corresponding Qt metatypes. For this a special function was introduced, `initializeQEverCloud` which is declared in `Globals.h` header. It is meant to be called once before other QEverCloud functionality is used. There is no harm in calling it multiple times if it happens by occasion. + +### New convenience functions toRange for iterating over Qt's associative containers + +In QEverCloud 5 a new header file was added, `Helpers.h` which contains various auxiliary stuff which doesn't quite fit in other places. In particular, this new header contains two convenience functions `toRange` which allow one to use modern C++'s range based loops for iteration over Qt's associative containers. + +Modern C++'s range based loops have certain requirements for container's iterators: dereferencing the iterator should return a pair with key and value. Iterators of Qt containers such as `QHash` and `QMap` don't comply with this requirement: their iterators are not dereferenced at all, they contain methods `key()` and `value()` which return key and value respectively. Helper functions `toRange` create lightweight wrappers around Qt's containers and their iterators providing range based for loop compliant wrapper iterators. No data copying from the container takes place so it is truly lightweight. + +There are two overloads of `toRange` function: one for iterating over the constant container and one for iterating over the non-const one. + +In code such iteration looks like this: +``` +QHash myHash; +<...> // fill myHash +for(const auto & it: toRange(myHash)) { + const auto & key = it.key(); + const auto & value = it.value(); + <...> // do something with key and value +} +``` From 436a317308f8ebed08b501ce6e8001efb79a297b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 18 Dec 2019 07:18:42 +0300 Subject: [PATCH 137/188] Update generated code --- QEverCloud/headers/generated/Services.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/QEverCloud/headers/generated/Services.h b/QEverCloud/headers/generated/Services.h index 9409de73..697d7129 100644 --- a/QEverCloud/headers/generated/Services.h +++ b/QEverCloud/headers/generated/Services.h @@ -3315,11 +3315,13 @@ QEVERCLOUD_EXPORT INoteStore * newNoteStore( IRequestContextPtr ctx = {}, QObject * parent = nullptr, IRetryPolicyPtr retryPolicy = {}); + QEVERCLOUD_EXPORT IUserStore * newUserStore( QString userStoreUrl = {}, IRequestContextPtr ctx = {}, QObject * parent = nullptr, IRetryPolicyPtr retryPolicy = {}); + } // namespace qevercloud Q_DECLARE_METATYPE(QList) From d3ccee74087cb2322c747b09e7bfd27c2d5ad1f4 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 18 Dec 2019 07:34:24 +0300 Subject: [PATCH 138/188] Rename function --- QEverCloud/headers/Log.h | 2 +- QEverCloud/src/Log.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index c3bd6bba..229c62f2 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -67,7 +67,7 @@ QEVERCLOUD_EXPORT ILoggerPtr logger(); QEVERCLOUD_EXPORT void setLogger(ILoggerPtr logger); -QEVERCLOUD_EXPORT ILoggerPtr newNullLogger(); +QEVERCLOUD_EXPORT ILoggerPtr nullLogger(); QEVERCLOUD_EXPORT ILoggerPtr newStdErrLogger(LogLevel level = LogLevel::Warn); diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 3265f326..025b5465 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -195,7 +195,7 @@ ILoggerPtr logger() return *globalLogger; } - return newNullLogger(); + return nullLogger(); } void setLogger(ILoggerPtr logger) @@ -205,7 +205,7 @@ void setLogger(ILoggerPtr logger) } } -ILoggerPtr newNullLogger() +ILoggerPtr nullLogger() { return std::make_shared(); } From 625ea732d94aaa252b8d3c0660fc7f5c83baae8a Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 18 Dec 2019 07:48:39 +0300 Subject: [PATCH 139/188] Continue writing migration notes --- docs/Migration_notes_4_to_5.md | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index f231aed8..32e29fd6 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -49,8 +49,35 @@ It's very unlikely that your code uses `AsyncResult` constructors directly, inst What would affect your code though is the change in `AsyncResult::finished` signature: in addition to value and exception data it also passes the request context pointer. In your code you'd need to add the additional parameter to the slot connected to `AsyncResult::finished` signal. You might just do it and leave the new parameter unused but you can actually use request context for e.g. matching request id to the guid of a downloaded note, for example. If your code downloads many notes asynchronously and concurrently, your slot connected to `AsyncResult::finished` might be invoked several times for different notes. Now you can conveniently map each such invokation to a particular note. +### Changes in Optional template class + +In QEverCloud 5 `Optional` template class implementation was changed: `operator==` and `operator!=` accepting another `Optional` were added to it. Unfortunately, it has lead to some complications: you can no longer do comparisons involving implicit type conversions between Optional and value of compatible yet different type, like this: +``` +Optional a = 42; +double b = 1.0; +bool res = (a == b); +``` +Instead you need to cast the right hand side expression to proper type: +``` +Optional a = 42; +double b = 1.0; +bool res = (a == static_cast(b)); +``` + ## New functionality +### Printability + +Since QEverCloud 5 all types and enumerations from Evernote API as well as exception classes are printable. Printability means that enumeration values and objects of Evernote types and exceptions classes can be printed to `QTextStream` and `QDebug`. Additionally, objects of Evernote types and exceptions classes can be conveniently converted to string using `toString` method. + +Printability for classes was implemented as inheritance from `Printable` base class which contains one pure virtual method: +``` +virtual void print(QTextStream & strm) const = 0; +``` +`Printable` uses this method to implement printing to `QTextStream` and `QDebug` using stream operators and the conversion to string. + +Printability of enumerations and objects was required to implement QEverCloud's logging facility (see below). + ### New interfaces: IDurableService and IRetryPolicy `IDurableService` interface encapsulates the logic of retrying the request if some *retriable* error has occurred during the attempt to execute it. A good example of a retriable error is a transient network failure. QEverCloud might have sent a http request to Evernote service but network has suddenly failed, the request was not delivered to Evernote service which thus has never sent the response back to QEverCloud. With retries the request is automatically sent again in the hope that it would succeed this time but it happens only for errors which are actually retriable. The logic of deciding whether some particular error is retriable is encapsulated within `IRetryPolicy` interface. QEverCloud offers two convenience functions for dealing with `IRetryPolicy`: @@ -87,3 +114,24 @@ for(const auto & it: toRange(myHash)) { <...> // do something with key and value } ``` + +### Logging facility + +QEverCloud 5 added a flexible logging facility which client code can use as desired. The logging facility consists of `LogLevel` enumeration and `ILogger` interface located in new `Log.h` header. `LogLevel` enumeration has the following log levels: + + * `Trace` + * `Debug` + * `Info` + * `Warn` + * `Error` + +The default log level is `Info` which means that QEverCloud's logger would log events with `Info`, `Warn` and `Error` level. + +The `ILogger` interface contains methods which would be called by QEverCloud when it uses the logger internally. The fact that `ILogger` is an interface and not a particular class means that the client code can implement this interface and thus integrate QEverCloud's logger into its own logging facility, whatever that it. The instance of a particular QEverCloud logger is a singleton which can be set using `setLogger` function and retrieved using `logger` function. For convenience QEverCloud provides two auxiliary functions: + + * `nullLogger`: this function creates an instance of logger which does nothing. It is a logger used by QEverCloud by default i.e. by default QEverCloud doesn't write the logs it collects anywhere + * `newStdErrLogger`: this function creates an instance of logger which writes logs to stderr. + +### New parameter in EvernoteOAuthWebView::authenticate method + +The optional timeout parameter was added to `EvernoteOAuthWebView::authenticate` method. The timeout is not for the whole OAuth procedure but for communication with Evernote service over the network. If Evernote doesn't answer to QEverCloud's request for the duration of a timeout, OAuth fails. That's how OAuth has worked before too but previously this timeout duration could not be specified by the client code. Now it can be specified. By default the timeout of 30 seconds is used. From 194b8a9c92cc0ca5aaf5e7e068714e9a3809f16e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 19 Dec 2019 07:19:38 +0300 Subject: [PATCH 140/188] Fix typo --- QEverCloud/headers/RequestContext.h | 4 ++-- QEverCloud/src/tests/TestDurableService.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/QEverCloud/headers/RequestContext.h b/QEverCloud/headers/RequestContext.h index 2c43c7da..43e81fdc 100644 --- a/QEverCloud/headers/RequestContext.h +++ b/QEverCloud/headers/RequestContext.h @@ -22,7 +22,7 @@ namespace qevercloud { static constexpr quint64 DEFAULT_REQUEST_TIMEOUT_MSEC = 10'000ull; -static constexpr bool DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE = true; +static constexpr bool DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE = true; static constexpr quint64 DEFAULT_MAX_REQUEST_TIMEOUT_MSEC = 600'000ull; @@ -80,7 +80,7 @@ using IRequestContextPtr = std::shared_ptr; QEVERCLOUD_EXPORT IRequestContextPtr newRequestContext( QString authenticationToken = {}, qint64 requestTimeout = DEFAULT_REQUEST_TIMEOUT_MSEC, - bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + bool increaseRequestTimeoutExponentially = DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, qint64 maxRequestTimeout = DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, quint32 maxRequestRetryCount = DEFAULT_MAX_REQUEST_RETRY_COUNT); diff --git a/QEverCloud/src/tests/TestDurableService.cpp b/QEverCloud/src/tests/TestDurableService.cpp index 7827f4a7..c923fd77 100644 --- a/QEverCloud/src/tests/TestDurableService.cpp +++ b/QEverCloud/src/tests/TestDurableService.cpp @@ -116,7 +116,7 @@ void DurableServiceTester::shouldRetrySyncServiceCalls() auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); @@ -161,7 +161,7 @@ void DurableServiceTester::shouldRetryAsyncServiceCalls() auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); @@ -217,7 +217,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallMoreThanMaxTimes() auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); @@ -265,7 +265,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallMoreThanMaxTimes() auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); @@ -324,7 +324,7 @@ void DurableServiceTester::shouldNotRetrySyncServiceCallInCaseOfUnretriableError auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); @@ -374,7 +374,7 @@ void DurableServiceTester::shouldNotRetryAsyncServiceCallInCaseOfUnretriableErro auto ctx = newRequestContext( QString(), DEFAULT_REQUEST_TIMEOUT_MSEC, - DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_ICREASE, + DEFAULT_REQUEST_TIMEOUT_EXPONENTIAL_INCREASE, DEFAULT_MAX_REQUEST_TIMEOUT_MSEC, maxServiceCallCounter); From 814731f546d6b04ea242c88a6609a0725010d8eb Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 19 Dec 2019 07:52:21 +0300 Subject: [PATCH 141/188] Continue writing migration notes --- docs/Migration_notes_4_to_5.md | 81 +++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 21 deletions(-) diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index 32e29fd6..5fd59b79 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -23,7 +23,7 @@ Some CMake options existing in QEverCloud before version 5 were removed. These o * `MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX` * `BUILD_WITH_QT4` -### Removed functions +### Removed global functions Two functions were removed from QEverCloud 5 which used to control the request timeout: they were improperly called `connectionTimeout` and `setConnectionTimeout`. In QEverCloud 5 in order to specify request timeouts one should use `IRequestContext` interface (see below for more details). @@ -64,6 +64,25 @@ double b = 1.0; bool res = (a == static_cast(b)); ``` +### Changes in Thumbnail class + +Since QEverCloud 5 method `Thumbnail::createPostRequest` returns `std::pair` instead of `QPair`. There are [plans to deprecate/remove](https://bugreports.qt.io/browse/QTBUG-80309) `QPair` in favour of `std::pair`. + +`Thumbnail::ImageType` used to be a so called "C++98-style scoped enum" i.e. struct `ImageType` wrapping enum `type` so that enum items could be referenced with `ImageType::` prefix. Now this enum is a proper C++11 scoped enum so the prefix is still there but there's no need to refer to the type as `ImageType::type`, `ImageType` is sufficient now. + +### Changes in EDAMErrorCode header + +`EDAMErrorCode.h` header contains numerous enumerations related to error codes. Before QEverCloud 5 they used to be "C++98-style scoped enums" i.e. structs wrapping enum called `type`. Now they are proper `enum classes`. For client code it means that all references to enumerations containing `::type` suffix need to be freed from it. I.e. all occurrences of `EDAMErrorCode::type` need to be changes to `EDAMErrorCode`, same for other enumerations. + +### Changes in service classes + +Before QEverCloud 5 there were two classes which methods were used to communicate with Evernote: `NoteStore` and `UserStore`. Now these classes are converted to abstract interfaces: `INoteStore` and `IUserStore`. The actual instances of services should now be created with functions `newNoteStore` and `newUserStore`. These functions accept service url, request context, parent `QObject` and retry policy. The request context parameter has important meaning here: + * it would be used as default request context if none is provided in particular method calls of the service (only request id would be different) + * the authentication token from this request context would be used in method calls for which no request context was provided + * if this request context has zero max request retry count, the automatic retries of requests would be disabled + +Methods of both interfaces now accept optional `IRequestContextPtr` where before QEverCloud 5 they used to accept `authenticationToken` parameter. If no request context is provided, the default one is used - either the one provided to `newNoteStore`/`newUserStore` or the one created with `newRequestContext` with all the default parameters. + ## New functionality ### Printability @@ -78,7 +97,17 @@ virtual void print(QTextStream & strm) const = 0; Printability of enumerations and objects was required to implement QEverCloud's logging facility (see below). -### New interfaces: IDurableService and IRetryPolicy +### IRequestContext interface + +`IRequestContext` interface carries several values related to the request which define the way in which the request is handled by QEverCloud. In particular, values within request context include the following: + * `requestId` is the autogenerated unique identifier of the request which allows to tell one request from another in e.g. logs + * `authenticationToken` is Evernote authentication token - either user's own one or the one for a particular linked notebook for requests related to it. Before QEverCloud 5 it used to be a separate parameter in service calls but now it is a part of request context. + * `requestTimeout` in milliseconds + * `increaseRequestTimeoutExponentially` is a boolean flag telling whether the timeout should be increased when the request is automatically retried + * `maxRequestTimeout` is an upper boundary for automatically increased timeout on retries + * `maxRequestRetryCount` is the maximum number of attempts to retry the request + +### IDurableService and IRetryPolicy interfaces `IDurableService` interface encapsulates the logic of retrying the request if some *retriable* error has occurred during the attempt to execute it. A good example of a retriable error is a transient network failure. QEverCloud might have sent a http request to Evernote service but network has suddenly failed, the request was not delivered to Evernote service which thus has never sent the response back to QEverCloud. With retries the request is automatically sent again in the hope that it would succeed this time but it happens only for errors which are actually retriable. The logic of deciding whether some particular error is retriable is encapsulated within `IRetryPolicy` interface. QEverCloud offers two convenience functions for dealing with `IRetryPolicy`: * `newRetryPolicy` creates the retry policy used by QEverCloud by default - only transient network errors are retried. @@ -88,7 +117,7 @@ In order to create the actual durable service instance, call `newDurableService` You don't have to use `IDurableService` or `IRetryPolicy` directly, they are already used by QEverClouds internals under the hood. But if you want to reuse QEverCloud's retry functionality for arbitrary code of yours, you can actually do so. -### New class: NetworkException +### NetworkException New exception class was introduced in QEverCloud 5: `NetworkException`. It encapsulates any network errors that might occur during the communication between QEverCloud and Evernote service. Some of these errors might be transient and thus retriable (see the section about `IDurableService` and `IRetryPolicy` above). The type of error is an element from `QNetworkReply::NetworkError` enumeration. @@ -96,6 +125,33 @@ New exception class was introduced in QEverCloud 5: `NetworkException`. It encap The migration from `QSharedPointer` to `std::shared_ptr` required to explicitly specify corresponding Qt metatypes. For this a special function was introduced, `initializeQEverCloud` which is declared in `Globals.h` header. It is meant to be called once before other QEverCloud functionality is used. There is no harm in calling it multiple times if it happens by occasion. +### Logging facility + +QEverCloud 5 added a flexible logging facility which client code can use as desired. The logging facility consists of `LogLevel` enumeration and `ILogger` interface located in new `Log.h` header. `LogLevel` enumeration has the following log levels: + + * `Trace` + * `Debug` + * `Info` + * `Warn` + * `Error` + +The default log level is `Info` which means that QEverCloud's logger would log events with `Info`, `Warn` and `Error` level. + +The `ILogger` interface contains methods which would be called by QEverCloud when it uses the logger internally. The fact that `ILogger` is an interface and not a particular class means that the client code can implement this interface and thus integrate QEverCloud's logger into its own logging facility, whatever that it. The instance of a particular QEverCloud logger is a singleton which can be set using `setLogger` function and retrieved using `logger` function. For convenience QEverCloud provides two auxiliary functions: + + * `nullLogger`: this function creates an instance of logger which does nothing. It is a logger used by QEverCloud by default i.e. by default QEverCloud doesn't write the logs it collects anywhere + * `newStdErrLogger`: this function creates an instance of logger which writes logs to stderr. + +### New servers classes + +QEverCloud 5 added new classes in `Servers.h` header which can be used to implement a simplistic version of Evernote service of your own. `NoteStoreServer` and `UserStoreServer` classes are `QObject` subclasses which are capable of the following: + * take serialized thrift request data as `QByteArray` in `onRequest` slot + * parse the request and emit one of particular signals indicating what request needs to be served. For example, for note creation request `NoteStoreServer::createNoteRequest` signal would be emitted. + * take external response on request into a particular slot. For example, for note creation request `NoteStoreServer::onCreateNoteRequestReady` slot should be invoked. + * encode response data into a thrift format and emit a particular signal indicating that the response is ready to be delivered. For example, for note creation request `NoteStoreServer::createNoteRequestReady` signal would be emitted. + + In QEverCloud these classes are used in unit tests which ensure that code talking to Evernote service works as it should. + ### New convenience functions toRange for iterating over Qt's associative containers In QEverCloud 5 a new header file was added, `Helpers.h` which contains various auxiliary stuff which doesn't quite fit in other places. In particular, this new header contains two convenience functions `toRange` which allow one to use modern C++'s range based loops for iteration over Qt's associative containers. @@ -115,23 +171,6 @@ for(const auto & it: toRange(myHash)) { } ``` -### Logging facility - -QEverCloud 5 added a flexible logging facility which client code can use as desired. The logging facility consists of `LogLevel` enumeration and `ILogger` interface located in new `Log.h` header. `LogLevel` enumeration has the following log levels: - - * `Trace` - * `Debug` - * `Info` - * `Warn` - * `Error` - -The default log level is `Info` which means that QEverCloud's logger would log events with `Info`, `Warn` and `Error` level. - -The `ILogger` interface contains methods which would be called by QEverCloud when it uses the logger internally. The fact that `ILogger` is an interface and not a particular class means that the client code can implement this interface and thus integrate QEverCloud's logger into its own logging facility, whatever that it. The instance of a particular QEverCloud logger is a singleton which can be set using `setLogger` function and retrieved using `logger` function. For convenience QEverCloud provides two auxiliary functions: - - * `nullLogger`: this function creates an instance of logger which does nothing. It is a logger used by QEverCloud by default i.e. by default QEverCloud doesn't write the logs it collects anywhere - * `newStdErrLogger`: this function creates an instance of logger which writes logs to stderr. - -### New parameter in EvernoteOAuthWebView::authenticate method +### New optional timeout parameter in EvernoteOAuthWebView::authenticate method The optional timeout parameter was added to `EvernoteOAuthWebView::authenticate` method. The timeout is not for the whole OAuth procedure but for communication with Evernote service over the network. If Evernote doesn't answer to QEverCloud's request for the duration of a timeout, OAuth fails. That's how OAuth has worked before too but previously this timeout duration could not be specified by the client code. Now it can be specified. By default the timeout of 30 seconds is used. From 6fd4c965a77b598f4e8d2ce4e658d2b8f7b7fcac Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 20 Dec 2019 07:21:37 +0300 Subject: [PATCH 142/188] Continue writing migration notes + minor typo fixes in docs --- CHANGELOG.md | 4 ++-- docs/CodingStyle.md | 2 +- docs/Migration_notes_4_to_5.md | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4e6f5b..b0f7a7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ required to introduce several API breaks.** * Network requests sent to Evernote service via `NoteStore` and `UserStore` method calls are now automatically retried if network occasionally fails. - Retry logic can be parametrized either on `NoteStore` or `UserStore` level + Retry logic can be parametrized on `NoteStore` or `UserStore` level or per each particular method call. * `IRequestContext` interface was introduced and added to all methods of `NoteStore` and `UserStore` as well as to their constructors. This interface @@ -148,7 +148,7 @@ ## 2.0 * Qt 4 is no longer supported. - * Asynchronous API is introdused. + * Asynchronous API is introduced. * Various non-critical fixes and improvements. ## 1.2 diff --git a/docs/CodingStyle.md b/docs/CodingStyle.md index 0209da9e..8692befc 100644 --- a/docs/CodingStyle.md +++ b/docs/CodingStyle.md @@ -144,7 +144,7 @@ Try to stick with the following layout of class contents: - `Q_OBJECT` macro, if required for the class - inner classes, if any - typedefs, if any -- contructors - the default one, if present, comes first, then non-default constructors, if any, then copy-constructor, if present. +- constructors - the default one, if present, comes first, then non-default constructors, if any, then copy-constructor, if present. - assignment operators, if any - destructor, if present - Qt signals, if any diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index 5fd59b79..91328449 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -174,3 +174,20 @@ for(const auto & it: toRange(myHash)) { ### New optional timeout parameter in EvernoteOAuthWebView::authenticate method The optional timeout parameter was added to `EvernoteOAuthWebView::authenticate` method. The timeout is not for the whole OAuth procedure but for communication with Evernote service over the network. If Evernote doesn't answer to QEverCloud's request for the duration of a timeout, OAuth fails. That's how OAuth has worked before too but previously this timeout duration could not be specified by the client code. Now it can be specified. By default the timeout of 30 seconds is used. + +### New localData field in structs corresponding to Evernote types + +Since QEverCloud 5 structs corresponding to Evernote types have a new field of type `EverCloudLocalData` called `localData`. This field encapsulates several data members which don't take part in synchronization with Evernote (thus "local" in the name) but which are useful for applications using QEverCloud to implement rich Evernote client apps. `EverCloudLocalData` struct contains the following fields: + * `id` string which by default is generated as a `QUuid` but can be substituted with any string value + * `dirty`, `local` and `favorited` boolean flags + * `dict` which is a collection of arbitrary data in the form of `QVariant`s indexed by strings + +### Enumerations registered in Qt's meta object system with Q_ENUM_NS macro + +Enumerations such as error codes in `EDAMErrorCode.h` were marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS) macro in case build is done with Qt >= 5.8. This macro adds some introspection capabilities through Qt's meta object system for these enumerations. + +### Elements of Evernote types registered in Qt's meta object system with Q_PROPERTY and Q_GADGET macros + +Some introspection capabilities were added to QEverCloud 5 structs corresponding to Evernote types: they now have [Q_GADGET](https://doc.qt.io/qt-5/qobject.html#Q_GADGET) macro and each of their attributes is registered as a [Q_PROPERTY](https://doc.qt.io/qt-5/qobject.html#Q_PROPERTY). + + From eccb6816f63aefe527ad32c94a86d640f3b40c3b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 20 Dec 2019 07:49:20 +0300 Subject: [PATCH 143/188] Various edits to migration notes --- docs/Migration_notes_4_to_5.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index 91328449..7f61c204 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -1,4 +1,4 @@ -# Migration notes from major version 4 to major version 5 +# Migration notes from QEverCloud 4 to 5 Release 5 of QEverCloud added several major new features which required to introduce API breaks. This document lists the changes made and suggests ways to adapt your code using QEverCloud to these changes. @@ -10,9 +10,9 @@ In release 5 QEverCloud bumped the minimal required versions of compiler, Qt and * Qt: 5.5 * CMake: 3.5.1 -If your build infrastructure is older than than, unfortunately you want be able to build QEverCloud 5 before you upgrade your infrastructure. +If your build infrastructure is older than that, unfortunately you won't be able to build QEverCloud 5 before you upgrade your infrastructure. -If you use any other compiler than g++ or Visual Studio, the requirement is that it should support C++14 standard features used by QEverCloud. CMake automatically checks the presence of support for most of required features during the pre-build configuration phase. +If you use any other compiler than g++ or Visual Studio, the requirement is that it should support C++14 features used by QEverCloud. CMake automatically checks the presence of support for most of required features during the pre-build configuration phase. ## Removed functionality @@ -31,15 +31,17 @@ Two functions were removed from QEverCloud 5 which used to control the request t ### Changes in names of headers -Since QEverCloud 5 all header and source files have consistent naming: now they all start from capital letters i.e. `globals.h` has become `Globals.h`. Before that naming of header and source files was inconsistent - some file names started from capital letters, some did not. It was preserved for backward compatibility but since QEverCloud 5 breaks this compatibility in numerous ways, it was considered a good opportunity to clean up the headers naming as well. +Since QEverCloud 5 all header and source files have consistent naming: now they all start from uppercase letters i.e. `globals.h` has become `Globals.h`. Before QEverCloud 5 the naming of header and source files was inconsistent for legacy reasons - some file names started from uppercase letters, some from lowercase ones. It was preserved for backward compatibility but as QEverCloud 5 breaks this compatibility in numerous ways, it was considered a good opportunity to clean up the headers naming as well. -Most probably it shouldn't be a problem for your code as the recommendation has always been to include `QEverCloud.h` global header (or `QEverCloudOAuth.h` for OAuth functionality) instead of particular other headers. +Most probably it shouldn't be a problem for your code as the recommendation has always been to include `QEverCloud.h` global header (or `QEverCloudOAuth.h` for OAuth functionality) instead of particular other headers. If your code did use other headers, just adjust their names in inclusion directives. ### Use of std::shared_ptr instead of QSharedPointer throughout the library -In release 5 of QEverCloud all `QSharedPointers` were replaced with `std::shared_ptrs`. Smart pointers from the C++ standard library offer more convenience and flexibility than Qt's ones which were introduced back in times of C++98 when there was no choice to use standard library's smart pointers as there were none. +In release 5 of QEverCloud all `QSharedPointers` were replaced with `std::shared_ptrs`. Smart pointers from the C++ standard library offer more convenience and flexibility than Qt's ones which were introduced back in times of C++98 when there was no choice to use the standard library's smart pointers as they didn't exist. -One place within the library where the replacement took place is `AsyncResult::finished` signal. `QSharedPointer` was replaced with typedef `EverCloudExceptionDataPtr` which actually is `std::shared_ptr`. Note that Qt metatype is registered for the typedef rather than the shared_ptr so in your code you should use the typedef as well to ensure Qt doesn't have any troubles queuing the pointer in signal-slot connections. +One place within the library where the replacement took place is `AsyncResult::finished` signal. `QSharedPointer` was replaced with typedef `EverCloudExceptionDataPtr` which actually is `std::shared_ptr`. Note that Qt metatype is registered for the typedef rather than the `std::shared_ptr` so in your code you should use the typedef as well to ensure Qt doesn't have any troubles queuing the pointer in signal-slot connections. + +Note that due to this change your code needs to call `initializeQEverCloud` function before QEverCloud functionality is used (see below). ### Changes in AsyncResult class @@ -51,7 +53,7 @@ What would affect your code though is the change in `AsyncResult::finished` sign ### Changes in Optional template class -In QEverCloud 5 `Optional` template class implementation was changed: `operator==` and `operator!=` accepting another `Optional` were added to it. Unfortunately, it has lead to some complications: you can no longer do comparisons involving implicit type conversions between Optional and value of compatible yet different type, like this: +In QEverCloud 5 `Optional` template class implementation was changed: `operator==` and `operator!=` accepting another `Optional` were added to it. Unfortunately, it has lead to some complications: you can no longer do comparisons involving implicit type conversions between `Optional` and value of compatible yet different type, like this: ``` Optional a = 42; double b = 1.0; @@ -83,6 +85,8 @@ Before QEverCloud 5 there were two classes which methods were used to communicat Methods of both interfaces now accept optional `IRequestContextPtr` where before QEverCloud 5 they used to accept `authenticationToken` parameter. If no request context is provided, the default one is used - either the one provided to `newNoteStore`/`newUserStore` or the one created with `newRequestContext` with all the default parameters. +The constructor of `UserStore` class in previous QEverCloud versions used to accept `host` string which was the address of Evernote service. Now `newUserStore` accepts a user store url which is essentially `"https://" + host + "/edam/user"` + ## New functionality ### Printability @@ -123,7 +127,7 @@ New exception class was introduced in QEverCloud 5: `NetworkException`. It encap ### New global function: initializeQEverCloud -The migration from `QSharedPointer` to `std::shared_ptr` required to explicitly specify corresponding Qt metatypes. For this a special function was introduced, `initializeQEverCloud` which is declared in `Globals.h` header. It is meant to be called once before other QEverCloud functionality is used. There is no harm in calling it multiple times if it happens by occasion. +The migration from `QSharedPointer` to `std::shared_ptr` required to explicitly specify some Qt metatypes using this smart pointer. For this a special function was introduced, `initializeQEverCloud` which is declared in `Globals.h` header. It is meant to be called once before other QEverCloud functionality is used. There is no harm in calling it multiple times if it happens by occasion. ### Logging facility @@ -156,7 +160,7 @@ QEverCloud 5 added new classes in `Servers.h` header which can be used to implem In QEverCloud 5 a new header file was added, `Helpers.h` which contains various auxiliary stuff which doesn't quite fit in other places. In particular, this new header contains two convenience functions `toRange` which allow one to use modern C++'s range based loops for iteration over Qt's associative containers. -Modern C++'s range based loops have certain requirements for container's iterators: dereferencing the iterator should return a pair with key and value. Iterators of Qt containers such as `QHash` and `QMap` don't comply with this requirement: their iterators are not dereferenced at all, they contain methods `key()` and `value()` which return key and value respectively. Helper functions `toRange` create lightweight wrappers around Qt's containers and their iterators providing range based for loop compliant wrapper iterators. No data copying from the container takes place so it is truly lightweight. +Modern C++'s range based loops have certain requirements for container's iterators: one should be able to dereference the iterator and work with whatever value that yields. Iterators of Qt containers such as `QHash` and `QMap` don't comply with this requirement: their iterators are not dereferenced at all, they contain methods `key()` and `value()` which return key and value respectively. Helper functions `toRange` create lightweight wrappers around Qt's containers and their iterators providing range based for loop compliant wrapper iterators. No data copying from the container takes place so it is truly lightweight. There are two overloads of `toRange` function: one for iterating over the constant container and one for iterating over the non-const one. From 66b9a51d41524b6e82dff326206c8a8e528cdaec Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 20 Dec 2019 22:50:02 +0300 Subject: [PATCH 144/188] Remove excessive function declaration --- QEverCloud/src/Http.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/QEverCloud/src/Http.h b/QEverCloud/src/Http.h index 507381fa..119eda8e 100644 --- a/QEverCloud/src/Http.h +++ b/QEverCloud/src/Http.h @@ -93,8 +93,6 @@ private Q_SLOTS: //////////////////////////////////////////////////////////////////////////////// -QNetworkAccessManager * evernoteNetworkAccessManager(); - QNetworkRequest createEvernoteRequest(QString url); QByteArray askEvernote(QString url, QByteArray postData, const qint64 timeoutMsec); From afea0cff1e678eeaa5937278caa529b6535e7f77 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 10:50:16 +0300 Subject: [PATCH 145/188] Add missing header inclusion --- QEverCloud/src/AsyncResult_p.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/QEverCloud/src/AsyncResult_p.cpp b/QEverCloud/src/AsyncResult_p.cpp index 57e85501..be002a3d 100644 --- a/QEverCloud/src/AsyncResult_p.cpp +++ b/QEverCloud/src/AsyncResult_p.cpp @@ -9,7 +9,9 @@ #include "AsyncResult_p.h" #include "Http.h" +#include #include + #include namespace qevercloud { From 545f86c6b75646a71fe1a99addb88cc49c27e272 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 10:57:16 +0300 Subject: [PATCH 146/188] Add missing header inclusion --- QEverCloud/src/InkNoteImageDownloader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/InkNoteImageDownloader.cpp b/QEverCloud/src/InkNoteImageDownloader.cpp index 585de34d..65b8e47e 100644 --- a/QEverCloud/src/InkNoteImageDownloader.cpp +++ b/QEverCloud/src/InkNoteImageDownloader.cpp @@ -8,6 +8,7 @@ #include "Http.h" +#include #include #include #include From 5c32123fef94de30260e2a27e441062d0d108dfc Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 10:58:25 +0300 Subject: [PATCH 147/188] Add missing header inclusion --- QEverCloud/src/Thumbnail.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/Thumbnail.cpp b/QEverCloud/src/Thumbnail.cpp index 8e76fa2c..3868e10d 100644 --- a/QEverCloud/src/Thumbnail.cpp +++ b/QEverCloud/src/Thumbnail.cpp @@ -9,6 +9,7 @@ #include "Http.h" +#include #include #include #include From 18728ad2551585e02672c2bad5c730e0c7a725b1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 11:02:26 +0300 Subject: [PATCH 148/188] Add missing header inclusion --- QEverCloud/src/OAuth.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index 4e0ecd8c..603f1bfd 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -9,6 +9,7 @@ #include "Http.h" +#include #include #include #include From 18d5818dd944acb67eb68cdfc15c3f1f7016f8ea Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 11:31:12 +0300 Subject: [PATCH 149/188] Add /bigobj flag for msvc compiler --- QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index c8f117b0..d6832679 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -34,5 +34,5 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") endif() elseif(MSVC) message(STATUS "Using VC++ compiler: ${CMAKE_CXX_COMPILER_VERSION}") - set(CMAKE_CXX_FLAGS "-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif() From d97da936e21f92d94ab72293157be2a5a64ca047 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 11:44:08 +0300 Subject: [PATCH 150/188] Include header with Q_NAMESPACE declaration In attempt to fix linkage issues with msvc --- QEverCloud/src/tests/TestQEverCloud.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index b318a5dd..31ae94eb 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -12,6 +12,7 @@ #include "generated/TestUserStore.h" #include +#include #include #include From d166f9596a818e0ae40e8c8cc6bae3f9769b88b1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 12:27:30 +0300 Subject: [PATCH 151/188] Try to include the global header --- QEverCloud/src/tests/TestQEverCloud.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index 31ae94eb..cc3dcf81 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -11,8 +11,7 @@ #include "generated/TestNoteStore.h" #include "generated/TestUserStore.h" -#include -#include +#include #include #include From 41fb7e25533efb268114dad181bac7b0d20718f3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 12:57:25 +0300 Subject: [PATCH 152/188] Replace add_definitions with target_compile_definitions --- QEverCloud/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 3003ba8e..3ef86472 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -99,11 +99,11 @@ include_directories(${PROJECT_BINARY_DIR}) set(LIBNAME "${QEVERCLOUD_LIBNAME_PREFIX}${QEVERCLOUD_QT_VERSION}qevercloud") if(BUILD_SHARED) - add_definitions("-DQEVERCLOUD_SHARED_LIBRARY") add_library(${LIBNAME} SHARED ${ALL_HEADERS_AND_SOURCES}) + target_compile_definitions(${LIBNAME} PUBLIC "-DQEVERCLOUD_SHARED_LIBRARY") else() - add_definitions("-DQEVERCLOUD_STATIC_LIBRARY") add_library(${LIBNAME} STATIC ${ALL_HEADERS_AND_SOURCES}) + target_compile_definitions(${LIBNAME} PUBLIC "-DQEVERCLOUD_STATIC_LIBRARY") endif() add_sanitizers(${LIBNAME}) From 289ba1fab5a7e4aac6c2e322154512bbeea67f57 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 21:49:42 +0300 Subject: [PATCH 153/188] Experiment: temporarily remove note store tests and remove /bigobj msvc compiler switch to see if it would solve the problem with linking --- QEverCloud/CMakeLists.txt | 4 ++-- QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake | 2 +- QEverCloud/src/tests/TestQEverCloud.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 3ef86472..25e0e152 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -147,7 +147,7 @@ if(Qt5Test_FOUND) src/tests/TestDurableService.h src/tests/TestOptional.h src/tests/generated/RandomDataGenerators.h - src/tests/generated/TestNoteStore.h + # src/tests/generated/TestNoteStore.h src/tests/generated/TestUserStore.h) set(TEST_SOURCES src/tests/SocketHelpers.cpp @@ -155,7 +155,7 @@ if(Qt5Test_FOUND) src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp src/tests/generated/RandomDataGenerators.cpp - src/tests/generated/TestNoteStore.cpp + # src/tests/generated/TestNoteStore.cpp src/tests/generated/TestUserStore.cpp) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index d6832679..a56a7a97 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -34,5 +34,5 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") endif() elseif(MSVC) message(STATUS "Using VC++ compiler: ${CMAKE_CXX_COMPILER_VERSION}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif() diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index cc3dcf81..f3fb6630 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -8,7 +8,7 @@ #include "TestDurableService.h" #include "TestOptional.h" -#include "generated/TestNoteStore.h" +// #include "generated/TestNoteStore.h" #include "generated/TestUserStore.h" #include @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) - RUN_TESTS(NoteStoreTester) + // RUN_TESTS(NoteStoreTester) RUN_TESTS(UserStoreTester) return 0; From 6165c8fcbf3681f9d3e59bc17f125a2a2ea9021c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 22:09:50 +0300 Subject: [PATCH 154/188] Revert "Experiment: temporarily remove note store tests and remove /bigobj msvc compiler switch to see if it would solve the problem with linking" This reverts commit 289ba1fab5a7e4aac6c2e322154512bbeea67f57. --- QEverCloud/CMakeLists.txt | 4 ++-- QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake | 2 +- QEverCloud/src/tests/TestQEverCloud.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 25e0e152..3ef86472 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -147,7 +147,7 @@ if(Qt5Test_FOUND) src/tests/TestDurableService.h src/tests/TestOptional.h src/tests/generated/RandomDataGenerators.h - # src/tests/generated/TestNoteStore.h + src/tests/generated/TestNoteStore.h src/tests/generated/TestUserStore.h) set(TEST_SOURCES src/tests/SocketHelpers.cpp @@ -155,7 +155,7 @@ if(Qt5Test_FOUND) src/tests/TestOptional.cpp src/tests/TestQEverCloud.cpp src/tests/generated/RandomDataGenerators.cpp - # src/tests/generated/TestNoteStore.cpp + src/tests/generated/TestNoteStore.cpp src/tests/generated/TestUserStore.cpp) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index a56a7a97..d6832679 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -34,5 +34,5 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") endif() elseif(MSVC) message(STATUS "Using VC++ compiler: ${CMAKE_CXX_COMPILER_VERSION}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif() diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index f3fb6630..cc3dcf81 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -8,7 +8,7 @@ #include "TestDurableService.h" #include "TestOptional.h" -// #include "generated/TestNoteStore.h" +#include "generated/TestNoteStore.h" #include "generated/TestUserStore.h" #include @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) - // RUN_TESTS(NoteStoreTester) + RUN_TESTS(NoteStoreTester) RUN_TESTS(UserStoreTester) return 0; From cd405bd3a72f6f63da39b644569579c8054bec64 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 22:11:27 +0300 Subject: [PATCH 155/188] Try to disable incremental linking for test --- QEverCloud/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 3ef86472..3b843123 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -157,12 +157,19 @@ if(Qt5Test_FOUND) src/tests/generated/RandomDataGenerators.cpp src/tests/generated/TestNoteStore.cpp src/tests/generated/TestUserStore.cpp) - add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) + add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) - set_target_properties(test_${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 - CXX_EXTENSIONS OFF) + if(MSVC) + set_target_properties(test_${PROJECT_NAME} PROPERTIES + CXX_STANDARD 14 + CXX_EXTENSIONS OFF + LINK_FLAGS "/INCREMENTAL:NO") + else() + set_target_properties(test_${PROJECT_NAME} PROPERTIES + CXX_STANDARD 14 + CXX_EXTENSIONS OFF) + endif() target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) else() message(STATUS "Haven't found Qt components required for building and running the unit tests") From 2b55614e928bb2ed5739ca6b11500400327900ec Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 22:20:29 +0300 Subject: [PATCH 156/188] Enable verbose makefile to try and figure out why the hell linking fails --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d2634d0e..967aef3d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -70,7 +70,7 @@ before_build: build_script: - cd build - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" - - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" + - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" -DCMAKE_VERBOSE_MAKEFILE=ON - cmake --build . --target all - cmake --build . --target check - cmake --build . --target install From 925cc8b77250c24c98f322f2ea3c0a11ac37df7e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 23:35:48 +0300 Subject: [PATCH 157/188] Try harder to disable incremental linking --- QEverCloud/CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 3b843123..5b22c40e 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -161,15 +161,12 @@ if(Qt5Test_FOUND) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) if(MSVC) - set_target_properties(test_${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 - CXX_EXTENSIONS OFF - LINK_FLAGS "/INCREMENTAL:NO") - else() - set_target_properties(test_${PROJECT_NAME} PROPERTIES - CXX_STANDARD 14 - CXX_EXTENSIONS OFF) + string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${replace_CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:NO") endif() + set_target_properties(test_${PROJECT_NAME} PROPERTIES + CXX_STANDARD 14 + CXX_EXTENSIONS OFF) target_link_libraries(test_${PROJECT_NAME} ${LIBNAME} ${QT_LIBRARIES} Qt5::Test) else() message(STATUS "Haven't found Qt components required for building and running the unit tests") From 4923ac2c5b87c4de417b23bfd88fc7b74bab0941 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sat, 21 Dec 2019 23:48:45 +0300 Subject: [PATCH 158/188] Try one more recipe for incremental linking disabling --- QEverCloud/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 5b22c40e..e21524d5 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -161,8 +161,12 @@ if(Qt5Test_FOUND) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) if(MSVC) - string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replace_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) - set(CMAKE_EXE_LINKER_FLAGS "${replace_CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:NO") + foreach(FLAG_TYPE EXE MODULE SHARED) + string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") + string(REPLACE "/EDITANDCONTINUE" "" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") + set(CMAKE_${FLAG_TYPE}_LINKER_FLAGS "/INCREMENTAL:NO ${FLAG_TMP}" CACHE STRING "Overriding default ${FLAG_TYPE} linker flags." FORCE) + mark_as_advanced(CMAKE_${FLAG_TYPE}_LINKER_FLAGS) + endforeach() endif() set_target_properties(test_${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 From 4a3edbabe7ec6646dc7566353879961ccacfc481 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:10:27 +0300 Subject: [PATCH 159/188] Stop messing with incremental linking, instead limit the scope of Q_NAMESPACE and Q_ENUM_NS only to QEverCloud library itself --- QEverCloud/CMakeLists.txt | 8 ---- QEverCloud/headers/Helpers.h | 2 + QEverCloud/headers/generated/EDAMErrorCode.h | 46 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index e21524d5..dd6e4757 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -160,14 +160,6 @@ if(Qt5Test_FOUND) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) - if(MSVC) - foreach(FLAG_TYPE EXE MODULE SHARED) - string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") - string(REPLACE "/EDITANDCONTINUE" "" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") - set(CMAKE_${FLAG_TYPE}_LINKER_FLAGS "/INCREMENTAL:NO ${FLAG_TMP}" CACHE STRING "Overriding default ${FLAG_TYPE} linker flags." FORCE) - mark_as_advanced(CMAKE_${FLAG_TYPE}_LINKER_FLAGS) - endforeach() - endif() set_target_properties(test_${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 2a05ebe1..4952f74f 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -33,6 +33,7 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) /** * It appears that Q_NAMESPACE declaration should be present in exactly one file * per namespace, otherwise moc generates multiple definitions of corresponding @@ -41,6 +42,7 @@ namespace qevercloud { #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_NAMESPACE #endif +#endif // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 9bde7453..0aaa3de2 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -131,9 +131,11 @@ enum class EDAMErrorCode SSO_AUTHENTICATION_REQUIRED = 28 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EDAMErrorCode) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EDAMErrorCode value) { @@ -192,9 +194,11 @@ enum class EDAMInvalidContactReason NO_CONNECTION }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EDAMInvalidContactReason) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EDAMInvalidContactReason value) { @@ -242,9 +246,11 @@ enum class ShareRelationshipPrivilegeLevel FULL_ACCESS = 30 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ShareRelationshipPrivilegeLevel) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ShareRelationshipPrivilegeLevel value) { @@ -278,9 +284,11 @@ enum class PrivilegeLevel ADMIN = 9 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(PrivilegeLevel) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(PrivilegeLevel value) { @@ -312,9 +320,11 @@ enum class ServiceLevel BUSINESS = 4 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ServiceLevel) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ServiceLevel value) { @@ -343,9 +353,11 @@ enum class QueryFormat SEXP = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(QueryFormat) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(QueryFormat value) { @@ -377,9 +389,11 @@ enum class NoteSortOrder TITLE = 5 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(NoteSortOrder) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(NoteSortOrder value) { @@ -428,9 +442,11 @@ enum class PremiumOrderStatus CANCELED = 5 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(PremiumOrderStatus) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(PremiumOrderStatus value) { @@ -494,9 +510,11 @@ enum class SharedNotebookPrivilegeLevel BUSINESS_FULL_ACCESS = 5 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotebookPrivilegeLevel) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotebookPrivilegeLevel value) { @@ -536,9 +554,11 @@ enum class SharedNotePrivilegeLevel FULL_ACCESS = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotePrivilegeLevel) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotePrivilegeLevel value) { @@ -573,9 +593,11 @@ enum class SponsoredGroupRole GROUP_OWNER = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SponsoredGroupRole) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SponsoredGroupRole value) { @@ -607,9 +629,11 @@ enum class BusinessUserRole NORMAL = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessUserRole) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessUserRole value) { @@ -647,9 +671,11 @@ enum class BusinessUserStatus DEACTIVATED = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessUserStatus) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessUserStatus value) { @@ -684,9 +710,11 @@ enum class SharedNotebookInstanceRestrictions NO_SHARED_NOTEBOOKS = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotebookInstanceRestrictions) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotebookInstanceRestrictions value) { @@ -721,9 +749,11 @@ enum class ReminderEmailConfig SEND_DAILY_EMAIL = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ReminderEmailConfig) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ReminderEmailConfig value) { @@ -762,9 +792,11 @@ enum class BusinessInvitationStatus REDEEMED = 2 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessInvitationStatus) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessInvitationStatus value) { @@ -796,9 +828,11 @@ enum class ContactType LINKEDIN = 6 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ContactType) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ContactType value) { @@ -827,9 +861,11 @@ enum class EntityType WORKSPACE = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EntityType) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EntityType value) { @@ -869,9 +905,11 @@ enum class RecipientStatus IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RecipientStatus) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RecipientStatus value) { @@ -915,9 +953,11 @@ enum class CanMoveToContainerStatus INSUFFICIENT_CONTAINER_PRIVILEGE = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(CanMoveToContainerStatus) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(CanMoveToContainerStatus value) { @@ -952,9 +992,11 @@ enum class RelatedContentType REFERENCE_MATERIAL = 4 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RelatedContentType) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RelatedContentType value) { @@ -1000,9 +1042,11 @@ enum class RelatedContentAccess DIRECT_LINK_EMBEDDED_VIEW = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RelatedContentAccess) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RelatedContentAccess value) { @@ -1031,9 +1075,11 @@ enum class UserIdentityType IDENTITYID = 3 }; +#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(UserIdentityType) #endif +#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(UserIdentityType value) { From f3002db1b6c6549c175a03c0c64f9600d63c535c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:19:24 +0300 Subject: [PATCH 160/188] Experiment: comment out Q_NAMESPACE and Q_ENUM_NS altogether --- QEverCloud/headers/Helpers.h | 2 +- QEverCloud/headers/Log.h | 2 +- QEverCloud/headers/generated/EDAMErrorCode.h | 46 ++++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 4952f74f..6b952a3c 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -40,7 +40,7 @@ namespace qevercloud { * meta object, so putting it here */ #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_NAMESPACE +// Q_NAMESPACE #endif #endif // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 229c62f2..e581a7d0 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -32,7 +32,7 @@ enum class LogLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(LogLevel) +// Q_ENUM_NS(LogLevel) #endif QEVERCLOUD_EXPORT QTextStream & operator<<( diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 0aaa3de2..58fcd0b7 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -133,7 +133,7 @@ enum class EDAMErrorCode #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(EDAMErrorCode) +// Q_ENUM_NS(EDAMErrorCode) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -196,7 +196,7 @@ enum class EDAMInvalidContactReason #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(EDAMInvalidContactReason) +// Q_ENUM_NS(EDAMInvalidContactReason) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -248,7 +248,7 @@ enum class ShareRelationshipPrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(ShareRelationshipPrivilegeLevel) +// Q_ENUM_NS(ShareRelationshipPrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -286,7 +286,7 @@ enum class PrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(PrivilegeLevel) +// Q_ENUM_NS(PrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -322,7 +322,7 @@ enum class ServiceLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(ServiceLevel) +// Q_ENUM_NS(ServiceLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -355,7 +355,7 @@ enum class QueryFormat #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(QueryFormat) +// Q_ENUM_NS(QueryFormat) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -391,7 +391,7 @@ enum class NoteSortOrder #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(NoteSortOrder) +// Q_ENUM_NS(NoteSortOrder) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -444,7 +444,7 @@ enum class PremiumOrderStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(PremiumOrderStatus) +// Q_ENUM_NS(PremiumOrderStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -512,7 +512,7 @@ enum class SharedNotebookPrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(SharedNotebookPrivilegeLevel) +// Q_ENUM_NS(SharedNotebookPrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -556,7 +556,7 @@ enum class SharedNotePrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(SharedNotePrivilegeLevel) +// Q_ENUM_NS(SharedNotePrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -595,7 +595,7 @@ enum class SponsoredGroupRole #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(SponsoredGroupRole) +// Q_ENUM_NS(SponsoredGroupRole) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -631,7 +631,7 @@ enum class BusinessUserRole #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(BusinessUserRole) +// Q_ENUM_NS(BusinessUserRole) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -673,7 +673,7 @@ enum class BusinessUserStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(BusinessUserStatus) +// Q_ENUM_NS(BusinessUserStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -712,7 +712,7 @@ enum class SharedNotebookInstanceRestrictions #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(SharedNotebookInstanceRestrictions) +// Q_ENUM_NS(SharedNotebookInstanceRestrictions) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -751,7 +751,7 @@ enum class ReminderEmailConfig #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(ReminderEmailConfig) +// Q_ENUM_NS(ReminderEmailConfig) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -794,7 +794,7 @@ enum class BusinessInvitationStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(BusinessInvitationStatus) +// Q_ENUM_NS(BusinessInvitationStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -830,7 +830,7 @@ enum class ContactType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(ContactType) +// Q_ENUM_NS(ContactType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -863,7 +863,7 @@ enum class EntityType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(EntityType) +// Q_ENUM_NS(EntityType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -907,7 +907,7 @@ enum class RecipientStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(RecipientStatus) +// Q_ENUM_NS(RecipientStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -955,7 +955,7 @@ enum class CanMoveToContainerStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(CanMoveToContainerStatus) +// Q_ENUM_NS(CanMoveToContainerStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -994,7 +994,7 @@ enum class RelatedContentType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(RelatedContentType) +// Q_ENUM_NS(RelatedContentType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -1044,7 +1044,7 @@ enum class RelatedContentAccess #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(RelatedContentAccess) +// Q_ENUM_NS(RelatedContentAccess) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -1077,7 +1077,7 @@ enum class UserIdentityType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -Q_ENUM_NS(UserIdentityType) +// Q_ENUM_NS(UserIdentityType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) From 27ce7a20fe0fade605e6dcea0b7c5c531c2185d1 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:30:24 +0300 Subject: [PATCH 161/188] Experiment: remove Q_GADGET and Q_PROPERTY declarations --- QEverCloud/headers/generated/Types.h | 823 --------------------------- 1 file changed, 823 deletions(-) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 8b00efea..4dd93645 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -101,7 +101,6 @@ using MessageThreadID = qint64; */ class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable { - Q_GADGET public: EverCloudLocalData(); virtual ~EverCloudLocalData() noexcept override; @@ -164,8 +163,6 @@ class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable * */ struct QEVERCLOUD_EXPORT SyncState: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -249,13 +246,6 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Timestamp currentTime MEMBER currentTime) - Q_PROPERTY(Timestamp fullSyncBefore MEMBER fullSyncBefore) - Q_PROPERTY(qint32 updateCount MEMBER updateCount) - Q_PROPERTY(Optional uploaded MEMBER uploaded) - Q_PROPERTY(Optional userLastUpdated MEMBER userLastUpdated) - Q_PROPERTY(Optional userMaxMessageEventId MEMBER userMaxMessageEventId) }; /** @@ -267,8 +257,6 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable **/ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -403,23 +391,6 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional includeNotes MEMBER includeNotes) - Q_PROPERTY(Optional includeNoteResources MEMBER includeNoteResources) - Q_PROPERTY(Optional includeNoteAttributes MEMBER includeNoteAttributes) - Q_PROPERTY(Optional includeNotebooks MEMBER includeNotebooks) - Q_PROPERTY(Optional includeTags MEMBER includeTags) - Q_PROPERTY(Optional includeSearches MEMBER includeSearches) - Q_PROPERTY(Optional includeResources MEMBER includeResources) - Q_PROPERTY(Optional includeLinkedNotebooks MEMBER includeLinkedNotebooks) - Q_PROPERTY(Optional includeExpunged MEMBER includeExpunged) - Q_PROPERTY(Optional includeNoteApplicationDataFullMap MEMBER includeNoteApplicationDataFullMap) - Q_PROPERTY(Optional includeResourceApplicationDataFullMap MEMBER includeResourceApplicationDataFullMap) - Q_PROPERTY(Optional includeNoteResourceApplicationDataFullMap MEMBER includeNoteResourceApplicationDataFullMap) - Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) - Q_PROPERTY(Optional omitSharedNotebooks MEMBER omitSharedNotebooks) - Q_PROPERTY(Optional requireNoteContentClass MEMBER requireNoteContentClass) - Q_PROPERTY(Optional> notebookGuids MEMBER notebookGuids) }; /** @@ -430,8 +401,6 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable **/ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -542,20 +511,6 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional order MEMBER order) - Q_PROPERTY(Optional ascending MEMBER ascending) - Q_PROPERTY(Optional words MEMBER words) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) - Q_PROPERTY(Optional timeZone MEMBER timeZone) - Q_PROPERTY(Optional inactive MEMBER inactive) - Q_PROPERTY(Optional emphasized MEMBER emphasized) - Q_PROPERTY(Optional includeAllReadableNotebooks MEMBER includeAllReadableNotebooks) - Q_PROPERTY(Optional includeAllReadableWorkspaces MEMBER includeAllReadableWorkspaces) - Q_PROPERTY(Optional context MEMBER context) - Q_PROPERTY(Optional rawWords MEMBER rawWords) - Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) }; /** @@ -573,8 +528,6 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable */ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -627,18 +580,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional includeTitle MEMBER includeTitle) - Q_PROPERTY(Optional includeContentLength MEMBER includeContentLength) - Q_PROPERTY(Optional includeCreated MEMBER includeCreated) - Q_PROPERTY(Optional includeUpdated MEMBER includeUpdated) - Q_PROPERTY(Optional includeDeleted MEMBER includeDeleted) - Q_PROPERTY(Optional includeUpdateSequenceNum MEMBER includeUpdateSequenceNum) - Q_PROPERTY(Optional includeNotebookGuid MEMBER includeNotebookGuid) - Q_PROPERTY(Optional includeTagGuids MEMBER includeTagGuids) - Q_PROPERTY(Optional includeAttributes MEMBER includeAttributes) - Q_PROPERTY(Optional includeLargestResourceMime MEMBER includeLargestResourceMime) - Q_PROPERTY(Optional includeLargestResourceSize MEMBER includeLargestResourceSize) }; /** @@ -648,8 +589,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable **/ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -689,12 +628,6 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable return !(*this == other); } - using TagCounts = QMap; - - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional notebookCounts MEMBER notebookCounts) - Q_PROPERTY(Optional tagCounts MEMBER tagCounts) - Q_PROPERTY(Optional trashCount MEMBER trashCount) }; /** @@ -709,8 +642,6 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable * */ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -773,15 +704,6 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional includeContent MEMBER includeContent) - Q_PROPERTY(Optional includeResourcesData MEMBER includeResourcesData) - Q_PROPERTY(Optional includeResourcesRecognition MEMBER includeResourcesRecognition) - Q_PROPERTY(Optional includeResourcesAlternateData MEMBER includeResourcesAlternateData) - Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) - Q_PROPERTY(Optional includeNoteAppDataValues MEMBER includeNoteAppDataValues) - Q_PROPERTY(Optional includeResourceAppDataValues MEMBER includeResourceAppDataValues) - Q_PROPERTY(Optional includeAccountLimits MEMBER includeAccountLimits) }; /** @@ -792,8 +714,6 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable * */ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -847,12 +767,6 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(qint32 updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Timestamp updated MEMBER updated) - Q_PROPERTY(Timestamp saved MEMBER saved) - Q_PROPERTY(QString title MEMBER title) - Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) }; /** @@ -865,8 +779,6 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable * */ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -933,13 +845,6 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noteGuid MEMBER noteGuid) - Q_PROPERTY(Optional plainText MEMBER plainText) - Q_PROPERTY(Optional filter MEMBER filter) - Q_PROPERTY(Optional referenceUri MEMBER referenceUri) - Q_PROPERTY(Optional context MEMBER context) - Q_PROPERTY(Optional cacheKey MEMBER cacheKey) }; /** @@ -951,8 +856,6 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1038,23 +941,11 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional maxNotes MEMBER maxNotes) - Q_PROPERTY(Optional maxNotebooks MEMBER maxNotebooks) - Q_PROPERTY(Optional maxTags MEMBER maxTags) - Q_PROPERTY(Optional writableNotebooksOnly MEMBER writableNotebooksOnly) - Q_PROPERTY(Optional includeContainingNotebooks MEMBER includeContainingNotebooks) - Q_PROPERTY(Optional includeDebugInfo MEMBER includeDebugInfo) - Q_PROPERTY(Optional maxExperts MEMBER maxExperts) - Q_PROPERTY(Optional maxRelatedContent MEMBER maxRelatedContent) - Q_PROPERTY(Optional> relatedContentTypes MEMBER relatedContentTypes) }; /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1086,11 +977,6 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noSetReadOnly MEMBER noSetReadOnly) - Q_PROPERTY(Optional noSetReadPlusActivity MEMBER noSetReadPlusActivity) - Q_PROPERTY(Optional noSetModify MEMBER noSetModify) - Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -1100,8 +986,6 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1168,13 +1052,6 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional displayName MEMBER displayName) - Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) - Q_PROPERTY(Optional bestPrivilege MEMBER bestPrivilege) - Q_PROPERTY(Optional individualPrivilege MEMBER individualPrivilege) - Q_PROPERTY(Optional restrictions MEMBER restrictions) - Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1185,8 +1062,6 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1224,10 +1099,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noSetReadNote MEMBER noSetReadNote) - Q_PROPERTY(Optional noSetModifyNote MEMBER noSetModifyNote) - Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -1237,8 +1108,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1293,12 +1162,6 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional displayName MEMBER displayName) - Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional restrictions MEMBER restrictions) - Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1308,8 +1171,6 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1358,11 +1219,6 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional displayName MEMBER displayName) - Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1374,8 +1230,6 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1411,10 +1265,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> invitations MEMBER invitations) - Q_PROPERTY(Optional> memberships MEMBER memberships) - Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -1429,8 +1279,6 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1483,12 +1331,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noteGuid MEMBER noteGuid) - Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) - Q_PROPERTY(Optional> invitationsToUpdate MEMBER invitationsToUpdate) - Q_PROPERTY(Optional> membershipsToUnshare MEMBER membershipsToUnshare) - Q_PROPERTY(Optional> invitationsToUnshare MEMBER invitationsToUnshare) }; /** @@ -1502,8 +1344,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable **/ struct QEVERCLOUD_EXPORT Data: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1544,10 +1384,6 @@ struct QEVERCLOUD_EXPORT Data: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional bodyHash MEMBER bodyHash) - Q_PROPERTY(Optional size MEMBER size) - Q_PROPERTY(Optional body MEMBER body) }; /** @@ -1557,8 +1393,6 @@ struct QEVERCLOUD_EXPORT Data: public Printable **/ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1810,42 +1644,6 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional defaultLocationName MEMBER defaultLocationName) - Q_PROPERTY(Optional defaultLatitude MEMBER defaultLatitude) - Q_PROPERTY(Optional defaultLongitude MEMBER defaultLongitude) - Q_PROPERTY(Optional preactivation MEMBER preactivation) - Q_PROPERTY(Optional viewedPromotions MEMBER viewedPromotions) - Q_PROPERTY(Optional incomingEmailAddress MEMBER incomingEmailAddress) - Q_PROPERTY(Optional recentMailedAddresses MEMBER recentMailedAddresses) - Q_PROPERTY(Optional comments MEMBER comments) - Q_PROPERTY(Optional dateAgreedToTermsOfService MEMBER dateAgreedToTermsOfService) - Q_PROPERTY(Optional maxReferrals MEMBER maxReferrals) - Q_PROPERTY(Optional referralCount MEMBER referralCount) - Q_PROPERTY(Optional refererCode MEMBER refererCode) - Q_PROPERTY(Optional sentEmailDate MEMBER sentEmailDate) - Q_PROPERTY(Optional sentEmailCount MEMBER sentEmailCount) - Q_PROPERTY(Optional dailyEmailLimit MEMBER dailyEmailLimit) - Q_PROPERTY(Optional emailOptOutDate MEMBER emailOptOutDate) - Q_PROPERTY(Optional partnerEmailOptInDate MEMBER partnerEmailOptInDate) - Q_PROPERTY(Optional preferredLanguage MEMBER preferredLanguage) - Q_PROPERTY(Optional preferredCountry MEMBER preferredCountry) - Q_PROPERTY(Optional clipFullPage MEMBER clipFullPage) - Q_PROPERTY(Optional twitterUserName MEMBER twitterUserName) - Q_PROPERTY(Optional twitterId MEMBER twitterId) - Q_PROPERTY(Optional groupName MEMBER groupName) - Q_PROPERTY(Optional recognitionLanguage MEMBER recognitionLanguage) - Q_PROPERTY(Optional referralProof MEMBER referralProof) - Q_PROPERTY(Optional educationalDiscount MEMBER educationalDiscount) - Q_PROPERTY(Optional businessAddress MEMBER businessAddress) - Q_PROPERTY(Optional hideSponsorBilling MEMBER hideSponsorBilling) - Q_PROPERTY(Optional useEmailAutoFiling MEMBER useEmailAutoFiling) - Q_PROPERTY(Optional reminderEmailConfig MEMBER reminderEmailConfig) - Q_PROPERTY(Optional emailAddressLastConfirmed MEMBER emailAddressLastConfirmed) - Q_PROPERTY(Optional passwordUpdated MEMBER passwordUpdated) - Q_PROPERTY(Optional salesforcePushEnabled MEMBER salesforcePushEnabled) - Q_PROPERTY(Optional shouldLogClientEvent MEMBER shouldLogClientEvent) - Q_PROPERTY(Optional optOutMachineLearning MEMBER optOutMachineLearning) }; /** @@ -1855,8 +1653,6 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1912,14 +1708,6 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional title MEMBER title) - Q_PROPERTY(Optional location MEMBER location) - Q_PROPERTY(Optional department MEMBER department) - Q_PROPERTY(Optional mobilePhone MEMBER mobilePhone) - Q_PROPERTY(Optional linkedInProfileUrl MEMBER linkedInProfileUrl) - Q_PROPERTY(Optional workPhone MEMBER workPhone) - Q_PROPERTY(Optional companyStartDate MEMBER companyStartDate) }; /** @@ -1928,8 +1716,6 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable **/ struct QEVERCLOUD_EXPORT Accounting: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2080,30 +1866,6 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional uploadLimitEnd MEMBER uploadLimitEnd) - Q_PROPERTY(Optional uploadLimitNextMonth MEMBER uploadLimitNextMonth) - Q_PROPERTY(Optional premiumServiceStatus MEMBER premiumServiceStatus) - Q_PROPERTY(Optional premiumOrderNumber MEMBER premiumOrderNumber) - Q_PROPERTY(Optional premiumCommerceService MEMBER premiumCommerceService) - Q_PROPERTY(Optional premiumServiceStart MEMBER premiumServiceStart) - Q_PROPERTY(Optional premiumServiceSKU MEMBER premiumServiceSKU) - Q_PROPERTY(Optional lastSuccessfulCharge MEMBER lastSuccessfulCharge) - Q_PROPERTY(Optional lastFailedCharge MEMBER lastFailedCharge) - Q_PROPERTY(Optional lastFailedChargeReason MEMBER lastFailedChargeReason) - Q_PROPERTY(Optional nextPaymentDue MEMBER nextPaymentDue) - Q_PROPERTY(Optional premiumLockUntil MEMBER premiumLockUntil) - Q_PROPERTY(Optional updated MEMBER updated) - Q_PROPERTY(Optional premiumSubscriptionNumber MEMBER premiumSubscriptionNumber) - Q_PROPERTY(Optional lastRequestedCharge MEMBER lastRequestedCharge) - Q_PROPERTY(Optional currency MEMBER currency) - Q_PROPERTY(Optional unitPrice MEMBER unitPrice) - Q_PROPERTY(Optional businessId MEMBER businessId) - Q_PROPERTY(Optional businessName MEMBER businessName) - Q_PROPERTY(Optional businessRole MEMBER businessRole) - Q_PROPERTY(Optional unitDiscount MEMBER unitDiscount) - Q_PROPERTY(Optional nextChargeDate MEMBER nextChargeDate) - Q_PROPERTY(Optional availablePoints MEMBER availablePoints) }; /** @@ -2113,8 +1875,6 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2165,12 +1925,6 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional businessId MEMBER businessId) - Q_PROPERTY(Optional businessName MEMBER businessName) - Q_PROPERTY(Optional role MEMBER role) - Q_PROPERTY(Optional email MEMBER email) - Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -2178,8 +1932,6 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable **/ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2264,18 +2016,6 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional userMailLimitDaily MEMBER userMailLimitDaily) - Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) - Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) - Q_PROPERTY(Optional userLinkedNotebookMax MEMBER userLinkedNotebookMax) - Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) - Q_PROPERTY(Optional userNoteCountMax MEMBER userNoteCountMax) - Q_PROPERTY(Optional userNotebookCountMax MEMBER userNotebookCountMax) - Q_PROPERTY(Optional userTagCountMax MEMBER userTagCountMax) - Q_PROPERTY(Optional noteTagCountMax MEMBER noteTagCountMax) - Q_PROPERTY(Optional userSavedSearchesMax MEMBER userSavedSearchesMax) - Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) }; /** @@ -2283,8 +2023,6 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable **/ struct QEVERCLOUD_EXPORT User: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2436,25 +2174,6 @@ struct QEVERCLOUD_EXPORT User: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional id MEMBER id) - Q_PROPERTY(Optional username MEMBER username) - Q_PROPERTY(Optional email MEMBER email) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional timezone MEMBER timezone) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) - Q_PROPERTY(Optional created MEMBER created) - Q_PROPERTY(Optional updated MEMBER updated) - Q_PROPERTY(Optional deleted MEMBER deleted) - Q_PROPERTY(Optional active MEMBER active) - Q_PROPERTY(Optional shardId MEMBER shardId) - Q_PROPERTY(Optional attributes MEMBER attributes) - Q_PROPERTY(Optional accounting MEMBER accounting) - Q_PROPERTY(Optional businessUserInfo MEMBER businessUserInfo) - Q_PROPERTY(Optional photoUrl MEMBER photoUrl) - Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) - Q_PROPERTY(Optional accountLimits MEMBER accountLimits) }; /** @@ -2464,8 +2183,6 @@ struct QEVERCLOUD_EXPORT User: public Printable * */ struct QEVERCLOUD_EXPORT Contact: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2531,14 +2248,6 @@ struct QEVERCLOUD_EXPORT Contact: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional id MEMBER id) - Q_PROPERTY(Optional type MEMBER type) - Q_PROPERTY(Optional photoUrl MEMBER photoUrl) - Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) - Q_PROPERTY(Optional messagingPermit MEMBER messagingPermit) - Q_PROPERTY(Optional messagingPermitExpires MEMBER messagingPermitExpires) }; /** @@ -2548,8 +2257,6 @@ struct QEVERCLOUD_EXPORT Contact: public Printable * */ struct QEVERCLOUD_EXPORT Identity: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2628,15 +2335,6 @@ struct QEVERCLOUD_EXPORT Identity: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(IdentityID id MEMBER id) - Q_PROPERTY(Optional contact MEMBER contact) - Q_PROPERTY(Optional userId MEMBER userId) - Q_PROPERTY(Optional deactivated MEMBER deactivated) - Q_PROPERTY(Optional sameBusiness MEMBER sameBusiness) - Q_PROPERTY(Optional blocked MEMBER blocked) - Q_PROPERTY(Optional userConnected MEMBER userConnected) - Q_PROPERTY(Optional eventId MEMBER eventId) }; /** @@ -2645,8 +2343,6 @@ struct QEVERCLOUD_EXPORT Identity: public Printable **/ struct QEVERCLOUD_EXPORT Tag: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2711,11 +2407,6 @@ struct QEVERCLOUD_EXPORT Tag: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional parentGuid MEMBER parentGuid) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) }; /** @@ -2739,8 +2430,6 @@ struct QEVERCLOUD_EXPORT Tag: public Printable * */ struct QEVERCLOUD_EXPORT LazyMap: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2771,11 +2460,6 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable return !(*this == other); } - using FullMap = QMap; - - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> keysOnly MEMBER keysOnly) - Q_PROPERTY(Optional fullMap MEMBER fullMap) }; /** @@ -2783,8 +2467,6 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable * */ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2892,19 +2574,6 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional sourceURL MEMBER sourceURL) - Q_PROPERTY(Optional timestamp MEMBER timestamp) - Q_PROPERTY(Optional latitude MEMBER latitude) - Q_PROPERTY(Optional longitude MEMBER longitude) - Q_PROPERTY(Optional altitude MEMBER altitude) - Q_PROPERTY(Optional cameraMake MEMBER cameraMake) - Q_PROPERTY(Optional cameraModel MEMBER cameraModel) - Q_PROPERTY(Optional clientWillIndex MEMBER clientWillIndex) - Q_PROPERTY(Optional recoType MEMBER recoType) - Q_PROPERTY(Optional fileName MEMBER fileName) - Q_PROPERTY(Optional attachment MEMBER attachment) - Q_PROPERTY(Optional applicationData MEMBER applicationData) }; /** @@ -2913,8 +2582,6 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable * */ struct QEVERCLOUD_EXPORT Resource: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3022,19 +2689,6 @@ struct QEVERCLOUD_EXPORT Resource: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional noteGuid MEMBER noteGuid) - Q_PROPERTY(Optional data MEMBER data) - Q_PROPERTY(Optional mime MEMBER mime) - Q_PROPERTY(Optional width MEMBER width) - Q_PROPERTY(Optional height MEMBER height) - Q_PROPERTY(Optional duration MEMBER duration) - Q_PROPERTY(Optional active MEMBER active) - Q_PROPERTY(Optional recognition MEMBER recognition) - Q_PROPERTY(Optional attributes MEMBER attributes) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional alternateData MEMBER alternateData) }; /** @@ -3042,8 +2696,6 @@ struct QEVERCLOUD_EXPORT Resource: public Printable * */ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3291,31 +2943,6 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable return !(*this == other); } - using Classifications = QMap; - - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional subjectDate MEMBER subjectDate) - Q_PROPERTY(Optional latitude MEMBER latitude) - Q_PROPERTY(Optional longitude MEMBER longitude) - Q_PROPERTY(Optional altitude MEMBER altitude) - Q_PROPERTY(Optional author MEMBER author) - Q_PROPERTY(Optional source MEMBER source) - Q_PROPERTY(Optional sourceURL MEMBER sourceURL) - Q_PROPERTY(Optional sourceApplication MEMBER sourceApplication) - Q_PROPERTY(Optional shareDate MEMBER shareDate) - Q_PROPERTY(Optional reminderOrder MEMBER reminderOrder) - Q_PROPERTY(Optional reminderDoneTime MEMBER reminderDoneTime) - Q_PROPERTY(Optional reminderTime MEMBER reminderTime) - Q_PROPERTY(Optional placeName MEMBER placeName) - Q_PROPERTY(Optional contentClass MEMBER contentClass) - Q_PROPERTY(Optional applicationData MEMBER applicationData) - Q_PROPERTY(Optional lastEditedBy MEMBER lastEditedBy) - Q_PROPERTY(Optional classifications MEMBER classifications) - Q_PROPERTY(Optional creatorId MEMBER creatorId) - Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) - Q_PROPERTY(Optional sharedWithBusiness MEMBER sharedWithBusiness) - Q_PROPERTY(Optional conflictSourceNoteGuid MEMBER conflictSourceNoteGuid) - Q_PROPERTY(Optional noteTitleQuality MEMBER noteTitleQuality) }; /** @@ -3326,8 +2953,6 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable * */ struct QEVERCLOUD_EXPORT SharedNote: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3380,13 +3005,6 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional sharerUserID MEMBER sharerUserID) - Q_PROPERTY(Optional recipientIdentity MEMBER recipientIdentity) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) - Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) - Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -3428,8 +3046,6 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable * */ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3473,12 +3089,6 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noUpdateTitle MEMBER noUpdateTitle) - Q_PROPERTY(Optional noUpdateContent MEMBER noUpdateContent) - Q_PROPERTY(Optional noEmail MEMBER noEmail) - Q_PROPERTY(Optional noShare MEMBER noShare) - Q_PROPERTY(Optional noSharePublicly MEMBER noSharePublicly) }; /** @@ -3491,8 +3101,6 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable */ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3527,12 +3135,6 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) - Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) - Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) - Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) - Q_PROPERTY(Optional uploaded MEMBER uploaded) }; /** @@ -3541,8 +3143,6 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable * */ struct QEVERCLOUD_EXPORT Note: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3722,25 +3322,6 @@ struct QEVERCLOUD_EXPORT Note: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional title MEMBER title) - Q_PROPERTY(Optional content MEMBER content) - Q_PROPERTY(Optional contentHash MEMBER contentHash) - Q_PROPERTY(Optional contentLength MEMBER contentLength) - Q_PROPERTY(Optional created MEMBER created) - Q_PROPERTY(Optional updated MEMBER updated) - Q_PROPERTY(Optional deleted MEMBER deleted) - Q_PROPERTY(Optional active MEMBER active) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) - Q_PROPERTY(Optional> resources MEMBER resources) - Q_PROPERTY(Optional attributes MEMBER attributes) - Q_PROPERTY(Optional tagNames MEMBER tagNames) - Q_PROPERTY(Optional> sharedNotes MEMBER sharedNotes) - Q_PROPERTY(Optional restrictions MEMBER restrictions) - Q_PROPERTY(Optional limits MEMBER limits) }; /** @@ -3750,8 +3331,6 @@ struct QEVERCLOUD_EXPORT Note: public Printable * */ struct QEVERCLOUD_EXPORT Publishing: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3809,11 +3388,6 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional uri MEMBER uri) - Q_PROPERTY(Optional order MEMBER order) - Q_PROPERTY(Optional ascending MEMBER ascending) - Q_PROPERTY(Optional publicDescription MEMBER publicDescription) }; /** @@ -3825,8 +3399,6 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable * */ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3870,10 +3442,6 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional notebookDescription MEMBER notebookDescription) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional recommended MEMBER recommended) }; /** @@ -3882,8 +3450,6 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3921,10 +3487,6 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional includeAccount MEMBER includeAccount) - Q_PROPERTY(Optional includePersonalLinkedNotebooks MEMBER includePersonalLinkedNotebooks) - Q_PROPERTY(Optional includeBusinessLinkedNotebooks MEMBER includeBusinessLinkedNotebooks) }; /** @@ -3932,8 +3494,6 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4010,13 +3570,6 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional query MEMBER query) - Q_PROPERTY(Optional format MEMBER format) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional scope MEMBER scope) }; /** @@ -4035,8 +3588,6 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4072,9 +3623,6 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) - Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) }; /** @@ -4089,8 +3637,6 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4148,12 +3694,6 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) - Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) - Q_PROPERTY(Optional inMyList MEMBER inMyList) - Q_PROPERTY(Optional stack MEMBER stack) - Q_PROPERTY(Optional recipientStatus MEMBER recipientStatus) }; /** @@ -4162,8 +3702,6 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4299,23 +3837,6 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional id MEMBER id) - Q_PROPERTY(Optional userId MEMBER userId) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional email MEMBER email) - Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) - Q_PROPERTY(Optional notebookModifiable MEMBER notebookModifiable) - Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) - Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) - Q_PROPERTY(Optional globalId MEMBER globalId) - Q_PROPERTY(Optional username MEMBER username) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) - Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) - Q_PROPERTY(Optional recipientUsername MEMBER recipientUsername) - Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) - Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -4323,8 +3844,6 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4347,8 +3866,6 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional canMoveToContainer MEMBER canMoveToContainer) }; /** @@ -4379,8 +3896,6 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4558,36 +4073,6 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noReadNotes MEMBER noReadNotes) - Q_PROPERTY(Optional noCreateNotes MEMBER noCreateNotes) - Q_PROPERTY(Optional noUpdateNotes MEMBER noUpdateNotes) - Q_PROPERTY(Optional noExpungeNotes MEMBER noExpungeNotes) - Q_PROPERTY(Optional noShareNotes MEMBER noShareNotes) - Q_PROPERTY(Optional noEmailNotes MEMBER noEmailNotes) - Q_PROPERTY(Optional noSendMessageToRecipients MEMBER noSendMessageToRecipients) - Q_PROPERTY(Optional noUpdateNotebook MEMBER noUpdateNotebook) - Q_PROPERTY(Optional noExpungeNotebook MEMBER noExpungeNotebook) - Q_PROPERTY(Optional noSetDefaultNotebook MEMBER noSetDefaultNotebook) - Q_PROPERTY(Optional noSetNotebookStack MEMBER noSetNotebookStack) - Q_PROPERTY(Optional noPublishToPublic MEMBER noPublishToPublic) - Q_PROPERTY(Optional noPublishToBusinessLibrary MEMBER noPublishToBusinessLibrary) - Q_PROPERTY(Optional noCreateTags MEMBER noCreateTags) - Q_PROPERTY(Optional noUpdateTags MEMBER noUpdateTags) - Q_PROPERTY(Optional noExpungeTags MEMBER noExpungeTags) - Q_PROPERTY(Optional noSetParentTag MEMBER noSetParentTag) - Q_PROPERTY(Optional noCreateSharedNotebooks MEMBER noCreateSharedNotebooks) - Q_PROPERTY(Optional updateWhichSharedNotebookRestrictions MEMBER updateWhichSharedNotebookRestrictions) - Q_PROPERTY(Optional expungeWhichSharedNotebookRestrictions MEMBER expungeWhichSharedNotebookRestrictions) - Q_PROPERTY(Optional noShareNotesWithBusiness MEMBER noShareNotesWithBusiness) - Q_PROPERTY(Optional noRenameNotebook MEMBER noRenameNotebook) - Q_PROPERTY(Optional noSetInMyList MEMBER noSetInMyList) - Q_PROPERTY(Optional noChangeContact MEMBER noChangeContact) - Q_PROPERTY(Optional canMoveToContainerRestrictions MEMBER canMoveToContainerRestrictions) - Q_PROPERTY(Optional noSetReminderNotifyEmail MEMBER noSetReminderNotifyEmail) - Q_PROPERTY(Optional noSetReminderNotifyInApp MEMBER noSetReminderNotifyInApp) - Q_PROPERTY(Optional noSetRecipientSettingsStack MEMBER noSetRecipientSettingsStack) - Q_PROPERTY(Optional noCanMoveNote MEMBER noCanMoveNote) }; /** @@ -4595,8 +4080,6 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT Notebook: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4750,22 +4233,6 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional defaultNotebook MEMBER defaultNotebook) - Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) - Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) - Q_PROPERTY(Optional publishing MEMBER publishing) - Q_PROPERTY(Optional published MEMBER published) - Q_PROPERTY(Optional stack MEMBER stack) - Q_PROPERTY(Optional> sharedNotebookIds MEMBER sharedNotebookIds) - Q_PROPERTY(Optional> sharedNotebooks MEMBER sharedNotebooks) - Q_PROPERTY(Optional businessNotebook MEMBER businessNotebook) - Q_PROPERTY(Optional contact MEMBER contact) - Q_PROPERTY(Optional restrictions MEMBER restrictions) - Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) }; /** @@ -4775,8 +4242,6 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable * */ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4880,18 +4345,6 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional shareName MEMBER shareName) - Q_PROPERTY(Optional username MEMBER username) - Q_PROPERTY(Optional shardId MEMBER shardId) - Q_PROPERTY(Optional sharedNotebookGlobalId MEMBER sharedNotebookGlobalId) - Q_PROPERTY(Optional uri MEMBER uri) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) - Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) - Q_PROPERTY(Optional stack MEMBER stack) - Q_PROPERTY(Optional businessId MEMBER businessId) }; /** @@ -4901,8 +4354,6 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable * */ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4949,12 +4400,6 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional notebookDisplayName MEMBER notebookDisplayName) - Q_PROPERTY(Optional contactName MEMBER contactName) - Q_PROPERTY(Optional hasSharedNotebook MEMBER hasSharedNotebook) - Q_PROPERTY(Optional joinedUserCount MEMBER joinedUserCount) }; /** @@ -4963,8 +4408,6 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable * */ struct QEVERCLOUD_EXPORT UserProfile: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5035,17 +4478,6 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional id MEMBER id) - Q_PROPERTY(Optional name MEMBER name) - Q_PROPERTY(Optional email MEMBER email) - Q_PROPERTY(Optional username MEMBER username) - Q_PROPERTY(Optional attributes MEMBER attributes) - Q_PROPERTY(Optional joined MEMBER joined) - Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) - Q_PROPERTY(Optional photoUrl MEMBER photoUrl) - Q_PROPERTY(Optional role MEMBER role) - Q_PROPERTY(Optional status MEMBER status) }; /** @@ -5056,8 +4488,6 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5102,12 +4532,6 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional url MEMBER url) - Q_PROPERTY(Optional width MEMBER width) - Q_PROPERTY(Optional height MEMBER height) - Q_PROPERTY(Optional pixelRatio MEMBER pixelRatio) - Q_PROPERTY(Optional fileSize MEMBER fileSize) }; /** @@ -5117,8 +4541,6 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5225,23 +4647,6 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional contentId MEMBER contentId) - Q_PROPERTY(Optional title MEMBER title) - Q_PROPERTY(Optional url MEMBER url) - Q_PROPERTY(Optional sourceId MEMBER sourceId) - Q_PROPERTY(Optional sourceUrl MEMBER sourceUrl) - Q_PROPERTY(Optional sourceFaviconUrl MEMBER sourceFaviconUrl) - Q_PROPERTY(Optional sourceName MEMBER sourceName) - Q_PROPERTY(Optional date MEMBER date) - Q_PROPERTY(Optional teaser MEMBER teaser) - Q_PROPERTY(Optional> thumbnails MEMBER thumbnails) - Q_PROPERTY(Optional contentType MEMBER contentType) - Q_PROPERTY(Optional accessType MEMBER accessType) - Q_PROPERTY(Optional visibleUrl MEMBER visibleUrl) - Q_PROPERTY(Optional clipUrl MEMBER clipUrl) - Q_PROPERTY(Optional contact MEMBER contact) - Q_PROPERTY(Optional authors MEMBER authors) }; /** @@ -5250,8 +4655,6 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable * */ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5314,15 +4717,6 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional businessId MEMBER businessId) - Q_PROPERTY(Optional email MEMBER email) - Q_PROPERTY(Optional role MEMBER role) - Q_PROPERTY(Optional status MEMBER status) - Q_PROPERTY(Optional requesterId MEMBER requesterId) - Q_PROPERTY(Optional fromWorkChat MEMBER fromWorkChat) - Q_PROPERTY(Optional created MEMBER created) - Q_PROPERTY(Optional mostRecentReminder MEMBER mostRecentReminder) }; /** @@ -5356,8 +4750,6 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable */ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5386,10 +4778,6 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional type MEMBER type) - Q_PROPERTY(Optional stringIdentifier MEMBER stringIdentifier) - Q_PROPERTY(Optional longIdentifier MEMBER longIdentifier) }; /** @@ -5398,8 +4786,6 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable **/ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5451,20 +4837,12 @@ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(UserID userId MEMBER userId) - Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) - Q_PROPERTY(Optional username MEMBER username) - Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) - Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) }; /** * */ struct QEVERCLOUD_EXPORT UserUrls: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5533,13 +4911,6 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) - Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) - Q_PROPERTY(Optional userStoreUrl MEMBER userStoreUrl) - Q_PROPERTY(Optional utilityUrl MEMBER utilityUrl) - Q_PROPERTY(Optional messageStoreUrl MEMBER messageStoreUrl) - Q_PROPERTY(Optional userWebSocketUrl MEMBER userWebSocketUrl) }; /** @@ -5548,8 +4919,6 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable **/ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5637,17 +5006,6 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Timestamp currentTime MEMBER currentTime) - Q_PROPERTY(QString authenticationToken MEMBER authenticationToken) - Q_PROPERTY(Timestamp expiration MEMBER expiration) - Q_PROPERTY(Optional user MEMBER user) - Q_PROPERTY(Optional publicUserInfo MEMBER publicUserInfo) - Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) - Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) - Q_PROPERTY(Optional secondFactorRequired MEMBER secondFactorRequired) - Q_PROPERTY(Optional secondFactorDeliveryHint MEMBER secondFactorDeliveryHint) - Q_PROPERTY(Optional urls MEMBER urls) }; /** @@ -5655,8 +5013,6 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5753,21 +5109,6 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(QString serviceHost MEMBER serviceHost) - Q_PROPERTY(QString marketingUrl MEMBER marketingUrl) - Q_PROPERTY(QString supportUrl MEMBER supportUrl) - Q_PROPERTY(QString accountEmailDomain MEMBER accountEmailDomain) - Q_PROPERTY(Optional enableFacebookSharing MEMBER enableFacebookSharing) - Q_PROPERTY(Optional enableGiftSubscriptions MEMBER enableGiftSubscriptions) - Q_PROPERTY(Optional enableSupportTickets MEMBER enableSupportTickets) - Q_PROPERTY(Optional enableSharedNotebooks MEMBER enableSharedNotebooks) - Q_PROPERTY(Optional enableSingleNoteSharing MEMBER enableSingleNoteSharing) - Q_PROPERTY(Optional enableSponsoredAccounts MEMBER enableSponsoredAccounts) - Q_PROPERTY(Optional enableTwitterSharing MEMBER enableTwitterSharing) - Q_PROPERTY(Optional enableLinkedInSharing MEMBER enableLinkedInSharing) - Q_PROPERTY(Optional enablePublicNotebooks MEMBER enablePublicNotebooks) - Q_PROPERTY(Optional enableGoogle MEMBER enableGoogle) }; /** @@ -5775,8 +5116,6 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5807,9 +5146,6 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(QString name MEMBER name) - Q_PROPERTY(BootstrapSettings settings MEMBER settings) }; /** @@ -5817,8 +5153,6 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5844,8 +5178,6 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(QList profiles MEMBER profiles) }; /** @@ -5868,7 +5200,6 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable */ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Printable { - Q_GADGET public: EDAMErrorCode errorCode; Optional parameter; @@ -5894,8 +5225,6 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin return !(*this == other); } - Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) - Q_PROPERTY(Optional parameter MEMBER parameter) }; /** @@ -5914,7 +5243,6 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin */ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Printable { - Q_GADGET public: EDAMErrorCode errorCode; Optional message; @@ -5942,9 +5270,6 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr return !(*this == other); } - Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) - Q_PROPERTY(Optional message MEMBER message) - Q_PROPERTY(Optional rateLimitDuration MEMBER rateLimitDuration) }; /** @@ -5962,7 +5287,6 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr */ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public Printable { - Q_GADGET public: Optional identifier; Optional key; @@ -5988,8 +5312,6 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public return !(*this == other); } - Q_PROPERTY(Optional identifier MEMBER identifier) - Q_PROPERTY(Optional key MEMBER key) }; /** @@ -6016,7 +5338,6 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public */ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, public Printable { - Q_GADGET public: QList contacts; Optional parameter; @@ -6044,9 +5365,6 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, return !(*this == other); } - Q_PROPERTY(QList contacts MEMBER contacts) - Q_PROPERTY(Optional parameter MEMBER parameter) - Q_PROPERTY(Optional> reasons MEMBER reasons) }; /** @@ -6062,8 +5380,6 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, **/ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6177,21 +5493,6 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Timestamp currentTime MEMBER currentTime) - Q_PROPERTY(Optional chunkHighUSN MEMBER chunkHighUSN) - Q_PROPERTY(qint32 updateCount MEMBER updateCount) - Q_PROPERTY(Optional> notes MEMBER notes) - Q_PROPERTY(Optional> notebooks MEMBER notebooks) - Q_PROPERTY(Optional> tags MEMBER tags) - Q_PROPERTY(Optional> searches MEMBER searches) - Q_PROPERTY(Optional> resources MEMBER resources) - Q_PROPERTY(Optional> expungedNotes MEMBER expungedNotes) - Q_PROPERTY(Optional> expungedNotebooks MEMBER expungedNotebooks) - Q_PROPERTY(Optional> expungedTags MEMBER expungedTags) - Q_PROPERTY(Optional> expungedSearches MEMBER expungedSearches) - Q_PROPERTY(Optional> linkedNotebooks MEMBER linkedNotebooks) - Q_PROPERTY(Optional> expungedLinkedNotebooks MEMBER expungedLinkedNotebooks) }; /** @@ -6200,8 +5501,6 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable **/ struct QEVERCLOUD_EXPORT NoteList: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6277,15 +5576,6 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(qint32 startIndex MEMBER startIndex) - Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) - Q_PROPERTY(QList notes MEMBER notes) - Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) - Q_PROPERTY(Optional searchedWords MEMBER searchedWords) - Q_PROPERTY(Optional updateCount MEMBER updateCount) - Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) - Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -6300,8 +5590,6 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable * */ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6365,19 +5653,6 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Guid guid MEMBER guid) - Q_PROPERTY(Optional title MEMBER title) - Q_PROPERTY(Optional contentLength MEMBER contentLength) - Q_PROPERTY(Optional created MEMBER created) - Q_PROPERTY(Optional updated MEMBER updated) - Q_PROPERTY(Optional deleted MEMBER deleted) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) - Q_PROPERTY(Optional attributes MEMBER attributes) - Q_PROPERTY(Optional largestResourceMime MEMBER largestResourceMime) - Q_PROPERTY(Optional largestResourceSize MEMBER largestResourceSize) }; /** @@ -6388,8 +5663,6 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable **/ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6467,15 +5740,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(qint32 startIndex MEMBER startIndex) - Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) - Q_PROPERTY(QList notes MEMBER notes) - Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) - Q_PROPERTY(Optional searchedWords MEMBER searchedWords) - Q_PROPERTY(Optional updateCount MEMBER updateCount) - Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) - Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -6485,8 +5749,6 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable * */ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6548,13 +5810,6 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional guid MEMBER guid) - Q_PROPERTY(Optional note MEMBER note) - Q_PROPERTY(Optional toAddresses MEMBER toAddresses) - Q_PROPERTY(Optional ccAddresses MEMBER ccAddresses) - Q_PROPERTY(Optional subject MEMBER subject) - Q_PROPERTY(Optional message MEMBER message) }; /** @@ -6567,8 +5822,6 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6675,16 +5928,6 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> notes MEMBER notes) - Q_PROPERTY(Optional> notebooks MEMBER notebooks) - Q_PROPERTY(Optional> tags MEMBER tags) - Q_PROPERTY(Optional> containingNotebooks MEMBER containingNotebooks) - Q_PROPERTY(Optional debugInfo MEMBER debugInfo) - Q_PROPERTY(Optional> experts MEMBER experts) - Q_PROPERTY(Optional> relatedContent MEMBER relatedContent) - Q_PROPERTY(Optional cacheKey MEMBER cacheKey) - Q_PROPERTY(Optional cacheExpires MEMBER cacheExpires) }; /** @@ -6694,8 +5937,6 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable * */ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6730,9 +5971,6 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional note MEMBER note) - Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -6742,8 +5980,6 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable * */ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6795,11 +6031,6 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional displayName MEMBER displayName) - Q_PROPERTY(Optional recipientUserIdentity MEMBER recipientUserIdentity) - Q_PROPERTY(Optional privilege MEMBER privilege) - Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -6811,8 +6042,6 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6855,10 +6084,6 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> invitations MEMBER invitations) - Q_PROPERTY(Optional> memberships MEMBER memberships) - Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -6868,8 +6093,6 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6939,12 +6162,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional inviteMessage MEMBER inviteMessage) - Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) - Q_PROPERTY(Optional> invitationsToCreateOrUpdate MEMBER invitationsToCreateOrUpdate) - Q_PROPERTY(Optional> unshares MEMBER unshares) }; /** @@ -6960,8 +6177,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7001,10 +6216,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional userIdentity MEMBER userIdentity) - Q_PROPERTY(Optional userException MEMBER userException) - Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -7013,8 +6224,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7041,8 +6250,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> errors MEMBER errors) }; /** @@ -7051,8 +6258,6 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7099,11 +6304,6 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional noteGuid MEMBER noteGuid) - Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) - Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) - Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -7112,8 +6312,6 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable * */ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7160,11 +6358,6 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) - Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) - Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) - Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -7173,8 +6366,6 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable * */ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7207,9 +6398,6 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) - Q_PROPERTY(Optional> matchingShares MEMBER matchingShares) }; /** @@ -7225,8 +6413,6 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7273,11 +6459,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional identityID MEMBER identityID) - Q_PROPERTY(Optional userID MEMBER userID) - Q_PROPERTY(Optional userException MEMBER userException) - Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -7286,8 +6467,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { -private: - Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -7314,8 +6493,6 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable return !(*this == other); } - Q_PROPERTY(EverCloudLocalData localData MEMBER localData) - Q_PROPERTY(Optional> errors MEMBER errors) }; } // namespace qevercloud From d57ec9452ca04e36aa546c99e4bfc9fb79614a1e Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:35:49 +0300 Subject: [PATCH 162/188] Revert "Experiment: remove Q_GADGET and Q_PROPERTY declarations" This reverts commit 27ce7a20fe0fade605e6dcea0b7c5c531c2185d1. --- QEverCloud/headers/generated/Types.h | 823 +++++++++++++++++++++++++++ 1 file changed, 823 insertions(+) diff --git a/QEverCloud/headers/generated/Types.h b/QEverCloud/headers/generated/Types.h index 4dd93645..8b00efea 100644 --- a/QEverCloud/headers/generated/Types.h +++ b/QEverCloud/headers/generated/Types.h @@ -101,6 +101,7 @@ using MessageThreadID = qint64; */ class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable { + Q_GADGET public: EverCloudLocalData(); virtual ~EverCloudLocalData() noexcept override; @@ -163,6 +164,8 @@ class QEVERCLOUD_EXPORT EverCloudLocalData: public Printable * */ struct QEVERCLOUD_EXPORT SyncState: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -246,6 +249,13 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(Timestamp fullSyncBefore MEMBER fullSyncBefore) + Q_PROPERTY(qint32 updateCount MEMBER updateCount) + Q_PROPERTY(Optional uploaded MEMBER uploaded) + Q_PROPERTY(Optional userLastUpdated MEMBER userLastUpdated) + Q_PROPERTY(Optional userMaxMessageEventId MEMBER userMaxMessageEventId) }; /** @@ -257,6 +267,8 @@ struct QEVERCLOUD_EXPORT SyncState: public Printable **/ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -391,6 +403,23 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeNotes MEMBER includeNotes) + Q_PROPERTY(Optional includeNoteResources MEMBER includeNoteResources) + Q_PROPERTY(Optional includeNoteAttributes MEMBER includeNoteAttributes) + Q_PROPERTY(Optional includeNotebooks MEMBER includeNotebooks) + Q_PROPERTY(Optional includeTags MEMBER includeTags) + Q_PROPERTY(Optional includeSearches MEMBER includeSearches) + Q_PROPERTY(Optional includeResources MEMBER includeResources) + Q_PROPERTY(Optional includeLinkedNotebooks MEMBER includeLinkedNotebooks) + Q_PROPERTY(Optional includeExpunged MEMBER includeExpunged) + Q_PROPERTY(Optional includeNoteApplicationDataFullMap MEMBER includeNoteApplicationDataFullMap) + Q_PROPERTY(Optional includeResourceApplicationDataFullMap MEMBER includeResourceApplicationDataFullMap) + Q_PROPERTY(Optional includeNoteResourceApplicationDataFullMap MEMBER includeNoteResourceApplicationDataFullMap) + Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) + Q_PROPERTY(Optional omitSharedNotebooks MEMBER omitSharedNotebooks) + Q_PROPERTY(Optional requireNoteContentClass MEMBER requireNoteContentClass) + Q_PROPERTY(Optional> notebookGuids MEMBER notebookGuids) }; /** @@ -401,6 +430,8 @@ struct QEVERCLOUD_EXPORT SyncChunkFilter: public Printable **/ struct QEVERCLOUD_EXPORT NoteFilter: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -511,6 +542,20 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional order MEMBER order) + Q_PROPERTY(Optional ascending MEMBER ascending) + Q_PROPERTY(Optional words MEMBER words) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional timeZone MEMBER timeZone) + Q_PROPERTY(Optional inactive MEMBER inactive) + Q_PROPERTY(Optional emphasized MEMBER emphasized) + Q_PROPERTY(Optional includeAllReadableNotebooks MEMBER includeAllReadableNotebooks) + Q_PROPERTY(Optional includeAllReadableWorkspaces MEMBER includeAllReadableWorkspaces) + Q_PROPERTY(Optional context MEMBER context) + Q_PROPERTY(Optional rawWords MEMBER rawWords) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) }; /** @@ -528,6 +573,8 @@ struct QEVERCLOUD_EXPORT NoteFilter: public Printable */ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -580,6 +627,18 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeTitle MEMBER includeTitle) + Q_PROPERTY(Optional includeContentLength MEMBER includeContentLength) + Q_PROPERTY(Optional includeCreated MEMBER includeCreated) + Q_PROPERTY(Optional includeUpdated MEMBER includeUpdated) + Q_PROPERTY(Optional includeDeleted MEMBER includeDeleted) + Q_PROPERTY(Optional includeUpdateSequenceNum MEMBER includeUpdateSequenceNum) + Q_PROPERTY(Optional includeNotebookGuid MEMBER includeNotebookGuid) + Q_PROPERTY(Optional includeTagGuids MEMBER includeTagGuids) + Q_PROPERTY(Optional includeAttributes MEMBER includeAttributes) + Q_PROPERTY(Optional includeLargestResourceMime MEMBER includeLargestResourceMime) + Q_PROPERTY(Optional includeLargestResourceSize MEMBER includeLargestResourceSize) }; /** @@ -589,6 +648,8 @@ struct QEVERCLOUD_EXPORT NotesMetadataResultSpec: public Printable **/ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -628,6 +689,12 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable return !(*this == other); } + using TagCounts = QMap; + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookCounts MEMBER notebookCounts) + Q_PROPERTY(Optional tagCounts MEMBER tagCounts) + Q_PROPERTY(Optional trashCount MEMBER trashCount) }; /** @@ -642,6 +709,8 @@ struct QEVERCLOUD_EXPORT NoteCollectionCounts: public Printable * */ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -704,6 +773,15 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeContent MEMBER includeContent) + Q_PROPERTY(Optional includeResourcesData MEMBER includeResourcesData) + Q_PROPERTY(Optional includeResourcesRecognition MEMBER includeResourcesRecognition) + Q_PROPERTY(Optional includeResourcesAlternateData MEMBER includeResourcesAlternateData) + Q_PROPERTY(Optional includeSharedNotes MEMBER includeSharedNotes) + Q_PROPERTY(Optional includeNoteAppDataValues MEMBER includeNoteAppDataValues) + Q_PROPERTY(Optional includeResourceAppDataValues MEMBER includeResourceAppDataValues) + Q_PROPERTY(Optional includeAccountLimits MEMBER includeAccountLimits) }; /** @@ -714,6 +792,8 @@ struct QEVERCLOUD_EXPORT NoteResultSpec: public Printable * */ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -767,6 +847,12 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Timestamp updated MEMBER updated) + Q_PROPERTY(Timestamp saved MEMBER saved) + Q_PROPERTY(QString title MEMBER title) + Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) }; /** @@ -779,6 +865,8 @@ struct QEVERCLOUD_EXPORT NoteVersionId: public Printable * */ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -845,6 +933,13 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional plainText MEMBER plainText) + Q_PROPERTY(Optional filter MEMBER filter) + Q_PROPERTY(Optional referenceUri MEMBER referenceUri) + Q_PROPERTY(Optional context MEMBER context) + Q_PROPERTY(Optional cacheKey MEMBER cacheKey) }; /** @@ -856,6 +951,8 @@ struct QEVERCLOUD_EXPORT RelatedQuery: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -941,11 +1038,23 @@ struct QEVERCLOUD_EXPORT RelatedResultSpec: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional maxNotes MEMBER maxNotes) + Q_PROPERTY(Optional maxNotebooks MEMBER maxNotebooks) + Q_PROPERTY(Optional maxTags MEMBER maxTags) + Q_PROPERTY(Optional writableNotebooksOnly MEMBER writableNotebooksOnly) + Q_PROPERTY(Optional includeContainingNotebooks MEMBER includeContainingNotebooks) + Q_PROPERTY(Optional includeDebugInfo MEMBER includeDebugInfo) + Q_PROPERTY(Optional maxExperts MEMBER maxExperts) + Q_PROPERTY(Optional maxRelatedContent MEMBER maxRelatedContent) + Q_PROPERTY(Optional> relatedContentTypes MEMBER relatedContentTypes) }; /** NO DOC COMMENT ID FOUND */ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -977,6 +1086,11 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noSetReadOnly MEMBER noSetReadOnly) + Q_PROPERTY(Optional noSetReadPlusActivity MEMBER noSetReadPlusActivity) + Q_PROPERTY(Optional noSetModify MEMBER noSetModify) + Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -986,6 +1100,8 @@ struct QEVERCLOUD_EXPORT ShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1052,6 +1168,13 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional bestPrivilege MEMBER bestPrivilege) + Q_PROPERTY(Optional individualPrivilege MEMBER individualPrivilege) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1062,6 +1185,8 @@ struct QEVERCLOUD_EXPORT MemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1099,6 +1224,10 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noSetReadNote MEMBER noSetReadNote) + Q_PROPERTY(Optional noSetModifyNote MEMBER noSetModifyNote) + Q_PROPERTY(Optional noSetFullAccess MEMBER noSetFullAccess) }; /** @@ -1108,6 +1237,8 @@ struct QEVERCLOUD_EXPORT NoteShareRelationshipRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1162,6 +1293,12 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1171,6 +1308,8 @@ struct QEVERCLOUD_EXPORT NoteMemberShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1219,6 +1358,11 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -1230,6 +1374,8 @@ struct QEVERCLOUD_EXPORT NoteInvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1265,6 +1411,10 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> invitations MEMBER invitations) + Q_PROPERTY(Optional> memberships MEMBER memberships) + Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -1279,6 +1429,8 @@ struct QEVERCLOUD_EXPORT NoteShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1331,6 +1483,12 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) + Q_PROPERTY(Optional> invitationsToUpdate MEMBER invitationsToUpdate) + Q_PROPERTY(Optional> membershipsToUnshare MEMBER membershipsToUnshare) + Q_PROPERTY(Optional> invitationsToUnshare MEMBER invitationsToUnshare) }; /** @@ -1344,6 +1502,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesParameters: public Printable **/ struct QEVERCLOUD_EXPORT Data: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1384,6 +1544,10 @@ struct QEVERCLOUD_EXPORT Data: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional bodyHash MEMBER bodyHash) + Q_PROPERTY(Optional size MEMBER size) + Q_PROPERTY(Optional body MEMBER body) }; /** @@ -1393,6 +1557,8 @@ struct QEVERCLOUD_EXPORT Data: public Printable **/ struct QEVERCLOUD_EXPORT UserAttributes: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1644,6 +1810,42 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional defaultLocationName MEMBER defaultLocationName) + Q_PROPERTY(Optional defaultLatitude MEMBER defaultLatitude) + Q_PROPERTY(Optional defaultLongitude MEMBER defaultLongitude) + Q_PROPERTY(Optional preactivation MEMBER preactivation) + Q_PROPERTY(Optional viewedPromotions MEMBER viewedPromotions) + Q_PROPERTY(Optional incomingEmailAddress MEMBER incomingEmailAddress) + Q_PROPERTY(Optional recentMailedAddresses MEMBER recentMailedAddresses) + Q_PROPERTY(Optional comments MEMBER comments) + Q_PROPERTY(Optional dateAgreedToTermsOfService MEMBER dateAgreedToTermsOfService) + Q_PROPERTY(Optional maxReferrals MEMBER maxReferrals) + Q_PROPERTY(Optional referralCount MEMBER referralCount) + Q_PROPERTY(Optional refererCode MEMBER refererCode) + Q_PROPERTY(Optional sentEmailDate MEMBER sentEmailDate) + Q_PROPERTY(Optional sentEmailCount MEMBER sentEmailCount) + Q_PROPERTY(Optional dailyEmailLimit MEMBER dailyEmailLimit) + Q_PROPERTY(Optional emailOptOutDate MEMBER emailOptOutDate) + Q_PROPERTY(Optional partnerEmailOptInDate MEMBER partnerEmailOptInDate) + Q_PROPERTY(Optional preferredLanguage MEMBER preferredLanguage) + Q_PROPERTY(Optional preferredCountry MEMBER preferredCountry) + Q_PROPERTY(Optional clipFullPage MEMBER clipFullPage) + Q_PROPERTY(Optional twitterUserName MEMBER twitterUserName) + Q_PROPERTY(Optional twitterId MEMBER twitterId) + Q_PROPERTY(Optional groupName MEMBER groupName) + Q_PROPERTY(Optional recognitionLanguage MEMBER recognitionLanguage) + Q_PROPERTY(Optional referralProof MEMBER referralProof) + Q_PROPERTY(Optional educationalDiscount MEMBER educationalDiscount) + Q_PROPERTY(Optional businessAddress MEMBER businessAddress) + Q_PROPERTY(Optional hideSponsorBilling MEMBER hideSponsorBilling) + Q_PROPERTY(Optional useEmailAutoFiling MEMBER useEmailAutoFiling) + Q_PROPERTY(Optional reminderEmailConfig MEMBER reminderEmailConfig) + Q_PROPERTY(Optional emailAddressLastConfirmed MEMBER emailAddressLastConfirmed) + Q_PROPERTY(Optional passwordUpdated MEMBER passwordUpdated) + Q_PROPERTY(Optional salesforcePushEnabled MEMBER salesforcePushEnabled) + Q_PROPERTY(Optional shouldLogClientEvent MEMBER shouldLogClientEvent) + Q_PROPERTY(Optional optOutMachineLearning MEMBER optOutMachineLearning) }; /** @@ -1653,6 +1855,8 @@ struct QEVERCLOUD_EXPORT UserAttributes: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1708,6 +1912,14 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional location MEMBER location) + Q_PROPERTY(Optional department MEMBER department) + Q_PROPERTY(Optional mobilePhone MEMBER mobilePhone) + Q_PROPERTY(Optional linkedInProfileUrl MEMBER linkedInProfileUrl) + Q_PROPERTY(Optional workPhone MEMBER workPhone) + Q_PROPERTY(Optional companyStartDate MEMBER companyStartDate) }; /** @@ -1716,6 +1928,8 @@ struct QEVERCLOUD_EXPORT BusinessUserAttributes: public Printable **/ struct QEVERCLOUD_EXPORT Accounting: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1866,6 +2080,30 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional uploadLimitEnd MEMBER uploadLimitEnd) + Q_PROPERTY(Optional uploadLimitNextMonth MEMBER uploadLimitNextMonth) + Q_PROPERTY(Optional premiumServiceStatus MEMBER premiumServiceStatus) + Q_PROPERTY(Optional premiumOrderNumber MEMBER premiumOrderNumber) + Q_PROPERTY(Optional premiumCommerceService MEMBER premiumCommerceService) + Q_PROPERTY(Optional premiumServiceStart MEMBER premiumServiceStart) + Q_PROPERTY(Optional premiumServiceSKU MEMBER premiumServiceSKU) + Q_PROPERTY(Optional lastSuccessfulCharge MEMBER lastSuccessfulCharge) + Q_PROPERTY(Optional lastFailedCharge MEMBER lastFailedCharge) + Q_PROPERTY(Optional lastFailedChargeReason MEMBER lastFailedChargeReason) + Q_PROPERTY(Optional nextPaymentDue MEMBER nextPaymentDue) + Q_PROPERTY(Optional premiumLockUntil MEMBER premiumLockUntil) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional premiumSubscriptionNumber MEMBER premiumSubscriptionNumber) + Q_PROPERTY(Optional lastRequestedCharge MEMBER lastRequestedCharge) + Q_PROPERTY(Optional currency MEMBER currency) + Q_PROPERTY(Optional unitPrice MEMBER unitPrice) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional businessName MEMBER businessName) + Q_PROPERTY(Optional businessRole MEMBER businessRole) + Q_PROPERTY(Optional unitDiscount MEMBER unitDiscount) + Q_PROPERTY(Optional nextChargeDate MEMBER nextChargeDate) + Q_PROPERTY(Optional availablePoints MEMBER availablePoints) }; /** @@ -1875,6 +2113,8 @@ struct QEVERCLOUD_EXPORT Accounting: public Printable * */ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -1925,6 +2165,12 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional businessName MEMBER businessName) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -1932,6 +2178,8 @@ struct QEVERCLOUD_EXPORT BusinessUserInfo: public Printable **/ struct QEVERCLOUD_EXPORT AccountLimits: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2016,6 +2264,18 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional userMailLimitDaily MEMBER userMailLimitDaily) + Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) + Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) + Q_PROPERTY(Optional userLinkedNotebookMax MEMBER userLinkedNotebookMax) + Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) + Q_PROPERTY(Optional userNoteCountMax MEMBER userNoteCountMax) + Q_PROPERTY(Optional userNotebookCountMax MEMBER userNotebookCountMax) + Q_PROPERTY(Optional userTagCountMax MEMBER userTagCountMax) + Q_PROPERTY(Optional noteTagCountMax MEMBER noteTagCountMax) + Q_PROPERTY(Optional userSavedSearchesMax MEMBER userSavedSearchesMax) + Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) }; /** @@ -2023,6 +2283,8 @@ struct QEVERCLOUD_EXPORT AccountLimits: public Printable **/ struct QEVERCLOUD_EXPORT User: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2174,6 +2436,25 @@ struct QEVERCLOUD_EXPORT User: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional timezone MEMBER timezone) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional shardId MEMBER shardId) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional accounting MEMBER accounting) + Q_PROPERTY(Optional businessUserInfo MEMBER businessUserInfo) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional accountLimits MEMBER accountLimits) }; /** @@ -2183,6 +2464,8 @@ struct QEVERCLOUD_EXPORT User: public Printable * */ struct QEVERCLOUD_EXPORT Contact: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2248,6 +2531,14 @@ struct QEVERCLOUD_EXPORT Contact: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional type MEMBER type) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional messagingPermit MEMBER messagingPermit) + Q_PROPERTY(Optional messagingPermitExpires MEMBER messagingPermitExpires) }; /** @@ -2257,6 +2548,8 @@ struct QEVERCLOUD_EXPORT Contact: public Printable * */ struct QEVERCLOUD_EXPORT Identity: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2335,6 +2628,15 @@ struct QEVERCLOUD_EXPORT Identity: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(IdentityID id MEMBER id) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional userId MEMBER userId) + Q_PROPERTY(Optional deactivated MEMBER deactivated) + Q_PROPERTY(Optional sameBusiness MEMBER sameBusiness) + Q_PROPERTY(Optional blocked MEMBER blocked) + Q_PROPERTY(Optional userConnected MEMBER userConnected) + Q_PROPERTY(Optional eventId MEMBER eventId) }; /** @@ -2343,6 +2645,8 @@ struct QEVERCLOUD_EXPORT Identity: public Printable **/ struct QEVERCLOUD_EXPORT Tag: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2407,6 +2711,11 @@ struct QEVERCLOUD_EXPORT Tag: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional parentGuid MEMBER parentGuid) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) }; /** @@ -2430,6 +2739,8 @@ struct QEVERCLOUD_EXPORT Tag: public Printable * */ struct QEVERCLOUD_EXPORT LazyMap: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2460,6 +2771,11 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable return !(*this == other); } + using FullMap = QMap; + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> keysOnly MEMBER keysOnly) + Q_PROPERTY(Optional fullMap MEMBER fullMap) }; /** @@ -2467,6 +2783,8 @@ struct QEVERCLOUD_EXPORT LazyMap: public Printable * */ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2574,6 +2892,19 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional sourceURL MEMBER sourceURL) + Q_PROPERTY(Optional timestamp MEMBER timestamp) + Q_PROPERTY(Optional latitude MEMBER latitude) + Q_PROPERTY(Optional longitude MEMBER longitude) + Q_PROPERTY(Optional altitude MEMBER altitude) + Q_PROPERTY(Optional cameraMake MEMBER cameraMake) + Q_PROPERTY(Optional cameraModel MEMBER cameraModel) + Q_PROPERTY(Optional clientWillIndex MEMBER clientWillIndex) + Q_PROPERTY(Optional recoType MEMBER recoType) + Q_PROPERTY(Optional fileName MEMBER fileName) + Q_PROPERTY(Optional attachment MEMBER attachment) + Q_PROPERTY(Optional applicationData MEMBER applicationData) }; /** @@ -2582,6 +2913,8 @@ struct QEVERCLOUD_EXPORT ResourceAttributes: public Printable * */ struct QEVERCLOUD_EXPORT Resource: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2689,6 +3022,19 @@ struct QEVERCLOUD_EXPORT Resource: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional data MEMBER data) + Q_PROPERTY(Optional mime MEMBER mime) + Q_PROPERTY(Optional width MEMBER width) + Q_PROPERTY(Optional height MEMBER height) + Q_PROPERTY(Optional duration MEMBER duration) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional recognition MEMBER recognition) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional alternateData MEMBER alternateData) }; /** @@ -2696,6 +3042,8 @@ struct QEVERCLOUD_EXPORT Resource: public Printable * */ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -2943,6 +3291,31 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable return !(*this == other); } + using Classifications = QMap; + + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional subjectDate MEMBER subjectDate) + Q_PROPERTY(Optional latitude MEMBER latitude) + Q_PROPERTY(Optional longitude MEMBER longitude) + Q_PROPERTY(Optional altitude MEMBER altitude) + Q_PROPERTY(Optional author MEMBER author) + Q_PROPERTY(Optional source MEMBER source) + Q_PROPERTY(Optional sourceURL MEMBER sourceURL) + Q_PROPERTY(Optional sourceApplication MEMBER sourceApplication) + Q_PROPERTY(Optional shareDate MEMBER shareDate) + Q_PROPERTY(Optional reminderOrder MEMBER reminderOrder) + Q_PROPERTY(Optional reminderDoneTime MEMBER reminderDoneTime) + Q_PROPERTY(Optional reminderTime MEMBER reminderTime) + Q_PROPERTY(Optional placeName MEMBER placeName) + Q_PROPERTY(Optional contentClass MEMBER contentClass) + Q_PROPERTY(Optional applicationData MEMBER applicationData) + Q_PROPERTY(Optional lastEditedBy MEMBER lastEditedBy) + Q_PROPERTY(Optional classifications MEMBER classifications) + Q_PROPERTY(Optional creatorId MEMBER creatorId) + Q_PROPERTY(Optional lastEditorId MEMBER lastEditorId) + Q_PROPERTY(Optional sharedWithBusiness MEMBER sharedWithBusiness) + Q_PROPERTY(Optional conflictSourceNoteGuid MEMBER conflictSourceNoteGuid) + Q_PROPERTY(Optional noteTitleQuality MEMBER noteTitleQuality) }; /** @@ -2953,6 +3326,8 @@ struct QEVERCLOUD_EXPORT NoteAttributes: public Printable * */ struct QEVERCLOUD_EXPORT SharedNote: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3005,6 +3380,13 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional sharerUserID MEMBER sharerUserID) + Q_PROPERTY(Optional recipientIdentity MEMBER recipientIdentity) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -3046,6 +3428,8 @@ struct QEVERCLOUD_EXPORT SharedNote: public Printable * */ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3089,6 +3473,12 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noUpdateTitle MEMBER noUpdateTitle) + Q_PROPERTY(Optional noUpdateContent MEMBER noUpdateContent) + Q_PROPERTY(Optional noEmail MEMBER noEmail) + Q_PROPERTY(Optional noShare MEMBER noShare) + Q_PROPERTY(Optional noSharePublicly MEMBER noSharePublicly) }; /** @@ -3101,6 +3491,8 @@ struct QEVERCLOUD_EXPORT NoteRestrictions: public Printable */ struct QEVERCLOUD_EXPORT NoteLimits: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3135,6 +3527,12 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteResourceCountMax MEMBER noteResourceCountMax) + Q_PROPERTY(Optional uploadLimit MEMBER uploadLimit) + Q_PROPERTY(Optional resourceSizeMax MEMBER resourceSizeMax) + Q_PROPERTY(Optional noteSizeMax MEMBER noteSizeMax) + Q_PROPERTY(Optional uploaded MEMBER uploaded) }; /** @@ -3143,6 +3541,8 @@ struct QEVERCLOUD_EXPORT NoteLimits: public Printable * */ struct QEVERCLOUD_EXPORT Note: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3322,6 +3722,25 @@ struct QEVERCLOUD_EXPORT Note: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional content MEMBER content) + Q_PROPERTY(Optional contentHash MEMBER contentHash) + Q_PROPERTY(Optional contentLength MEMBER contentLength) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional active MEMBER active) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional> resources MEMBER resources) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional tagNames MEMBER tagNames) + Q_PROPERTY(Optional> sharedNotes MEMBER sharedNotes) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional limits MEMBER limits) }; /** @@ -3331,6 +3750,8 @@ struct QEVERCLOUD_EXPORT Note: public Printable * */ struct QEVERCLOUD_EXPORT Publishing: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3388,6 +3809,11 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional uri MEMBER uri) + Q_PROPERTY(Optional order MEMBER order) + Q_PROPERTY(Optional ascending MEMBER ascending) + Q_PROPERTY(Optional publicDescription MEMBER publicDescription) }; /** @@ -3399,6 +3825,8 @@ struct QEVERCLOUD_EXPORT Publishing: public Printable * */ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3442,6 +3870,10 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookDescription MEMBER notebookDescription) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional recommended MEMBER recommended) }; /** @@ -3450,6 +3882,8 @@ struct QEVERCLOUD_EXPORT BusinessNotebook: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3487,6 +3921,10 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional includeAccount MEMBER includeAccount) + Q_PROPERTY(Optional includePersonalLinkedNotebooks MEMBER includePersonalLinkedNotebooks) + Q_PROPERTY(Optional includeBusinessLinkedNotebooks MEMBER includeBusinessLinkedNotebooks) }; /** @@ -3494,6 +3932,8 @@ struct QEVERCLOUD_EXPORT SavedSearchScope: public Printable * */ struct QEVERCLOUD_EXPORT SavedSearch: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3570,6 +4010,13 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional query MEMBER query) + Q_PROPERTY(Optional format MEMBER format) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional scope MEMBER scope) }; /** @@ -3588,6 +4035,8 @@ struct QEVERCLOUD_EXPORT SavedSearch: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3623,6 +4072,9 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) + Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) }; /** @@ -3637,6 +4089,8 @@ struct QEVERCLOUD_EXPORT SharedNotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3694,6 +4148,12 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional reminderNotifyEmail MEMBER reminderNotifyEmail) + Q_PROPERTY(Optional reminderNotifyInApp MEMBER reminderNotifyInApp) + Q_PROPERTY(Optional inMyList MEMBER inMyList) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional recipientStatus MEMBER recipientStatus) }; /** @@ -3702,6 +4162,8 @@ struct QEVERCLOUD_EXPORT NotebookRecipientSettings: public Printable * */ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3837,6 +4299,23 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional userId MEMBER userId) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional recipientIdentityId MEMBER recipientIdentityId) + Q_PROPERTY(Optional notebookModifiable MEMBER notebookModifiable) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional globalId MEMBER globalId) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) + Q_PROPERTY(Optional recipientUsername MEMBER recipientUsername) + Q_PROPERTY(Optional recipientUserId MEMBER recipientUserId) + Q_PROPERTY(Optional serviceAssigned MEMBER serviceAssigned) }; /** @@ -3844,6 +4323,8 @@ struct QEVERCLOUD_EXPORT SharedNotebook: public Printable */ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -3866,6 +4347,8 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional canMoveToContainer MEMBER canMoveToContainer) }; /** @@ -3896,6 +4379,8 @@ struct QEVERCLOUD_EXPORT CanMoveToContainerRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4073,6 +4558,36 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noReadNotes MEMBER noReadNotes) + Q_PROPERTY(Optional noCreateNotes MEMBER noCreateNotes) + Q_PROPERTY(Optional noUpdateNotes MEMBER noUpdateNotes) + Q_PROPERTY(Optional noExpungeNotes MEMBER noExpungeNotes) + Q_PROPERTY(Optional noShareNotes MEMBER noShareNotes) + Q_PROPERTY(Optional noEmailNotes MEMBER noEmailNotes) + Q_PROPERTY(Optional noSendMessageToRecipients MEMBER noSendMessageToRecipients) + Q_PROPERTY(Optional noUpdateNotebook MEMBER noUpdateNotebook) + Q_PROPERTY(Optional noExpungeNotebook MEMBER noExpungeNotebook) + Q_PROPERTY(Optional noSetDefaultNotebook MEMBER noSetDefaultNotebook) + Q_PROPERTY(Optional noSetNotebookStack MEMBER noSetNotebookStack) + Q_PROPERTY(Optional noPublishToPublic MEMBER noPublishToPublic) + Q_PROPERTY(Optional noPublishToBusinessLibrary MEMBER noPublishToBusinessLibrary) + Q_PROPERTY(Optional noCreateTags MEMBER noCreateTags) + Q_PROPERTY(Optional noUpdateTags MEMBER noUpdateTags) + Q_PROPERTY(Optional noExpungeTags MEMBER noExpungeTags) + Q_PROPERTY(Optional noSetParentTag MEMBER noSetParentTag) + Q_PROPERTY(Optional noCreateSharedNotebooks MEMBER noCreateSharedNotebooks) + Q_PROPERTY(Optional updateWhichSharedNotebookRestrictions MEMBER updateWhichSharedNotebookRestrictions) + Q_PROPERTY(Optional expungeWhichSharedNotebookRestrictions MEMBER expungeWhichSharedNotebookRestrictions) + Q_PROPERTY(Optional noShareNotesWithBusiness MEMBER noShareNotesWithBusiness) + Q_PROPERTY(Optional noRenameNotebook MEMBER noRenameNotebook) + Q_PROPERTY(Optional noSetInMyList MEMBER noSetInMyList) + Q_PROPERTY(Optional noChangeContact MEMBER noChangeContact) + Q_PROPERTY(Optional canMoveToContainerRestrictions MEMBER canMoveToContainerRestrictions) + Q_PROPERTY(Optional noSetReminderNotifyEmail MEMBER noSetReminderNotifyEmail) + Q_PROPERTY(Optional noSetReminderNotifyInApp MEMBER noSetReminderNotifyInApp) + Q_PROPERTY(Optional noSetRecipientSettingsStack MEMBER noSetRecipientSettingsStack) + Q_PROPERTY(Optional noCanMoveNote MEMBER noCanMoveNote) }; /** @@ -4080,6 +4595,8 @@ struct QEVERCLOUD_EXPORT NotebookRestrictions: public Printable * */ struct QEVERCLOUD_EXPORT Notebook: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4233,6 +4750,22 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional defaultNotebook MEMBER defaultNotebook) + Q_PROPERTY(Optional serviceCreated MEMBER serviceCreated) + Q_PROPERTY(Optional serviceUpdated MEMBER serviceUpdated) + Q_PROPERTY(Optional publishing MEMBER publishing) + Q_PROPERTY(Optional published MEMBER published) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional> sharedNotebookIds MEMBER sharedNotebookIds) + Q_PROPERTY(Optional> sharedNotebooks MEMBER sharedNotebooks) + Q_PROPERTY(Optional businessNotebook MEMBER businessNotebook) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional restrictions MEMBER restrictions) + Q_PROPERTY(Optional recipientSettings MEMBER recipientSettings) }; /** @@ -4242,6 +4775,8 @@ struct QEVERCLOUD_EXPORT Notebook: public Printable * */ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4345,6 +4880,18 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional shareName MEMBER shareName) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional shardId MEMBER shardId) + Q_PROPERTY(Optional sharedNotebookGlobalId MEMBER sharedNotebookGlobalId) + Q_PROPERTY(Optional uri MEMBER uri) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional stack MEMBER stack) + Q_PROPERTY(Optional businessId MEMBER businessId) }; /** @@ -4354,6 +4901,8 @@ struct QEVERCLOUD_EXPORT LinkedNotebook: public Printable * */ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4400,6 +4949,12 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional notebookDisplayName MEMBER notebookDisplayName) + Q_PROPERTY(Optional contactName MEMBER contactName) + Q_PROPERTY(Optional hasSharedNotebook MEMBER hasSharedNotebook) + Q_PROPERTY(Optional joinedUserCount MEMBER joinedUserCount) }; /** @@ -4408,6 +4963,8 @@ struct QEVERCLOUD_EXPORT NotebookDescriptor: public Printable * */ struct QEVERCLOUD_EXPORT UserProfile: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4478,6 +5035,17 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional id MEMBER id) + Q_PROPERTY(Optional name MEMBER name) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional joined MEMBER joined) + Q_PROPERTY(Optional photoLastUpdated MEMBER photoLastUpdated) + Q_PROPERTY(Optional photoUrl MEMBER photoUrl) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional status MEMBER status) }; /** @@ -4488,6 +5056,8 @@ struct QEVERCLOUD_EXPORT UserProfile: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4532,6 +5102,12 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional url MEMBER url) + Q_PROPERTY(Optional width MEMBER width) + Q_PROPERTY(Optional height MEMBER height) + Q_PROPERTY(Optional pixelRatio MEMBER pixelRatio) + Q_PROPERTY(Optional fileSize MEMBER fileSize) }; /** @@ -4541,6 +5117,8 @@ struct QEVERCLOUD_EXPORT RelatedContentImage: public Printable * */ struct QEVERCLOUD_EXPORT RelatedContent: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4647,6 +5225,23 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional contentId MEMBER contentId) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional url MEMBER url) + Q_PROPERTY(Optional sourceId MEMBER sourceId) + Q_PROPERTY(Optional sourceUrl MEMBER sourceUrl) + Q_PROPERTY(Optional sourceFaviconUrl MEMBER sourceFaviconUrl) + Q_PROPERTY(Optional sourceName MEMBER sourceName) + Q_PROPERTY(Optional date MEMBER date) + Q_PROPERTY(Optional teaser MEMBER teaser) + Q_PROPERTY(Optional> thumbnails MEMBER thumbnails) + Q_PROPERTY(Optional contentType MEMBER contentType) + Q_PROPERTY(Optional accessType MEMBER accessType) + Q_PROPERTY(Optional visibleUrl MEMBER visibleUrl) + Q_PROPERTY(Optional clipUrl MEMBER clipUrl) + Q_PROPERTY(Optional contact MEMBER contact) + Q_PROPERTY(Optional authors MEMBER authors) }; /** @@ -4655,6 +5250,8 @@ struct QEVERCLOUD_EXPORT RelatedContent: public Printable * */ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4717,6 +5314,15 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional businessId MEMBER businessId) + Q_PROPERTY(Optional email MEMBER email) + Q_PROPERTY(Optional role MEMBER role) + Q_PROPERTY(Optional status MEMBER status) + Q_PROPERTY(Optional requesterId MEMBER requesterId) + Q_PROPERTY(Optional fromWorkChat MEMBER fromWorkChat) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional mostRecentReminder MEMBER mostRecentReminder) }; /** @@ -4750,6 +5356,8 @@ struct QEVERCLOUD_EXPORT BusinessInvitation: public Printable */ struct QEVERCLOUD_EXPORT UserIdentity: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4778,6 +5386,10 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional type MEMBER type) + Q_PROPERTY(Optional stringIdentifier MEMBER stringIdentifier) + Q_PROPERTY(Optional longIdentifier MEMBER longIdentifier) }; /** @@ -4786,6 +5398,8 @@ struct QEVERCLOUD_EXPORT UserIdentity: public Printable **/ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4837,12 +5451,20 @@ struct QEVERCLOUD_EXPORT PublicUserInfo: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(UserID userId MEMBER userId) + Q_PROPERTY(Optional serviceLevel MEMBER serviceLevel) + Q_PROPERTY(Optional username MEMBER username) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) }; /** * */ struct QEVERCLOUD_EXPORT UserUrls: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -4911,6 +5533,13 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional userStoreUrl MEMBER userStoreUrl) + Q_PROPERTY(Optional utilityUrl MEMBER utilityUrl) + Q_PROPERTY(Optional messageStoreUrl MEMBER messageStoreUrl) + Q_PROPERTY(Optional userWebSocketUrl MEMBER userWebSocketUrl) }; /** @@ -4919,6 +5548,8 @@ struct QEVERCLOUD_EXPORT UserUrls: public Printable **/ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5006,6 +5637,17 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(QString authenticationToken MEMBER authenticationToken) + Q_PROPERTY(Timestamp expiration MEMBER expiration) + Q_PROPERTY(Optional user MEMBER user) + Q_PROPERTY(Optional publicUserInfo MEMBER publicUserInfo) + Q_PROPERTY(Optional noteStoreUrl MEMBER noteStoreUrl) + Q_PROPERTY(Optional webApiUrlPrefix MEMBER webApiUrlPrefix) + Q_PROPERTY(Optional secondFactorRequired MEMBER secondFactorRequired) + Q_PROPERTY(Optional secondFactorDeliveryHint MEMBER secondFactorDeliveryHint) + Q_PROPERTY(Optional urls MEMBER urls) }; /** @@ -5013,6 +5655,8 @@ struct QEVERCLOUD_EXPORT AuthenticationResult: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5109,6 +5753,21 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QString serviceHost MEMBER serviceHost) + Q_PROPERTY(QString marketingUrl MEMBER marketingUrl) + Q_PROPERTY(QString supportUrl MEMBER supportUrl) + Q_PROPERTY(QString accountEmailDomain MEMBER accountEmailDomain) + Q_PROPERTY(Optional enableFacebookSharing MEMBER enableFacebookSharing) + Q_PROPERTY(Optional enableGiftSubscriptions MEMBER enableGiftSubscriptions) + Q_PROPERTY(Optional enableSupportTickets MEMBER enableSupportTickets) + Q_PROPERTY(Optional enableSharedNotebooks MEMBER enableSharedNotebooks) + Q_PROPERTY(Optional enableSingleNoteSharing MEMBER enableSingleNoteSharing) + Q_PROPERTY(Optional enableSponsoredAccounts MEMBER enableSponsoredAccounts) + Q_PROPERTY(Optional enableTwitterSharing MEMBER enableTwitterSharing) + Q_PROPERTY(Optional enableLinkedInSharing MEMBER enableLinkedInSharing) + Q_PROPERTY(Optional enablePublicNotebooks MEMBER enablePublicNotebooks) + Q_PROPERTY(Optional enableGoogle MEMBER enableGoogle) }; /** @@ -5116,6 +5775,8 @@ struct QEVERCLOUD_EXPORT BootstrapSettings: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5146,6 +5807,9 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QString name MEMBER name) + Q_PROPERTY(BootstrapSettings settings MEMBER settings) }; /** @@ -5153,6 +5817,8 @@ struct QEVERCLOUD_EXPORT BootstrapProfile: public Printable **/ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5178,6 +5844,8 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(QList profiles MEMBER profiles) }; /** @@ -5200,6 +5868,7 @@ struct QEVERCLOUD_EXPORT BootstrapInfo: public Printable */ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Printable { + Q_GADGET public: EDAMErrorCode errorCode; Optional parameter; @@ -5225,6 +5894,8 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin return !(*this == other); } + Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) + Q_PROPERTY(Optional parameter MEMBER parameter) }; /** @@ -5243,6 +5914,7 @@ class QEVERCLOUD_EXPORT EDAMUserException: public EvernoteException, public Prin */ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Printable { + Q_GADGET public: EDAMErrorCode errorCode; Optional message; @@ -5270,6 +5942,9 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr return !(*this == other); } + Q_PROPERTY(EDAMErrorCode errorCode MEMBER errorCode) + Q_PROPERTY(Optional message MEMBER message) + Q_PROPERTY(Optional rateLimitDuration MEMBER rateLimitDuration) }; /** @@ -5287,6 +5962,7 @@ class QEVERCLOUD_EXPORT EDAMSystemException: public EvernoteException, public Pr */ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public Printable { + Q_GADGET public: Optional identifier; Optional key; @@ -5312,6 +5988,8 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public return !(*this == other); } + Q_PROPERTY(Optional identifier MEMBER identifier) + Q_PROPERTY(Optional key MEMBER key) }; /** @@ -5338,6 +6016,7 @@ class QEVERCLOUD_EXPORT EDAMNotFoundException: public EvernoteException, public */ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, public Printable { + Q_GADGET public: QList contacts; Optional parameter; @@ -5365,6 +6044,9 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, return !(*this == other); } + Q_PROPERTY(QList contacts MEMBER contacts) + Q_PROPERTY(Optional parameter MEMBER parameter) + Q_PROPERTY(Optional> reasons MEMBER reasons) }; /** @@ -5380,6 +6062,8 @@ class QEVERCLOUD_EXPORT EDAMInvalidContactsException: public EvernoteException, **/ struct QEVERCLOUD_EXPORT SyncChunk: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5493,6 +6177,21 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Timestamp currentTime MEMBER currentTime) + Q_PROPERTY(Optional chunkHighUSN MEMBER chunkHighUSN) + Q_PROPERTY(qint32 updateCount MEMBER updateCount) + Q_PROPERTY(Optional> notes MEMBER notes) + Q_PROPERTY(Optional> notebooks MEMBER notebooks) + Q_PROPERTY(Optional> tags MEMBER tags) + Q_PROPERTY(Optional> searches MEMBER searches) + Q_PROPERTY(Optional> resources MEMBER resources) + Q_PROPERTY(Optional> expungedNotes MEMBER expungedNotes) + Q_PROPERTY(Optional> expungedNotebooks MEMBER expungedNotebooks) + Q_PROPERTY(Optional> expungedTags MEMBER expungedTags) + Q_PROPERTY(Optional> expungedSearches MEMBER expungedSearches) + Q_PROPERTY(Optional> linkedNotebooks MEMBER linkedNotebooks) + Q_PROPERTY(Optional> expungedLinkedNotebooks MEMBER expungedLinkedNotebooks) }; /** @@ -5501,6 +6200,8 @@ struct QEVERCLOUD_EXPORT SyncChunk: public Printable **/ struct QEVERCLOUD_EXPORT NoteList: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5576,6 +6277,15 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 startIndex MEMBER startIndex) + Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) + Q_PROPERTY(QList notes MEMBER notes) + Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) + Q_PROPERTY(Optional searchedWords MEMBER searchedWords) + Q_PROPERTY(Optional updateCount MEMBER updateCount) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -5590,6 +6300,8 @@ struct QEVERCLOUD_EXPORT NoteList: public Printable * */ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5653,6 +6365,19 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Guid guid MEMBER guid) + Q_PROPERTY(Optional title MEMBER title) + Q_PROPERTY(Optional contentLength MEMBER contentLength) + Q_PROPERTY(Optional created MEMBER created) + Q_PROPERTY(Optional updated MEMBER updated) + Q_PROPERTY(Optional deleted MEMBER deleted) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional> tagGuids MEMBER tagGuids) + Q_PROPERTY(Optional attributes MEMBER attributes) + Q_PROPERTY(Optional largestResourceMime MEMBER largestResourceMime) + Q_PROPERTY(Optional largestResourceSize MEMBER largestResourceSize) }; /** @@ -5663,6 +6388,8 @@ struct QEVERCLOUD_EXPORT NoteMetadata: public Printable **/ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5740,6 +6467,15 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(qint32 startIndex MEMBER startIndex) + Q_PROPERTY(qint32 totalNotes MEMBER totalNotes) + Q_PROPERTY(QList notes MEMBER notes) + Q_PROPERTY(Optional stoppedWords MEMBER stoppedWords) + Q_PROPERTY(Optional searchedWords MEMBER searchedWords) + Q_PROPERTY(Optional updateCount MEMBER updateCount) + Q_PROPERTY(Optional searchContextBytes MEMBER searchContextBytes) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) }; /** @@ -5749,6 +6485,8 @@ struct QEVERCLOUD_EXPORT NotesMetadataList: public Printable * */ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5810,6 +6548,13 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional guid MEMBER guid) + Q_PROPERTY(Optional note MEMBER note) + Q_PROPERTY(Optional toAddresses MEMBER toAddresses) + Q_PROPERTY(Optional ccAddresses MEMBER ccAddresses) + Q_PROPERTY(Optional subject MEMBER subject) + Q_PROPERTY(Optional message MEMBER message) }; /** @@ -5822,6 +6567,8 @@ struct QEVERCLOUD_EXPORT NoteEmailParameters: public Printable * */ struct QEVERCLOUD_EXPORT RelatedResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5928,6 +6675,16 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> notes MEMBER notes) + Q_PROPERTY(Optional> notebooks MEMBER notebooks) + Q_PROPERTY(Optional> tags MEMBER tags) + Q_PROPERTY(Optional> containingNotebooks MEMBER containingNotebooks) + Q_PROPERTY(Optional debugInfo MEMBER debugInfo) + Q_PROPERTY(Optional> experts MEMBER experts) + Q_PROPERTY(Optional> relatedContent MEMBER relatedContent) + Q_PROPERTY(Optional cacheKey MEMBER cacheKey) + Q_PROPERTY(Optional cacheExpires MEMBER cacheExpires) }; /** @@ -5937,6 +6694,8 @@ struct QEVERCLOUD_EXPORT RelatedResult: public Printable * */ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -5971,6 +6730,9 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional note MEMBER note) + Q_PROPERTY(Optional updated MEMBER updated) }; /** @@ -5980,6 +6742,8 @@ struct QEVERCLOUD_EXPORT UpdateNoteIfUsnMatchesResult: public Printable * */ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6031,6 +6795,11 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional displayName MEMBER displayName) + Q_PROPERTY(Optional recipientUserIdentity MEMBER recipientUserIdentity) + Q_PROPERTY(Optional privilege MEMBER privilege) + Q_PROPERTY(Optional sharerUserId MEMBER sharerUserId) }; /** @@ -6042,6 +6811,8 @@ struct QEVERCLOUD_EXPORT InvitationShareRelationship: public Printable * */ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6084,6 +6855,10 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> invitations MEMBER invitations) + Q_PROPERTY(Optional> memberships MEMBER memberships) + Q_PROPERTY(Optional invitationRestrictions MEMBER invitationRestrictions) }; /** @@ -6093,6 +6868,8 @@ struct QEVERCLOUD_EXPORT ShareRelationships: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6162,6 +6939,12 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional inviteMessage MEMBER inviteMessage) + Q_PROPERTY(Optional> membershipsToUpdate MEMBER membershipsToUpdate) + Q_PROPERTY(Optional> invitationsToCreateOrUpdate MEMBER invitationsToCreateOrUpdate) + Q_PROPERTY(Optional> unshares MEMBER unshares) }; /** @@ -6177,6 +6960,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesParameters: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6216,6 +7001,10 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional userIdentity MEMBER userIdentity) + Q_PROPERTY(Optional userException MEMBER userException) + Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -6224,6 +7013,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6250,6 +7041,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> errors MEMBER errors) }; /** @@ -6258,6 +7051,8 @@ struct QEVERCLOUD_EXPORT ManageNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6304,6 +7099,11 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional noteGuid MEMBER noteGuid) + Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) + Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) + Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -6312,6 +7112,8 @@ struct QEVERCLOUD_EXPORT SharedNoteTemplate: public Printable * */ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6358,6 +7160,11 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional notebookGuid MEMBER notebookGuid) + Q_PROPERTY(Optional recipientThreadId MEMBER recipientThreadId) + Q_PROPERTY(Optional> recipientContacts MEMBER recipientContacts) + Q_PROPERTY(Optional privilege MEMBER privilege) }; /** @@ -6366,6 +7173,8 @@ struct QEVERCLOUD_EXPORT NotebookShareTemplate: public Printable * */ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6398,6 +7207,9 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional updateSequenceNum MEMBER updateSequenceNum) + Q_PROPERTY(Optional> matchingShares MEMBER matchingShares) }; /** @@ -6413,6 +7225,8 @@ struct QEVERCLOUD_EXPORT CreateOrUpdateNotebookSharesResult: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6459,6 +7273,11 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional identityID MEMBER identityID) + Q_PROPERTY(Optional userID MEMBER userID) + Q_PROPERTY(Optional userException MEMBER userException) + Q_PROPERTY(Optional notFoundException MEMBER notFoundException) }; /** @@ -6467,6 +7286,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesError: public Printable * */ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable { +private: + Q_GADGET public: /** * See the declaration of EverCloudLocalData for details @@ -6493,6 +7314,8 @@ struct QEVERCLOUD_EXPORT ManageNoteSharesResult: public Printable return !(*this == other); } + Q_PROPERTY(EverCloudLocalData localData MEMBER localData) + Q_PROPERTY(Optional> errors MEMBER errors) }; } // namespace qevercloud From ade593f2b622af16b01162d60578ba8248603503 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:35:56 +0300 Subject: [PATCH 163/188] Revert "Experiment: comment out Q_NAMESPACE and Q_ENUM_NS altogether" This reverts commit f3002db1b6c6549c175a03c0c64f9600d63c535c. --- QEverCloud/headers/Helpers.h | 2 +- QEverCloud/headers/Log.h | 2 +- QEverCloud/headers/generated/EDAMErrorCode.h | 46 ++++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 6b952a3c..4952f74f 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -40,7 +40,7 @@ namespace qevercloud { * meta object, so putting it here */ #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_NAMESPACE +Q_NAMESPACE #endif #endif // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index e581a7d0..229c62f2 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -32,7 +32,7 @@ enum class LogLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(LogLevel) +Q_ENUM_NS(LogLevel) #endif QEVERCLOUD_EXPORT QTextStream & operator<<( diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 58fcd0b7..0aaa3de2 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -133,7 +133,7 @@ enum class EDAMErrorCode #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(EDAMErrorCode) +Q_ENUM_NS(EDAMErrorCode) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -196,7 +196,7 @@ enum class EDAMInvalidContactReason #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(EDAMInvalidContactReason) +Q_ENUM_NS(EDAMInvalidContactReason) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -248,7 +248,7 @@ enum class ShareRelationshipPrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(ShareRelationshipPrivilegeLevel) +Q_ENUM_NS(ShareRelationshipPrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -286,7 +286,7 @@ enum class PrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(PrivilegeLevel) +Q_ENUM_NS(PrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -322,7 +322,7 @@ enum class ServiceLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(ServiceLevel) +Q_ENUM_NS(ServiceLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -355,7 +355,7 @@ enum class QueryFormat #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(QueryFormat) +Q_ENUM_NS(QueryFormat) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -391,7 +391,7 @@ enum class NoteSortOrder #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(NoteSortOrder) +Q_ENUM_NS(NoteSortOrder) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -444,7 +444,7 @@ enum class PremiumOrderStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(PremiumOrderStatus) +Q_ENUM_NS(PremiumOrderStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -512,7 +512,7 @@ enum class SharedNotebookPrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(SharedNotebookPrivilegeLevel) +Q_ENUM_NS(SharedNotebookPrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -556,7 +556,7 @@ enum class SharedNotePrivilegeLevel #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(SharedNotePrivilegeLevel) +Q_ENUM_NS(SharedNotePrivilegeLevel) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -595,7 +595,7 @@ enum class SponsoredGroupRole #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(SponsoredGroupRole) +Q_ENUM_NS(SponsoredGroupRole) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -631,7 +631,7 @@ enum class BusinessUserRole #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(BusinessUserRole) +Q_ENUM_NS(BusinessUserRole) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -673,7 +673,7 @@ enum class BusinessUserStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(BusinessUserStatus) +Q_ENUM_NS(BusinessUserStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -712,7 +712,7 @@ enum class SharedNotebookInstanceRestrictions #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(SharedNotebookInstanceRestrictions) +Q_ENUM_NS(SharedNotebookInstanceRestrictions) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -751,7 +751,7 @@ enum class ReminderEmailConfig #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(ReminderEmailConfig) +Q_ENUM_NS(ReminderEmailConfig) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -794,7 +794,7 @@ enum class BusinessInvitationStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(BusinessInvitationStatus) +Q_ENUM_NS(BusinessInvitationStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -830,7 +830,7 @@ enum class ContactType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(ContactType) +Q_ENUM_NS(ContactType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -863,7 +863,7 @@ enum class EntityType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(EntityType) +Q_ENUM_NS(EntityType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -907,7 +907,7 @@ enum class RecipientStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(RecipientStatus) +Q_ENUM_NS(RecipientStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -955,7 +955,7 @@ enum class CanMoveToContainerStatus #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(CanMoveToContainerStatus) +Q_ENUM_NS(CanMoveToContainerStatus) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -994,7 +994,7 @@ enum class RelatedContentType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(RelatedContentType) +Q_ENUM_NS(RelatedContentType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -1044,7 +1044,7 @@ enum class RelatedContentAccess #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(RelatedContentAccess) +Q_ENUM_NS(RelatedContentAccess) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) @@ -1077,7 +1077,7 @@ enum class UserIdentityType #if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) -// Q_ENUM_NS(UserIdentityType) +Q_ENUM_NS(UserIdentityType) #endif #endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) From 7fa102bde351705f0fa37d5f19625dac72f703d7 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:36:07 +0300 Subject: [PATCH 164/188] Revert "Stop messing with incremental linking, instead limit the scope of Q_NAMESPACE and Q_ENUM_NS only to QEverCloud library itself" This reverts commit 4a3edbabe7ec6646dc7566353879961ccacfc481. --- QEverCloud/CMakeLists.txt | 8 ++++ QEverCloud/headers/Helpers.h | 2 - QEverCloud/headers/generated/EDAMErrorCode.h | 46 -------------------- 3 files changed, 8 insertions(+), 48 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index dd6e4757..e21524d5 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -160,6 +160,14 @@ if(Qt5Test_FOUND) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) + if(MSVC) + foreach(FLAG_TYPE EXE MODULE SHARED) + string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") + string(REPLACE "/EDITANDCONTINUE" "" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") + set(CMAKE_${FLAG_TYPE}_LINKER_FLAGS "/INCREMENTAL:NO ${FLAG_TMP}" CACHE STRING "Overriding default ${FLAG_TYPE} linker flags." FORCE) + mark_as_advanced(CMAKE_${FLAG_TYPE}_LINKER_FLAGS) + endforeach() + endif() set_target_properties(test_${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 4952f74f..2a05ebe1 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -33,7 +33,6 @@ namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) /** * It appears that Q_NAMESPACE declaration should be present in exactly one file * per namespace, otherwise moc generates multiple definitions of corresponding @@ -42,7 +41,6 @@ namespace qevercloud { #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_NAMESPACE #endif -#endif // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 0aaa3de2..9bde7453 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -131,11 +131,9 @@ enum class EDAMErrorCode SSO_AUTHENTICATION_REQUIRED = 28 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EDAMErrorCode) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EDAMErrorCode value) { @@ -194,11 +192,9 @@ enum class EDAMInvalidContactReason NO_CONNECTION }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EDAMInvalidContactReason) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EDAMInvalidContactReason value) { @@ -246,11 +242,9 @@ enum class ShareRelationshipPrivilegeLevel FULL_ACCESS = 30 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ShareRelationshipPrivilegeLevel) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ShareRelationshipPrivilegeLevel value) { @@ -284,11 +278,9 @@ enum class PrivilegeLevel ADMIN = 9 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(PrivilegeLevel) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(PrivilegeLevel value) { @@ -320,11 +312,9 @@ enum class ServiceLevel BUSINESS = 4 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ServiceLevel) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ServiceLevel value) { @@ -353,11 +343,9 @@ enum class QueryFormat SEXP = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(QueryFormat) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(QueryFormat value) { @@ -389,11 +377,9 @@ enum class NoteSortOrder TITLE = 5 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(NoteSortOrder) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(NoteSortOrder value) { @@ -442,11 +428,9 @@ enum class PremiumOrderStatus CANCELED = 5 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(PremiumOrderStatus) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(PremiumOrderStatus value) { @@ -510,11 +494,9 @@ enum class SharedNotebookPrivilegeLevel BUSINESS_FULL_ACCESS = 5 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotebookPrivilegeLevel) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotebookPrivilegeLevel value) { @@ -554,11 +536,9 @@ enum class SharedNotePrivilegeLevel FULL_ACCESS = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotePrivilegeLevel) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotePrivilegeLevel value) { @@ -593,11 +573,9 @@ enum class SponsoredGroupRole GROUP_OWNER = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SponsoredGroupRole) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SponsoredGroupRole value) { @@ -629,11 +607,9 @@ enum class BusinessUserRole NORMAL = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessUserRole) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessUserRole value) { @@ -671,11 +647,9 @@ enum class BusinessUserStatus DEACTIVATED = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessUserStatus) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessUserStatus value) { @@ -710,11 +684,9 @@ enum class SharedNotebookInstanceRestrictions NO_SHARED_NOTEBOOKS = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(SharedNotebookInstanceRestrictions) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(SharedNotebookInstanceRestrictions value) { @@ -749,11 +721,9 @@ enum class ReminderEmailConfig SEND_DAILY_EMAIL = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ReminderEmailConfig) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ReminderEmailConfig value) { @@ -792,11 +762,9 @@ enum class BusinessInvitationStatus REDEEMED = 2 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(BusinessInvitationStatus) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(BusinessInvitationStatus value) { @@ -828,11 +796,9 @@ enum class ContactType LINKEDIN = 6 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(ContactType) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(ContactType value) { @@ -861,11 +827,9 @@ enum class EntityType WORKSPACE = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(EntityType) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(EntityType value) { @@ -905,11 +869,9 @@ enum class RecipientStatus IN_MY_LIST_AND_DEFAULT_NOTEBOOK = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RecipientStatus) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RecipientStatus value) { @@ -953,11 +915,9 @@ enum class CanMoveToContainerStatus INSUFFICIENT_CONTAINER_PRIVILEGE = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(CanMoveToContainerStatus) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(CanMoveToContainerStatus value) { @@ -992,11 +952,9 @@ enum class RelatedContentType REFERENCE_MATERIAL = 4 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RelatedContentType) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RelatedContentType value) { @@ -1042,11 +1000,9 @@ enum class RelatedContentAccess DIRECT_LINK_EMBEDDED_VIEW = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(RelatedContentAccess) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(RelatedContentAccess value) { @@ -1075,11 +1031,9 @@ enum class UserIdentityType IDENTITYID = 3 }; -#if defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_ENUM_NS(UserIdentityType) #endif -#endif // // defined(QEVERCLOUD_SHARED_LIBRARY) || defined(QEVERCLOUD_STATIC_LIBRARY) inline uint qHash(UserIdentityType value) { From a1e65a986d342c21fee6ee16b0da7f66bee57043 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:37:45 +0300 Subject: [PATCH 165/188] Try to make compile definitions private for library --- QEverCloud/CMakeLists.txt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index e21524d5..8300eddd 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -100,10 +100,10 @@ set(LIBNAME "${QEVERCLOUD_LIBNAME_PREFIX}${QEVERCLOUD_QT_VERSION}qevercloud") if(BUILD_SHARED) add_library(${LIBNAME} SHARED ${ALL_HEADERS_AND_SOURCES}) - target_compile_definitions(${LIBNAME} PUBLIC "-DQEVERCLOUD_SHARED_LIBRARY") + target_compile_definitions(${LIBNAME} PRIVATE "-DQEVERCLOUD_SHARED_LIBRARY") else() add_library(${LIBNAME} STATIC ${ALL_HEADERS_AND_SOURCES}) - target_compile_definitions(${LIBNAME} PUBLIC "-DQEVERCLOUD_STATIC_LIBRARY") + target_compile_definitions(${LIBNAME} PRIVATE "-DQEVERCLOUD_STATIC_LIBRARY") endif() add_sanitizers(${LIBNAME}) @@ -160,14 +160,6 @@ if(Qt5Test_FOUND) add_executable(test_${PROJECT_NAME} ${TEST_HEADERS} ${TEST_SOURCES}) add_sanitizers(test_${PROJECT_NAME}) add_test(test_${PROJECT_NAME} test_${PROJECT_NAME}) - if(MSVC) - foreach(FLAG_TYPE EXE MODULE SHARED) - string(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") - string(REPLACE "/EDITANDCONTINUE" "" FLAG_TMP "${CMAKE_${FLAG_TYPE}_LINKER_FLAGS}") - set(CMAKE_${FLAG_TYPE}_LINKER_FLAGS "/INCREMENTAL:NO ${FLAG_TMP}" CACHE STRING "Overriding default ${FLAG_TYPE} linker flags." FORCE) - mark_as_advanced(CMAKE_${FLAG_TYPE}_LINKER_FLAGS) - endforeach() - endif() set_target_properties(test_${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF) From 28fc770b0881af5bc0916adff9559add60558ba6 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:44:57 +0300 Subject: [PATCH 166/188] Try to enable Optional move semantics back for MSVC --- QEverCloud/headers/Optional.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/QEverCloud/headers/Optional.h b/QEverCloud/headers/Optional.h index f0ca4976..2f21815a 100644 --- a/QEverCloud/headers/Optional.h +++ b/QEverCloud/headers/Optional.h @@ -384,9 +384,6 @@ class Optional swap(first.m_value, second.m_value); } -// Visual C++ does not to generate implicit move constructors so this stuff -// doesn't work with even recent MSVC compilers -#if defined(Q_COMPILER_RVALUE_REFS) && !defined(_MSC_VER) Optional(Optional && other) { swap(*this, other); @@ -412,7 +409,6 @@ class Optional swap(m_value, other); return *this; } -#endif private: bool m_isSet; From b030469ec09dba8dd14dc3b2ac6ff32b636d0a56 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:53:36 +0300 Subject: [PATCH 167/188] Remove undefs which should no longer be needed --- QEverCloud/src/tests/SocketHelpers.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/QEverCloud/src/tests/SocketHelpers.h b/QEverCloud/src/tests/SocketHelpers.h index e0838430..851248aa 100644 --- a/QEverCloud/src/tests/SocketHelpers.h +++ b/QEverCloud/src/tests/SocketHelpers.h @@ -13,14 +13,6 @@ #include -#ifdef QEVERCLOUD_SHARED_LIBRARY -#undef QEVERCLOUD_SHARED_LIBRARY -#endif - -#ifdef QEVERCLOUD_STATIC_LIBRARY -#undef QEVERCLOUD_STATIC_LIBRARY -#endif - namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// From d9ec488b0c5cf2e9149524db6dcec91979a626ae Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 11:54:11 +0300 Subject: [PATCH 168/188] Remove no longer needed verbose makefile in appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 967aef3d..d2634d0e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -70,7 +70,7 @@ before_build: build_script: - cd build - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" - - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" -DCMAKE_VERBOSE_MAKEFILE=ON + - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" - cmake --build . --target all - cmake --build . --target check - cmake --build . --target install From 56c602de3ca27b3397271df8a123597f10e7a1e7 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 12:46:39 +0300 Subject: [PATCH 169/188] Add some warnings in attempt to figure out why NoteStoreTester tests get stuck at AppVeyor CI --- .../src/tests/generated/TestNoteStore.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index ee606fae..bd16d78f 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -15,6 +15,7 @@ #include "RandomDataGenerators.h" #include #include +#include #include #include @@ -6040,6 +6041,8 @@ public Q_SLOTS: void NoteStoreTester::shouldExecuteGetSyncState() { + qWarning() << "Entering NoteStoreTester::shouldExecuteGetSyncState\n"; + IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -6048,6 +6051,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() NoteStoreGetSyncStateTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> SyncState { + qWarning() << "Inside helper lambda\n"; Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); @@ -6065,8 +6069,11 @@ void NoteStoreTester::shouldExecuteGetSyncState() &NoteStoreServer::onGetSyncStateRequestReady); QTcpServer tcpServer; + qWarning() << "Before TCP server starting\n"; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); + qWarning() << "After TCP server starting\n"; quint16 port = tcpServer.serverPort(); + qWarning() << "Assigned TCP server port: " << port << "\n"; QTcpSocket * pSocket = nullptr; QObject::connect( @@ -6074,7 +6081,9 @@ void NoteStoreTester::shouldExecuteGetSyncState() &QTcpServer::newConnection, &tcpServer, [&] { + qWarning() << "Before calling nextPendingConnection\n"; pSocket = tcpServer.nextPendingConnection(); + qWarning() << "After calling nextPendingConnection\n"; Q_ASSERT(pSocket); QObject::connect( pSocket, @@ -6086,7 +6095,9 @@ void NoteStoreTester::shouldExecuteGetSyncState() } QByteArray requestData = readThriftRequestFromSocket(*pSocket); + qWarning() << "Calling server.onRequest\n"; server.onRequest(requestData); + qWarning() << "After calling server.onRequest\n"; }); QObject::connect( @@ -6095,6 +6106,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() &server, [&] (QByteArray responseData) { + qWarning() << "Inside on request ready lambda\n"; QByteArray buffer; buffer.append("HTTP/1.1 200 OK\r\n"); buffer.append("Content-Length: "); @@ -6106,15 +6118,20 @@ void NoteStoreTester::shouldExecuteGetSyncState() if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } + qWarning() << "Leaving on request ready lambda\n"; }); + qWarning() << "Before creating note store\n"; auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port), nullptr, nullptr, nullRetryPolicy()); + qWarning() << "After creating note store\n"; + qWarning() << "Before calling noteStore->getSyncState\n"; SyncState res = noteStore->getSyncState( ctx); + qWarning() << "After calling noteStore->getSyncState\n"; QVERIFY(res == response); } From af4ac2b68d6cb193d49797623cdf161d939fdafe Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 13:24:40 +0300 Subject: [PATCH 170/188] Add some logs to try and figure out why network interaction fails at AppVeyor CI with MinGW build --- QEverCloud/src/Http.cpp | 20 ++++++++++++++++++-- QEverCloud/src/tests/TestQEverCloud.cpp | 2 ++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index bc5c0937..752a0abb 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -44,6 +45,9 @@ void ReplyFetcher::start( QNetworkAccessManager * nam, QNetworkRequest request, qint64 timeoutMsec, QByteArray postData) { + QEC_TRACE("reply_fetcher", "Starting reply fetcher for url " << request.url() + << ", timeout = " << timeoutMsec); + m_httpStatusCode = 0; m_errorType = QNetworkReply::NoError; m_errorText.clear(); @@ -72,8 +76,8 @@ void ReplyFetcher::start( void ReplyFetcher::onDownloadProgress(qint64 downloaded, qint64 total) { - Q_UNUSED(downloaded) - Q_UNUSED(total) + QEC_TRACE("reply_fetcher", "Download progress: downloaded " << downloaded + << " out of total " << total); m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); } @@ -91,9 +95,12 @@ void ReplyFetcher::checkForTimeout() void ReplyFetcher::onFinished() { + QEC_TRACE("reply_fetcher", "Finished fetching reply"); + m_ticker->stop(); if (m_errorType != QNetworkReply::NoError) { + QEC_WARNING("reply_fetcher", "Error is not none: " << (int)m_errorType); return; } @@ -125,6 +132,9 @@ void ReplyFetcher::onSslErrors(QList errors) void ReplyFetcher::setError( QNetworkReply::NetworkError errorType, QString errorText) { + QEC_WARNING("reply_fetcher", "Fetching error: (" << (int)errorType << ") " + << errorText); + m_ticker->stop(); m_errorType = errorType; m_errorText = errorText; @@ -159,6 +169,9 @@ QByteArray simpleDownload( QNetworkAccessManager* nam, QNetworkRequest request, const qint64 timeoutMsec, QByteArray postData, int * httpStatusCode) { + QEC_DEBUG("http", "simple download: url = " << request.url() << ", timeout = " + << timeoutMsec); + ReplyFetcher * fetcher = new ReplyFetcher; QEventLoop loop; QObject::connect(fetcher, SIGNAL(replyFetched(QObject*)), @@ -167,7 +180,10 @@ QByteArray simpleDownload( ReplyFetcherLauncher * fetcherLauncher = new ReplyFetcherLauncher(fetcher, nam, request, timeoutMsec, postData); QTimer::singleShot(0, fetcherLauncher, SLOT(start())); + + QEC_TRACE("http", "simple download: starting event loop"); loop.exec(QEventLoop::ExcludeUserInputEvents); + QEC_TRACE("http", "simple download: done executing event loop"); fetcherLauncher->deleteLater(); diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index cc3dcf81..f72240d6 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -39,6 +39,8 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) + + setLogger(newStdErrLogger(LogLevel::Trace)); RUN_TESTS(NoteStoreTester) RUN_TESTS(UserStoreTester) From a184087cc6c18fb59ffb8533d07cc85db6f4ea56 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 13:25:24 +0300 Subject: [PATCH 171/188] Temporarily disable MSVC build jobs at AppVeyor CI --- appveyor.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d2634d0e..7d86f0b5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,18 +17,18 @@ environment: matrix: - prepare_mode: YES name: win32-prepare - - prepare_mode: NO - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - name: win32 - build_tool: msvc2017 - build_suite: msvc2017_32 - qt: msvc2017 - - prepare_mode: NO - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - name: win64 - build_tool: msvc2017 - build_suite: msvc2017_64 - qt: msvc2017_64 + # - prepare_mode: NO + # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + # name: win32 + # build_tool: msvc2017 + # build_suite: msvc2017_32 + # qt: msvc2017 + # - prepare_mode: NO + # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + # name: win64 + # build_tool: msvc2017 + # build_suite: msvc2017_64 + # qt: msvc2017_64 - prepare_mode: NO APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 name: win32 From 83bba4cc832bbd7a413a33236c33403e4c15b49c Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 14:09:00 +0300 Subject: [PATCH 172/188] Flush after each logged message in stderr logger --- QEverCloud/src/Log.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/QEverCloud/src/Log.cpp b/QEverCloud/src/Log.cpp index 025b5465..c1586855 100644 --- a/QEverCloud/src/Log.cpp +++ b/QEverCloud/src/Log.cpp @@ -122,6 +122,7 @@ class StdErrLogger final: public ILogger << "\t[" << component << "] " << fileName << ":" << lineNumber << " " << message << "\n"; + m_cerr.flush(); } virtual void setLevel(const LogLevel level) override From f524f511fec8085938911cc078b20b1dad6eff10 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:02:29 +0300 Subject: [PATCH 173/188] Try to disable gcc optimizations to avoid problems like those with gcc between 8.0 and 8.2 --- CMakeLists.txt | 1 + .../modules/QEverCloudCompilerSettings.cmake | 15 +++++++++------ appveyor.yml | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c20ee261..ac3da37e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ include(QEverCloudDoxygen) set(BUILD_DOCUMENTATION ON CACHE BOOL "Build documentation for QEverCloud") set(BUILD_QCH_DOCUMENTATION OFF CACHE BOOL "Build documentation for QEverCloud in qch format") set(BUILD_WITH_OAUTH_SUPPORT ON CACHE BOOL "Build QEverCloud with OAuth support") +set(DISABLE_GCC_OPTIMIZATIONS OFF CACHE BOOL "Disable optimizations when building with gcc (to workaround some known issues)") if(BUILD_DOCUMENTATION) # set Doxygen documentation properties diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index d6832679..a6132128 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -3,14 +3,17 @@ if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Using GNU C++ compiler, version ${GCC_VERSION}") if(GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0) if(GCC_VERSION VERSION_LESS 8.2) - # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") - set(CMAKE_C_FLAGS_RELEASE "-g -O0") - set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") + set(DISABLE_GCC_OPTIMIZATIONS ON) endif() endif() + if(DISABLE_GCC_OPTIMIZATIONS) + # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") + set(CMAKE_C_FLAGS_RELEASE "-g -O0") + set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") + endif() if(BUILD_SHARED) set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}") endif() diff --git a/appveyor.yml b/appveyor.yml index 7d86f0b5..58662a06 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -69,7 +69,7 @@ before_build: build_script: - cd build - - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" + - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" -DDISABLE_GCC_OPTIMIZATIONS=ON - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" - cmake --build . --target all - cmake --build . --target check From 1cbe7dd97e74bdd13e45f3f08b6485728bf64c4d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:14:52 +0300 Subject: [PATCH 174/188] Add more debug outputs to figure out where the damn thing hangs --- QEverCloud/src/generated/Services.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 2513950b..9a4a6785 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -734,24 +734,47 @@ QByteArray NoteStoreGetSyncStatePrepareParams( ThriftBinaryBufferWriter writer; qint32 cseqid = 0; + qWarning() << "Before writer.writeMessageBegin\n"; writer.writeMessageBegin( QStringLiteral("getSyncState"), ThriftMessageType::T_CALL, cseqid); + qWarning() << "After writer.writeMessageBegin\n"; + qWarning() << "Before writer.writeStructBegin\n"; writer.writeStructBegin( QStringLiteral("NoteStore_getSyncState_pargs")); + qWarning() << "After writer.writeStructBegin\n"; + + qWarning() << "Before writer.writeFieldBegin\n"; writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); + qWarning() << "After writer.writeFieldBegin\n"; + qWarning() << "Before writer.writeString\n"; writer.writeString(authenticationToken); + qWarning() << "After writer.writeString\n"; + + qWarning() << "Before writer.writeFieldEnd\n"; writer.writeFieldEnd(); + qWarning() << "After writer.writeFieldEnd\n"; + qWarning() << "Before writer.writeFieldStop\n"; writer.writeFieldStop(); + qWarning() << "After writer.writeFieldStop\n"; + + qWarning() << "Before writer.writeStructEnd\n"; writer.writeStructEnd(); + qWarning() << "After writer.writeStructEnd\n"; + + qWarning() << "Before writer.writeMessageEnd\n"; writer.writeMessageEnd(); + qWarning() << "After writer.writeMessageEnd\n"; + + auto buffer = writer.buffer(); + qWarning() << "Buffer size in the end: " << buffer.size(); return writer.buffer(); } From 1a54fbe10d0f5deb0c7b8cce7739eb8679cf7c51 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:24:03 +0300 Subject: [PATCH 175/188] More debug outputs --- QEverCloud/src/Globals.cpp | 2 ++ QEverCloud/src/Http.cpp | 8 ++++++++ QEverCloud/src/generated/Services.cpp | 2 ++ 3 files changed, 12 insertions(+) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index b2ba3d7f..a46ef134 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -36,6 +37,7 @@ void registerMetatypes() QNetworkAccessManager * evernoteNetworkAccessManager() { + qWarning() << "Fetching evernoteNetworkAccessManager\n"; return globalEvernoteNetworkAccessManager; } diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 752a0abb..599b05da 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -169,6 +169,9 @@ QByteArray simpleDownload( QNetworkAccessManager* nam, QNetworkRequest request, const qint64 timeoutMsec, QByteArray postData, int * httpStatusCode) { + qWarning() << "Simple download: url = " << request.url() << ", timeout = " + << timeoutMsec << "\n"; + QEC_DEBUG("http", "simple download: url = " << request.url() << ", timeout = " << timeoutMsec); @@ -205,6 +208,8 @@ QByteArray simpleDownload( QNetworkRequest createEvernoteRequest(QString url) { + qWarning() << "Entering createEvernoteRequest: url = " << url << "\n"; + QNetworkRequest request; request.setUrl(url); request.setHeader(QNetworkRequest::ContentTypeHeader, @@ -217,11 +222,14 @@ QNetworkRequest createEvernoteRequest(QString url) .arg(libraryVersion() % 10000)); request.setRawHeader("Accept", "application/x-thrift"); + qWarning() << "Exiting createEvernoteRequest: url = " << url << "\n"; return request; } QByteArray askEvernote(QString url, QByteArray postData, const qint64 timeoutMsec) { + qWarning() << "askEvernote: url = " << url << ", timeout = " << timeoutMsec << "\n"; + int httpStatusCode = 0; QByteArray reply = simpleDownload( evernoteNetworkAccessManager(), diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 9a4a6785..62fc585d 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -887,10 +887,12 @@ SyncState NoteStore::getSyncState( QByteArray params = NoteStoreGetSyncStatePrepareParams( ctx->authenticationToken()); + qWarning() << "Before calling askEvernote\n"; QByteArray reply = askEvernote( m_url, params, ctx->requestTimeout()); + qWarning() << "After calling askEvernote\n"; QEC_DEBUG("note_store", "received reply for request with id = " << ctx->requestId()); From a0b15c32f80f45c021a01f05eb9c7c33be7ce2cc Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:39:01 +0300 Subject: [PATCH 176/188] Don't use Q_GLOBAL_STATIC with MinGW as it appears to hang for unknown reason --- QEverCloud/src/Globals.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index a46ef134..54565e85 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -13,7 +13,14 @@ #include #include + +#ifndef __MINGW32__ #include +#else +#include +#include +#include +#endif namespace qevercloud { @@ -21,7 +28,11 @@ namespace { //////////////////////////////////////////////////////////////////////////////// +// For unknown reason fetching the value declared as Q_GLOBAL_STATIC hangs with +// code built by MinGW. Hence this workaround +#ifndef __MINGW32__ Q_GLOBAL_STATIC(QNetworkAccessManager, globalEvernoteNetworkAccessManager) +#endif //////////////////////////////////////////////////////////////////////////////// @@ -37,8 +48,17 @@ void registerMetatypes() QNetworkAccessManager * evernoteNetworkAccessManager() { - qWarning() << "Fetching evernoteNetworkAccessManager\n"; +#ifndef __MINGW32__ return globalEvernoteNetworkAccessManager; +#else + static std::shared_ptr pNetworkAccessManager; + static QMutex networkAccessManagerMutex; + QMutexLocker mutexLocker(&networkAccessManagerMutex); + if (!pNetworkAccessManager) { + pNetworkAccessManager.reset(new QNetworkAccessManager); + } + return pNetworkAccessManager.get(); +#endif } //////////////////////////////////////////////////////////////////////////////// From d4417529098c03388d3c3ab25d47ca9594ff03e2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:46:34 +0300 Subject: [PATCH 177/188] Revert "More debug outputs" This reverts commit 1a54fbe10d0f5deb0c7b8cce7739eb8679cf7c51. --- QEverCloud/src/Globals.cpp | 1 - QEverCloud/src/Http.cpp | 8 -------- QEverCloud/src/generated/Services.cpp | 2 -- 3 files changed, 11 deletions(-) diff --git a/QEverCloud/src/Globals.cpp b/QEverCloud/src/Globals.cpp index 54565e85..20449e08 100644 --- a/QEverCloud/src/Globals.cpp +++ b/QEverCloud/src/Globals.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #ifndef __MINGW32__ diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 599b05da..752a0abb 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -169,9 +169,6 @@ QByteArray simpleDownload( QNetworkAccessManager* nam, QNetworkRequest request, const qint64 timeoutMsec, QByteArray postData, int * httpStatusCode) { - qWarning() << "Simple download: url = " << request.url() << ", timeout = " - << timeoutMsec << "\n"; - QEC_DEBUG("http", "simple download: url = " << request.url() << ", timeout = " << timeoutMsec); @@ -208,8 +205,6 @@ QByteArray simpleDownload( QNetworkRequest createEvernoteRequest(QString url) { - qWarning() << "Entering createEvernoteRequest: url = " << url << "\n"; - QNetworkRequest request; request.setUrl(url); request.setHeader(QNetworkRequest::ContentTypeHeader, @@ -222,14 +217,11 @@ QNetworkRequest createEvernoteRequest(QString url) .arg(libraryVersion() % 10000)); request.setRawHeader("Accept", "application/x-thrift"); - qWarning() << "Exiting createEvernoteRequest: url = " << url << "\n"; return request; } QByteArray askEvernote(QString url, QByteArray postData, const qint64 timeoutMsec) { - qWarning() << "askEvernote: url = " << url << ", timeout = " << timeoutMsec << "\n"; - int httpStatusCode = 0; QByteArray reply = simpleDownload( evernoteNetworkAccessManager(), diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 62fc585d..9a4a6785 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -887,12 +887,10 @@ SyncState NoteStore::getSyncState( QByteArray params = NoteStoreGetSyncStatePrepareParams( ctx->authenticationToken()); - qWarning() << "Before calling askEvernote\n"; QByteArray reply = askEvernote( m_url, params, ctx->requestTimeout()); - qWarning() << "After calling askEvernote\n"; QEC_DEBUG("note_store", "received reply for request with id = " << ctx->requestId()); From 9777944dba7645767f7a2b49ccddf583f130ed9f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:46:58 +0300 Subject: [PATCH 178/188] Revert "Add some logs to try and figure out why network interaction fails at AppVeyor CI with MinGW build" This reverts commit af4ac2b68d6cb193d49797623cdf161d939fdafe. --- QEverCloud/src/Http.cpp | 20 ++------------------ QEverCloud/src/tests/TestQEverCloud.cpp | 2 -- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/QEverCloud/src/Http.cpp b/QEverCloud/src/Http.cpp index 752a0abb..bc5c0937 100644 --- a/QEverCloud/src/Http.cpp +++ b/QEverCloud/src/Http.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -45,9 +44,6 @@ void ReplyFetcher::start( QNetworkAccessManager * nam, QNetworkRequest request, qint64 timeoutMsec, QByteArray postData) { - QEC_TRACE("reply_fetcher", "Starting reply fetcher for url " << request.url() - << ", timeout = " << timeoutMsec); - m_httpStatusCode = 0; m_errorType = QNetworkReply::NoError; m_errorText.clear(); @@ -76,8 +72,8 @@ void ReplyFetcher::start( void ReplyFetcher::onDownloadProgress(qint64 downloaded, qint64 total) { - QEC_TRACE("reply_fetcher", "Download progress: downloaded " << downloaded - << " out of total " << total); + Q_UNUSED(downloaded) + Q_UNUSED(total) m_lastNetworkTime = QDateTime::currentMSecsSinceEpoch(); } @@ -95,12 +91,9 @@ void ReplyFetcher::checkForTimeout() void ReplyFetcher::onFinished() { - QEC_TRACE("reply_fetcher", "Finished fetching reply"); - m_ticker->stop(); if (m_errorType != QNetworkReply::NoError) { - QEC_WARNING("reply_fetcher", "Error is not none: " << (int)m_errorType); return; } @@ -132,9 +125,6 @@ void ReplyFetcher::onSslErrors(QList errors) void ReplyFetcher::setError( QNetworkReply::NetworkError errorType, QString errorText) { - QEC_WARNING("reply_fetcher", "Fetching error: (" << (int)errorType << ") " - << errorText); - m_ticker->stop(); m_errorType = errorType; m_errorText = errorText; @@ -169,9 +159,6 @@ QByteArray simpleDownload( QNetworkAccessManager* nam, QNetworkRequest request, const qint64 timeoutMsec, QByteArray postData, int * httpStatusCode) { - QEC_DEBUG("http", "simple download: url = " << request.url() << ", timeout = " - << timeoutMsec); - ReplyFetcher * fetcher = new ReplyFetcher; QEventLoop loop; QObject::connect(fetcher, SIGNAL(replyFetched(QObject*)), @@ -180,10 +167,7 @@ QByteArray simpleDownload( ReplyFetcherLauncher * fetcherLauncher = new ReplyFetcherLauncher(fetcher, nam, request, timeoutMsec, postData); QTimer::singleShot(0, fetcherLauncher, SLOT(start())); - - QEC_TRACE("http", "simple download: starting event loop"); loop.exec(QEventLoop::ExcludeUserInputEvents); - QEC_TRACE("http", "simple download: done executing event loop"); fetcherLauncher->deleteLater(); diff --git a/QEverCloud/src/tests/TestQEverCloud.cpp b/QEverCloud/src/tests/TestQEverCloud.cpp index f72240d6..cc3dcf81 100644 --- a/QEverCloud/src/tests/TestQEverCloud.cpp +++ b/QEverCloud/src/tests/TestQEverCloud.cpp @@ -39,8 +39,6 @@ int main(int argc, char *argv[]) RUN_TESTS(DurableServiceTester) RUN_TESTS(OptionalTester) - - setLogger(newStdErrLogger(LogLevel::Trace)); RUN_TESTS(NoteStoreTester) RUN_TESTS(UserStoreTester) From 779dff8e157e52210812670882d4cdd1f99bf529 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:47:51 +0300 Subject: [PATCH 179/188] Revert "Add more debug outputs to figure out where the damn thing hangs" This reverts commit 1cbe7dd97e74bdd13e45f3f08b6485728bf64c4d. --- QEverCloud/src/generated/Services.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/QEverCloud/src/generated/Services.cpp b/QEverCloud/src/generated/Services.cpp index 9a4a6785..2513950b 100644 --- a/QEverCloud/src/generated/Services.cpp +++ b/QEverCloud/src/generated/Services.cpp @@ -734,47 +734,24 @@ QByteArray NoteStoreGetSyncStatePrepareParams( ThriftBinaryBufferWriter writer; qint32 cseqid = 0; - qWarning() << "Before writer.writeMessageBegin\n"; writer.writeMessageBegin( QStringLiteral("getSyncState"), ThriftMessageType::T_CALL, cseqid); - qWarning() << "After writer.writeMessageBegin\n"; - qWarning() << "Before writer.writeStructBegin\n"; writer.writeStructBegin( QStringLiteral("NoteStore_getSyncState_pargs")); - qWarning() << "After writer.writeStructBegin\n"; - - qWarning() << "Before writer.writeFieldBegin\n"; writer.writeFieldBegin( QStringLiteral("authenticationToken"), ThriftFieldType::T_STRING, 1); - qWarning() << "After writer.writeFieldBegin\n"; - qWarning() << "Before writer.writeString\n"; writer.writeString(authenticationToken); - qWarning() << "After writer.writeString\n"; - - qWarning() << "Before writer.writeFieldEnd\n"; writer.writeFieldEnd(); - qWarning() << "After writer.writeFieldEnd\n"; - qWarning() << "Before writer.writeFieldStop\n"; writer.writeFieldStop(); - qWarning() << "After writer.writeFieldStop\n"; - - qWarning() << "Before writer.writeStructEnd\n"; writer.writeStructEnd(); - qWarning() << "After writer.writeStructEnd\n"; - - qWarning() << "Before writer.writeMessageEnd\n"; writer.writeMessageEnd(); - qWarning() << "After writer.writeMessageEnd\n"; - - auto buffer = writer.buffer(); - qWarning() << "Buffer size in the end: " << buffer.size(); return writer.buffer(); } From a0c29de47ef1ee56303c05191ba559434a65541b Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:48:34 +0300 Subject: [PATCH 180/188] Revert "Try to disable gcc optimizations to avoid problems like those with gcc between 8.0 and 8.2" This reverts commit f524f511fec8085938911cc078b20b1dad6eff10. --- CMakeLists.txt | 1 - .../modules/QEverCloudCompilerSettings.cmake | 15 ++++++--------- appveyor.yml | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac3da37e..c20ee261 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ include(QEverCloudDoxygen) set(BUILD_DOCUMENTATION ON CACHE BOOL "Build documentation for QEverCloud") set(BUILD_QCH_DOCUMENTATION OFF CACHE BOOL "Build documentation for QEverCloud in qch format") set(BUILD_WITH_OAUTH_SUPPORT ON CACHE BOOL "Build QEverCloud with OAuth support") -set(DISABLE_GCC_OPTIMIZATIONS OFF CACHE BOOL "Disable optimizations when building with gcc (to workaround some known issues)") if(BUILD_DOCUMENTATION) # set Doxygen documentation properties diff --git a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake index a6132128..d6832679 100644 --- a/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake +++ b/QEverCloud/cmake/modules/QEverCloudCompilerSettings.cmake @@ -3,17 +3,14 @@ if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Using GNU C++ compiler, version ${GCC_VERSION}") if(GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0) if(GCC_VERSION VERSION_LESS 8.2) - set(DISABLE_GCC_OPTIMIZATIONS ON) + # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") + set(CMAKE_C_FLAGS_RELEASE "-g -O0") + set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") endif() endif() - if(DISABLE_GCC_OPTIMIZATIONS) - # NOTE: workaround for a problem similar to https://issues.apache.org/jira/browse/THRIFT-4584 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp -fno-inline -fno-tree-fre") - set(CMAKE_C_FLAGS_RELEASE "-g -O0") - set(CMAKE_CXX_FLAGS_RELEASE "-g -O0") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0") - endif() if(BUILD_SHARED) set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}") endif() diff --git a/appveyor.yml b/appveyor.yml index 58662a06..7d86f0b5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -69,7 +69,7 @@ before_build: build_script: - cd build - - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" -DDISABLE_GCC_OPTIMIZATIONS=ON + - if %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.5/%qt%" - if not %build_tool%==mingw cmake .. -G %makefiles% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="c:/dev/qevercloud/build/installdir" -DUSE_QT5_WEBKIT=%use_webkit% -DCMAKE_PREFIX_PATH="C:/Qt/5.13/%cd%" - cmake --build . --target all - cmake --build . --target check From ab2bc2e6777c445e388bda92bc591e6a27aac67f Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:48:50 +0300 Subject: [PATCH 181/188] Revert "Temporarily disable MSVC build jobs at AppVeyor CI" This reverts commit a184087cc6c18fb59ffb8533d07cc85db6f4ea56. --- appveyor.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7d86f0b5..d2634d0e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,18 +17,18 @@ environment: matrix: - prepare_mode: YES name: win32-prepare - # - prepare_mode: NO - # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - # name: win32 - # build_tool: msvc2017 - # build_suite: msvc2017_32 - # qt: msvc2017 - # - prepare_mode: NO - # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - # name: win64 - # build_tool: msvc2017 - # build_suite: msvc2017_64 - # qt: msvc2017_64 + - prepare_mode: NO + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + name: win32 + build_tool: msvc2017 + build_suite: msvc2017_32 + qt: msvc2017 + - prepare_mode: NO + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + name: win64 + build_tool: msvc2017 + build_suite: msvc2017_64 + qt: msvc2017_64 - prepare_mode: NO APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 name: win32 From cf6ca271520b0bf93ad76433707b09fc598533c0 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 15:50:08 +0300 Subject: [PATCH 182/188] Revert "Add some warnings in attempt to figure out why NoteStoreTester tests get stuck at AppVeyor CI" This reverts commit 56c602de3ca27b3397271df8a123597f10e7a1e7. --- .../src/tests/generated/TestNoteStore.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/QEverCloud/src/tests/generated/TestNoteStore.cpp b/QEverCloud/src/tests/generated/TestNoteStore.cpp index bd16d78f..ee606fae 100644 --- a/QEverCloud/src/tests/generated/TestNoteStore.cpp +++ b/QEverCloud/src/tests/generated/TestNoteStore.cpp @@ -15,7 +15,6 @@ #include "RandomDataGenerators.h" #include #include -#include #include #include @@ -6041,8 +6040,6 @@ public Q_SLOTS: void NoteStoreTester::shouldExecuteGetSyncState() { - qWarning() << "Entering NoteStoreTester::shouldExecuteGetSyncState\n"; - IRequestContextPtr ctx = newRequestContext( QStringLiteral("authenticationToken")); @@ -6051,7 +6048,6 @@ void NoteStoreTester::shouldExecuteGetSyncState() NoteStoreGetSyncStateTesterHelper helper( [&] (IRequestContextPtr ctxParam) -> SyncState { - qWarning() << "Inside helper lambda\n"; Q_ASSERT(ctx->authenticationToken() == ctxParam->authenticationToken()); return response; }); @@ -6069,11 +6065,8 @@ void NoteStoreTester::shouldExecuteGetSyncState() &NoteStoreServer::onGetSyncStateRequestReady); QTcpServer tcpServer; - qWarning() << "Before TCP server starting\n"; QVERIFY(tcpServer.listen(QHostAddress::LocalHost)); - qWarning() << "After TCP server starting\n"; quint16 port = tcpServer.serverPort(); - qWarning() << "Assigned TCP server port: " << port << "\n"; QTcpSocket * pSocket = nullptr; QObject::connect( @@ -6081,9 +6074,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() &QTcpServer::newConnection, &tcpServer, [&] { - qWarning() << "Before calling nextPendingConnection\n"; pSocket = tcpServer.nextPendingConnection(); - qWarning() << "After calling nextPendingConnection\n"; Q_ASSERT(pSocket); QObject::connect( pSocket, @@ -6095,9 +6086,7 @@ void NoteStoreTester::shouldExecuteGetSyncState() } QByteArray requestData = readThriftRequestFromSocket(*pSocket); - qWarning() << "Calling server.onRequest\n"; server.onRequest(requestData); - qWarning() << "After calling server.onRequest\n"; }); QObject::connect( @@ -6106,7 +6095,6 @@ void NoteStoreTester::shouldExecuteGetSyncState() &server, [&] (QByteArray responseData) { - qWarning() << "Inside on request ready lambda\n"; QByteArray buffer; buffer.append("HTTP/1.1 200 OK\r\n"); buffer.append("Content-Length: "); @@ -6118,20 +6106,15 @@ void NoteStoreTester::shouldExecuteGetSyncState() if (!writeBufferToSocket(buffer, *pSocket)) { QFAIL("Failed to write response to socket"); } - qWarning() << "Leaving on request ready lambda\n"; }); - qWarning() << "Before creating note store\n"; auto noteStore = newNoteStore( QStringLiteral("http://127.0.0.1:") + QString::number(port), nullptr, nullptr, nullRetryPolicy()); - qWarning() << "After creating note store\n"; - qWarning() << "Before calling noteStore->getSyncState\n"; SyncState res = noteStore->getSyncState( ctx); - qWarning() << "After calling noteStore->getSyncState\n"; QVERIFY(res == response); } From aa8645c110eb3dba39b883e5f249bd349eb8f7b9 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 16:34:03 +0300 Subject: [PATCH 183/188] Add missing export of EvernoteOAuthWebView::OAuthResult --- QEverCloud/headers/OAuth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index 89def511..cab92e0a 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -96,7 +96,7 @@ class QEVERCLOUD_EXPORT EvernoteOAuthWebView: public QWidget QString oauthError() const; /** Holds data that is returned by Evernote on a successful authentication */ - struct OAuthResult: public Printable + struct QEVERCLOUD_EXPORT OAuthResult: public Printable { QString noteStoreUrl; ///< note store url for the user; no need to /// question UserStore::getNoteStoreUrl for it. From e61c0ffeeef745ddeca09940e5c7475a6158c808 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Sun, 22 Dec 2019 16:35:29 +0300 Subject: [PATCH 184/188] Convert typedef to using statement --- QEverCloud/headers/OAuth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QEverCloud/headers/OAuth.h b/QEverCloud/headers/OAuth.h index cab92e0a..39802eb4 100644 --- a/QEverCloud/headers/OAuth.h +++ b/QEverCloud/headers/OAuth.h @@ -176,7 +176,7 @@ class QEVERCLOUD_EXPORT EvernoteOAuthDialog: public QDialog { Q_OBJECT public: - typedef EvernoteOAuthWebView::OAuthResult OAuthResult; + using OAuthResult = EvernoteOAuthWebView::OAuthResult; /** Constructs the dialog. * From 3958806022ca2bb62dbbd6fe1b6547cec74e81e0 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 23 Dec 2019 07:46:43 +0300 Subject: [PATCH 185/188] Make use of Q_NAMESPACE and Q_ENUM_NS optional --- CHANGELOG.md | 5 ++- CMakeLists.txt | 1 + QEverCloud/CMakeLists.txt | 6 +++ QEverCloud/headers/Helpers.h | 4 ++ QEverCloud/headers/Log.h | 2 + QEverCloud/headers/VersionInfo.h.in | 6 +++ QEverCloud/headers/generated/EDAMErrorCode.h | 46 ++++++++++++++++++++ README.md | 2 + docs/Migration_notes_4_to_5.md | 5 ++- 9 files changed, 74 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f7a7c5..5b887a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,8 +25,9 @@ types. There is also no `structs` wrapping enums called `type` anymore so e.g. `EDAMErrorCode::type` values are now simply `EDAMErrorCode` ones. * Enumerations were also marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS) - macro in case build is done with Qt >= 5.8. This macro adds some introspection - capabilities for the bespoke enumerations. + macro if QEverCloud is built with Qt >= 5.8 and if the corresponding CMake + option is enabled. This macro adds some introspection capabilities for + the bespoke enumerations. * A dedicated exception class representing network failures was added - `NetworkException`. As other QEverCloud's exceptions, it is a subclass of `EverCloudException`. By default QEverCloud catches such exceptions on its diff --git a/CMakeLists.txt b/CMakeLists.txt index c20ee261..c61319dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ include(QEverCloudDoxygen) set(BUILD_DOCUMENTATION ON CACHE BOOL "Build documentation for QEverCloud") set(BUILD_QCH_DOCUMENTATION OFF CACHE BOOL "Build documentation for QEverCloud in qch format") set(BUILD_WITH_OAUTH_SUPPORT ON CACHE BOOL "Build QEverCloud with OAuth support") +set(BUILD_WITH_Q_NAMESPACE ON CACHE BOOL "Use Q_NAMESPACE and Q_ENUM_NS macros for introspection") if(BUILD_DOCUMENTATION) # set Doxygen documentation properties diff --git a/QEverCloud/CMakeLists.txt b/QEverCloud/CMakeLists.txt index 8300eddd..6096fc9c 100644 --- a/QEverCloud/CMakeLists.txt +++ b/QEverCloud/CMakeLists.txt @@ -91,6 +91,12 @@ else() set(QEVERCLOUD_USES_QT_WEB_ENGINE "#define QEVERCLOUD_USE_QT_WEB_ENGINE 0") endif() +if(BUILD_WITH_Q_NAMESPACE) + set(QEVERCLOUD_USES_Q_NAMESPACE "#define QEVERCLOUD_USES_Q_NAMESPACE 1") +else() + set(QEVERCLOUD_USES_Q_NAMESPACE "#define QEVERCLOUD_USES_Q_NAMESPACE 0") +endif() + configure_file(headers/VersionInfo.h.in ${PROJECT_BINARY_DIR}/VersionInfo.h @ONLY) list(APPEND ALL_HEADERS_AND_SOURCES ${PROJECT_BINARY_DIR}/VersionInfo.h) diff --git a/QEverCloud/headers/Helpers.h b/QEverCloud/headers/Helpers.h index 2a05ebe1..d2c05dc8 100644 --- a/QEverCloud/headers/Helpers.h +++ b/QEverCloud/headers/Helpers.h @@ -29,6 +29,8 @@ #include #include +#include "VersionInfo.h" + namespace qevercloud { //////////////////////////////////////////////////////////////////////////////// @@ -39,8 +41,10 @@ namespace qevercloud { * meta object, so putting it here */ #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_NAMESPACE #endif +#endif //////////////////////////////////////////////////////////////////////////////// diff --git a/QEverCloud/headers/Log.h b/QEverCloud/headers/Log.h index 229c62f2..392b2795 100644 --- a/QEverCloud/headers/Log.h +++ b/QEverCloud/headers/Log.h @@ -32,8 +32,10 @@ enum class LogLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(LogLevel) #endif +#endif QEVERCLOUD_EXPORT QTextStream & operator<<( QTextStream & out, const LogLevel level); diff --git a/QEverCloud/headers/VersionInfo.h.in b/QEverCloud/headers/VersionInfo.h.in index c5a606d0..28c56d39 100644 --- a/QEverCloud/headers/VersionInfo.h.in +++ b/QEverCloud/headers/VersionInfo.h.in @@ -24,4 +24,10 @@ */ @QEVERCLOUD_USES_QT_WEB_ENGINE@ +/** + * This macro tells whether QEverCloud library was built with use of Q_NAMESPACE + * and Q_ENUM_NS + */ +@QEVERCLOUD_USES_Q_NAMESPACE@ + #endif // QEVERCLOUD_VERSION_INFO_H diff --git a/QEverCloud/headers/generated/EDAMErrorCode.h b/QEverCloud/headers/generated/EDAMErrorCode.h index 9bde7453..0c96a85d 100644 --- a/QEverCloud/headers/generated/EDAMErrorCode.h +++ b/QEverCloud/headers/generated/EDAMErrorCode.h @@ -132,8 +132,10 @@ enum class EDAMErrorCode }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(EDAMErrorCode) #endif +#endif inline uint qHash(EDAMErrorCode value) { @@ -193,8 +195,10 @@ enum class EDAMInvalidContactReason }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(EDAMInvalidContactReason) #endif +#endif inline uint qHash(EDAMInvalidContactReason value) { @@ -243,8 +247,10 @@ enum class ShareRelationshipPrivilegeLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(ShareRelationshipPrivilegeLevel) #endif +#endif inline uint qHash(ShareRelationshipPrivilegeLevel value) { @@ -279,8 +285,10 @@ enum class PrivilegeLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(PrivilegeLevel) #endif +#endif inline uint qHash(PrivilegeLevel value) { @@ -313,8 +321,10 @@ enum class ServiceLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(ServiceLevel) #endif +#endif inline uint qHash(ServiceLevel value) { @@ -344,8 +354,10 @@ enum class QueryFormat }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(QueryFormat) #endif +#endif inline uint qHash(QueryFormat value) { @@ -378,8 +390,10 @@ enum class NoteSortOrder }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(NoteSortOrder) #endif +#endif inline uint qHash(NoteSortOrder value) { @@ -429,8 +443,10 @@ enum class PremiumOrderStatus }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(PremiumOrderStatus) #endif +#endif inline uint qHash(PremiumOrderStatus value) { @@ -495,8 +511,10 @@ enum class SharedNotebookPrivilegeLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(SharedNotebookPrivilegeLevel) #endif +#endif inline uint qHash(SharedNotebookPrivilegeLevel value) { @@ -537,8 +555,10 @@ enum class SharedNotePrivilegeLevel }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(SharedNotePrivilegeLevel) #endif +#endif inline uint qHash(SharedNotePrivilegeLevel value) { @@ -574,8 +594,10 @@ enum class SponsoredGroupRole }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(SponsoredGroupRole) #endif +#endif inline uint qHash(SponsoredGroupRole value) { @@ -608,8 +630,10 @@ enum class BusinessUserRole }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(BusinessUserRole) #endif +#endif inline uint qHash(BusinessUserRole value) { @@ -648,8 +672,10 @@ enum class BusinessUserStatus }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(BusinessUserStatus) #endif +#endif inline uint qHash(BusinessUserStatus value) { @@ -685,8 +711,10 @@ enum class SharedNotebookInstanceRestrictions }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(SharedNotebookInstanceRestrictions) #endif +#endif inline uint qHash(SharedNotebookInstanceRestrictions value) { @@ -722,8 +750,10 @@ enum class ReminderEmailConfig }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(ReminderEmailConfig) #endif +#endif inline uint qHash(ReminderEmailConfig value) { @@ -763,8 +793,10 @@ enum class BusinessInvitationStatus }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(BusinessInvitationStatus) #endif +#endif inline uint qHash(BusinessInvitationStatus value) { @@ -797,8 +829,10 @@ enum class ContactType }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(ContactType) #endif +#endif inline uint qHash(ContactType value) { @@ -828,8 +862,10 @@ enum class EntityType }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(EntityType) #endif +#endif inline uint qHash(EntityType value) { @@ -870,8 +906,10 @@ enum class RecipientStatus }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(RecipientStatus) #endif +#endif inline uint qHash(RecipientStatus value) { @@ -916,8 +954,10 @@ enum class CanMoveToContainerStatus }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(CanMoveToContainerStatus) #endif +#endif inline uint qHash(CanMoveToContainerStatus value) { @@ -953,8 +993,10 @@ enum class RelatedContentType }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(RelatedContentType) #endif +#endif inline uint qHash(RelatedContentType value) { @@ -1001,8 +1043,10 @@ enum class RelatedContentAccess }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(RelatedContentAccess) #endif +#endif inline uint qHash(RelatedContentAccess value) { @@ -1032,8 +1076,10 @@ enum class UserIdentityType }; #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +#if QEVERCLOUD_USES_Q_NAMESPACE Q_ENUM_NS(UserIdentityType) #endif +#endif inline uint qHash(UserIdentityType value) { diff --git a/README.md b/README.md index 29a297f1..a11d97b9 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ Other available CMake configurations options: *BUILD_SHARED* - when *ON*, CMake configures the build for the shared library. By default this option is on. +*BUILD_WITH_Q_NAMESPACE* - when *ON*, `Q_NAMESPACE` and `Q_ENUM_NS` macros are used to add introspection capabilities to enumerations within `qevercloud` namespace. Qt >= 5.8 is required to enable this option. By default this option is enabled. + If *BUILD_SHARED* is *ON*, `make install` installs CMake module necessary for applications using CMake's `find_package` command to find the installation of QEverCloud. It is possible to build the library with enabled sanitizers using additional CMake options: diff --git a/docs/Migration_notes_4_to_5.md b/docs/Migration_notes_4_to_5.md index 7f61c204..7c603368 100644 --- a/docs/Migration_notes_4_to_5.md +++ b/docs/Migration_notes_4_to_5.md @@ -188,7 +188,10 @@ Since QEverCloud 5 structs corresponding to Evernote types have a new field of t ### Enumerations registered in Qt's meta object system with Q_ENUM_NS macro -Enumerations such as error codes in `EDAMErrorCode.h` were marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS) macro in case build is done with Qt >= 5.8. This macro adds some introspection capabilities through Qt's meta object system for these enumerations. +Enumerations such as error codes in `EDAMErrorCode.h` were marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS) macro if QEverCloud is built with Qt >= 5.8 and if the corresponding CMake option `BUILD_WITH_Q_NAMESPACE` is enabled (it is enabled by default). This macro adds some introspection capabilities for the bespoke enumerations. + + +in case build is done with Qt >= 5.8. This macro adds some introspection capabilities through Qt's meta object system for these enumerations. ### Elements of Evernote types registered in Qt's meta object system with Q_PROPERTY and Q_GADGET macros From 32bc0acd38e0c98eaa45c0ceaa477033585c5321 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 23 Dec 2019 08:14:03 +0300 Subject: [PATCH 186/188] Fix OAuth.cpp --- QEverCloud/src/OAuth.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/QEverCloud/src/OAuth.cpp b/QEverCloud/src/OAuth.cpp index 603f1bfd..481a77f8 100644 --- a/QEverCloud/src/OAuth.cpp +++ b/QEverCloud/src/OAuth.cpp @@ -18,7 +18,7 @@ #include #include -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE +#if QEVERCLOUD_USE_QT_WEB_ENGINE #include #include #else @@ -73,7 +73,7 @@ void setNonceGenerator(quint64 (*nonceGenerator)()) //////////////////////////////////////////////////////////////////////////////// -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE +#if QEVERCLOUD_USE_QT_WEB_ENGINE class EvernoteOAuthWebViewPrivate: public QWebEngineView #else class EvernoteOAuthWebViewPrivate: public QWebView @@ -109,13 +109,13 @@ public Q_SLOTS: //////////////////////////////////////////////////////////////////////////////// EvernoteOAuthWebViewPrivate::EvernoteOAuthWebViewPrivate(QWidget * parent) -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE +#if QEVERCLOUD_USE_QT_WEB_ENGINE : QWebEngineView(parent) #else : QWebView(parent) #endif { -#ifndef QEVERCLOUD_USE_QT_WEB_ENGINE +#if !QEVERCLOUD_USE_QT_WEB_ENGINE page()->setNetworkAccessManager(evernoteNetworkAccessManager()); #endif } @@ -177,7 +177,7 @@ void EvernoteOAuthWebViewPrivate::onUrlChanged(const QUrl & url) QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, this, &EvernoteOAuthWebViewPrivate::permanentFinished); QUrl url(m_oauthUrlBase + QStringLiteral("&oauth_token=%1").arg(token)); -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE +#if QEVERCLOUD_USE_QT_WEB_ENGINE replyFetcher->start(evernoteNetworkAccessManager(), url, m_timeoutMsec); #else replyFetcher->start(page()->networkAccessManager(), url, m_timeoutMsec); @@ -285,7 +285,7 @@ void EvernoteOAuthWebView::authenticate( QObject::connect(replyFetcher, &ReplyFetcher::replyFetched, d, &EvernoteOAuthWebViewPrivate::temporaryFinished); QUrl url(d->m_oauthUrlBase + QStringLiteral("&oauth_callback=nnoauth")); -#ifdef QEVERCLOUD_USE_QT_WEB_ENGINE +#if QEVERCLOUD_USE_QT_WEB_ENGINE replyFetcher->start(evernoteNetworkAccessManager(), url, timeoutMsec); #else replyFetcher->start(d->page()->networkAccessManager(), url, timeoutMsec); @@ -387,7 +387,7 @@ EvernoteOAuthDialog::EvernoteOAuthDialog(QString consumerKey, EvernoteOAuthDialog::~EvernoteOAuthDialog() { -#ifndef QEVERCLOUD_USE_QT_WEB_ENGINE +#if !QEVERCLOUD_USE_QT_WEB_ENGINE QWebSettings::clearMemoryCaches(); #endif From 3ae22ee5c612822ca03670f9614c617199c9ef1d Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 1 Jan 2020 22:43:41 +0300 Subject: [PATCH 187/188] Fix release preparation matrix item in AppVeyor CI configuration --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index d2634d0e..be7cde82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,6 +17,9 @@ environment: matrix: - prepare_mode: YES name: win32-prepare + build_tool: msvc2017 + build_suite: msvc2017_32 + qt: msvc2017 - prepare_mode: NO APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 name: win32 From 4c0088a8efdbcb01c71fbd33383a1b05a465b821 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Wed, 1 Jan 2020 22:46:05 +0300 Subject: [PATCH 188/188] Specify proper worker image for release preparation matrix item in AppVeyor CI configuration --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index be7cde82..9e4c8f4b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,7 @@ environment: secure: rLuHhO0prerqoGCYmfOoyxqcwwamCXtuZtl4Jzqeu3aGgflk0mnX1fogLq68YcRW matrix: - prepare_mode: YES + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 name: win32-prepare build_tool: msvc2017 build_suite: msvc2017_32